Skip to content

Mitigating the high computational costs associated with applying Bayesian model updating in inverse problems / Uncertainty Quantification and Efficient Sensitivity Analysis by using Surrogate Models

License

Notifications You must be signed in to change notification settings

ymorsi7/SeismicLSTM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SeismicLSTM: LSTM Networks for Nonlinear Structural Systems

Python TensorFlow License

LSTM Architecture

LSTM Network Architecture for Seismic Structural Analysis

πŸ“‹ Table of Contents

🎯 Overview

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.

πŸ“– Abstract

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:

  1. Linear elastic 2D 8-degree-of-freedom (DoF) shear building model
  2. Nonlinear single degree of freedom system (NL-SDoF)
  3. 2D nonlinear 3DoF shear building model

✨ Features

  • πŸš€ 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

πŸ› οΈ Installation

Prerequisites

  • Python 3.8 or higher
  • pip package manager

Setup

  1. Clone the repository

    git clone https://github.com/ymorsi7/SeismicLSTM.git
    cd SeismicLSTM
  2. Install dependencies

    pip install -r requirements.txt
  3. Verify installation

    python -c "import tensorflow as tf; print(f'TensorFlow version: {tf.__version__}')"

πŸš€ Quick Start

Basic Usage

Train a base LSTM model with default parameters:

python main.py --data_file data_2DOF_SB_BWWN.mat --model_type base --epochs 10

A/B Testing

Compare Model A and Model B architectures:

python main.py --data_file data_2DOF_SB_BWWN.mat --ab_test --epochs 10

πŸ“– Usage

Command Line Arguments

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

Example Commands

# 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

πŸ“Š Results

The results demonstrate the effectiveness of LSTM networks for seismic structural analysis across different structural configurations:

Test-bed Structures

Test-bed Structures

Test-bed structures for surrogate modeling study

Performance Results

1. Linear Elastic 8-Story Shear Building

Linear Elastic Results

2. Nonlinear Inelastic Single Degree Of Freedom (SDOF) Structure

SDOF Results

3. Nonlinear Inelastic Multi Degree Of Freedom (MDOF) Structure

MDOF Results

4. A/B Testing Comparison

A/B Testing Results

πŸ“ Project Structure

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

πŸ“š Detailed Report

For comprehensive analysis and detailed results, please refer to our research paper:

πŸ“„ Read the Full Paper

🀝 Contributing

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.

Contributing Guidelines

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ Citation

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}
}

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Authors

  • Abdoul Aziz Sandotin Coulibaly - Lead Researcher
  • Enrique Simbort Zeballos - Research Contributor
  • Yusuf Morsi - Research Contributor
  • Ramin Sarange - Research Contributor

About

Mitigating the high computational costs associated with applying Bayesian model updating in inverse problems / Uncertainty Quantification and Efficient Sensitivity Analysis by using Surrogate Models

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages