- Overview
- Abstract
- Features
- Installation
- Quick Start
- Usage
- Results
- Project Structure
- Contributing
- Citation
- License
This repository implements Long Short-Term Memory (LSTM) networks for surrogate modeling of nonlinear structural systems under seismic excitation. The project addresses the computational challenges in performance-based seismic design (PBSD) by providing fast, accurate, and reliable surrogate models for structural response prediction.
Performance-based seismic design (PBSD) of structural systems relies on computationally expensive high-fidelity finite element (FE) models to predict how structures will respond to seismic excitation. For risk-based assessments, FE response simulations must be run thousands of times with different realizations of the sources of uncertainty. Consequently, data-driven machine learning (DDML) surrogate models have gained prominence as fast emulators for predicting seismic structural responses in probabilistic analyses.
This paper leverages deep Long Short-Term Memory (LSTM) networks, known for their powerful and flexible framework for time series prediction tasks. The advantages of using LSTM networks include:
- ✅ Continuous-time modeling of structural dynamics
- ✅ Adaptive temporal resolution handling
- ✅ Implicit memory of past information
- ✅ Complex nonlinear dynamics modeling
- ✅ Interpolation and extrapolation capabilities
- ✅ Robust noise handling
- ✅ High-dimensional dataset scalability
The effectiveness of the proposed method is validated through three proof-of-concept studies:
- Linear elastic 2D 8-degree-of-freedom (DoF) shear building model
- Nonlinear single degree of freedom system (NL-SDoF)
- 2D nonlinear 3DoF shear building model
- 🚀 Modular Architecture: Clean, maintainable code structure
- 🔧 Multiple Model Types: Base, Model A, and Model B architectures
- 📊 A/B Testing: Compare different model architectures
- 📈 Training Visualization: Real-time loss plotting and history tracking
- 💾 Model Persistence: Save and load trained models and scalers
- 🎛️ Configurable Parameters: Easy hyperparameter tuning
- 📋 Comprehensive Logging: Detailed training progress and metrics
- Python 3.8 or higher
- pip package manager
-
Clone the repository
git clone https://github.com/ymorsi7/SeismicLSTM.git cd SeismicLSTM
-
Install dependencies
pip install -r requirements.txt
-
Verify installation
python -c "import tensorflow as tf; print(f'TensorFlow version: {tf.__version__}')"
Train a base LSTM model with default parameters:
python main.py --data_file data_2DOF_SB_BWWN.mat --model_type base --epochs 10
Compare Model A and Model B architectures:
python main.py --data_file data_2DOF_SB_BWWN.mat --ab_test --epochs 10
Argument | Type | Default | Description |
---|---|---|---|
--data_file |
str | data_2DOF_SB_BWWN.mat |
Path to MATLAB data file |
--model_type |
str | base |
Model type (base , A , B ) |
--epochs |
int | 10 |
Number of training epochs |
--batch_size |
int | 5 |
Batch size for training |
--ab_test |
flag | False |
Perform A/B testing |
--save_dir |
str | results |
Directory to save results |
# Train Model A with custom parameters
python main.py --model_type A --epochs 20 --batch_size 10
# Train Model B and save to custom directory
python main.py --model_type B --save_dir my_results
# Quick A/B test with 5 epochs
python main.py --ab_test --epochs 5
The results demonstrate the effectiveness of LSTM networks for seismic structural analysis across different structural configurations:
SeismicLSTM/
├── 📁 src/ # Source code
│ ├── 📁 data/ # Data handling
│ │ └── data_loader.py # Data loading and preprocessing
│ ├── 📁 models/ # Model architectures
│ │ └── lstm_models.py # LSTM model definitions
│ └── 📁 utils/ # Utilities
│ └── training.py # Training utilities
├── 📁 files/ # Documentation and images
│ ├── 📄 paper.pdf # Research paper
│ ├── 🖼️ testbed.png # Test-bed structures
│ ├── 🖼️ lstm.png # LSTM architecture
│ ├── 🖼️ 1.png # Linear elastic results
│ ├── 🖼️ 2.png # SDOF results
│ ├── 🖼️ 3.png # MDOF results
│ └── 🖼️ ab.png # A/B testing results
├── 📄 main.py # Main training script
├── 📄 requirements.txt # Python dependencies
├── 📄 .gitignore # Git ignore rules
└── 📄 README.md # This file
For comprehensive analysis and detailed results, please refer to our research paper:
We welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
If you use this code in your research, please cite our paper:
@article{seismiclstm2024,
title={Application of Long Short-Term Memory (LSTM) Networks-Based Surrogate Modeling for Nonlinear Structural Systems},
author={Coulibaly, Abdoul Aziz Sandotin and Zeballos, Enrique Simbort and Morsi, Yusuf and Sarange, Ramin},
journal={Journal of Structural Engineering},
year={2024},
doi={10.1000/xyz}
}
This project is licensed under the MIT License - see the LICENSE file for details.
- Abdoul Aziz Sandotin Coulibaly - Lead Researcher
- Enrique Simbort Zeballos - Research Contributor
- Yusuf Morsi - Research Contributor
- Ramin Sarange - Research Contributor