Skip to content

7vik2005/FireSense-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python YOLOv8 Flask License

🔥 FireSense AI

Intelligent Fire and Smoke Detection using YOLOv8, Computer Vision, and Real-Time Monitoring


📌 Overview

FireSense AI is a comprehensive computer vision-based fire and smoke detection system developed using the YOLOv8 object detection framework.

The project is designed to provide:

  • Real-Time Fire Detection
  • Real-Time Smoke Detection
  • Image Analysis
  • Video Surveillance
  • Live Webcam Monitoring
  • Detection Analytics
  • Historical Reporting
  • Interactive Dashboard Visualization

FireSense AI combines Deep Learning, Computer Vision, and Web Development into a single integrated platform capable of monitoring visual data sources and automatically identifying fire and smoke hazards.


🎯 Problem Statement

Fire accidents cause significant damage to:

  • Human Life
  • Property
  • Forest Resources
  • Industrial Infrastructure

Traditional fire detection systems primarily rely on:

  • Smoke Sensors
  • Heat Sensors
  • Alarm Systems

Although effective in controlled environments, these systems may experience:

  • Delayed Detection
  • Limited Coverage
  • Sensor Malfunctions
  • High Installation Costs

Recent advancements in Artificial Intelligence and Computer Vision allow cameras to act as intelligent monitoring systems capable of identifying fire and smoke directly from visual data.

FireSense AI leverages these advancements to provide an automated vision-based monitoring solution.


🚀 Features

🖼 Image Detection

Upload an image and instantly detect fire and smoke.

Capabilities

  • YOLOv8 Object Detection
  • Bounding Box Generation
  • Confidence Score Visualization
  • Fire Detection Count
  • Smoke Detection Count
  • Detection Summary
  • Download Processed Image

🎥 Video Detection

Upload videos and perform frame-by-frame fire and smoke detection.

Capabilities

  • Frame-Level Analysis
  • Real-Time Progress Tracking
  • Detection Statistics
  • Processed Video Generation
  • Download Processed Video
  • Video Analytics

📷 Live Webcam Monitoring

Perform real-time monitoring using a webcam stream.

Capabilities

  • Real-Time Object Detection
  • Fire Monitoring
  • Smoke Monitoring
  • Screenshot Capture
  • Instant Screenshot Analysis
  • Detection History Logging

📊 Analytics Dashboard

A centralized dashboard for monitoring system performance and detection activity.

Dashboard Features

  • Images Processed
  • Videos Processed
  • Screenshots Captured
  • Total Fire Detections
  • Total Smoke Detections
  • Detection History Tables
  • Fire vs Smoke Visualization
  • Source Distribution Charts

🧠 Machine Learning Pipeline

Dataset Collection
        ↓
Image Annotation
        ↓
Dataset Validation
        ↓
YOLOv8 Training
        ↓
Model Evaluation
        ↓
Inference Pipeline
        ↓
Web Deployment

🏗 System Architecture

User Input
     │
     ▼
Flask Web Application
     │
     ▼
YOLOv8 Detection Engine
     │
     ▼
Detection Processing
     │
     ▼
Result Storage
     │
     ▼
Analytics Dashboard

🛠 Technology Stack

Programming Language

  • Python 3.x

Deep Learning

  • YOLOv8
  • Ultralytics

Computer Vision

  • OpenCV

Backend

  • Flask

Frontend

  • HTML5
  • CSS3
  • JavaScript

Data Analysis

  • Pandas
  • NumPy

Visualization

  • Chart.js

Version Control

  • Git
  • GitHub

📂 Project Structure

FireSense-AI
│
├── app.py
├── requirements.txt
├── README.md
├── .gitignore
│
├── dataset
│   └── data.yaml
│
├── src
│   ├── train.py
│   ├── predict.py
│   ├── video_predict.py
│   └── webcam.py
│
├── templates
│   ├── home.html
│   ├── image_detection.html
│   ├── video_detection.html
│   ├── webcam_detection.html
│   └── analysis.html
│
├── static
│   ├── css
│   │   └── style.css
│   │
│   ├── uploads
│   ├── results
│   └── screenshots
│
├── reports
│
└── runs
    └── detect
        └── firesense_pro
            └── weights
                └── best.pt

⚙ Installation

Clone Repository

git clone https://github.com/7vik2005/FireSense-AI.git

Move Into Project Directory

cd FireSense-AI

Create Virtual Environment

python -m venv venv

Activate Virtual Environment

Windows

venv\Scripts\activate

Linux / macOS

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Run Application

python app.py

Open your browser and navigate to:

http://127.0.0.1:5000

📊 Dataset Information

The FireSense AI model was trained on a custom fire and smoke detection dataset containing annotated images of fire and smoke instances under diverse environmental conditions.

Dataset Characteristics

