{"id":49549124,"url":"https://github.com/adityajhakumar/earthquake-detection-system","last_synced_at":"2026-05-02T21:04:29.334Z","repository":{"id":257074185,"uuid":"857254646","full_name":"adityajhakumar/Earthquake-Detection-System","owner":"adityajhakumar","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-14T07:20:12.000Z","size":151,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-14T18:30:57.886Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adityajhakumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-14T06:54:41.000Z","updated_at":"2024-09-14T07:20:15.000Z","dependencies_parsed_at":"2024-10-09T18:30:46.090Z","dependency_job_id":null,"html_url":"https://github.com/adityajhakumar/Earthquake-Detection-System","commit_stats":null,"previous_names":["adityajhakumar/earthquake-detection-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adityajhakumar/Earthquake-Detection-System","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityajhakumar%2FEarthquake-Detection-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityajhakumar%2FEarthquake-Detection-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityajhakumar%2FEarthquake-Detection-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityajhakumar%2FEarthquake-Detection-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adityajhakumar","download_url":"https://codeload.github.com/adityajhakumar/Earthquake-Detection-System/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityajhakumar%2FEarthquake-Detection-System/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32549388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-02T21:04:27.833Z","updated_at":"2026-05-02T21:04:29.325Z","avatar_url":"https://github.com/adityajhakumar.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Earthquake Detection System 🌍🚨\n\n![Earthquake](img.jpg) \n\n\n## Welcome! 👋\n\nWelcome to the Earthquake Detection System project! 🎉 This initiative aims to leverage machine learning to detect earthquakes using data from gyroscopes and accelerometers. Whether you're a researcher, developer, or just curious about the intersection of technology and natural disaster detection, this project is for you. Dive in to explore how we've built and fine-tuned a system to keep our communities safe from the tremors of Earth!\n\n## What’s Inside? 🧩\n\n### 1. Data Generation 🛠️\n\nWe’ve crafted a dataset that's both realistic and synthetic to train and test our models. Here’s what you’ll find:\n- **Accelerometer Data (Ax, Ay, Az)**: Tracks acceleration in the X, Y, and Z axes.\n- **Gyroscope Data (Gx, Gy, Gz)**: Measures rotational changes in the X, Y, and Z axes.\n- **Labels**: Simple binary indicators - `0` for normal conditions and `1` for earthquakes.\n\n#### How We Generate Data\n- **Normal Conditions**: Smooth, steady data with minimal noise.\n- **Earthquake Conditions**: Features significant spikes and variations to mimic real earthquakes.\n\n\n\n### 2. Model Training 🤖\n\nWe’ve experimented with several powerful models to find the best fit for our task:\n\n#### Random Forest 🌳\n- **What It Is**: A collection of decision trees working together to make predictions.\n- **Why It’s Great**: Handles diverse data well and avoids overfitting.\n\n#### XGBoost 🏆\n- **What It Is**: An advanced boosting technique that’s both fast and flexible.\n- **Why It’s Great**: Delivers exceptional performance and scales effortlessly.\n\n#### Support Vector Machine (SVM) 🚀\n- **What It Is**: Finds the best boundary between different classes.\n- **Why It’s Great**: Perfect for high-dimensional data and complex decision boundaries.\n\n#### Long Short-Term Memory (LSTM) ⏳\n- **What It Is**: A type of neural network designed to understand sequences.\n- **Why It’s Great**: Excellent for capturing patterns over time, ideal for time-series data.\n\n\n\n### 3. Evaluating Our Models 📊\n\nWe don’t just train models - we thoroughly evaluate them using:\n- **Accuracy**: How often our model gets it right.\n- **Precision**: How many of the predicted positives are truly positive.\n- **Recall**: How many of the actual positives our model managed to catch.\n- **F1 Score**: A balanced measure combining precision and recall.\n\n### 4. Ensuring Robustness 🔍\n\nWe use cross-validation to make sure our models are reliable:\n- **K-Fold Cross-Validation**: Splits data into multiple folds to ensure robust training.\n- **Stratified K-Fold Cross-Validation**: Maintains class balance in each fold for more accurate results.\n\n### 5. Visualizing Performance 📈\n\nSee how well our models perform through visualizations:\n- **Training and Validation Accuracy**: Tracks accuracy improvements over epochs.\n- **Training and Validation Loss**: Shows how loss decreases during training.\n\n\n\n## Flowchart\n\nHere’s a simplified flowchart of our process:\n\n1. **Data Generation**\n   - Create synthetic and realistic sensor data for both normal and earthquake conditions.\n\n2. **Data Preprocessing**\n   - Scale features and split data into training and test sets.\n\n3. **Model Training**\n   - Train various models (Random Forest, XGBoost, SVM, LSTM) using the training data.\n\n4. **Model Evaluation**\n   - Evaluate models on test data, focusing on key metrics like Accuracy, Precision, Recall, and F1 Score.\n\n5. **Cross-Validation**\n   - Apply K-Fold and Stratified K-Fold cross-validation to ensure our models are robust and generalizable.\n\n6. **Visualization**\n   - Plot training and validation metrics to monitor and understand model performance.\n\n## Getting Started 🚀\n\n### Installation 🛠️\n\n1. **Clone the Repository**\n\n    ```bash\n    git clone https://github.com/adityajhakumar/earthquake-detection.git\n    cd earthquake-detection\n    ```\n\n2. **Install Dependencies**\n\n    Set up a virtual environment and install required packages:\n\n    ```bash\n    python -m venv venv\n    source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n    pip install -r requirements.txt\n    ```\n\n3. **Requirements**\n\n    Our `requirements.txt` includes:\n    \n    ```plaintext\n    numpy\n    pandas\n    scikit-learn\n    keras\n    matplotlib\n    ```\n\n### Usage\n\n- **Generate Data**: Run `generate_data.py` to create your dataset:\n\n    ```bash\n    python generate_data.py\n    ```\n\n- **Train and Evaluate Models**: Use `train_evaluate_models.py`:\n\n    ```bash\n    python train_evaluate_models.py\n    ```\n\n- **Cross-Validation**: Perform cross-validation with `cross_validation.py`:\n\n    ```bash\n    python cross_validation.py\n    ```\n\n## Evaluation Metrics\n\nWe use the following metrics to evaluate our models:\n- **Accuracy**: Measures overall correctness.\n- **Precision**: Evaluates the accuracy of positive predictions.\n- **Recall**: Assesses how well positive cases are detected.\n- **F1 Score**: Balances precision and recall.\n- ![image](https://github.com/user-attachments/assets/d52151eb-e298-4183-92eb-36cc6383e90d)\n- \u003cimg width=\"370\" alt=\"image\" src=\"https://github.com/user-attachments/assets/11a93ae7-fdc0-4ef0-8c03-50f5a2cbf8c8\"\u003e\n![image](https://github.com/user-attachments/assets/c99e7f59-aec6-42cf-b458-720df5998e8c)\n\n\n\n\n## License 📝\n\nThis project is licensed under the Apache License 2.0. Check out the [LICENSE](LICENSE) file for details.\n\n## Contact 📧\n\nHave questions or feedback? Feel free to reach out to me, [Aditya Kumar Jha](mailto:your.email@example.com). I’m here to help!\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityajhakumar%2Fearthquake-detection-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityajhakumar%2Fearthquake-detection-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityajhakumar%2Fearthquake-detection-system/lists"}