Skip to content

This project automates detection and counting of shelters in a refugee camp to estimate population. A drone's high-def image is analyzed with YOLOv8 for detecting shelters and other categories. The SAHI library handles large images. The model is trained on data from various camps in DRC. Future work will explore segmentation with models like SAM

License

Notifications You must be signed in to change notification settings

alex6H/RefugeeCampShelterDetection-YOLOv8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shelters detection of a refugee camp on drone image with YOLOv8

This project automates detection and count of shelters in a refugee camp to estimate the population. A drone's high-def image is analyzed with YOLOv8 for detecting shelters and other categories of camp structure. The model is trained on drone images in Chad, Mozambic and the Democratic Republic of Congo (DRC). Far from perfect, the model and the script provide a good result in shelter detection of similar DRC camps. Still a lot of work need to be done to integrate more example from various country in the training dataset. Future work will explore segmentation with models like SAM.

image

Objective

The aim is to be able to automate the counting process for shelters in a refugee camp in order to estimate the population. In this case, we are in DRC, on the outskirts of Goma (North Kivu) in Elohim camp. To carry out this shelter count, a drone was used (in December 2023) to acquire a high-definition image.

In the script we will then use the Ultralytics framework , which implements Yolov8 in Python. YOLO's primary objective is to detect objects on video. In our case we're going to do it on a raster image, which is just as powerful and very fast. The aim is to detect shelters and locate them with bouding boxes, not to segment them (we need a count, not a a perfect delimitation). The next improvement will be to use bouding boxes to segment objects using a model such as Segment Anything Model but we will explore that later.

Note that because of the size of the image, the Slicing Aided Hyper Inference (SAHI) library will be used to cut the image into pieces and submit it to Yolo.

There is a pre work of this script who as note yet be published : The model has been trained based on the Yolo8 Nano model with Google Colab. The training data was taken from drone images of camps in Mozambique, Chad and the Democratic Republic of Congo. Label Studio was used to annotate the data and create the training dataset. At first, the annotations were done entirely by hand and then via active learning where the model is continually improved using its own output to refine its future predictions.

View of a camp around Goma:

image

Model

The model used is a fine tuning of the Yolo8 Nano model trained via Google Colab.

Tests were carried out with the Medium and Small models, which considerably increased training time without providing much higher quality detection. This was judged by visual comparison of the results. The Nano model was chosen for its speed of training compared with the other models.

There are two model exports available: Pytorch (best.pt) and Open Neural Network Exchange (.onnx).

Usage in QGIS

ONNX can be used directly in QGIS via the Deepness: Deep Neural Remote Sensing plugin and the following parameters :

  • Model type should be "Detector". We detecte bouding boxes (we do not have a segmentation model yet)
  • Model file path : path to the .onnx model
  • Tiles overlap should be bigger than the bigest object you want to detecte on the image
  • Detector type : YOLO_Ultralytics
  • Confidence : the treshold for the minimum confidence (between 0 and 1)
  • IoU : Intersection Over Union to remove overlapping detected objects (between 0 and 1)

Note that your raster unit should be in meter (e.g. : EPSG:3857 - WGS 84 / Pseudo-Mercator). image

Training dataset

The model was trained on a dataset including camps in Mozambique and Chad, but above all on neighbouring camps in DRC around Goma. It is these similar camps that explain the good prediction results in this example. It is by no means certain that this model will perform as well out of the box in other camps. From one camp to another, the category definitions presented here may no longer be relevant, affecting the quality of detection.

It should be noted that the results are good mainly for so-called "informal" shelters (makeshift shelters made of wood and plastic sheeting). This is because the training images contain a huge number of examples of these informal shelters. This dataset is then expanded (via Albumentations). The other categories suffer from much poorer detection due, for the most part, to a lack of training data. For example, vehicles are regularly identified as shelters simply because the level of confidence is far too low in this category due to the lack of data.

Here below the number of instance, after augmentation, by classes, in the training dataset :

image

