Public charging stations for electric vehicles often implement battery swap
systems to minimize charging times. However, these systems primarily display the
State of Charge (SoC) of batteries, without providing information on the State of
Health (SoH). This limitation poses a significant risk, as users may inadvertently
receive degraded battery packs with an SoH of 70%–80%, increasing susceptibility
to overheating and potential safety hazards, such as fires. Mitigating these risks, this
study evaluates the performance of three machine learning algorithms—Random
Forest (RF), Neural Network (NN), Gradient Boosting (GB), K-Nearest Neighbor
(KNN), and Decision Tree (DT)—for predicting the State of Health (SoH) of bat-
teries. The prediction is based on key parameters such as battery cycles, voltage,
current, and State of Charge (SoC), with Depth of Discharge (DoD) derived from
charging and discharging cycles serving as a critical feature for accurate estimation.
Experimental results indicate that the KNN algorithm achieves the lowest Mean
Absolute Error (MAE) of 2.0748%, outperforming the other methods. The slope of
the battery degradation is found to be 0.02484 and the R2 score is 0.99895 which is
the same as the value from the machine learning method. Consequently, the KNN
method is recommended to be integrated to the public charging station. It is also
successfully integrating the KNN method to the public charging system.