This project demonstrates a real-time fire detection system using semantic segmentation. Built with PyTorch, the system identifies fire in images by analyzing pixels, enabling early detection in hazardous situations.
- PlatformPython, Jupyter Notebook
- StackPyTorch, UNet, Wandb
- ModelUNet Architecture for Semantic Segmentation
The system is built on the following workflow:
1. Environment Setup
2. Data Preparation
3. Model Training
4. Fire Detection
The environment setup involves configuring Python libraries and tools to run the fire detector. Libraries like PyTorch and Wandb are essential for training and tracking the model.
- Python Libraries:
Install
torch
,torchvision
,wandb
, and others. - Wandb:
Used for tracking experiments and visualizing training metrics.
In the data preparation phase, the system organizes images into training and validation datasets. These images are labeled to distinguish areas of fire from non-fire regions.
- Semantic Segmentation:
Annotate images to mark fire zones pixel by pixel.
- Dataset Tools:
Use tools like
LabelMe
for image annotation.
The UNet model is trained on the labeled dataset. During training, the system learns to identify patterns in the image that signify fire.
- UNet Architecture:
A deep learning model designed for precise pixel-level segmentation.
- Training Process:
Optimize the model by adjusting hyperparameters like batch size and learning rate.
- Wandb Tracking:
Monitor training metrics like loss and accuracy.
The trained model processes new images or video streams to identify fire. The output highlights fire regions, helping in early detection and response.
- Prediction Output:
Segmented images with fire areas marked in red.
- Applications:
Can be used for forest fire detection, industrial safety, and surveillance systems.