The training data is taken entirely from drone images with a GSD between 2cm/pixel to 10cm/pixel. Although the process of increasing the data includes a pass that degrades the image quality, this particularity in terms of definition suggests that the model will not perform well on images with a lower resolution (>10cm/pixel).

Categories

When the training datasets were first created, only informal shelters were annotated. . After some thought, several categories were added. Unfortunately, the lack of examples in some of these categories has resulted in a mediocre detection confidence. The definition of the category and the training dataset need to be improved.

Here are the categories and their definitions:

  • Building: A structure with a complex shape and a solid roof. Surface mainly above 50m²

    image

  • Dwelling: A simple, regularly shaped structure with a basic corrugated iron roof, often rusted. Surface mainly between 10 to 50 m²

    image image

  • Shelter Informal: A small size shelter (few meter square), irregularly shaped construction made with plastic sheeting and a plastic roof. Surface mainly between 2 to 10 m²

    image image

  • Shelter Formal: A small, rectangular or square construction made with plastic sheeting, often with a corrugated iron roof. This one is tricky because it can be easily confuse with informal shelter used in marketplace. Surface mainly between 15 to 25 m²

    image

  • Under Construction : A structure with visible wood sticks, maybe be incompletely covered by plastic sheeting or just the foundations of a structure. Note that this category may mix under construction shelter and destroyed or vanalised shelters. There is one exception to the definition : In some structured camps, when the formal shelters are under construction, 6 or 8 holes are digged into the ground. They are classified as "Under construction"

    image image image image image image image

  • Construction hole : One hole in the ground without constructed structure around. Often a sign of a new latrine

    image image image

  • Car: A vehicle with four or more wheels. Can be a car or a truck. Note that this category can easily be improved with example from the web.

    image image image

  • Hut: A small construction, either rectangular or round, with a straw roof.

    image image image

  • Latrine: A dwelling featuring elements typical of a latrine, such as a chimney, double door, or concrete slab. This category need to be remove because it is too complicated for the model to detecte it. Often it is mixed with a simple dwelling. The elements to clearly identify it from the sky are often difficult to see. it's often or the position of the latrine (a bit away from shelters) or the site visit that identifies the dwelling as a latrine, rather than just the look of the latrine from the sky.

    image image

  • Latrine Plastic Sheeting : squares or rectangle latrine without a roof, made of wood and plastic sheeting. Rarely more than 6 or 8 m²

    image image image

  • Water Source: Mutliple taps where people gather to collect water. Often with water hoses and/or hand pumps. Only few examples of this in the datasets. Most of the time there is a lot of people with buckets around.

    image image image

  • Tank: Any (water) reservoir.

    image image

  • Tent : A simple tent, often black and white, with visible underlying metal support uprights. Commonly used in camps as a temporary health facility or storage.

    image image

  • Umbrella : Simple umbrella, often use along the road as a small shop

    image

Hardware

Yolo runs easily on a laptop with standart GPU. For this example, the scipt for infering was run on a NVIDIA T1200 Laptop GPU, 4096MiB without any issue.

Improvement and next steps

As mentioned, there is still considerable work ahead, primarily including:

  • Enhancing the model by incorporating more examples from various countries and categories.
  • Exploring segmentation techniques with models such as SAM.
  • Implementing the script within a QGIS toolbox.
  • Addressing additional minor improvements.

Contribution

I’ll be glad to collaborate with others on this project. If you have ideas, improvements, or would like to contribute in any way, please feel free to reach out. I welcome all forms of collaboration.

Thanks

Thanks to Andrea Cippà, siteplanner and drone pilote, for having provided a lot of camps images! Here is a link to his Youtube Channel


Thank you for your interest and contributions!

About

This project automates detection and counting of shelters in a refugee camp to estimate population. A drone's high-def image is analyzed with YOLOv8 for detecting shelters and other categories. The SAHI library handles large images. The model is trained on data from various camps in DRC. Future work will explore segmentation with models like SAM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published