This project simulates sensor data for a bridge structure and uses machine learning to detect anomalies. The project includes data simulation, preprocessing, model training, anomaly detection, and visualization.
SmartStructureGuardian
│
├── data
│ └── raw
│ └── processed
│
├── notebooks
│ └── data_simulation.ipynb
│ └── data_analysis.ipynb
│ └── anomaly_detection.ipynb
│
├── src
│ ├── data_simulation.py
│ ├── data_preprocessing.py
│ ├── model_training.py
│ ├── anomaly_detection.py
│ └── visualization.py
│
├── docs
│ ├── README.md
│ ├── setup.md
│ └── usage.md
│
├── models
│ └── trained_model.h5
│
├── outputs
│ ├── figures
│ └── reports
│
└── requirements.txt
-
Clone the repository:
git clone https://github.com/oaslananka/SmartStructureGuardian.git cd SmartStructureGuardian
-
Create and activate a virtual environment (optional but recommended):
python -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
-
Install the required Python packages:
pip install -r requirements.txt
-
Simulate sensor data:
python src/data_simulation.py
This will generate simulated sensor data and save it to
data/raw/simulated_sensor_data.csv
. -
Preprocess the sensor data:
python src/data_preprocessing.py
This will preprocess the sensor data and save it to
data/processed/preprocessed_sensor_data.csv
. -
Train the anomaly detection model:
python src/model_training.py
This will train the anomaly detection model and save it to
models/anomaly_detection_model.pkl
. -
Detect anomalies in the sensor data:
python src/anomaly_detection.py
This will detect anomalies in the sensor data and save the results to
outputs/reports/anomaly_detection_results.csv
. -
Visualize the anomalies:
python src/visualization.py
This will generate a 3D animated GIF showing the bending and deformation of the bridge and save it to
outputs/figures/bridge_bending_animation.gif
.
The project includes scripts to visualize the sensor data and detected anomalies:
visualization.py
: Creates a 3D animation of the bridge deformation based on the stress data and saves it as a GIF.
Example visualization of sensor data and detected anomalies:
Contributions are welcome! Please fork the repository and create a pull request with your changes.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
This project was created by oaslananka.