A cutting-edge full-stack application for real-time forest fire prediction, 3D simulation, and safe path planning using Deep Learning.
Forest-Fire is an integrated platform designed to assist in wildfire management and prevention. By leveraging satellite data, deep learning (U-Net), and pathfinding algorithms (D* Lite), this tool provides actionable insights into fire spread and safe evacuation routes.
The system consists of a robust FastAPI backend that serves predictions from a PyTorch-based model, and a modern Next.js frontend that visualizes data in 2D, offers simulation controls, and provides an interactive dashboard for decision-makers.
📚 Research & Architecture: Read the comprehensive project documentation, including dataset engineering and model architectures, in the docs/project_overview.md file.
- Deep Learning Predictions: Utilizes a U-Net architecture to predict fire spread probability based on environmental factors (temperature, humidity, wind, rain).
- Geospatial Simulation Engine: An interactive
react-leafletmapping interface allowing users to view dynamic Cellular Automata spreading atop real-world geographic bounds (Uttarakhand). - Safe Path Planning: Implements the D* Lite algorithm to calculate dynamic safe paths for rescue teams or evacuation based on real-time AI probabilities.
- Historical Validation: Side-by-side temporal playbacks comparing the model's predicted 48-hour fire spread against actual historical MODIS satellite sequences.
- Data Upload Portal: An interface for government or organizations to upload raw
.nc,.tiff, or.geojsondisaster snapshots for instant AI inference and routing. - AI Assistant: Integrated chat interface for querying system data and insights.
The project follows a modern microservices-like architecture:
graph TD
User[User] -->|Interacts| Client[Next.js Frontend]
Client -->|HTTP/JSON| API[FastAPI Server]
subgraph "Backend Services"
API -->|Inference| Model[PyTorch U-Net]
API -->|Pathfinding| Algo[D* Lite]
API -->|Data| Store[Artifacts/Cache]
end
subgraph "Data Processing"
Raw[Satellite/Weather Data] -->|Preprocessing| Model
end
Frontend
- Framework: Next.js 15
- Language: TypeScript
- Styling: Tailwind CSS, Shadcn UI
- Visualization: React Three Fiber, Recharts, Leaflet
- State/Network: Axios, React Hook Form
Backend & Server
- Framework: FastAPI
- Server: Uvicorn
- Language: Python 3.10+
- Validation: Pydantic
Machine Learning
- Deep Learning: PyTorch, TensorFlow (Legacy)
- Architecture: U-Net (Custom implementation)
- Data Processing: NumPy, Pandas, Scikit-learn
- Pathfinding: D* Lite Algorithm
/
├── Frontend/ # Next.js Web Application
│ ├── app/ # App Router pages (Dashboard, Simulation, etc.)
│ ├── components/ # Reusable UI components (Three.js scenes, Charts)
│ └── ...
├── Server/ # FastAPI Backend
│ ├── app/
│ │ ├── main.py # API Entry point
│ │ ├── d_star_lite.py # Pathfinding logic
│ │ └── ...
│ └── ...
├── Model/ # ML Research & Training
│ ├── src/ # Model definitions (UNet)
│ ├── weights/ # Trained model checkpoints
│ ├── dataset/ # Training data
│ └── ...
└── ...Follow these instructions to set up the project locally.
- Node.js (v18+ recommended)
- Python (v3.10+)
- Git
git clone https://github.com/AceofStades/Forest-Fire.git
cd Forest-FireNavigate to the Server directory, create a virtual environment, and install dependencies.
cd Server
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the server
uvicorn app.main:app --reload --port 8000The API will be available at
http://localhost:8000.
Open a new terminal, navigate to the Frontend directory.
cd Frontend
# Install dependencies
npm install # or pnpm install / yarn install
# Run the development server
npm run devThe application will be running at
http://localhost:3000.
If you wish to retrain the model or explore the datasets:
cd Model
pip install -r requirements.txt
# Check src/ for model definitions and train.py for training scriptsContributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is brought to you by:
- AceofStades - Machine Learning Engineer
- Vishalbarai007 - Backend Engineer
- SRB114719 - Web Engineer
Distributed under the MIT License. See LICENSE for more information.