Skip to content

LSTM-based prediction of microstructure-mechanical property correlations

Notifications You must be signed in to change notification settings

apatra6/DualPhaseDeformationLSTM

Repository files navigation

A Machine Learning-Based Surrogate Modeling Framework for Predicting the History-Dependent Deformation of Dual Phase Microstructures

Sarthak Khandelwal, Soudip Basu, Anirban Patra

Department of Metallurgical Engineering and Materials Science, Indian Institute of Technology Bombay, Mumbai, India

Abstract

A Machine Learning (ML)-based surrogate modeling framework is developed to predict the heterogeneous deformation behavior of dual phase microstructures. The deformation is first simulated using a dislocation density-based J2 plasticity Finite Element (FE) model, whose results form the basis for surrogate model training and validation. Long Short Term Memory (LSTM)-based ML models, with different architectures, are employed to predict the spatio-temporal evolution of three output variables: effective strain, von Mises effective stress, and the stress triaxiality ratio. Two metrics, the mean average error (MAE) and the coefficient of determination, $R^2$, are used to assess the performance of the models and different architectures. Based on our analysis, the LSTM model is generally found to predict the spatio-temporal deformation fields with reasonable accuracy, even for untrained microstructures with varying microstructural attributes and random instantiations. The LSTM model is also used to predict aggregate properties, such as the stress-strain response and the strain partitioning in the dual phase microstructures.

The LSTM model predictions have been published in a recent article. Please cite this reference if you are using the codes shared in this repository: Khandelwal, S., Basu, S., Patra, A., “A machine learning-based surrogate modeling framework for predicting the history-dependent deformation of dual phase microstructures”, Materials Today Communications, 2021, https://doi.org/10.1016/j.mtcomm.2021.102914.

Training

LSTM-based RNN: A LSTM-based RNN model capable of predicting the microstructure evolution during deformation of dual phase microstructures by just looking at the microstructure after 1% strain. We have predicted three variables using this model: effective strain, effective stress and stress triaxiality ratio.

The model analysis, predictions and results for different microstructures can be produced using this.

Here's a brief introduction to what each file in this repository does

  • script/pred_all_dataset.py: takes a particular model and makes predictions for all the given microstructures using the model. It stores the results in a separate folder for each microstructure with appropriate names.
  • script/window_lstm.py: this script consists of the LSTM model's architecture and training. 5 mircostructure's data has been used to train the model. The script saves the model and plots the evolution of loss with each epoch.
  • window-lstm-predictions.ipynb: this notebook consists of the LSTM model's architecture and training with proper explaination for each code block
  • window-lstm-training.ipynb: this notebook consists of the plots made for the analysis of the predictions made using this model.

Running

The model is completely developed in Tensorflow 2.0 with some helper functions from scipy and scikit-learn. It would be recommended to run it as jupyter notebook for a clear step by step understanding of the work that has been done. To install the required packages, create a virtual environment and simply run

pip install -r requirements.txt

then launch a jupyter-notebook and open window-lstm-predictions.ipynb to start training your model.

Example

This dropbox folder contains the model trained by us along with data for microstructure 14. Here are details about the different files in the folder

  • LSTM_model_trained_to_5_datasets.rar: contains the trained tensforflow model saved using model.save() in tensforflow. The model can be loaded and directly used for preditctions through tf.keras.models.load_model() function.
  • microstructure14.csv: is a csv file containing data extracted by the data-extraction script. It contains the values of each variable at each timestep for every material point in the microstructure.
  • microstructure14-out.csv: is the output file generated at the end of the J2 Plasticity simulation. This file contains the global variable values which are the same for the entire microstrcture at a given timestamp. This file is used for generating stress-strain plots and discretising the data.

About

LSTM-based prediction of microstructure-mechanical property correlations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published