Optimizing Battery RUL Prediction of Lithium-Ion Batteries Based on Harris Hawk Optimization Approach Using Random Forest and LightGBM

Predictive Maintenance (PdM) of lithium-ion batteries has garnered significant attention in recent years due to their widespread application as energy supplies in various industrial equipment, including automated guided vehicles and battery Electric Vehicles (EVs). Accurately estimating these batteries’ Remaining Useful Life (RUL) is crucial for ensuring optimal performance, preempting unexpected failures, and minimizing maintenance costs. This article focuses on the importance of RUL prediction for lithium-ion batteries and its implications in predictive maintenance. We suggest a novel method based on machine learning techniques using optimization parameters to accurately predict the RUL of lithium-ion batteries. Our approach uses several battery performance variables, such as voltage, current, and temperature, to build a prediction model to anticipate the battery’s RUL precisely. We compare the performance of our suggested process with existing models for battery RUL prediction, incorporating Harris Hawks Optimization (HHO) for hyperparameter tuning. We evaluate the performance of our approach on a dataset of lithium-ion batteries and compare it with other related methods. On a dataset of lithium-ion batteries, we assess our method’s effectiveness and contrast it with other relevant techniques. The proposed method achieves high accuracy in predicting RUL, as evidenced by low values of metrics such as MAE, MSE, RMSE, MAPE, $R^{2}$ , and NMRSE. Also, it achieves high $R^{2}$ scores of 0.979 and 0.971 for the training and testing data, suggesting the model’s high effectiveness in predicting the RUL of batteries.


I. INTRODUCTION
Society is pressured to research and produce new energy due to the traditional energy dilemma. Lithium-ion batteries are among the most frequently used new energy sources due to their high energy density, high output voltage, prolonged cycle life, and wide operating temperature range [1]. But as lithium-ion batteries are repeatedly charged and drained, the internal resistance increases. The battery warms up signifi-The associate editor coordinating the review of this manuscript and approving it for publication was Branislav Hredzak . cantly once the internal resistance increases, impacting the battery pack's functionality and everyday employ [2]. Routine and experience-based inspection and maintenance have been widely used as preventative maintenance techniques for many years. However, a more reliable and mature digital system called the Battery Management System (BMS) has been developed with the digital transformation trend and advancements in lithium-ion battery technology. The BMS can use the Internet of Things (IoT) to gather big data from numerous large-scale sensors and track the status of lithium-ion batteries in real time. A dependable and intelligent BMS uses precise sensor data analytics to prevent abrupt device failures and save significant maintenance costs while providing early warning signals of future degradation. Artificial intelligence approaches are utilized to create efficient prediction models that correctly forecast the RUL and enable early defect detection of lithium-ion batteries to achieve a smart BMS [3]. Conventional RUL prediction typically uses the data from the acceleration sensor. This approach can produce accurate RUL predictions if it exclusively targets mechanical machinery like bearings [4].
PdM has evolved an essential strategy for improving the reliability and efficiency of industrial systems. By operating sensor data to detect potential equipment failures before they occur, organizations can reduce downtime and maintenance expenses and raise the safety and productivity of their processes. In recent years, ML algorithms have shown significant promise in PdM. RF and LightGBM are two famous algorithms widely operated in RUL prediction for various kinds of equipment. ML algorithms have the advantage of being able to process vast volumes of sensor data and extract complicated patterns that are challenging for human specialists to recognize. The choice of hyperparameters, which are parameters that regulate the algorithm's learning process, has a significant impact on the performance of ML models. In this paper, we utilize the harmony search algorithm to optimize the hyperparameters of the RF and LightGBM models for predicting the RUL of lithium-ion batteries. We analyze the impact of hyperparameters on the accuracy of RUL predictions and compare the performances of the two algorithms. The findings demonstrate that sensor data integration and hyperparameter optimization may significantly improve lithium-ion battery RUL predictions. Our study contributes to PdM by providing valuable insights into utilizing ML algorithms and sensor data for RUL prediction, which can help reduce maintenance costs, prevent equipment failures, and improve safety across various applications.
Our study aims to contribute to the field; the following list summarizes our contributions: • Developing a technique for predicting the RUL of NMC-LCO 18650 batteries employing ML approaches.
• Comparing the performance of the suggested approach with different models, the related work for battery RUL prediction.
• Using HHO for hyperparameter tuning to optimize the performance of the ML models.
• Highlighting the potential of ML methods for battery RUL prediction, which can contribute to the field of PdM.
• Demonstrating the effectiveness of the proposed method in predicting the RUL of lithium-ion batteries, as evidenced by high R 2 scores and low values of metrics such as MAE, MSE, RMSE, MAPE, and NMRSE.
• Comparing the performance of two ML algorithms, RF and LightGBM, for battery RUL prediction. The remainder of the paper is structured as follows: In Section II, we briefly review the relevant literature on PdM and battery health monitoring. Section III present our proposed method, which combines RF and LightGBM with HHO for hyperparameter tuning. We also discuss the use of data curation and analysis in Section IV. In Section V, we present the implementation process, results, and performance evaluation of our method. Finally, we conclude the paper in Section VI, where we summarize our contributions and highlight future research directions.

II. LITERATURE REVIEW
This section presents related work of PdM and the RUL using ML. Estimating the remaining usable life is a critical PdM task that has grown important as a study area during the past ten years. In order to build a successful maintenance strategy, RUL prediction is essential to ensuring the overall system's dependability and safety. Data from the past can be used to forecast RUL. The RUL of assets may be predicted with increasing accuracy using ML approaches. PdM is condition-based maintenance that involves routinely inspecting the equipment. PdM's ultimate objective is to predict when an appliance will develop defects to avoid unanticipated equipment breakdowns and, as a result, save maintenance costs and downtime. Several alternative ML approaches have been developed in order to predict the matching RUL using the gathered historical data [5]. Different approaches have been utilized in previous studies, including classification, clustering, and regression techniques, depending on the nature of the issue. For instance, some studies have concentrated on classifying whether a failure would occur, while others have employed clustering approaches to group similar events. In addition to classification techniques, regression methods have also been utilized to predict numerical target variables, as demonstrated by Uhlmann et al. [6]. Ellefsen et al. [7] investigated unsupervised learning for predicting RUL using a semi-supervised process. Other researchers have explored the potential of deep learning strategies, such as Convolutional Neural Networks (CNN), Deep Neural Networks (DNN), and Long Short-Term Memory (LSTM), for estimating RUL [8], [9], [10].

