This project is a real-time fire detection system built using MobileNetV2 (TensorFlow/Keras) for deep learning and OpenCV for computer vision.
It can detect fire in images, videos, or live webcam feeds with high accuracy.
- ✅ Trainable model (binary classification: Fire / No Fire)
- ✅ Preprocessing: image resizing, normalization, augmentation
- ✅ Model optimization with EarlyStopping & ModelCheckpoint
- ✅ Real-time detection with OpenCV (webcam/video feed)
- ✅ Saved model weights for reusability (
.h5files)
- Python 3.10+
- TensorFlow / Keras
- OpenCV
- NumPy, Matplotlib, scikit-learn
project/
│── dataset/ # Training dataset (Fire / NoFire folders)
│ ├── Fire/
│ └── NoFire/
│── fire_detection_model.py # Script for training MobileNetV2 model
│── fire_detection_app.py # Real-time detection using trained model
│── best_fire_model.h5 # Saved trained model (example)
│── fire_detection_model_mobilenet.h5 # Another trained model version
│── requirements.txt # Dependencies
│── .gitignore
│── LICENSE
│── README.mdgit clone https://github.com/your-username/fire-detection-mobilenet.git
cd fire-detection-mobilenetpython -m venv venv
venv\Scripts\activate # On Windowspip install -r requirements.txt
dataset/
├── Fire/
└── NoFire/
python fire_detection_model.py
This will train MobileNetV2 and save the best model as .h5.
python fire_detection_app.py
Opens your webcam/video feed
Detects Fire / No Fire in real time
Model Accuracy: 92%+ on custom dataset
Fast inference with MobileNetV2
Alerts when fire is detected in video stream
Nirjana Das
GitHub:nirjanadas