You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Konstantina Spanoudaki abb2d421d1 Upload files to 'presentation' 5 months ago
dataset first commit 9 months ago
images first commit 6 months ago
inference first commit 6 months ago
models first commit 6 months ago
presentation Upload files to 'presentation' 5 months ago
train first commit 6 months ago
README.md Update 'README.md' 6 months ago
firevision.bib first commit 6 months ago
requirements.txt first commit 6 months ago

README.md

🔥FireVision: An Early Fire and Smoke Detection Platform Utilizing Mask R-CNN Deep Learning Inferences

This project features two distinct detection models (Fire & Smoke) trained and compared across three different backbones (ResNet50, ResNet101, and ResNet152) using Mask R-CNN.

BEFORE

AFTER

🛠️REQUIREMENTS

  • GPU: NVIDIA GPU with at least 8GB VRAM
  • CUDA: Version 12.2
  • Operating System: Linux
  • Python: Version 3.10, PyTorch, NumPy, Pandas
  • Virtual Environment: Strongly Recommended

Project Structure

.
├── 📂 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

🛠️ Execution

🖼️ Dataset

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

⚙️ Environment Setup

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

🏋️ Training Process

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.

Inference Example

  • Single Detection: Test one model either fire or smoke, independently
  • Two-stage Detection: Executes both models sequentially on the same image.
    By default, the script runs sequentially: it first detects smoke, saves the intermediate result, and then uses that image to detect fire. This results in a final image (result_total.jpg) containing both masks.
# 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:

  • For Fire only: Comment out the "Smoke model" block and change the input_image in the Fire model call to your original image path.
  • For Smoke only: Comment out the "Fire model" block.

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

📄Publication

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

Suggested Citation

@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}
}