A. RUL BASED ON THE MACHINE LEARNING METHODS
The primary difficulties and future directions for study in battery health prognostics are outlined in this paper's thorough examination of aging processes and cutting-edge health prognostic techniques. There has been a review and description of the complicated connections between aging processes, aging modes, influencing elements, and aging kinds. After a comprehensive review of each prognostic job and method, the battery health prognosis approaches are separated into groups depending on various time scales and purposes, such as short-term SOH estimation, long-term End Of Life (EOL) prediction, and deterioration trajectory prediction. Comparative analyses have been conducted after the study has explored the similarities and differences between the various RUL battery-related procedures [11]. The combination of the enhanced variational modal decomposition (VMD), particle filter (PF), and Gaussian Process Regression (GPR) in this study has been recommended as a unique hybrid technique for estimating battery future capacity and RUL, which the recorded battery capacity data is divided by the VMD algorithm into several residual sequences and an aging trend sequence, with the number of modal layers being determined then the aging trend sequence and residual sequences are then, respectively, have been predicted with using the prediction models of the PF and GPR algorithms [12]. These days for the RUL issue in the battery, there are many techniques that many researchers use, such as deep learning-based forecasting techniques, in an attempt to enhance predicted outcomes; some current deep learning-based forecasting techniques focus on increasing the network depth and expanding the training dataset, which can be highly resource-intensive. The research has suggested a merging technique based on the Long Short-Term Memory Neural Network (LSTM NN) and the Broad Learning System (BLS) algorithm. A fusion neural network model has also been developed to predict the lithium-ion battery capacity and RUL correctly. To be more precise, the BLS algorithm creates feature nodes initially using historical capacity data and then creates enhancement nodes by using enhancement mapping. The input layer of the LSTM NN is then formed by concatenating all BLS-created nodes to build the BLS-LSTM fusion NN [13].
After the IC curves are generated using the voltage data from the constant current charging phase, they are denoised using the smoothing spline filter. Using the Pearson correlation coefficient technique, the significant HIs have been selected based on the IC curve properties. The L2 regularization parameter formed the BLS network, which was then tuned to create the SOH estimate model. Based on the Incremental Capacity Analysis (ICA) and enhanced BLS network-based SOH estimate technology for lithium-ion batteries, a PSO approach has filtered the shrinkage scale of the enhancement nodes [14]. In order to predict battery lifespan, this research has suggested a revolutionary semi-supervised self-learning method in which the partial capacity-voltage curve has been employed to obtain three Health Indicators (HIs). Information from three randomly picked batteries in the original part has been utilized to create the capacity estimate and lifespan prediction models. The historical capabilities have been recreated operating the HIs to offer fictitious values for the lifetime model's self-training. In the research, future deterioration has been predicted utilizing the self-trained lifespan model to provide a probabilistic forecast of future capacity [15]. The novel cell-to-pack health and lifespan prognostics method presented in the paper is based on combining transferable deep learning and GPR, where the partial discharge operation generates general health markers. The sequential degradation model of the HIs has been developed and moved based on a deep learning architecture for the prediction of battery pack deterioration; following that, the probabilistically anticipated future deteriorated capacities of the battery pack and each battery cell have provided a complete lifespan prognosis. Additionally, experimental results have been shown that define the weakest cell for maintenance in advance and the battery pack's desired capacity movements [16]. A new approach for estimating RUL has been suggested and is based on live model modification employing transfer learning and optimal HIs. GPR has been utilized to optimize the threshold for HIs to identify the EOL. The RUL has been predicted based on the optimized HIs operating a mix of transfer learning and gated RNNs, which may support online applications. The prediction model is further fine-tuned to provide accuracy in performing the test batteries before the deterioration cycle data. The model was trained initially employing a suitable battery [17].
The study aims to enhance the accuracy of RUL prediction for lithium-ion batteries, which is crucial for their prognostics and health management. The authors proposed a two-phase deterioration model with a dynamic transition point utilizing binary segmentation. This model considers the various ways that tested battery cells degrade, resulting in more precise RUL predictions. The authors created a system based on particle filtering to account for uncertainties during RUL prediction [18]. The research has recommended a specific RUL prediction technique for lithium-ion batteries based on an LSTM network designed for use with an Improved Sparrow Search Algorithm (ISSA) for lithium-ion batteries. Because they directly affect prediction accuracy, the LSTM hyperparameters that needed tuning were chosen. ISSA then adjusts the LSTM's hyperparameters depending on data about battery capacity from several datasets to produce RUL prediction [19]. Accurate RUL prediction is necessary for supercapacitors to operate securely and reliably. The Bidirectional Long (BiLSTM) network and the observer are the foundations of the two-stage online RUL prediction framework that has been proposed in this study. The Bayesian Optimization (BO) technique and the BiLSTM network have been employed in stage 1 to estimate capacitance. The BiLSTM network's hyperparameters have been intended to be optimized by the BO method. The paper has used short-term variations to reduce the Moving Average Filter (MAF) employed in Stage 2 to manage the estimated capacitance. The double exponential model has represented the deterioration trajectory, which has been updated by the observer using the estimated capacitance as the measurement [20].
The proposed strategy propagates these points utilizing the unscented KF to produce a complex proposal distribution, then employs singular value decomposition to provide sigma samples for the unscented transformation. Compared to the traditional unscented particle filter method, the improved method offers better performance in proposing the RUL of storage batteries [21]. A hybrid framework that integrates model-based and data-driven techniques has been proposed to enhance the accuracy of battery lifetime prediction, which leverages an empirical model based on physical principles and a support vector regression model based on actual operational data to estimate the battery lifetime by computing the battery capacity. In order to ensure that the model parameters remain current and accurate, particle filters are employed to update the practical model dynamically in [22]. Reference [23] has demonstrated how to forecast how much useable life a battery has left using a unique hybrid Elman-LSTM technique that combines LSTM and ENN with the experimental model decomposition methodology. The empirical mode decomposition method divides the recorded battery capacity against cycle number data into various sub-layers. The high-frequency and low-frequency sub-layers are then predicted using recurrent LSTM and Elman-NN models. In Table 1, there is a comparison of several model-based methods for RUL prediction.

III. MATERIALS AND METHODS
This section provides a thorough discussion of the suggested model.

