Instructions to use select-ai/fire-smoke-detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use select-ai/fire-smoke-detection with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("select-ai/fire-smoke-detection") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
- Fire and Smoke Detection System - Version 1
Fire and Smoke Detection System - Version 1
Model description
- Model name: YOLO26L Fire and Smoke Detection
- Version:
v1 - Status:
experimental - Repository visibility: internal
- Upstream base model: YOLO26L (Ultralytics), pretrained on COCO
- Inventory owner: Nishant
- Architecture: YOLO26L object detector fine-tuned for binary fire/smoke detection
- Reference date: 2026-07-29
This repository contains the Version 1 fire and smoke detection system designed for real-time CCTV safety monitoring. The model detects fire and smoke in video frames with high precision, enabling early warning systems for industrial facilities, public spaces, and residential buildings.
The model achieves 84% accuracy for fire detection and 68% accuracy for smoke detection on benchmark evaluation datasets
Problem statement
Early detection of fire and smoke is critical for preventing property damage, injuries, and loss of life. Traditional smoke detectors have limitations:
- Limited coverage: Point sensors only detect hazards in immediate vicinity
- Delayed response: Smoke must reach the detector before triggering an alarm
- No visual context: Cannot distinguish between fire sizes, locations, or spreading patterns
How to use
The primary inference script processes CCTV frames and detects fire/smoke events:
python scripts/run.py \
--video /path/to/cctv_feed.mp4 \
--model models/best.pt \
--conf 0.25 \
--imgsz 960 \
--output output_detections/
The system will:
- Process each frame through YOLO26L detector
- Detect bounding boxes for fire (class 0) and smoke (class 1) regions
- Filter detections by confidence threshold (default 0.25)
- Output annotated frames with bounding boxes and class labels
Input contract
- Input: Decoded color frame, typically BGR
uint8OpenCV arrays or video path - Model input size: Frames are automatically resized to 960 Γ 960 with aspect ratio preservation
- Detection confidence threshold: 0.25 (default) β minimum confidence for fire/smoke detection
- IoU threshold: 0.7 for Non-Maximum Suppression (NMS)
- Color format: BGR (OpenCV standard)
Feature engineering pipeline
The system uses end-to-end YOLO26L object detection with no manual feature engineering:
Model architecture:
- Backbone: YOLO26L with C3k2 blocks and C2PSA attention modules
- Parameters: 26,179,428 trainable parameters
- Layers: 392 layers total
- GFLOPs: 93.1 (computational complexity)
- Detection classes: 2 (fire, smoke)
- Detection heads: Multi-scale detection at 3 levels (P3, P4, P5)
Training augmentations:
- Random horizontal flip (probability 0.5)
- Mosaic augmentation (probability 1.0)
Detection output:
- Bounding box coordinates (x1, y1, x2, y2) in original image space
- Class label (0: fire, 1: smoke)
- Confidence score (0.0 to 1.0)
Configuration and thresholds
Production configuration thresholds:
CONF_THRESHOLD = 0.25 # Minimum detection confidence
IOU_THRESHOLD = 0.7 # NMS IoU threshold
IMAGE_SIZE = 960 # Input image size (square)
MAX_DETECTIONS = 300 # Maximum detections per image
Tunable confidence threshold:
CONF_THRESHOLD(0.0β1.0): Controls detection sensitivity- Higher precision (fewer false alarms): 0.40β0.60
- Higher recall (catch more fires): 0.15β0.25
- Recommended production: 0.25 (balanced)
Adjust CONF_THRESHOLD based on deployment priorities:
- Critical safety applications (industrial facilities): Use 0.15β0.20 to maximize recall and catch early-stage fires
- High traffic areas (reduce false alarms): Use 0.35β0.50 to minimize false positives from reflections, lights, or similar objects
Output contract
For each detected fire or smoke region, the system outputs:
{
"detection_id": 1,
"box_xyxy": [x1, y1, x2, y2],
"class": "fire",
"class_id": 0,
}
Visualized output frames are saved with:
- Color-coded bounding boxes (Red: Fire, Gray: Smoke)
- Class label and confidence score overlay
- Multi-detection support (multiple fires/smoke regions per frame)
Pipeline architecture
[ Frame ]
β
βΌ
YOLO26L Detector
(960Γ960 input)
β
ββββΊ Backbone: C3k2 + C2PSA blocks
ββββΊ Neck: FPN with multi-scale fusion
ββββΊ Head: Multi-scale detection (P3, P4, P5)
β
βΌ
Detection Output
β
ββββΊ Fire bounding boxes (class 0)
ββββΊ Smoke bounding boxes (class 1)
ββββΊ Confidence scores
β
βΌ
Post-processing
β
ββββΊ Non-Maximum Suppression (IoU=0.7)
ββββΊ Confidence filtering (>0.25)
β
βΌ
[ Annotated Frame ]
Runtime requirements
- Python: 3.12+
- Key dependencies:
- Ultralytics β₯ 8.4.104 (YOLO training and inference)
- PyTorch β₯ 2.13.0 with CUDA 13.0
- OpenCV β₯ 4.11.0
- NumPy β₯ 1.26.4
Install dependencies:
pip install -r requirements.txt
For GPU acceleration (recommended for real-time processing):
- CUDA-compatible GPU (tested on NVIDIA L4 with 24GB VRAM)
- CUDA Toolkit β₯ 13.0
- PyTorch with CUDA support
- Mixed precision training enabled (AMP)
Intended use
This model is intended for CCTV-based fire and smoke detection in:
- Industrial facilities and manufacturing plants
- Concert fire detection
- Fire on Roads
- Public buildings (schools, hospitals, shopping malls)
- Residential complexes and apartments
- Forest fire monitoring systems
Limitations
- Performance degrades On very small fires (<20 pixels), heavy smoke obscuring the camera, extreme lighting conditions (direct sunlight glare, complete darkness), or reflective surfaces that mimic fire appearance
- Not designed for : Complex backgrounds, underwater or aerial footage, or thermal/infrared cameras (trained on visible spectrum only)
- No temporal tracking: Single-frame detection without fire spread analysis or smoke density tracking over time
- Smoke detection challenges: Smoke accuracy plummits in dark and hazy environments. (Especially dark black smoke in night) (68% accuracy vs. 88% for fire)
- False positive scenarios: Reflections from glass, bright lights, orange/red objects, steam, fog, or dust clouds may be misclassified
Performance
Training performance (final checkpoint)
Training dataset: 65,195 images (86.3% split, 5 combined datasets)
Validation dataset: 10,382 images (13.7% split)
Total dataset: 75,577 images
Best checkpoint: models/best.pt (epoch with best validation mAP)
Training date: 2026-07-23 to 2026-07-29
Training completed successfully with early stopping. Model converged after ~70 epochs on large-scale multi-dataset training.
Real-world benchmark evaluation
Benchmark dataset: 100 images (90 positive fire/smoke samples, 10 hard negatives)
Evaluation script: Custom presence accuracy metric (image-level hazard detection)
Confidence threshold: 0.25
Evaluation date: 2026-07-29
============================================================
BENCHMARK DATASET BREAKDOWN
============================================================
Total Images Evaluated : 100
Positive Images (Fire/Smoke): 90
Hard Negatives (Background) : 10
============================================================
Multi-threshold performance analysis:
The model was evaluated across 5 confidence thresholds to characterize the precision-recall tradeoff:
| Threshold | Fire Acc | Fire Prec | Fire Rec | Fire F1 | Smoke Acc | Smoke Prec | Smoke Rec | Smoke F1 | Overall Acc | Overall Prec | Overall Rec | Overall F1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.25 (prod) | 0.96 | 1.0 | 0.9494 | 0.9740 | 0.83 | 0.9844 | 0.7975 | 0.8811 | 0.96 | 0.9886 | 0.9667 | 0.9775 |
| 0.50 | 0.88 | 1.0 | 0.8481 | 0.9178 | 0.68 | 1.0 | 0.5949 | 0.7460 | 0.88 | 1.0 | 0.8667 | 0.9286 |
| 0.65 | 0.75 | 1.0 | 0.6835 | 0.8120 | 0.54 | 1.0 | 0.4177 | 0.5893 | 0.76 | 1.0 | 0.7333 | 0.8462 |
| 0.75 | 0.60 | 1.0 | 0.4937 | 0.6610 | 0.44 | 1.0 | 0.2911 | 0.4510 | 0.56 | 1.0 | 0.5111 | 0.6765 |
| 0.95 | 0.21 | 0.0 | 0.0 | 0.0 | 0.21 | 0.0 | 0.0 | 0.0 | 0.10 | 0.0 | 0.0 | 0.0 |
Key performance insights:
- Production threshold (0.25): 96% overall accuracy with 98.86% precision and 96.67% recall β optimal balance for real-world deployment
- Fire detection at 0.25: 96% accuracy, 94.94% recall, perfect 1.0 precision β catches 95% of fires with zero false alarms
- Smoke detection at 0.25: 83% accuracy, 79.75% recall, 98.44% precision β significantly improved from previous 68% accuracy
- Near-perfect precision across thresholds: 98-100% precision at 0.25-0.75 thresholds β minimal false positives
- Recall degrades gracefully: Higher thresholds reduce recall while maintaining perfect precision (0.50: 86.67% recall, 0.65: 73.33% recall)
- High-recall mode (0.25): Recommended for production β catches 96.67% of hazards while maintaining 98.86% precision
- High-precision mode (0.50-0.65): Use in high-traffic areas to minimize false alarms, accepting lower recall (73-86%)
- Threshold 0.95 is too aggressive: Zero detection capability β not recommended for any use case
Missed detections (false negatives):
- Very early-stage fires with minimal visible flames
- Light gray/white smoke against bright backgrounds
- Dense smoke completely obscuring the fire source
- Very small or distant fire/smoke regions (<30 pixels)
Dataset location
Training and evaluation datasets are stored at:
/home/ctspl/Nishant/fire_overnight/dataset/fire_master/
Dataset structure:
fire_master/
βββ train/
β βββ images/ # 65,195 training images (86.3%)
β βββ labels/ # YOLO format annotations
βββ valid/
β βββ images/ # 10,382 validation images (13.7%)
β βββ labels/ # YOLO format annotations
βββ data.yaml # Dataset configuration (75,577 total images)
Dataset is not included in this repository due to size constraints.
Out of scope
The following features are explicitly out of scope for this version:
- Temporal fire spread tracking: Analyzing fire growth rate and spread direction over time
- Smoke density estimation: Quantifying smoke concentration or visibility reduction
- Flame temperature estimation: Thermal analysis or fire intensity classification
- 3D fire localization: Estimating real-world fire position and size from 2D detections
Ownership
- Model trainer/developer: Nishant Prasad
- Independent Validation: -
- Dataset source: Combined public fire/smoke detection datasets
- Base model: Ultralytics YOLO26L
- Training date: 2026-07-23 to 2026-07-29
- Status: experimental
Repository layout
fire-smoke-detection/
βββ README.md
βββ MODEL_CARD.md
βββ CHANGELOG.md
βββ config.json
βββ requirements.txt
βββ tp.txt
βββ scripts/
β βββ train.py # Training script
β βββ run.py # Inference script
β βββ evaluate.ipynb # Evaluation notebook
βββ models/
β βββ best.pt # Best validation checkpoint
βββ docs/
βββ spec.md # Development specification
βββ train.log.md # Complete training log
βββ data.md # Dataset documentation
- Downloads last month
- -