Skip to content

πŸ”₯ AI-based forest fire detection system using CNN and real-time webcam monitoring with email alerts

License

Notifications You must be signed in to change notification settings

Venkatr770/Forest-Fire-Detection-AI

Repository files navigation

<<<<<<< HEAD

πŸ”₯ Forest Fire Detection Using AI

This project detects forest fires using Convolutional Neural Networks (CNN) and performs real-time fire detection via a mobile camera. It can optionally send email alerts when fire is detected and includes geolocation information.

πŸ“ Project Structure

Forest-Fire-Detection-AI/
β”œβ”€β”€ model_training/
β”‚   β”œβ”€β”€ Forest_Fire_Detection_Train_Test_model.ipynb      # CNN model training notebook (Google Colab)           
β”œβ”€β”€ live_detection/
β”‚   β”œβ”€β”€ fire_detection_live.py      # Real-time fire detection using webcam
β”œβ”€β”€ requirements.txt                # Python package dependencies
β”œβ”€β”€ README.md                       # Project overview and usage
└── .gitignore                      # Files to ignore in GitHub

🧠 Model Details

  • Model: Custom CNN
  • Input size: 224x224 pixels RGB
  • Output: Binary classification (Fire / No Fire)

πŸ—οΈ How to Use

πŸ”Ή 1. Train the Model (Colab)

Run Forest_Fire_Detection_Train_Test_model in Google Colab to train the model on fire and non-fire images. You can save the model as .keras.

πŸ“± 2. Using Mobile as a Webcam

This project also supports using a mobile phone as a webcam using the IP Webcam app (Android):

  1. Install the IP Webcam app from the Play Store.
  2. Connect your mobile and laptop to the same Wi-Fi or mobile hotspot.
  3. Open the app, scroll down, and tap "Start Server".
  4. Note the streaming URL (e.g., http://192.168.0.101:8080/video).
  5. In fire_detection_live.py, replace the webcam line:
cap = cv2.VideoCapture("http://192.168.0.101:8080/video")


### πŸ”Ή 3. Real-Time Detection (VS Code or Local Python)
Use `nforest_fire_detection.py` to detect fire from your mobile camera.

```bash
python nforest_fire_detection.py

Press q to quit the webcam stream.

πŸ”₯ Download Pre-trained Model

To use the real-time fire detection without training, download the pre-trained model from the link below:

πŸ‘‰ Download fire_model.keras

Place the downloaded file in the project folder before running live_detection.py.

πŸ“¦ Installation

pip install -r requirements.txt

πŸ“₯ Dataset

βœ… Requirements

  • TensorFlow 2.x
  • OpenCV
  • NumPy
  • Matplotlib

(Install via requirements.txt)

πŸ” Notes

  • Don't upload large datasets to GitHub. Use links instead.
  • Store sensitive credentials (like email passwords) securely.

πŸ‘¨β€πŸ’» Author

VENKAT RAMANAN R
B.Tech ECE, VIT-AP University
Edunet-Microsoft AI Internship Project

πŸ“ƒ License

This project is open-source under the MIT License.

Forest-Fire-Detection-AI

πŸ”₯ AI-based forest fire detection system using CNN and real-time webcam monitoring with email alerts

9d1a01909a67ae67aa827c7eb83bf5252d045441