A. PROPOSED FRAMEWORK
The strategy's main goal is to create a PdM model that reliably predicts the RUL of lithium-ion batteries using sensor data. The three primary parts of the approach are the preparation and gathering of data, the creation of the model, and the assessment of the model. The method's main goal is to create a PdM model that reliably predicts the RUL of lithium-ion batteries employing sensor data. The methodology comprises three main components: data collection and preparation, model development, and model evaluation. The required sensor data is collected and pre-processed in the first step to remove any noise. The pre-processed data is then used to extract relevant features using statistical and machinelearning techniques. In the second step, two ML algorithms, namely RF and LightGBM, are employed to develop the predictive model. Both algorithms are trained and optimized using hyperparameters to improve their performance.
Further optimization of the model's parameters using HHO is also used to get a more precise forecast of the RUL. In the final step, the developed models are evaluated by operating various metrics. Based on their sensor data, the best-performing model is then selected and utilized to predict the RUL of new lithium-ion batteries. The methodology generally involves a comprehensive approach that includes data preparation, feature extraction, model development, hyperparameter optimization, and model evaluation, ultimately leading to an accurate and reliable RUL predictive model for Lithium-Ion batteries. Figure 1 depicts the suggested approach's implementation flowchart.

B. COMPUTATIONAL EFFORT AND COMPLEXITY
The computational effort and complexity in the RF and Light-GBM models, using HHO for RUL prediction in batteries, refer to the computational resources needed for hyperparameter tuning and model training. During hyperparameter tuning with HHO, the algorithm explores the hyperparameter space to find the optimal settings for each model. This process involves a certain number of optimization iterations and a specified population size, impacting the overall computational effort. After hyperparameter tuning, the optimized models are trained. Model training entails constructing decision trees RF or applying gradient boosting (LightGBM), adding to the computational complexity. The dataset size, number of trees/boosting rounds, and other model-specific settings further influence the computational effort during training. To assess computational efficiency, we compare the time required for hyperparameter tuning and model training between the RF and LightGBM models. LightGBM typically exhibits higher complexity due to its gradient-boosting technique. Evaluating the computational effort and complexity offers insights into the feasibility and efficiency of using RF and LightGBM with HHO for battery RUL prediction.

C. HARRIS HAWKS OPTIMIZATION
HHO is a meta-heuristic optimization technique inspired by Harris hawks' hunting methods. The algorithm mimics the strategy these birds use to catch prey, which involves cooperation and competition among members of the hawk group. HHO begins with an initial population of hawks, where each hawk represents a candidate solution. The algorithm then proceeds through a series of iterations, or generations, during which the hawks search for the optimal solution. In each generation, the hawks are evaluated based on their fitness, which is determined by a fitness function that measures the quality of the candidate solution. The HHO algorithm has several key features that make it particularly well-suited for optimization problems in engineering and other fields [29]. Figure 2 represents the system architecture of HHO.
First, the algorithm is easy to implement and requires minimal tuning of its parameters. Second, a global optimization algorithm can search the entire solution space for the best possible solution. Finally, the algorithm is relatively fast, which makes it particularly useful for large-scale optimization problems. HHO is a useful tool for optimizing the machine-learning algorithm parameters for PdM and RUL prediction in the context of lithium-ion batteries. Through parameter optimization, HHO can significantly enhance the accuracy and reliability of RUL prediction, resulting in more efficient maintenance planning and cost savings for battery manufacturers and users.
where x i,j (t) is the j-th component of the i-th hawk's position at time t, x best,j (t) is the best position found so far in the search space, x p,j (t) and x q,j (t) are the positions of two randomly selected hawks, and r 1 and r 2 are random coefficients between 0 and 1. The position update equation is used to move each hawk to a new position in the search space based on the positions of other hawks and the best position found so far. HHO is a good optimization algorithm with excellent performance in many optimization problems. Its ability to balance cooperation and competition among population members and its simplicity and efficiency make  it a valuable tool for optimization problems in engineering and other fields [30].

D. RANDOM FOREST ALGORITHM
In order to increase the precision and stability of predictions, RF is a well-liked ensemble learning approach in ML. Both classification and regression tasks can be accomplished using the supervised learning algorithm. Building numerous decision trees, each learned on a random subset of the training data and features, is the main goal of RF. A majority vote on each individual tree prediction during prediction determines the final result. One of the main advantages of RF is that it is relatively insensitive to the choice of hyperparameters and can handle a wide range of data types and distributions. It is a reliable approach for predictive modeling since it can deal with missing values and noisy data. Additionally, RF offers helpful insights into the relative weights of each feature in the prediction, which can aid in understanding the underlying data patterns. Figure 3 displays the RF algorithm's flow diagram.
We have a training set of N samples with p input features and an associated vector of N response values. To build a decision tree that can accurately predict the response value for new samples. RF is an ensemble method that creates numerous decision trees and produces the average prediction of each tree's predictions. A subset of the training data (with replacement) and a subset of the input features at each split are required to build each decision tree in the randomly chosen RF. This randomness helps to prevent overfitting to the training data and improves the generalization performance on new data. We select the feature that provides the best split at each decision tree node according to a splitting criterion. The tree recursively develops by dividing the data into smaller groups according to the chosen feature and split point. Based on the sample's feature values, we move from the root node to a leaf node of the decision tree to forecast a new sample. The prediction is then made using the response value connected to the leaf node. Equation 2 represents the ensemble prediction of the RF algorithm [31].
whereŷ is the predicted response value, x is the input vector, = {θ 1 , . . . , θ M } is the set of decision trees, and f (x; θ m ) is the output of the m-th decision tree.
The hyperparameters for the RF algorithm are: • n estimators : the forest's density of decision trees.
• max features : the number of features to consider when looking for the best split at each node.
• max depth : the maximum depth of the decision trees.
• min samplessplit : the least amount of samples necessary to split an internal node.
• min samplesleaf : the bare minimum of samples needed at a leaf node. To optimize the RF model, we use HHO for hyperparameter tuning. HHO efficiently explores the hyperparameter space, maximizing the R 2 score during cross-validation. The comprehensive hyperparameter grid (param grid ) includes n estimators , max features , max depth , min samplessplit , min samplesleaf , and criterion. The NatureInspiredSearchCV class is instrumental in performing the hyperparameter optimization. This class orchestrates the optimization process by integrating the RF model, the hyperparameter grid, and the HHO algorithm. We specify important settings such as the population size, maximum number of generations, and number of runs, which influence the efficiency and effectiveness of the HHO algorithm. The RF model captures underlying patterns in the data, leading to improved RUL predictions. We validate the model's performance on diverse battery types, ensuring practical applicability.

E. LightGBM
The LightGBM gradient-boosting framework creates the usage of tree-based learning strategies. Similar to RF, it is also an ensemble method that builds multiple trees and combines their results. However, LightGBM uses a different approach to construct decision trees and train the model, which leads to faster and more accurate results. The main feature of LightGBM is the ability to handle large-scale data efficiently. It uses Gradient-based One-Side Sampling (GOSS) to select only a subset of the training data for each iteration, reducing computation time and memory usage. It also supports parallel and distributed computing, making it suitable for big data problems. The number of trees, learning rate, and the maximum depth of each tree must all be specified as hyperparameters before we can train a LightGBM model. LightGBM also offers several advanced features, such as definite feature handling and early stopping, which can improve the model's performance and reduce overfitting [32]. The objective function of LightGBM can be written as in Equation 3 Obj Given a dataset with N samples, where X ij represents the value of the j − th feature for the i − th sample, and y i is the corresponding label. Where l represents the loss function,ŷ i is the predicted value for the i−th sample, represents the set of all model parameters, including the decision trees and split VOLUME 11, 2023 points, f k is the k − th decision tree, K is the total number of trees, and (f k ) is the regularization term that penalizes the complexity of the model. Training LightGBM aims to find the set of model parameters that minimizes the objective function Obj( ). It is typically done using a gradient-based optimization algorithm such as Stochastic Gradient Descent (SGD).

F. HISTOGRAM OPTIMIZATION STRATEGY
The Histogram Optimization Strategy is a feature of Light-GBM that optimizes the creation and usage of histograms for faster training and better accuracy. Instead of predefining the histogram bins, LightGBM applies a dynamic binning approach that adapts to the data distribution. The algorithm starts by finding each feature's minimum and maximum values in the training data. Then, it divides each feature range into equal-width bins and constructs histograms based on the counts of samples falling into each bin. However, instead of using all the bins, LightGBM applies an optimization technique to select only the most informative ones. The optimization is performed by iteratively merging adjacent bins with the least gain in the loss function until the desired number of bins is reached. The Histogram Optimization Strategy has several advantages over other binning methods. First, it reduces memory consumption by using a smaller number of bins. Second, it enhances the model's accuracy by effectively capturing the data distribution. Third, it speeds up the training process by reducing the number of splits and simplifying the optimization problem. The flow diagram of the Histogram optimization strategy algorithm is shown in Figure 4.
In the histogram optimization strategy, LightGBM constructs histograms for each feature on the fly during the tree-building process. By utilizing this histogram-based computation, LightGBM can achieve faster and more efficient tree building than traditional decision tree algorithms. The objective function for finding the best split in LightGBM using the Histogram optimization strategy is Equation 4: In Equation 4, the G L and G R are the gradient statistics for the potential split's left and right nodes. Where H L and H R are the sum of Hessians for the left and right nodes, respectively, and λ and γ are regularization parameters. The split with the most significant value of is chosen as the best split.

