Training YOLOv8 models for fire and smoke detection from scratch on the D-Fire dataset and custom data specific to Mediterranean olive groves.
Deployment and testing of trained models using Streamlit.
In recent years, Mediterranean countries have faced numerous wildfires, often caused by the mishandling of dry leaves and branches in olive groves. These areas, usually remote from urban infrastructure, challenge the immediate detection of early-stage fires, delaying response times and reducing the likelihood of a positive outcome. Object detection models trained on terrain-specific data, coupled with basic monitoring infrastructure, can significantly enhance early detection of fire and smoke, improving response effectiveness.
Models were trained based on YOLOv8n and YOLOv8s, with plans to train heavier models as well. Training utilized the D-Fire dataset for baseline performance and our Croatian Fire Dataset for terrain-specific nuances.
data:
- images:
- train
- test
- labels:
- train
- test
Both models were trained for 150 epochs using CUDA on an Nvidia RTX 3070 Ti. The training process can be visualized through the following images, which display how each model's metrics evolved:
The training metrics show that both models improved significantly, reducing loss and increasing precision. The YOLOv8 small model displayed a slight advantage over the nano model in all evaluated metrics, suggesting that further training could yield even better results.
Both models were tested on a subset of the Croatia_fire_dataset to evaluate their performance on terrain-specific challenges. The testing settings were as follows:
Settings
- IOU: 0.4
- Confidence Threshold: 0.3
Both models have shown great preformance on most of the tested images including these...
Some predictions which resulted in different outcomes between the models.
To demonstrate the capabilities of the trained models, Streamlit was used to create a simple, practical, and aesthetically pleasing web application.
You can try it out here: Fire and Smoke Detection App
Both models are based on and trained using this dataset, which contains over 21,000 images featuring a variety of scenes across different landscapes.
You can check it out here: D-Fire Dataset
This dataset includes over 50 images of specific Mediterranean coastal landscapes with fires in olive groves, used additionally to test the models' capability to detect such fires.
You can download it here: Croatia Fire Dataset
I would like to thank the creators of the D-Fire dataset for providing a valuable resource that formed the foundation of this project. Also, a big thank you to the team at Ultralytics for creating YOLOv8, which simplified achieving remarkable results in object detection. Lastly, a thumbs up to the team behind Streamlit, which has made deploying these models incredibly straightforward and effective.
This project is licensed under the AGPL-3.0 License.
Made with 🔥 by Martin Josipović, 2024.