--- license: agpl-3.0 library_name: ultralytics datasets: - sreeharivp23/fire-segmentation-dataset pipeline_tag: image-segmentation tags: - yolo - yolo11 - ultralytics - instance-segmentation - fire-detection - safety - pytorch --- # Fire Segmentation — YOLO11n-seg A YOLO11n instance-segmentation model fine-tuned to detect **fire** with pixel-accurate masks. Unlike bounding-box fire detectors, it reports the exact flame region, which makes it possible to measure how much of a frame is burning and to draw precise overlays for monitoring/alerting systems. ![example](example_output.jpg) ## Usage ```python from ultralytics import YOLO model = YOLO("fire_seg_yolo11n.pt") # image, video file, folder, URL or webcam index all work results = model.predict("fire_video.mp4", conf=0.35) for r in results: if r.masks is not None: print(f"fire instances: {len(r.masks)}") r.show() # or r.save() ``` Or from the CLI: ```bash yolo segment predict model=fire_seg_yolo11n.pt source=fire_video.mp4 conf=0.35 ``` ## Model details | | | |---|---| | Base model | `yolo11n-seg.pt` (Ultralytics YOLO11 nano, segmentation) | | Task | Instance segmentation, 1 class: `fire` | | Input size | 640 × 640 | | Epochs | 60 | | Mask mAP50 | 0.54 | | Mask mAP50-95 | 0.29 | | Box mAP50 | 0.55 | ![training curves](training_curves.png) ## Training data The full auto-labelled dataset is published at [sreeharivp23/fire-segmentation-dataset](https://huggingface.co/datasets/sreeharivp23/fire-segmentation-dataset): ~1,100 fire images from the [CAIR Fire-Detection-Image-Dataset](https://github.com/cair/Fire-Detection-Image-Dataset) and the [DeepQuestAI Fire-Smoke-Dataset](https://github.com/DeepQuestAI/Fire-Smoke-Dataset), plus 250 no-fire negatives. Segmentation labels were **machine-generated**: a pretrained YOLOv8 fire/smoke bounding-box detector proposed fire regions, SAM 2.1 (base) converted each box into a pixel mask, and masks were polygonised into YOLO-seg format. An HSV flame-colour heuristic covered images the detector missed. Validation metrics above are measured against these auto-generated labels, not human annotations. ## Limitations - Labels are machine-generated; expect some mask noise, especially around smoke/glow boundaries and small or occluded flames. - Trained mostly on visible orange/yellow flames; performance on blue flames, night-vision or thermal imagery is untested. - **Not a certified fire-safety system.** Do not use as a substitute for smoke/fire alarms. ## License Fine-tuned from Ultralytics YOLO11, which is released under **AGPL-3.0**; these weights inherit that license.