IV. DATA CURATION AND ANALYSIS
This section provides a detailed overview of this study's data curation and analysis process using the NMC-LCO 18650 battery dataset. The dataset utilized in our analysis was obtained from the Hawaii Natural Energy Institute, which conducted the experiments and collected the data. The experimental data included measurements from 14 NMC-LCO 18650 batteries with a nominal capacity of 2.8 Ah. The batteries were subjected to cycling tests over 1000 cycles at a temperature of 25 • C. During the tests, the batteries were charged using a CC-CV (Constant Current-Constant Voltage) charge rate of C/2 and discharged at a rate of 1.5C. To ensure our predictive model's reliability and generalization capability, we employ a separate testing set consisting of batteries that are not part of the training process. The decision to use separate training and testing sets holds practical significance for predicting the RUL of batteries. By training the model on a subset of batteries and evaluating its performance on unseen batteries, we aim to assess its ability to generalize and make accurate predictions for batteries that have not been encountered during the training phase.

A. DATA DESCRIPTION
The data was collected under various conditions, such as different loading profiles of 1A, 2A, and 4A, shifting ambient temperatures of 4 • C, room temperature, and 44 • C, and discharge voltages of 2.7V, 2.5V, and 2.2V. The external temperatures, ranging from 4 • C to 44 • C, were also monitored in addition to the battery temperatures. The total capacity fluctuates between 2Ah and 0Ah in each charging and discharging cycle. It is important to note that deep discharge can harm the battery, and as a result, the battery voltage is typically between 3.7V and 4.2V during operation.

B. DATA PROCESSING
In addition to the initial data cleaning steps, several data processing techniques were employed to prepare the dataset for analysis. These included feature engineering, normalization, and data partitioning. In order to create new features from the raw data and extract pertinent information, feature engineering was used. In order to ensure that all features were on an equal scale, normalization was used, which can enhance the performance of ML algorithms. The features were scaled precisely to have a unit variance and a zero mean. The training, validation, and test sets were then created from the dataset. Model selection and hyperparameter tweaking were made on the validation set, final model performance was evaluated on the test set, and ML models were fitted on the training set. In order to make sure that each set had a balanced representation of the battery cycles, the data was stratified and divided.
In order to produce predictions, the dataset's several fields must be analyzed. The operations of feature extraction, selection, normalization, and segmentation are included in data preparation. A phase in data preparation is the creation of  training, testing, and validation datasets. Using the battery dataset, we divided it into three categories: training, validation, and testing, using 65% training data and 35% testing data. Table 2 displays the dataset partition that considers training and testing.

V. RESULTS AND DISCUSSION
This section evaluates the proposed integrated process's outcomes and implementation strategy, including performance evaluation and ML-based RUL prediction. RUL is the estimated remaining lifespan of a machine or component before it becomes inoperable or fails to meet performance criteria. RUL prediction is essential to PdM to ensure machines' reliable and safe operation and reduce maintenance costs. Figure 5 shows the Remaining Useful Time (RUT) histogram representation of the statistical distribution of the data considering only the battery life, in which the y-axis represents RUL density or frequency. The x-axis represents RUL. The frequency of each value refers to the number of occurrences or the proportion of data points with a specific value. In the context of the battery life represented on the graph, the frequency of each value indicates how often a particular battery life duration occurs in the dataset. Higher frequencies suggest that certain battery life durations are more common, while lower frequencies indicate less common durations. In fact, the curves represent the distribution, and the frequency of each value on each curve indicates the frequency of each value. It is a valuable tool for visualizing the distribution of RUL values and identifying trends or patterns in the data. The RUT histogram can provide insights into the health status of machines and help maintenance teams plan maintenance activities and predict failures. Table 3 outlines the technology and tools used in the implementation and the necessary settings. The operative technique on which the strategy was implemented and run as Windows 10 utilizing an Intel(R) CPU Core(TM), i5-9600K, at 3.70 GHz, the RAM used was 16 GB, and the programming language was Python 3.8.3.

