A predictive modeling tool for identifying and quantifying soil erosion risks in varied terrains, with a focus on the geological challenges faced in Ghanaian communities.
SERA analyzes the relationship between environmental factors — Rainfall (Erosivity) and Slope (Erodibility) — to predict soil loss in tons per hectare, using Multiple Linear Regression. Study areas include the Akwapim-Togo Range and coastal belts of Ghana.
It serves as a Decision Support System (DSS) for geological engineers and local planning authorities, providing quantitative evidence for soil conservation strategies.
- Predictive Modeling — Uses Scikit-learn to calculate erosion trends from historical geological data
- Dynamic Risk Assessment — Categorizes results into
Low,Moderate, andHighrisk zones - Automated Recommendations — Suggests engineering interventions (Bench Terracing, Check Dams, Reforestation) based on output severity
- Data Visualization — Generates Matplotlib graphs showing the regression trend line and specific risk coordinates
| Component | Technology |
|---|---|
| Language | Python 3.14 |
| Data Analysis | Pandas, NumPy |
| Machine Learning | Scikit-learn (Linear Regression) |
| Visualization | Matplotlib |
SERA operates on the following derived regression equation:
Erosion = 0.018(Rainfall) + 0.429(Slope) - 2.036
Key insight: The coefficient on Slope (0.429) is significantly larger than that of Rainfall (0.018), confirming that slope gradient is the primary driver of land degradation in the study area. This provides a quantitative basis for prioritizing slope-stabilization interventions.
1. Clone the repository
git clone https://github.com/Kyeremeh-Cosmos/soil-erosion-analyzer.git
cd soil-erosion-analyzer2. Set up a virtual environment
python -m venv .venv
source .venv/Scripts/activate # Windows
# source .venv/bin/activate # macOS / Linux3. Install dependencies
pip install pandas numpy matplotlib scikit-learn4. Run the application
python main.pyThe visual output includes:
- 📈 Historical Trend Line — regression fit across the training data
- ⭐ Risk Coordinate (Gold Star) — plots the input scenario on the trend, allowing non-technical stakeholders to immediately visualize the impact of environmental changes on their land
Kyeremeh Cosmos Computer Engineering & Engineering Student

