The primary goal of the machine learning (ML) modeling in this study is to establish predictive relationships between the key operating parameters of biodiesel-fueled engines and their performance and emission characteristics. By leveraging ML algorithms, the study aims to uncover complex nonlinear patterns that influence critical metrics such as brake thermal efficiency, combustion characteristics, and exhaust emissions. This approach not only enhances predictive accuracy but also facilitates the identification of optimal conditions for maximizing biodiesel performance and minimizing environmental impacts. The ML models are designed to complement experimental findings, offering a robust framework for real-world implementation and decision-making in biodiesel optimization.
Machine learning project life cycle
The Machine Learning (ML) project life cycle involves several key stages, ensuring a structured approach to problem-solving. It begins with problem definition, where objectives and constraints are identified. Next is data collection and preprocessing, including gathering, cleaning, and transforming raw data for model input. The exploratory data analysis (EDA) phase follows, where patterns, correlations, and distributions are analyzed. Feature engineering and selection refine relevant variables, improving model performance. The model selection and training stage involves choosing appropriate algorithms and optimizing hyperparameters. Afterward, model evaluation using performance metrics such as accuracy, precision, recall, or RMSE ensures reliability. The deployment phase integrates the model into real-world applications, followed by monitoring and maintenance, where performance is tracked and models are retrained as needed.
Modeling
The modeling approach in this study involves the development and validation of machine learning models to predict engine performance and emission outcomes based on experimental data. The methodology begins with preprocessing the dataset to handle missing values, normalize input parameters, and remove outliers, ensuring data quality and consistency. Feature selection techniques, such as recursive feature elimination or correlation analysis, are applied to identify the most influential parameters affecting engine performance. Subsequently, ML algorithms like Random Forest, Support Vector Regression (SVR), and Neural Networks are employed to construct predictive models.
Hyperparameter tuning is performed to enhance model performance by optimizing key parameters specific to the machine learning algorithms applied in this study. For instance, in the Random Forest model used to predict engine performance and emissions, the number of trees (n_estimators) and the maximum depth of the trees (max_depth) are optimized. In the Support Vector Regression (SVR) model, the kernel type, regularization parameter (C), and epsilon (ε) are fine-tuned to capture nonlinear relationships effectively. For the Neural Network models applied to this study, the optimization focuses on the number of hidden layers, the number of neurons per layer, learning rate, and activation functions to achieve robust predictions.
These parameters were selected to address the complexity of interactions between experimental variables, such as the type and concentration of metal oxide nanoparticles, coating properties of zirconia, and the biodiesel blend ratios. A combination of grid search and Bayesian optimization techniques is employed to systematically identify the optimal values, ensuring that the models capture the nuanced relationships affecting engine performance and emissions with high precision.
Data collection process
We collected data using a single-cylinder, four-stroke, water-cooled CI engine test rig. This setup was made to assess the performance, combustion, and emissions of biodiesel blends with a 45 PPM additive. The engine operated at a constant speed of 1500 RPM and a fixed injection timing of 23° before top dead center (BTDC). We tested four fuel types: three biodiesel blends (B10 + 45 PPM, B20 + 45 PPM, B30 + 45 PPM) and neat diesel. These were evaluated at four compression ratios (CR: 14.5, 15.5, 16.5, and 17.5) and four engine load levels (25%, 50%, 75%, and 100%). This created a total of 48 structured test conditions.
We measured performance parameters: Brake Power (BP), Brake Thermal Efficiency (BTE), and Specific Fuel Consumption (SFC) using an Eddy Current Dynamometer. This device had digital tools for torque and speed measurement. We measured peak cylinder pressure and combustion traits. These include Ignition Delay (ID), Heat Release Rate (HRR), and Indicated Mean Effective Pressure (IMEP). A piezoelectric pressure transducer worked with a high-speed data acquisition (DAQ) system. This setup was synced with crank angle measurement.
We recorded emission parameters like Carbon Monoxide (CO), Hydrocarbons (HC), Nitrogen Oxides (NOx), and smoke opacity. We used a calibrated AVL 444 five-gas analyzer and a smoke meter for these measurements. We repeated each test condition three times. This ensured repeatability. We then used the average of the three runs for analysis. This helped minimize random error and improve data reliability.
Prior to modeling, the dataset was thoroughly validated for completeness and consistency. The experiments created a balanced dataset for machine learning. It included enough variety in fuel types, CR, and load conditions. Table 3 shows the experimental setup, operating parameters, and instruments used. Table 4 shows peak pressure, brake thermal efficiency, specific fuel consumption, and emissions across various engine settings.
We improved the technical validation and transparency of the machine learning framework in this study. All experimental datasets for model training and validation are now detailed in the updated Table 4. This table shows various operational scenarios. It covers different fuel blends, engine loads, and compression ratios. Figures and tables in the manuscript are clearer and more accurate now. They have uniform scaling, correct units, and easy-to-understand legends. This helps with interpretation.
In the machine learning section, a more rigorous statistical evaluation has been introduced. We validated the model’s performance with a 10-fold cross-validation approach. This method splits the dataset into several training and testing sets. It helps ensure generalizability and lowers the risk of overfitting. We added residual plots and error histograms for important output parameters. These include Brake Thermal Efficiency (BTE), Specific Fuel Consumption (SFC), and CO and NOx emissions. This helps us see how well the model predicts and spot any systematic biases. Here are the feature importance rankings from methods like Random Forest and Gradient Boosting Regression. These rankings show how engine parameters affect predicted outcomes. These additions make the machine learning analysis stronger. They also provide better insight into the physics of the biodiesel engine system. This improves the study’s overall impact and reliability.
Data visualization and Pre-processing
To ensure a comprehensive understanding of the experimental data, we incorporated various visualization and statistical techniques. Ternary plots, shown in Fig. 10, were used to visually represent the relationships among critical input parameters such as Compression Ratio (CR), Load (%), and Peak Pressure, with Brake Thermal Efficiency (BTE) as the target metric. These plots provided a clear depiction of how variations in these engine parameters and biodiesel blend compositions (B10 + 45 PPM and B20 + 45 PPM) influenced thermal performance. The ternary visualization highlighted trends in engine performance metrics, aiding in understanding the interplay among the factors.
In addition to visual exploration, Pearson correlation analysis was performed shown in Fig. 11 to evaluate the relationships between input parameters (e.g., CR, Load, Peak Pressure) and target variables (e.g., BTE, Specific Fuel Consumption, and emissions). The correlation matrix revealed the degree of linear correlation, identifying key parameters with significant influence on target outcomes. Strongly correlated variables were noted to potentially address multicollinearity during model development. The results of the correlation analysis were visualized as a heatmap, providing a straightforward interpretation of variable interrelationships. For machine learning model development, the dataset was partitioned into training and testing subsets using a 70%−30% split. This ensured robust evaluation of the model’s generalization capability by assessing its performance on an independent test set. Pre-processing steps included normalization of input features to standardize scales, encoding of categorical variables (e.g., fuel blends), and handling of outliers and missing data. These steps ensured that the dataset was clean, consistent, and ready for predictive modeling.

Ternary plot for data distribution.

Pearson correlation plot.
Data splitting, normalization, and hyperparameter optimization
For this study, the dataset was split into training and testing sets using a 70:30 ratio, ensuring that 70% of the data was used for training the models, and the remaining 30% was reserved for model testing. This ratio was selected to provide an adequate representation of both training and testing data, promoting reliable model evaluation.
To further improve the performance and stability of the models, normalization techniques were applied. Specifically, Min-Max Scaling (or Standardization, depending on the model and data requirements) was utilized to rescale the features to a standard range, ensuring that the models could process the data more effectively.
In terms of model optimization, we carried out a systematic hyperparameter tuning process. This involved using grid search and random search methodologies to explore the search space for key hyperparameters for each model. The grid search was applied to the Decision Tree and Random Forest models, optimizing parameters such as max_depth and min_samples_split (for Decision Tree) and n_estimators, max_features, and max_depth (for Random Forest). The Gradient Boosting Regressor was optimized using random search, targeting key hyperparameters like learning_rate, n_estimators, and max_depth.
The optimal hyperparameter configurations were selected based on cross-validation performance using the Mean Squared Error (MSE) as the evaluation metric. This approach was critical to ensuring that the models were fine-tuned for predictive accuracy while avoiding overfitting.
Results and discussion of ML analysis
In this study, we investigated the efficacy of various machine learning (ML) algorithms for predicting thermal performance metrics using input parameters such as Fuel, CR, Load, and Peak pressure. Three ML algorithms were applied: Multiple Linear Regression (MLR), Gradient Boosting Regression (GBR), and Random Forest Regression (RF). Performance metrics, including R2 score, Mean Absolute Error (MAE), and Mean Squared Error (MSE), were utilized to assess the accuracy of the predictions. ML algorithms are crucial in understanding and optimizing the influence of metal oxide nanoparticles on a zirconia-coated diesel engine fueled by non-edible biodiesel from Momordica seeds.
Table 5 presents the performance metrics for different ML algorithms. It provides a detailed comparison of R2, MAE, and MSE values for each algorithm across all output variables. This table highlights each ML approach’s relative strengths and weaknesses in capturing the dataset’s complex relationships.
The performance of machine learning models in predicting thermal performance and emission metrics of a zirconia-coated diesel engine, fueled by non-edible biodiesel blended with nanoparticles, was reassessed after applying hyperparameter optimization techniques. The optimization process improved the predictive accuracy of the models significantly, as shown in the updated performance metrics Table 5. Hyperparameter tuning techniques such as grid search and random search were employed to optimize critical parameters for Gradient Boosting Regression (GBR) and Random Forest Regression (RF), including the learning rate, maximum tree depth, minimum samples split, and number of estimators. For Multiple Linear Regression (MLR), feature scaling and polynomial transformations were used to improve the model fit. These adjustments enhanced the models’ ability to capture complex nonlinear relationships within the dataset, which were not effectively addressed in the initial analysis.
The updated R² values now reflect moderate to strong predictive capabilities across most target variables, including Brake Thermal Efficiency (BTE), Specific Fuel Consumption (SFC), Carbon Monoxide (CO), Hydrocarbon (HC) emissions, and Smoke levels. For instance, GBR demonstrated superior performance in predicting CO emissions with an R² value of 0.94, while RF achieved the highest accuracy for BTE predictions with an R² value of 0.86. Conversely, MLR, while showing improvement, remains less effective than GBR and RF, highlighting its limitations in handling nonlinearity and complex feature interactions.
The improvements in R² values, along with reductions in Mean Absolute Error (MAE) and Mean Squared Error (MSE), illustrate the efficacy of hyperparameter tuning in refining model performance. These changes underscore the importance of iterative model refinement and validation when applying machine learning to experimental datasets.
Figure 12 represents a comprehensive comparison of experimental and predicted values for various engine performance and emission parameters, using the best-performing machine learning models. Subplot (a) showcases the Random Forest (RF) model’s performance for predicting Brake Thermal Efficiency (BTE) and Specific Fuel Consumption (SFC), where the model demonstrates strong predictive accuracy, particularly for BTE with an R² of 0.86. Subplot (b) illustrates the effectiveness of Multiple Linear Regression (MLR) for predicting Hydrocarbon (HC) emissions and Smoke levels, with MLR providing good results for Smoke and HC with R² values of 0.42 and 0.68, respectively. Subplot (c) highlights the performance of Gradient Boosting Regression (GBR) for predicting Carbon Monoxide (CO) emissions, where the model shows near-perfect predictions with an R² value of 0.94. Overall, the figure effectively demonstrates the strengths of each machine learning model in predicting different engine parameters and emissions, confirming the accuracy and applicability of these models for performance analysis in this study.