The dataset includes:

  • Fire Images
  • Smoke Images
  • Mixed Fire and Smoke Images
  • Indoor Fire Scenarios
  • Outdoor Fire Scenarios
  • Industrial Fire Incidents
  • Forest Fire Examples

Annotation Format

The dataset was annotated using the YOLO object detection format.

Classes

Class ID Class Name
1 Fire
0 Smoke

🏋️ Model Training

The project uses the YOLOv8 object detection architecture provided by Ultralytics.

Training Configuration

Model: YOLOv8n

Image Size: 416 x 416

Epochs: 30

Batch Size: 4

Optimizer: SGD / AdamW

Framework: Ultralytics YOLOv8

Training Command

yolo detect train \
model=yolov8n.pt \
data=dataset/data.yaml \
epochs=30 \
imgsz=416

🎯 Model Evaluation

The trained model was evaluated on a dedicated test dataset containing unseen images.

Evaluation Metrics

The following metrics were used:

  • Precision
  • Recall
  • F1 Score
  • mAP@0.5
  • mAP@0.5:0.95

Metric Definitions

Precision

Measures how many predicted detections are correct.

Precision = TP / (TP + FP)

Recall

Measures how many actual objects are detected.

Recall = TP / (TP + FN)

F1 Score

Harmonic mean of Precision and Recall.

F1 = 2 × Precision × Recall
      ----------------------
      Precision + Recall

mAP

Mean Average Precision evaluates overall object detection performance across classes.


🌐 Web Application Modules

Home Page

The home page serves as the central navigation hub and provides access to all system functionalities.

Modules

  • Image Detection
  • Video Detection
  • Webcam Detection
  • Analytics Dashboard

Image Detection Module

This module allows users to upload images for fire and smoke detection.

Workflow

Upload Image
      ↓
YOLOv8 Inference
      ↓
Detection Visualization
      ↓
Statistics Generation
      ↓
Download Result

Video Detection Module

This module performs frame-by-frame analysis on uploaded videos.

Workflow

Upload Video
      ↓
Frame Extraction
      ↓
YOLOv8 Detection
      ↓
Frame Annotation
      ↓
Video Reconstruction
      ↓
Processed Video Output

Additional Features

  • Progress Tracking
  • Frame Statistics
  • Detection Summary
  • Downloadable Results

Webcam Detection Module

Provides real-time monitoring using webcam streams.

Features

  • Live Object Detection
  • Fire Monitoring
  • Smoke Monitoring
  • Screenshot Capture
  • Instant Analysis
  • Historical Logging

📈 Analytics Dashboard

The Analytics Dashboard provides a complete overview of detection activities.

Dashboard Components

Statistics Cards

  • Images Processed
  • Videos Processed
  • Screenshots Captured
  • Fire Detections
  • Smoke Detections

Visual Analytics

Fire vs Smoke Chart

Provides a comparison between total fire and smoke detections.

Source Distribution Chart

Shows detection activity across:

  • Images
  • Videos
  • Screenshots

Historical Records

  • Image Detection History
  • Video Detection History
  • Screenshot Detection History

📁 Generated Reports

FireSense AI automatically maintains records of system activity.

Generated Logs

Image Reports

image_history.csv

Video Reports

video_history.csv

Webcam Reports

webcam_history.csv

These reports enable future auditing and monitoring of system performance.


🔮 Future Enhancements

The following improvements can further enhance FireSense AI:

Cloud Deployment

Deploy the application using:

  • AWS
  • Azure
  • Google Cloud Platform

Email Alerts

Automatic notifications when fire is detected.

SMS Notifications

Emergency alerts to registered users.

Multi-Camera Monitoring

Support for multiple surveillance cameras simultaneously.

Mobile Application

Android and iOS monitoring applications.

Edge AI Deployment

Deploy FireSense AI on:

  • Raspberry Pi
  • NVIDIA Jetson
  • Edge TPU Devices

CCTV Integration

Direct integration with existing surveillance systems.


📸 Application Screenshots

Home Page

Image Detection

Video Detection

Webcam Detection

Analytics Dashboard


📜 License

This project is licensed under the MIT License.

See the LICENSE file for complete details.


🙏 Acknowledgements

Special thanks to:

  • Ultralytics YOLOv8 Team
  • OpenCV Community
  • Flask Community
  • Open Source Contributors

for providing powerful tools and frameworks that made this project possible.


👨‍💻 Developer

Satvik Jambagi

Artificial Intelligence • Machine Learning • Computer Vision • Full Stack Development


⭐ If you found this project useful, consider giving it a star on GitHub.

About

FireSense AI is a comprehensive fire and smoke detection platform built using YOLOv8, OpenCV, Flask, and Computer Vision. The system supports image analysis, video surveillance, live webcam monitoring, screenshot analytics, interactive dashboards, and real-time detection reporting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors