Hybrid modelling of Bioprocess Dynamics
Description
This repository contains MATLAB scripts for modeling, predicting, and analyzing microbial growth and polymer production. In the dynamic modeling step (Folder: Dynamic_modelling), experimental datasets are loaded, optimized kinetic parameters are estimated, and predictions are generated, with model performance evaluated via cross-validation, bootstrap, and error metrics. The hybrid modeling step (Folder: Hybrid_modelling) integrates neural networks with optimized parameters to simulate system behavior, assess parameter sensitivity, and generate feature explanations using LIME, Shapley, and partial dependence plots. The cross-validation of hybrid models (Subfolder: Cross_validation_hybrid_modelling) involves encoding and decoding network parameters, simulating biomass and polymer growth, calculating prediction errors, and evaluating model performance. Finally, the statistics calculation (Folder: Statistics_calculation) step consolidates results from both dynamic and hybrid models, computing MAE, RMSE, MAPE, and R² to quantify model accuracy and reliability for validation datasets.
Files
Steps to reproduce
Step-1: Dynamic_modeling a1_Kinetic_mod_code:Main MATLAB script controlling data loading, parameter estimation, validation, prediction; a2_parameter_cal: This code uses initial guess values and original datasets and calculates optimized parameters; a3_cross_val: The code uses optimized parameters and dataset to perform cross-validation; a4_predprofiles: The code uses optimized parameters and datasets to generate prediction profiles; a6_bootfun: The code uses dataset, predictions, and parameters for bootstrap evaluation; a8_histogram_boot: The code plots histograms of bootstrap results for estimated parameters; a9_figure_fitness: The code plots fitness graphs using datasets, optimized parameters, and confidence intervals; MainGA: This code called by other function to evaluate model predictions against datasets to calculate error and fitness. ODEfun: This code is called by other functions to define system equations to simulate biological growth and interactions. ,Step-2: Hybrid modelling f_PSO_any_respt: The code applies particle swarm optimization with datasets to train hybrid models; g0_net_develope: g0_net_develope:The code develops neural network outputs using initial input, weights, and biases; g1_hybrid_model_predict: The code predicts hybrid model outputs using optimized parameters and neural network weights; g2_hybrid_model_predict_sensi:The code performs hybrid model predictions with parameter sensitivity and confidence interval estimation; g3_HM_coefficients: The code computes hybrid model prediction coefficients for individual datasets; h0_LIME_Shapley_creator: The code generates LIME and Shapley explanations for hybrid model prediction outputs; h1_LIME_Shapley_finalplot: The code plots feature contributions using LIME and Shapley for model explanations; h2_PDP_plots: The code generates PDP plots to show predictor effects on model outputs. Step 3:Cross_validation_hybrid_modelling a1_cross_val: main function which calls other functions to performs cross-validation using optimized parameters and datasets; decoder: Decodes network weights, biases, and fixed parameters into single vector; encoder: Encodes vector into network weights, biases, and fixed parameters; MainGA: This function uses encoded parameters to predict data, then calculates and reports model performance; ODEfun: Called by other functions to simulate hybrid biomass and polymer growth by using parameters, weight and biases; SumSqr: Called by other functions to calculate prediction error and outputs by using original data, parameters, weights, biases.], Step 4: Statistics_calculation [Use dynamic_stats folders code. a1_Kinetic_mod_code: The main code calls other function to get the dynamic model performances, i.e., MAE, MAPE, RMSE, and R2; Use hybrid_stas folder code. g3_HM_coefficients: The main code calls other function to get the hybrid model performances, i.e., MAE, MAPE, RMSE, and R2.
Institutions
- Karunya University