Comparison of experimental and predicted values for the best-performing machine learning models: (a) Random Forest (RF) for Brake Thermal Efficiency (BTE) and Specific Fuel Consumption (SFC), (b) Multiple Linear Regression (MLR) for Hydrocarbon (HC) emissions and Smoke levels, (c) Gradient Boosting Regression (GBR) for Carbon Monoxide (CO) emissions.
Validation analysis
The experimental validation of the machine learning (ML) models, as illustrated in Table 6. demonstrates the ability of the models to predict engine performance and emission metrics with varying degrees of accuracy. Gradient Boosting Regression (GBR) and Random Forest Regression (RF) consistently outperform Multiple Linear Regression (MLR), particularly for nonlinear parameters such as Brake Thermal Efficiency (BTE) and Hydrocarbon (HC) emissions. For instance, MLR shows significant prediction errors, such as a −2.2% error for BTE and a + 10.0 PPM error for HC, reflecting its inability to capture complex relationships in the dataset. In contrast, GBR and RF exhibit much lower errors, with RF achieving a near-perfect prediction for BTE (+ 0.2%) and minimal error for HC (−1.0 PPM). Similarly, for parameters like Specific Fuel Consumption (SFC) and Carbon Monoxide (CO) emissions, GBR and RF show minor deviations from the experimental values, demonstrating their robustness. These findings validate the reliability of advanced ML models like GBR and RF over MLR, underscoring their efficacy in modeling complex dependencies and ensuring accurate predictions for optimizing engine performance and emissions. This analysis highlights the importance of employing sophisticated algorithms for data-driven insights in such studies.
We expanded the experimental dataset a lot. This makes sure the machine learning models in this study are clear and can be repeated. Table 4 shows detailed data on all tested biodiesel blends. This includes Diesel, B10 + 45 PPM, B20 + 45 PPM, and B30 + 45 PPM. The data covers different compression ratios: 14.5, 15.5, 16.5, and 17.5. It also includes various engine loads at 25%, 50%, 75%, and 100%. This rich dataset is a strong base for training and testing machine learning models. Each data point in the table shows the average of three experiments. This helps ensure accuracy and reduces random fluctuations. The data includes performance metrics like BTE, SFC, and BP. It also looks at combustion traits, like peak pressure, and emissions, including CO, HC, NOx, CO₂, and smoke opacity. This makes the data useful for thermal and environmental analysis.
Has been updated. It now shows the correct units: % for BTE and CO, Ppm for NOx and HC, and kg/kwh for SFC. All error metrics, such as mean absolute error (MAE) and mean squared error (MSE), use the same decimal format. These changes enhance interpretability and allow a clear assessment of model performance. Table 6 shows predicted and actual values for selected test samples. It now includes average results from a 10-fold cross-validation process. This method boosts the strength and versatility of ML models. It cuts down on overfitting and checks model accuracy using different data subsets. This validation method shows the predictions are reliable. It also backs up the repeatability of the hybrid biodiesel-ML integration strategy.
Comparative analysis
A comparative analysis of MLR, GBR, and RF highlights that RF generally outperforms the other algorithms across most performance metrics. RF demonstrated the highest R2 scores for BTE and SFC, indicating a better fit to the data and more accurate predictions. MLR showed reasonable performance for BTE and Smoke but struggled with negative R2 scores for SFC and HC, indicating poor model fits for these metrics. GBR, while showing high accuracy for CO and BTE, was less consistent across other variables.
Practical implications of ML algorithms
ML models can significantly optimize diesel engine performance by accurately predicting key thermal metrics, facilitating better engine tuning and nanoparticle utilization. This optimization can lead to enhanced engine efficiency, improved fuel economy, and prolonged engine life, making it a vital tool for manufacturers and researchers. Accurate predictions enabled by these ML algorithms also contribute to more effective emissions control, thereby supporting environmental sustainability efforts by reducing the carbon footprint and harmful pollutants. Furthermore, the methodologies and findings from this study can be extended to other types of engines and fuels, broadening the scope of ML applications in thermal system optimization. This extension can potentially lead to breakthroughs in different areas of automotive engineering and beyond, demonstrating ML technologies’ versatility and far-reaching impact in advancing sustainable and efficient energy systems32,33,34,35.