A. FEATURE SELECTION
The most important characteristics that can aid in predicting the batteries' RUL were identified during the feature selection process. Selecting relevant features (variables, predictors) from a more extensive set of features is known as feature selection. By reducing overfitting, shortening training time, and enhancing the model's interpretability, feature selection seeks to improve the model's performance. Filter, wrapper, and embedding methods are the three main categories into which feature selection techniques can be divided. It was accomplished using various feature selection techniques, such as feature significance analysis using RF, mutual information analysis, and correlation analysis.

B. EVALUATION OF RESULTS WITH DIFFERENT METRICS
In order to assess the effectiveness and accuracy of our method in predicting the RUL of the batteries, we used several metrics. The metrics we used include Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), Mean Squared Error (MSE), coefficient of determination (R 2 ), Mean Absolute Percentage Error (MAPE), Normalized Mean Squared Error (NMRSE), and correlation coefficient. The MAE, MSE, and RMSE measure the absolute, squared, and mean squared differences between the actual and predicted RUL values. MAPE also shows the percentage difference between the actual and anticipated RUL values. The correlation coefficient reflects the linear connection between the actual and anticipated RUL values, whereas NMRSE is a normalized measure of the RMSE that considers the data's unpredictability. These metrics provide a comprehensive evaluation of the performance of our method and enable us to compare its effectiveness with other techniques in the literature.

1) THE MEAN ABSOLUTE ERROR
MAE is a generally utilized metric to evaluate the performance of regression models. In predicting the RUL of batteries, MAE can be used to measure the average absolute difference between the predicted RUL and the valid RUL values. The MAE formula is defined as in Equation 5: where n describes the total number of samples, RUL i,actual represents the actual RUL value for the i th sample, and RUL i,predicted defines the predicted RUL value for the i th sample. The MAE is the average absolute difference between the true and predicted RUL values across all batteries in the dataset.

2) ROOT MEAN SQUARED ERROR
A common metric for assessing the precision of a predictive model is the RMSE. It computes the average squared difference between a given variable's predicted and actual values.
In the case of predicting RUL, the RMSE formula can be written as in Equation 6: where n defines the number of samples, RUL i,actual is the actual RUL for sample i, and RUL i,predicted describes the predicted RUL for sample i. The RMSE penalizes more significant errors more heavily than minor ones, as it squares the differences before taking the square root. A lower RMSE indicates better predictive performance, as the predicted values are closer to the actual values.

3) MEAN SQUARED ERROR
The RUL can be defined in Equation 7, and the MSE calculates the average of the squared differences between the predicted and actual RUL values.
The MSE is a statistic frequently used to assess the effectiveness of regression models since it calculates the average squared difference between the actual and projected RUL values.

4) MEAN ABSOLUTE PERCENTAGE ERROR
The MAPE is a common metric for evaluating prediction accuracy, particularly when utilizing time series data. It determines the average difference between the predicted and actual values as a percentage of the actual values. The formula for MAPE in terms can be expressed as in Equation 8: where n defines the number of observations, RUL i,actual describes the RUL for the ith comment, and RUL i,predicted describes the predicted RUL for the ith observation. The MAPE is expressed as a percentage and helps compare the accuracy of different models or methods for predicting RUL. However, it is essential to note that the MAPE has some limitations, such as its sensitivity to extreme values and the fact that it can be undefined if any actual values are zero. Therefore, it is often used with other metrics to provide a complete evaluation of the performance of RUL prediction models.

5) NORMALIZED MEAN SQUARED ERROR
The sum of the squared deviations between the actual and expected RUL values is shown in the numerator. The denominator represents the total squared errors between the real RUL values and their mean. The NRMSE measures the accuracy of the predicted RUL values, normalized by the variability of the actual RUL values. A lower NRMSE indicates better accuracy and predictive power. The NRMSE formula in terms of RUL is performed as follows in Equation 9 : where n represents the number of observations, RUL i,actual represent the actual RUL value for observation i, RUL i,predicted defines the predicted RUL value for observation i, RUL i,max represent the maximum RUL value in the dataset, and RUL i,min defines the minimum RUL value in the dataset. The NRMSE value ranges from 0 to 1, with a smaller value indicating better performance. A value of 0 indicates a perfect match between the predicted and actual values, while a value of 1 indicates that the predicted values are entirely uncorrelated with the actual values.

