DOI: 10.5281/zenodo.5017032
title: Machine learning based multi-scale remodelling code

description: 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. <strong>Here is a detailed description of the program</strong>. <strong>demo_example and demo_pearson_opt. </strong>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 <em>in-vivo </em>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. <strong>Micro_samples</strong> 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. <strong>Neural_network_training</strong> contains the files for the training of the 1<sup>st</sup> neural network for calculating the elastic tensor and the 2<sup>nd</sup> series of neural networks for calculating the unit SED components. In <strong>1<sup>st</sup>_neural_network</strong> file, a Matlab code is for the training of the neural network based on Matlab R2020b. The training data of the 1<sup>st</sup> round and the 2<sup>nd</sup> round are provided in the dataset file. In <strong>2<sup>nd</sup>_neural_network</strong> 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. <strong>ML_approach </strong>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. <strong>Inverse_identification</strong> 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.