# Algerian Seismic Risk Engine
### A Geospatial Intelligence System for identifying seismic "Blind Spots" in Northern Algeria.
## 1. Overview
The **Algerian Seismic Risk Engine** is a data mining and geospatial analysis pipeline designed to quantify seismic risk in Northern Algeria (Tell Atlas). Unlike traditional maps that focus solely on earthquake magnitude, this system calculates a **Composite Risk Index (CRI)** by convolving seismic energy release with human population density.
By mapping data to a high-resolution **H3 Hexagonal Grid**, the system identifies "Blind Spots"—areas with moderate seismicity but high vulnerability (e.g., the Bougara/Mitidja sector) that are often overshadowed by massive but offshore events like the 2003 Boumerdès earthquake.
## 2. Key Features
* **Composite Risk Index (CRI):** A normalized metric combining Gutenberg-Richter energy release and WorldPop density data.
* **Interactive 3D Maps:** A Streamlit dashboard using PyDeck to visualize risk zones, fault lines, and population centers in 3D.
* **Machine Learning Integration:**
* **DBSCAN Clustering:** Automatically identifies tectonic domains and active fault zones without prior geological labelling.
* **Isolation Forest:** Detects spatiotemporal anomalies (e.g., deep intraplate events or potential precursors).
* **Real-time Statistics:** Dynamic calculation of the *b-value* (stress accumulation rate) based on filtered time/space windows.
* **Robust ETL Pipeline:** Handles magnitude homogenization (Mw conversion), spatiotemporal deduplication, and reverse geocoding.
## 3. Repository Structure
```text
Algerian Seismic Risk Engine/
├── data/
│ ├── raw/ # Raw ISC CSVs and WorldPop
│ └── processed/ # Cleaned datasets and Risk Maps
├── src/
│ ├── etl.py # Pipeline for cleaning, H3 indexing, and CRI calculation
│ ├── calculations.py # Seismological formulas (G-R Law, Energy)
│ └── ml_models.py # DBSCAN and Isolation Forest …