|
|
5 months ago | |
|---|---|---|
| dataset | 9 months ago | |
| images | 6 months ago | |
| inference | 6 months ago | |
| models | 6 months ago | |
| presentation | 5 months ago | |
| train | 6 months ago | |
| README.md | 6 months ago | |
| firevision.bib | 6 months ago | |
| requirements.txt | 6 months ago | |
This project features two distinct detection models (Fire & Smoke) trained and compared across three different backbones (ResNet50, ResNet101, and ResNet152) using Mask R-CNN.
.
├── 📂 dataset/ # Annotated dataset (COCO format)
│ ├── 📂 fire/ # Fire class images and annotations
│ └── 📂 smoke/ # Smoke class images and annotations
├── 📂 models/ # Trained weights of each architecture - best and last
│ ├── 📂 resnet50/
│ ├── 📂 resnet101/
│ └── 📂 resnet152/
├── 📂 inference/ # Two-stage inference scripts
├── 📂 train/ # Training scripts & helper files
├── README.md # Documentation
├── firevision.bib # suggested citation
└── requirements.txt
Before running any script, ensure that your dataset follows the COCO format as illustrated in the Project Structure.
In this project, we utilize separate directory structures for the Fire and Smoke classes. This architectural choice was made because we developed two specialized models (one for fire detection and one for smoke detection) to minimize Mask Loss, since the annotation was done manually.
The source images used to create our dataset can be found here
1.create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate
2.install PyTorch with CUDA support (for CUDA 12.1/12.2)
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
3.install the rest of the dependencies using the requirements.txt
pip install -r requirements.txt
or manually
pip install python_package
To train a model, run the corresponding script. For example, to train a Mask R-CNN with a ResNet50 backbone for fire detection:
python train/resnet50/train_resnet50_fire.py
Note: Ensure the training script is in the same directory as the helper files (engine.py, utils.py, etc.).
During training, a models/ directory is created to save the best and last weights, along with a CSV file for metric tracking.
Hyperparameters: 100 epochs, initial LR 0.005, with a CosineAnnealingLR scheduler decreasing to $10^{-6}$ over the first 50 epochs.
# Both blocks are active in main()
model_smoke = build_maskrcnn_resnet[50|101|152](num_classes).to(device)
...
model_fire = build_maskrcnn_resnet[50|101|152](num_classes).to(device)
If you only need to detect one class, simply comment out the block you don't need:
Then configure the paths according to yours and run the script directly. For instance let's run the ResNet101 backbone Mask R-CNN model.
python inference/infer_resnet101.py
For more details about the methodology and the results, you can read the full paper here:
FireVision: An Early Fire and Smoke Detection Platform Utilizing Mask R-CNN Deep Learning Inferences
@Article{FireVision2026,
AUTHOR = {Spanoudaki, Konstantina and Tsoumani, Meropi and Kontogiannis, Sotirios and Konstantinidou, Myrto and Karolos, Ion Anastasios and Kokkonis, George},
TITLE = {FireVision: An Early Fire and Smoke Detection Platform Utilizing Mask R-CNN Deep Learning Inferences},
JOURNAL = {Algorithms},
VOLUME = {19},
YEAR = {2026},
NUMBER = {3},
ARTICLE-NUMBER = {169},
URL = {https://www.mdpi.com/1999-4893/19/3/169},
ISSN = {1999-4893},
DOI = {10.3390/a19030169}
}