A cutting-edge hybrid quantum-classical system for wildfire spread prediction and optimal resource allocation.
🔗 Explore Our Official Website | Hackathon Website | Overview | Installation | Usage | Contributing
- Overview
- The Problem
- Our Solution
- Algorithm Workflow
- Installation Setup
- Data Sources
- Features
- Technologies Used
- Usage Examples
- Results & Benchmarks
- Contributing
- Team
- Acknowledgments
- License
Quantum Wildfire Brigade (QWB) is an innovative hybrid quantum-classical platform that combines advanced AI prediction models with quantum computing optimization to revolutionize wildfire management. Our system provides fire spread forecasting and optimal resource allocation, helping emergency responders make critical decisions faster and more effectively.
- Quantum-Powered Optimization: Leverages GAS (Grover Adaptative Search) for QUBO formulations for optimal firefighting strategy
- AI-Driven Predictions: Uses ConvLSTM neural network for accurate wildfire spread forecasting
- Real-Time Analysis: Processes live satellite data and weather conditions for up-to-date predictions
- Interactive Visualization: Intuitive web interface for monitoring fire progression and resource deployment
- Scalable Architecture: Modular design supporting multiple regions and fire scenarios simultaneously
Wildfires represent one of the most devastating natural disasters globally, with increasing frequency and intensity due to climate change. Key challenges include:
- Rapid Spread: Fires can propagate unpredictably based on weather, terrain, and vegetation
- Resource Constraints: Limited firefighting resources must be allocated efficiently across multiple fronts
- Time-Critical Decisions: Every minute counts in preventing catastrophic damage and loss of life
- Complex Variables: Multiple interacting factors (wind, humidity, topography) make prediction difficult
- Coordination Challenges: Multiple agencies and resources need real-time synchronization
Traditional approaches struggle with the computational complexity of optimizing resource allocation while simultaneously predicting fire behavior in real-time.
QWB addresses these challenges through a two-pronged hybrid approach:
- ConvLSTM Neural Network: Captures spatial-temporal patterns in fire progression
- Multi-Modal Data Integration: Combines satellite imagery, weather data, terrain maps, and vegetation indices
- Probabilistic Forecasting: Generates confidence intervals and multiple scenarios
- Adaptive Learning: Continuously improves predictions based on observed fire behavior
- QUBO Formulation: Transforms firefight problem into quantum-solvable optimization problems
- GAS optimization: Explores solution space exponentially faster than classical methods
- Constraint Satisfaction: Balances multiple objectives (coverage, response time, resource capacity)
- Dynamic Reallocation: Updates optimal strategies as fire conditions evolve
By combining quantum optimization with classical AI, QWB achieves:
- Speed: Quantum algorithms find optimal solutions faster than the best known classical approaches
- Accuracy: Deep learning models provide precise fire behavior predictions
- Adaptability: System responds to changing conditions
- Scalability: Handles complex scenarios with hundreds of variables
graph TB
A[📡 Data Collection] --> B[🧹 Preprocessing]
B --> C[🧠 ConvLSTM Prediction]
B --> D[⚛️ Quantum Optimization]
C --> E[🔥 Fire Spread Forecast]
D --> F[🚁 Firefighting Plan]
E --> G[📊 Decision Dashboard]
F --> G
G --> H{🔄 Real-Time Update?}
H -->|Yes| A
H -->|No| I[📋 Final Report]
style A fill:#4a90e2
style C fill:#e74c3c
style D fill:#9b59b6
style G fill:#2ecc71
style I fill:#f39c12
-
Data Ingestion
- Satellite imagery (Sentinel-2, MODIS)
- Weather data (temperature, wind, humidity)
- Terrain models (elevation, slope, aspect)
- Vegetation indices (NDVI, fuel moisture)
-
Prediction Module
- Spatiotemporal feature extraction
- ConvLSTM forward propagation
-
Optimization Module
- QUBO matrix construction
- GAS solver
- Solution decoding and validation
- Constraint verification
-
Visualization & Reporting
- Interactive fire progression maps
- Resource deployment overlays
- Performance metrics dashboard
- Automated alerts and notifications
We are given a 2D grid
-
$S_0$ is a set of nodes that are burning at time$t = 0$ . -
$M$ is an$a \times b \times a \times b$ tensor.$M_{(i, j), (k, l)}$ is the probability that a node$(i, j)$ ignites$(k, l)$ given that node the$(i, j)$ is burning. We set$M_{(i, j), (i, j)} = 1$ . -
$P_{i, j}$ is an integer between$0$ and$R_m$ indicating the risk of burning for each node$(i, j)$ , where$P_{i, j} = R_m$ indicates that the node is already burning. the probabiliyi$Pr_{i, j}$ that node$(i, j)$ burns can be computed using$M$ and$S_0$ , and then we discretize the values to get integer risks.
-
$W$ is the maximum nodes that can be defendend in a given time window.
The expected amount of burning nodes are,
We define a set
The variables are
Subject to
This problem is easily translated to QUBO:
- Python: 3.8 or higher
- Node.js: 16.x or higher (for web application)
- Qiskit: 1.x
- Qiskit-Optimization: Any version
git clone https://github.com/qbrigade/hackathon_LATAM.git
cd hackathon_LATAMUsing Conda (Recommended):
conda env create -f environment.yml
conda activate qwbUsing pip:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt# Run data download script
bash scripts/download_data.sh
# Or manually download from specified sources
python src/data/loader.py --downloadcd web
npm install
npm run devThe web interface will be available at http://localhost:3000
cd api
python app.pyThe API will be available at http://localhost:8000
Our system integrates multiple data sources for comprehensive wildfire analysis:
- Sentinel-2: 10m resolution multispectral imagery (European Space Agency)
- MODIS: Thermal anomalies and fire detection (NASA)
- VIIRS: Active fire detection (NOAA)
- Landsat 8/9: Historical vegetation and land cover data (USGS)
- NOAA: Temperature, humidity, wind speed/direction
- OpenWeatherMap API: Real-time weather conditions
- ERA5: Historical climate reanalysis (ECMWF)
- Local Weather Stations: Ground-truth measurements
- SRTM: Digital elevation models (NASA)
- NLCD: Land cover classification (USGS)
- FuelModel: Vegetation fuel types (LANDFIRE)
- OpenStreetMap: Road networks and infrastructure
- FIRMS: Historical fire perimeters (NASA)
- GWIS: Global wildfire information system (Copernicus)
- Local Fire Departments: Incident reports and outcomes
from src.data.loader import DataLoader
# Initialize loader
loader = DataLoader(config_path='configs/data_config.yaml')
# Load satellite imagery
imagery = loader.load_satellite_data(
region='california',
start_date='2024-01-01',
end_date='2024-12-31'
)
# Load weather data
weather = loader.load_weather_data(
coordinates=(34.0522, -118.2437),
timeframe='24h'
)- Short-term forecasting: 1-24 hour predictions with high accuracy
- Medium-term projections: 1-7 day scenarios for planning
- Probabilistic modeling: Multiple outcomes with confidence levels
- Ensemble predictions: Aggregated forecasts from multiple models
- Multi-objective optimization: Balances coverage, cost, and response time
- Dynamic reallocation: Adapts to changing fire conditions
- Constraint handling: Respects resource availability and logistics
- Scalable solutions: Handles 100+ variables efficiently
- Interactive maps: Real-time fire progression visualization
- Resource tracking: Monitor deployment status of all assets
- Alert system: Automated notifications for critical events
- Mobile responsive: Access from any device
- Multi-language support: English, Spanish, Portuguese
- RESTful API: Easy integration with existing systems
- WebSocket support: Real-time data streaming
- Authentication: Secure access control
- Rate limiting: Fair usage policies
- Comprehensive documentation: OpenAPI/Swagger specs
- Performance metrics: Accuracy, response time, resource utilization
- Historical analysis: Learn from past incidents
- Comparative studies: Benchmark different strategies
- Export capabilities: PDF, CSV, GeoJSON formats
- GAS: Qiskit Implementation for Grover Adaptative Search
- FastAPI: Modern Python web framework
- PostgreSQL: Relational database
- Redis: Caching and message broker
- Celery: Distributed task queue
- SQLAlchemy: ORM
- React: UI framework
- Next.js: React framework with SSR
- Leaflet: Interactive mapping
- D3.js: Data visualization
- Tailwind CSS: Utility-first CSS
from src.models.convlstm import WildfirePredictor
from src.data.preprocessor import DataPreprocessor
# Initialize predictor
predictor = WildfirePredictor.load_pretrained('models/convlstm_best.pth')
# Load and preprocess data
preprocessor = DataPreprocessor()
input_data = preprocessor.prepare_sequence(
satellite_images=['data/sentinel2_t1.tif', 'data/sentinel2_t2.tif'],
weather_data='data/weather.csv',
terrain='data/dem.tif'
)
# Generate predictions
predictions = predictor.predict(
input_data,
forecast_hours=24,
confidence_level=0.95
)
# Visualize results
predictions.plot_progression(output='fire_forecast.html')
predictions.export_geojson('fire_forecast.geojson')from src.pipeline import WildfireManagementPipeline
# Initialize complete pipeline
pipeline = WildfireManagementPipeline(
config_path='configs/model_config.yaml'
)
# Run full analysis
results = pipeline.run(
region='california_south',
current_fire_perimeter='data/active_fire.geojson',
forecast_duration=48,
optimize_resources=True
)
# Access results
print(f"Predicted fire area in 48h: {results.predicted_area} hectares")
print(f"Optimal resource allocation: {results.allocation_plan}")
print(f"Estimated containment time: {results.containment_estimate} hours")
# Generate comprehensive report
report = results.generate_report(format='pdf')
report.save('wildfire_analysis_report.pdf')# Start prediction job
curl -X POST http://localhost:8000/api/v1/predictions \
-H "Content-Type: application/json" \
-d '{
"region": "california",
"fire_id": "CA-2024-001",
"forecast_hours": 24
}'
# Get prediction results
curl http://localhost:8000/api/v1/predictions/job-123
# Request resource optimization
curl -X POST http://localhost:8000/api/v1/optimize \
-H "Content-Type: application/json" \
-d '{
"fire_zones": [...],
"available_resources": {...},
"constraints": {...}
}'-
Response time reduction: Faster optimal firefighting strategy
$O(\sqrt(N))$ vs$O(N)$
We welcome contributions from the community! Here's how you can help:
- 🐛 Report bugs and issues
- 💡 Suggest new features or improvements
- 📖 Improve documentation
- 🧪 Add tests and increase coverage
- 🎨 Enhance visualizations
- 🔬 Conduct experiments and share results
- Fork the repository
git clone https://github.com/YOUR_USERNAME/hackathon_LATAM.git
cd hackathon_LATAM
git remote add upstream https://github.com/qbrigade/hackathon_LATAM.git- Create a feature branch
git checkout -b feature/your-feature-name- Make your changes
- Write clean, documented code
- Follow PEP 8 style guidelines
- Add tests for new functionality
- Update documentation as needed
- Run tests
pytest tests/ --cov=src
black src/ tests/
flake8 src/ tests/- Commit and push
git add .
git commit -m "feat: add your feature description"
git push origin feature/your-feature-name- Create a Pull Request
- Provide a clear description of changes
- Reference related issues
- Ensure CI/CD checks pass
- Request review from maintainers
- Python: Follow PEP 8, use type hints
- JavaScript: Follow Airbnb style guide
- Commits: Use conventional commits (feat, fix, docs, etc.)
- Documentation: Update README and docstrings
- 📧 Email: contact@qbrigade.dev
- 🐙 GitHub: @qbrigade
- 🌐 Website: qbrigade.pages.dev
- 💬 Discord: Join our community server
We extend our gratitude to:
- NASA and ESA for satellite data access
- NOAA for weather data and fire detection systems
- Hackathon LATAM organizers for the opportunity
- Open-source community for invaluable tools and libraries
- Fire departments and emergency responders for domain expertise
- Academic institutions for research collaboration
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Quantum Wildfire Brigade
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Built with ❤️ by Quantum Wildfire Brigade
Protecting lives and property through quantum-enhanced intelligence
