Project Summary
This project is an AI system that performs daily flood risk prediction for 939 districts across Turkey. Trained using meteorological data (precipitation, temperature, wind) and geographical features (slope, river flow), the LSTM (Long Short-Term Memory) model detects potential flood risks in advance with a 96% success rate (Recall).
The system runs automatically every day, fetching current data, performing risk analysis, and generating an interactive choropleth map. It also scans news sources to learn from actual flood events and continuously improves itself (Fine-tuning).
Technologies Used
| Category | Technologies |
|---|---|
| AI / ML | TensorFlow, Keras, LSTM Neural Networks |
| Data Processing | Pandas, NumPy, Scikit-learn |
| Visualization | Folium (Leaflet.js), Matplotlib |
| Data Sources | MGM (Turkish State Meteorological Service), Open-Meteo API, Google News RSS |
| Automation | Python Scripts, Windows Task Scheduler |
Key Features
- Daily Automated Prediction: Fetches and analyzes data from 1800+ stations every morning.
- High Accuracy: Model trained with 25 years of historical data (1996-2021).
- Interactive Map: Displays district-based risk status with color codes (Green → Red).
- Continuous Learning: Updates model weights by learning from actual events.
- Hybrid Data Structure: Uses both dynamic (weather) and static (terrain) data.
System Architecture
The model analyzes the last 7 days of data for each district.
Input Features:
- Dynamic: Total Precipitation, Soil Moisture, Temperature (Max/Min), Wind Speed
- Static: Terrain Slope, River Flow (Expected Flow), Geographical Risk Score
Model Training and Performance
Below is the loss and accuracy graph showing the model's learning process:
Code Snippet (LSTM Architecture)
model = Sequential([
# Time series input (7 days x 10 features)
LSTM(128, input_shape=(7, 10), return_sequences=True),
Dropout(0.3),
BatchNormalization(),
# Deep feature extraction
LSTM(64, return_sequences=False),
Dropout(0.3),
# Classification
Dense(32, activation='relu'),
Dense(1, activation='sigmoid') # Flood probability between 0-1
])
Results
- Recall (Caught Flood Rate): 96.6%
- Precision (True Alarm Rate): 47.3%
- Dataset: 87,000+ daily records
This project demonstrates the power of artificial intelligence in disaster management and early warning systems.