6) R 2
A statistical measure known as the coefficient of determination, or R 2 , quantifies the percentage of the dependent variable's variance that can be predicted from the independent variable (s). It is frequently used to gauge the goodness of fit of a regression model. In the context of predicting RUL of batteries, R 2 is calculated as indicated in Equation Equation 10: where n is the number of samples, RUL i,actual defines the actual RUL value for the ith sample, RUL i,predicted represents the predicted RUL value for the ith sample, andRUL actual is the mean actual RUL value across all samples. The range of R2 is 0 to 1, where a value of 0 implies that the model does not explain any variability in the dependent variable, and a value of 1 suggests that it does. The real and anticipated RUL values fit more closely when the R2 value is larger [33]. The Table 4 summarizes the performance of two ML models, RFt, and LightGBM, in predicting the RUL of batteries. The models were optimized using HHO for hyperparameter tuning. The models' effectiveness was assessed using a variety of metrics, including MAE, MSE, RMSE, MAPE, R 2 , and NMRSE. The   Figure 6 provides the actual and predicted values by the model. Our goal is to demonstrate the model's performance and how accurately it can make predictions. The y-axis represents RUL, and the x-axis represents the sample because we have selected a set of samples to test the model. The blue data points represent the actual values, and the orange data points represent our predictions, which closely match the data in many points. This indicates a good performance of the model. The values may deviate more or less in some points, and the model's error can be calculated based on these differences. Figure 7 displays the predicted results for the RUL battery prediction, showcasing a comparison between our model's actual and predicted values. The blue line shows the true RUL values, while the orange line shows the corresponding predicted RUL values. By analyzing Figure7 in conjunction with Figure 6, we gain deeper insights into the performance of our RUL prediction model. The comparison between the actual and predicted values allows us to assess the accuracy and reliability of our method. Furthermore, the close alignment of the blue and orange lines in Figure 7 indicates high accuracy in our RUL predictions. The model's ability to closely track the actual RUL values demonstrates its effectiveness in forecasting battery RUL.   The R 2 score of 0.971 indicates that the proposed model based on RF and Lightgbm optimization with HHO achieved a high level of accuracy in predicting the RUL of batteries, with the predicted values closely matching the measured values. These outcomes illustrate the efficiency of the suggested approach and its potential to enhance battery RUL prediction. The proposed method offers increased accuracy in RUL battery prediction, providing an effective solution for predictive maintenance in the field of battery technology.  Table 5 compares the R 2 values achieved by four different methods for predicting the RUL of batteries. The first row shows the reference method, the Unscented Kalman Filter (UKF), used by Sangwan et al. [34]. The second row shows the hybrid method Cong et al. [35] used, which combines machine learning and statistical models. The third row shows the Empirical-Data Hybrid-Driven Approach (EDHDA) proposed by Chen et al. [36]. The fourth and final row shows the R 2 value achieved by the proposed method in this study, which uses RF and LightGBM optimization with HHO for hyperparameter tuning. The R 2 values range from 0.84 to 0.97%, with the proposed method achieving the highest R 2 value of 0.97%, indicating a high level of accuracy in predicting the RUL of batteries. Table 5 presents a comparison of MAPE and RMSE values for different methods used in predicting the RUL of batteries. Our proposed method outperforms all other methods with significantly lower MAPE (0.23) and RMSE (46.35) values. These results highlight our approach's superior accuracy and precision, showcasing its potential for accurate RUL prediction and ensuring lithium-ion batteries' reliable and efficient operation in various applications.

VI. CONCLUSION AND FUTURE WORK
RUL prediction plays a crucial role in ensuring systems' overall reliability and safety, which is essential for developing successful maintenance strategies. ML techniques have been increasingly used in various fields to predict the RUL of assets, and historical data can be leveraged to predict RUL, enabling efficient maintenance planning and cost savings associated with preventing equipment failures. The proposed approach in this study, which combines RF and LightGBM models with HHO and Sensor Fusion, effectively predicts the RUL of Lithium-Ion Batteries, outperforming traditional approaches. The HHO algorithm provided a better search space for the models' hyperparameters, resulting in improved prediction accuracy. The incorporation of sensor fusion helped extract more meaningful features from the battery data, further enhancing RUL prediction accuracy. The high R 2 values for both training and testing data suggest that the proposed approach is highly effective in predicting the RUL of batteries. Thus, the proposed approach can be a valuable tool for PdM of Lithium-Ion Batteries in various applications, including EVs and renewable energy systems. However, there is still room for improvement, and future work could focus on exploring other optimization algorithms and feature selection techniques to enhance the RUL prediction's accuracy further. Additionally, expanding the scope of the study to include other types of batteries and different operating conditions could provide a more comprehensive understanding of the proposed approach's effectiveness. Table 6 displays the primary notations utilized in the suggested strategy.