seismosense
An ML classifier tool which predicts the alert status of earthquakes based on geographical data
1.2K
SeismoSense is an AI-powered earthquake alert prediction system that leverages machine learning to analyze seismic data and provide instant alert predictions. This project combines cutting-edge ML pipelines, SMOTE oversampling for imbalanced data, and a sleek, futuristic Flask frontend with animated confidence bars.
To check the GitHub repo, click hereโ
green, orange, red, yellow) based on 5 key seismic features:
magnitudedepthcdi (Community Disaster Index)mmi (Modified Mercalli Intensity)sig (Significance)Landing Page

Prediction Result with Confidence Bar

git clone https://github.com/your-username/SeismoSense.git
cd SeismoSense
pip install -r requirements.txt
python app.py
Open your browser and navigate to http://127.0.0.1:5000โ to start predicting earthquake alerts!
A Dockerhub repositoryโ is created where I have pushed the docker image which contains the entire Cosmoclassifier app.
The image is built on both ARM64 and AMD64 architectures, so that it can run on almost all major computers. You can run the app easily by using the Dockerhub Image. Here's how you can do it:
Install Docker Desktopโ and sign-in. Make sure the app is functioning properly.
Open Terminal and run:
docker pull bytebard101/seismosense:latest
docker run --rm -p 5000:5000 bytebard101/seismosense:latest
docker run --rm -p 5001:5000 bytebard101/seismosense:latest
If you followed Step 2 and the command ran successfully, then DO NOT follow this step.
Check Docker Documentationโ to learn more about Docker and it's commands.
SeismoSense uses the Earthquake Alert Prediction Dataset from Kaggle, contributed by Ahmed Mohamed Zaki.
Dataset linkโ
The dataset compiles seismic measurements and historical alert levels, aiming to support predictive models for earthquake warning systems. It provides a real world challenge โ classification under class imbalance with geophysical features.
| Feature | Meaning / Description |
|---|---|
| magnitude | Measured strength (Richter or comparable scale) |
| depth | How deep the quake was beneath the surface |
| cdi | Community Disaster Index (impact-based) |
| mmi | Modified Mercalli Intensity (felt intensity) |
| sig | Significance metric (statistical/energy measure) |
greenorangeredyellowThe original mapping used in the repository is:
{'green': 0, 'orange': 1, 'red': 2, 'yellow': 3}
The ML pipeline was trained on the Earthquake Alert Prediction Dataset using RandomizedSearchCV for hyperparameter tuning and SMOTE to handle class imbalance.
Classification Report on Test Set (260 samples):
| Label | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| 0 (green) | 0.89 | 0.83 | 0.86 | 65 |
| 1 (orange) | 0.88 | 0.98 | 0.93 | 65 |
| 2 (red) | 0.98 | 0.94 | 0.96 | 65 |
| 3 (yellow) | 0.86 | 0.85 | 0.85 | 65 |
| Accuracy | 0.90 | 260 | ||
| Macro Avg | 0.90 | 0.90 | 0.90 | 260 |
| Weighted Avg | 0.90 | 0.90 | 0.90 | 260 |
โ Achieves 90% accuracy with balanced performance across all alert levels, showing robustness even on imbalanced data.
SEISMOSENSE/
โโโ dataset/
โ โโโ earthquake_data.csv # Training dataset
โโโ models/
โ โโโ estimator.pkl # Trained ML pipeline
โ โโโ names.pkl # Feature column names
โโโ templates/
โ โโโ index.html # Frontend code
โโโ .dockerignore # Excludes unnecessary files from Docker build
โโโ .gitignore # Ignores venv, pycache, logs, etc.
โโโ app.py # Flask server
โโโ Dockerfile # Containerizes the app for deployment
โโโ fit.py # ML training script
โโโ LICENSE # MIT License
โโโ README.md # Youโre reading it
โโโ requirements.txt # Python dependencies
โโโ research.ipynb # # Notebook used for testing, visualization and many more
Python 3.13.7
Flask for frontend server
scikit-learn for ML tasks
imbalanced-learn for SMOTE implementation and pipeline
XGBoost, RandomForest, SVC, KNN, Bagging for model benchmarking
HTML/CSS for modern UI with animation
Docker for containerized deployment
Add real-time earthquake data ingestion for live predictions.
Build a map-based visualization showing predicted alert levels geographically.
Extend to batch prediction for CSV uploads.
Add user authentication and log predictions for research purposes.
Note: Due to the absence of front-end web development expertise and the absence of other contributors for the project, I was compelled to utilize AI tools (such as LLM services like ChatGPTโข, Grokโข, and GitHub Copilotโข) to develop a sophisticated front-end for the web app. I am looking forward to human contribution on this project in order to scale it even further.
This project is licensed under the MIT License โ feel free to use, modify, or extend for personal and research purposes.
Thank you for visting the repository. Iโd be thrilled to hear those! You can find my contact info on my GitHub profileโ .
If you liked this project, please consider giving it a star ๐
Have a great day!
Content type
Image
Digest
sha256:81bccab36โฆ
Size
643.4 MB
Last updated
3 months ago
docker pull bytebard101/seismosense