Machine learning based multi-scale remodelling code
收藏资源简介:
This instruction illustrates a machine learning-based multi-scale model to predict bone formation in tissue scaffolds. This code uses neural networks to predict bone formation in synthetic scaffolds. We are sorry that the code is a little bit messy as we are not good at coding. The code can be used to predict bone remodelling results in synthetic scaffolds in a multi-level way. Therefore, it enables to inversely identification of the bone remodelling related parameters from clinical data. In order to run the machine learning-based multiscale bone remodelling program. The following platforms are what you need: Abaqus v2016/v614 Matlab R2020b An Abaqus plugin tool which can be downloaded from https://github.com/mhogg/pyvxray.git Jupyter notebook with Python 3. Here is a detailed description of the program. demo_example and demo_pearson_opt. This document provides instructions on running a demo example and a demo example calculating Pearson’s coefficient. The necessary functions for running the machine learning-based algorithm are located in the folder “demo_example”. In "demo_example", Multiscale_boneRemodelling_ML is the main function to start the program. “macro_umat” is the user subroutine to pass the homogenized material properties to Abaqus. “read_macro_1423” is a post-process file to obtain necessary stress/strain data information. “Sheep_macro_1423_C3D4.inp” is the input file of the sheep tibia scaffold model. Before start, please change line 49 and line 58 of “macro_umat” file to your current work directory. In “results” file, the results are obtained by running the demo_program. In “demo_pearson_opt” file, there are inversely-identified virtual X-ray images and in-vivo X-ray images. The python code "sheep3_6_9_8roi.ipynb" can be found to calculate the Pearson’s coefficient between the virtual X-ray images and in-vivo X-ray images. Jupyter notebook is required to run “sheep3_6_9_8roi.ipynb” to calculate the Pearson’s coefficient in "demo_pearson_opt". “image_opt” is the calculated Pearson’s coefficient based on the inverse-identified case. Micro_samples contains the files for the generation of micro RVE samples. “microRVE.inp” is the input file of the micro RVE for Abaqus. “Micro_USDF1.for” is the Fortran file that is used as a user subroutine in Abaqus to consider the adaptive bone density change in the bone regeneration area. “read_microRVE” is the post-process file to obtain strain and stress information. Neural_network_training contains the files for the training of the 1st neural network for calculating the elastic tensor and the 2nd series of neural networks for calculating the unit SED components. In 1st_neural_network file, a Matlab code is for the training of the neural network based on Matlab R2020b. The training data of the 1st round and the 2nd round are provided in the dataset file. In 2nd_neural_network file, a Matlab code “Train3D_SED” is used for the training of 21 independent neural networks for predicting 21 unit SED components. “dataset” contains the training data of unit SED components. ML_approach contains the files of the proposed machine learning-based approach and the trained neural networks. The Matlab code “Multiscale_boneRemodelling _ML” is the program for the proposed approach, which will call Abaqus for the finite element analysis at the macroscopic level. “sheep_macro_1423_C3D4.inp” is the input file of the in-silico model, including sheep tibia, bone fixation plate, screws and scaffold. “macro_umat” is the user subroutine file. “read_macro_1423” is used for post-process of FE data. “Trained_model” file includes all the trained neural networks. Inverse_identification contains files for the inverse problem. “image_analysis” contains the 5000 virtual images generated by the proposed ML approach (“postresults_imageupdate_5000). “sheep3_6_9_8roi.ipynb” is the python-based code for the images analysis and calculates the Pearson’s coefficient. “NN_pear” is the trained neural network to output Pearson’s coefficient. “Pea_opt” is the code to find the optimal bone remodelling parameters by multi-objective genetic algorithm. “in-vivo X_ray” includes the clinical X-ray images taken at different time points. “inverse_identified_results” includes the final inverse identified results.
本说明介绍了一种基于机器学习的多尺度模型,用于预测组织支架(tissue scaffolds)中的骨形成情况。本代码通过神经网络来预测人工合成支架(synthetic scaffolds)中的骨形成结果。很抱歉代码略显杂乱,因我们的编码能力尚有不足。该代码可从多尺度层面预测人工合成支架内的骨重建结果,因此能够从临床数据中逆向识别与骨重建相关的参数。若要运行该基于机器学习的多尺度骨重建程序,需准备以下运行平台:Abaqus v2016/v614、Matlab R2020b、可从https://github.com/mhogg/pyvxray.git下载的Abaqus插件工具,以及搭载Python 3的Jupyter Notebook。以下为该程序的详细说明。包含`demo_example`与`demo_pearson_opt`两个示例模块。本文档提供了运行基础演示示例,以及计算皮尔逊相关系数(Pearson’s coefficient)的演示示例的操作指南。运行该机器学习算法所需的核心函数均位于`demo_example`文件夹中。在`demo_example`文件夹内:`Multiscale_boneRemodelling_ML`为启动程序的主函数;`macro_umat`为用户子程序,用于将均质化材料属性传递至Abaqus;`read_macro_1423`为后处理文件,用于获取所需的应力/应变数据信息;`Sheep_macro_1423_C3D4.inp`为绵羊胫骨支架模型的输入文件。运行前,请将`macro_umat`文件的第49行与第58行修改为您当前的工作目录。`results`文件夹中存储了运行演示程序后得到的计算结果。在`demo_pearson_opt`文件夹中,包含逆向识别得到的虚拟X射线图像与体内X射线图像。可通过Python代码`sheep3_6_9_8roi.ipynb`计算虚拟X射线图像与体内X射线图像间的皮尔逊相关系数,运行该代码需借助Jupyter Notebook。`image_opt`为基于逆向识别案例计算得到的皮尔逊相关系数。`Micro_samples`文件夹包含用于生成微尺度代表性体积单元(RVE, Representative Volume Element)样本的文件:`microRVE.inp`为Abaqus微尺度RVE的输入文件;`Micro_USDF1.for`为Fortran文件,作为Abaqus的用户子程序,用于考虑骨再生区域内的骨密度自适应变化;`read_microRVE`为用于获取应变与应力信息的后处理文件。`Neural_network_training`文件夹包含用于训练两个系列神经网络的文件:第一系列神经网络用于计算弹性张量,第二系列神经网络用于计算单位应变能密度(SED, Strain Energy Density)分量。在`1st_neural_network`文件夹中,提供了基于Matlab R2020b编写的神经网络训练代码。第一轮与第二轮的训练数据已在`dataset`数据集中提供。在`2nd_neural_network`文件夹中,Matlab代码`Train3D_SED`用于训练21个独立的神经网络,以预测21个单位SED分量。`dataset`文件夹包含单位SED分量的训练数据。`ML_approach`文件夹包含所提出的基于机器学习的方法文件与已训练的神经网络:Matlab代码`Multiscale_boneRemodelling _ML`为所提方法的主程序,该程序将调用Abaqus进行宏观层面的有限元分析;`sheep_macro_1423_C3D4.inp`为硅基模拟模型的输入文件,包含绵羊胫骨、骨固定板、螺钉与支架;`macro_umat`为用户子程序文件;`read_macro_1423`用于有限元数据的后处理;`Trained_model`文件夹包含所有已训练完成的神经网络。`Inverse_identification`文件夹包含用于逆向问题求解的文件:`image_analysis`文件夹包含由所提机器学习方法生成的5000张虚拟图像(`postresults_imageupdate_5000`);`sheep3_6_9_8roi.ipynb`为用于图像分析并计算皮尔逊相关系数的Python代码;`NN_pear`为用于输出皮尔逊相关系数的已训练神经网络;`Pea_opt`为通过多目标遗传算法寻找最优骨重建参数的代码;`in-vivo X_ray`文件夹包含不同时间点采集的临床X射线图像;`inverse_identified_results`文件夹包含最终的逆向识别结果。



