Abstract
Electric vehicles (EVs) are gaining popularity due to their environmentally friendly features and advancements in technology. However, like any complex system, they can experience faults within their components, which may lead to performance degradation or safety concerns. This paper presents an intelligent fault diagnostics framework that employs machine learning (ML) techniques, specifically K-Nearest Neighbor (KNN), Random Forest (RF), and Support Vector Machine (SVM), to classify faults based on Failure Modes, Effects, and Criticality Analysis (FMECA) metrics. The proposed framework aims to enhance diagnostic accuracy and serve as a robust tool for improving maintenance and operational efficiency in modern EVs. Our results indicate that the ML classifiers effectively classify faults, albeit with varying degrees of accuracy, ultimately contributing to greater reliability in electric vehicle operations. Notably, the RF classifier achieved the highest accuracy of 98.18%, outperforming SVM and KNN, which recorded accuracies of 95.72% and 97.21%, respectively. Furthermore, the RF model exhibited the lowest prediction error rate of 1.82%, confirming its robustness in accurately identifying faults. These findings suggest that the integration of advanced ML models significantly enhances the performance of fault diagnosis systems in EVs, paving the way for future improvements in feature engineering and diagnostic methodologies.
Introduction
The rapid growth in the adoption of electric vehicles (EVs) is driven by several critical global forces, including the alarming depletion of fossil fuel resources, increasing awareness and proactive measures regarding climate change, advancements in renewable energy technologies, and significant improvements in electric motor and control system designs.1–5 These dynamics collectively accelerate the global transition toward EVs, 1 which, as reported, exceeded 5 million units in 2019 and are projected to reach an impressive annual milestone of 44 million by 2030. 6
However, as the complexity of EV systems continues to escalate encompassing diverse key components including electric motors, battery management systems, power electronics, and integrated computing elements 7 so do the challenges associated with fault diagnosis and maintenance. 8 The increasing integration of these components into smart grid infrastructures and environmentally driven systems amplifies the need for robust diagnostic strategies. Notably, drive motor systems, which are central to EV operation and safety, present multiple fault modes that require structured classification and advanced diagnostic techniques. 8 Effective fault diagnosis is therefore critical not only for ensuring optimal performance and reliability but also for reducing maintenance costs and supporting the long-term sustainability of EV technologies.
Among the various methodologies available for fault diagnosis, the Failure Mode and Effects Analysis (FMEA) approach has emerged as a robust framework for identifying potential failure modes and their impacts on system performance, thus facilitating timely corrective actions. For instance, in the context of EVs, the research conducted by Schlasza et al. 9 applied FMEA to systematically analyze the internal aging mechanisms occurring within lithium-ion traction battery cells. By reviewing and categorizing known degradation processes such as electrolyte decomposition, lithium plating, and structural changes in electrodes, the study established clear links between failure causes and their resulting effects. This structured approach not only provides a comprehensive understanding of battery aging but also serves as a foundation for developing more accurate and predictive diagnostic tools for EV battery systems. Hendricks et al. 10 scrutinized lithium-ion battery failures using an expanded framework known as Failure Modes, Mechanisms, and Effects Analysis (FMMEA), which builds upon traditional FMEA by incorporating the underlying physical mechanisms that lead to failure. Their work provides a structured approach for identifying how batteries used in safety-critical applications such as electric vehicles and aircraft can fail, how these failures manifest, and the life cycle conditions that contribute to their occurrence. By adopting a physics-of-failure (PoF) methodology, the study enables predictive modeling of battery degradation and supports the development of proactive control strategies for failure mitigation. This approach allows for more accurate battery life prediction and enhances system reliability and safety through informed design and maintenance planning. Shoults 11 conducted a detailed study employing Design Failure Modes and Effects Analysis (DFMEA) to systematically evaluate and reduce risks in electric motor systems used in hybrid and electric vehicles. The research emphasizes the growing complexity of EV technologies in response to stringent emissions and fuel economy regulations, and it addresses the need for robust risk analysis methodologies that align with industry standards. By applying DFMEA to a hybrid vehicle’s motor and inverter system, the study identified key mechanical and electrical risk factors and proposed specific corrective actions. These improvements resulted in a 32% reduction in the overall risk level of the motor system, demonstrating the value of early-stage DFMEA in enhancing system reliability, safety, and customer satisfaction in future EV design and implementation. Singh and Pahuja 12 utilized a fuzzy FMEA approach to systematically evaluate the risks associated with electrical failures in electric vehicles, with a particular focus on power electronic inverters. Recognizing the limitations of traditional FMEA due to its reliance on subjective and qualitative data, they integrated fuzzy logic into the evaluation process. By representing severity, occurrence, and detectability as fuzzy sets and processing them through a fuzzy inference engine using MATLAB, they produced a more nuanced and mathematically grounded Risk Priority Number (RPN). This allowed for improved differentiation of failure criticality and more predictive reliability assessments. Similarly, Prasad 13 performed a multiscale failure risk assessment of lithium-ion batteries used in EVs, emphasizing the growing safety concerns linked to increased energy density. His research began with a qualitative FMEA to identify high-risk failure modes across cell, module, and pack levels. A particularly critical failure mode was further analyzed using advanced numerical simulations under mechanical abuse conditions, such as crash scenarios. Additionally, he established a failure envelope at both cell and module levels, providing clear design guidelines for tolerable deformation limits to prevent internal short circuits and thermal runaway, contributing valuable insights for automotive safety design and insurance risk assessment. Bubbico et al. 14 applied FMEA to lithium-ion rechargeable batteries, focusing on hazard identification throughout the entire battery life cycle from installation and operation to disposal. Their study evaluated various system configurations and their interactions with environmental and operational conditions. By compiling data from multiple sources into comprehensive tables, the authors identified predictable dangerous scenarios and proposed mitigation measures aimed at enhancing system safety and reducing risks to both users and the environment. In a related study, Wang et al. 15 conducted a thorough review of thermal runaway phenomena and associated fire dynamics in both individual lithium-ion cells and larger battery packs. Their investigation analyzed the mechanisms leading to fire and explosion risks, emphasizing the urgent need for fire prevention strategies in EVs and stationary energy storage systems. The study also provided recommendations for enhancing fire safety through better design, monitoring, and suppression technologies. Furthermore, the review by Kaliaperumal et al. 16 explored the failure mechanisms of lithium-ion batteries using both FMEA and the more physics-based FMMEA approach. Their work highlighted failure risks at the component level, such as electrode and electrolyte instability, and categorized mitigation strategies into intrinsic safety measures (e.g. material optimization), protective devices (e.g. vents, circuit breakers), and thermal management systems (e.g. air, liquid, and PCM cooling). Their findings support a multi-layered safety strategy combining preventive design with real-time risk detection and control. Similarly, Borujerd et al. 17 presented a fuzzy failure modes and effects analysis to assess the risks associated with immersion-cooled battery packs in electric vehicles. Their research utilizes immersion cooling technology to enhance fast charging capabilities and extend the lifespan of lithium-ion batteries. The study methodically examines various failure modes, their underlying causes, and potential consequences, highlighting key factors such as sealing techniques, the performance of battery management systems, temperature control, and mechanical assembly. The authors propose strategies to mitigate these identified failures, ultimately aiming to refine production and installation processes through an FMEA control plan. This research underscores the significance of FMEA in improving the reliability and safety of battery technologies used in EVs. Consequently, FMEA serves as a crucial tool for ensuring the safety and reliability of complex electric vehicle systems.
Machine learning (ML) techniques are increasingly recognized for their effectiveness in fault diagnosis, particularly in electric vehicle drive motors, where traditional methods may struggle to identify complex fault patterns across varying operating conditions.18,19 The automatic learning capability of ML algorithms allows for efficient analysis of historical data, facilitating precise fault pattern recognition and prediction without the extensive manual effort typically required.20,21 Advanced ML methods, such as CatBoost, Random Forest (RF), and AdaBoost, can classify faults by managing large datasets and capturing nonlinear relationships between motor characteristics and faults, thus enhancing the reliability and efficiency of fault diagnosis. 22 For instance, Yaqub et al. 23 demonstrated a 92% accuracy rate in fault classification using RF on motor sound and vibration data, while Aishwarya and Brisilla 24 showcased various ML techniques, including Support Vector Machines (SVM) and deep learning (DL), for diagnosing three-phase induction motors. Additionally, research by Kim et al. 25 and Amandeep et al. 26 further validated the superior performance of ML models compared to traditional methods for diagnosing faults in induction motors, highlighting their potential to reduce maintenance costs and prevent unexpected equipment failures in industrial applications. These findings highlight the significant advantages of utilizing ML for improved fault detection in EV systems. It is evident that much of the existing research has primarily concentrated on fault diagnosis in electric motors, often overlooking the wide variety of components present in EVs.23–26 Additionally, Rasheed et al. 27 summarized various ML approaches designed for forecasting in vehicle failures, concentrating on methodologies, theories, and applications pertinent to data measurement and analysis systems employed in onboard health monitoring. They concluded that traditional On-Board Diagnostics (OBD) systems frequently struggle to differentiate between minor and major vehicle failures, highlighting the need for improved methods to enhance failure tracking and identification. Importantly, these reviews predominantly examine the application of ML techniques and DL, for fault diagnosis within specific vehicle systems, revealing a critical gap: an urgent need for integrated frameworks that harness diverse Artificial Intelligence (AI) techniques to create robust diagnostic systems capable of managing the complexities of entire vehicular systems. 27
In summary, Failure Mode, Effects, and Criticality Analysis (FMECA) approach provides substantial advantages for fault diagnosis in EVs. By systematically identifying and analyzing potential failure modes, FMECA enables engineers to prioritize critical components and proactively address vulnerabilities. This method enhances understanding of how various failure modes can affect overall vehicle performance, thereby improving safety and reliability. Additionally, integrating FMECA into the design and maintenance phases of EV development allows manufacturers to reduce the likelihood of unexpected failures, streamline maintenance processes, and minimize downtime. As a result, adopting FMECA not only boosts the operational efficiency of EVs but also enhances their long-term viability in a competitive market.
Moreover, the application of ML in fault diagnosis for EVs offers numerous benefits, particularly in enhancing predictive maintenance capabilities. Additionally, ML models can continuously learn from new data, improving their accuracy over time and adapting to changes in vehicle usage patterns or operational environments. ML algorithms can effectively analyze data derived from FMECA, enabling the prioritization of critical failure modes, these algorithms can also detect anomalies and predict failures with high precision. The synergy between these two methodologies enhances the accuracy of fault diagnosis and supports a more proactive maintenance strategy, ultimately leading to improved safety, reduced downtime, and greater customer satisfaction. By combining the strengths of FMECA and ML, stakeholders in the EV industry can adopt a more resilient and efficient approach to fault diagnosis, paving the way for the future of sustainable transportation.
Our work addresses the limitations of earlier research, which primarily focused on either FMEA or ML techniques independently. By bridging these two domains, we not only enhance the accuracy and reliability of fault diagnosis but also provide a systematic approach that can be readily adapted to the evolving complexities of EV technologies.
Among the array of ML techniques, SVM, RF, and K-Nearest Neighbors (KNN) have emerged as prominent models for fault diagnosis. These algorithms have demonstrated remarkable predictive capabilities, largely attributed to their strong generalization performance. 28 Their efficacy in diagnosing faults has been well-documented in the literature,22–26,28 showcasing their potential to improve diagnostic accuracy across various applications. This paper aims to contribute to the ongoing advancements in intelligent fault diagnosis by proposing ML-based framework tailored for EVs, utilizing FMECA data. Given the complexity of electrical systems and components in EVs, sophisticated diagnostic tools are necessary. We conduct a comparative analysis of the performance of three leading classifiers, SVM, RF, and KNN, with the primary objective of identifying the most effective classifier for accurately diagnosing faults in EV components while minimizing misclassification rates. By integrating FMECA data with ML algorithms, our work anticipates enhancing fault detection rates and facilitating real-time monitoring and decision-making processes for EV maintenance.
This paper contributes to improving diagnostic capabilities across a wide range of vehicular components. Furthermore, our findings offer valuable insights into the strengths and weaknesses of each ML classifier, thereby guiding future research directions and practical applications within the electric automotive industry. Ultimately, our work seeks to develop more reliable and efficient diagnostic tools, supporting the creation of a more dependable transportation ecosystem.
This paper is organized into four main sections. Section ‘Background’ offers crucial background information on FMECA, definitions of ML concepts, detailing evaluation metrics, and the classifiers utilized in our proposed approach, particularly in the context of fault diagnostics. Section ‘Methodology’ explores the methodology, introducing an innovative strategy that employs three ML classification techniques (RF, SVM, and KNN) to effectively diagnose faults in EVs based on the data of the FMECA approach. This section also includes a comparison of the results obtained from each classifier to identify the most effective one for diagnosing faults in EV components. Finally, section ‘Conclusion and future work’ concludes the paper and suggests promising avenues for future research that could further improve the reliability and efficiency of EV systems.
Background
Failure mode, effects, and criticality analysis (FMECA)
FMECA is a systematic methodology designed to identify potential failure modes within a system, assess their effects on overall system performance, and evaluate the criticality of each failure mode. 17 This structured approach enables engineers to prioritize risks and implement corrective actions, ultimately enhancing the reliability and safety of the system. In the context of EVs, FMECA plays a vital role in diagnosing faults, improving design, and ensuring that vehicle systems operate safely and effectively.
Steps for fault diagnosis of EVs using FMECA:
- Identify failure modes: Pinpoint potential failure modes of EV components, such as batteries, inverters, and electric motors. This step involves a thorough investigation of each component to understand how and where failures might occur.
- Determine effects of failure: For each identified failure mode, evaluate the potential effects on the overall performance and safety of the vehicle. Analyze scenarios where a failure might result in a loss of functionality or pose safety risks. This step is essential for comprehending how each failure mode influences the vehicles operation.
- Assess criticality: evaluate the severity and likelihood of each failure mode’s effects. Calculate the Risk Priority Number (RPN) for each failure mode using the formula (see equation (1)):
Where:
- D (Detection): Detection refers to the probability of identifying a failure mode or its underlying cause prior to it resulting in a significant impact or system failure. It serves as a measure of the effectiveness of existing controls, monitoring systems, or diagnostic methods in recognizing failures at an early stage.
- O (Occurrence): This metric reflects the probability of the failure occurring, based on historical data, statistical analysis, engineering judgment, or reliability models.
- S (Severity): Severity measures the potential impact of a failure mode on the system, users, or the environment. It takes into account the worst-case scenario, including safety risks, operational interruptions, or damage to the system.
- RPN: The risk priority number is a calculated metric used to rank failure modes for corrective action. It is derived from multiplying the ratings for detection, occurrence, and severity, resulting in a numerical value that quantifies the overall risk associated with a specific failure mode.
Each of these parameters (D, O, and S) is typically rated on a scale from 1 to 10, allowing for a quantitative assessment that facilitates comparisons across different failure modes.
By following these steps, engineers can systematically identify and mitigate risks associated with EV components, contributing to greater safety and reliability in vehicle design and operation.
Evaluation metrics
In the context of intelligent fault diagnosis for EVs, various performance metrics are essential for evaluating the effectiveness of predictive models, these metrics form a robust framework for evaluating and improving intelligent fault diagnosis systems in EVs, guiding advancements in reliability and safety.
- Confusion Matrix (CM): is a visual tool that illustrates the alignment between a models predictions and the actual class labels (refer to Figure 1). It offers a detailed overview of the classifiers performance, highlighting its strengths and weaknesses, and helping to pinpoint areas for improvement in prediction accuracy. The CM is essential for assessing the effectiveness of a machine learning model in classifying data accurately. 29
- Accuracy: Measures the proportion of correct predictions (see equation (2)) made by the classifier, providing a high-level view of performance. The classifier with the highest accuracy indicates the most reliable detection of fault conditions.
- Precision: This metric quantifies the number of TP predictions relative to the number of positive predictions made by the classifier (equation (3)). High precision means that the classifier is very reliable when predicting the presence of a fault which is crucial in fault diagnostics to reduce false alarms.
- Recall (Sensitivity): This metric indicates the ability of the classifier to identify all relevant instances (TPs) from the total actual positives (see equation (4)). A high recall is essential in fault diagnosis, as it emphasizes the models ability to catch faults that are present.
- F1-Score: reflect the equilibrium between precision and recall (see equation (5)), offering a balanced perspective on the model’s accuracy, especially when there is class imbalance in fault types.
- ROC (Receiver Operating Characteristic) curves: The ROC curves provide a visual representation of the classifiers performance across all classification thresholds. It plots the TP Rate (TPR) against the FP Rate (FPR; see equation (6)).The concurrent plotting of the curves facilitates a direct comparison between classifier accuracy comparison, highlighting strengths in specific operating ranges.
By comparing these metrics across the different classifiers, we can determine which model provides the best performance for effectively diagnosing faults in EV components. Generally, the classifier yielding the highest accuracy would be deemed the most effective for this task. The results of these metrics allow engineers or maintenance teams to allocate resources and attention more effectively to the components most likely to fail, thus enhancing the reliability of electric vehicles.

Confusion matrix.
Machine learning classifiers
ML is a subset of AI 29 that enables systems to improve their performance through experience rather than relying solely on explicit programming. A ML classifier is an algorithm or model specifically designed to analyze input data and categorize it into predefined classes or labels. During the training phase, the classifier identifies patterns within a labeled dataset and subsequently applies this knowledge to classify new, unseen data. In our study, we employ several standard classifiers, including RF, SVM, and KNN.
Support vector machine (SVM)
SVM is a supervised learning algorithm that creates a hyperplane in a high-dimensional space to distinguish between different classes (refer to Figure 2). The decision boundary is selected to maximize the margin between the classes. Due to its superior generalization capabilities, SVM has garnered significant interest from both academic and industrial communities as an effective algorithm for fault detection systems. 28

SVM classifier.
To effectively utilize the SVM classifier for intelligent fault diagnosis in EVs, we outline below the proposed algorithm (see Algorithm 1).
Random forest (RF)
RF is an ensemble learning method that identifies important features through random sampling and the construction of decision trees (see Figure 3). For classification tasks, it generates final predictions based on the majority vote from the individual trees. 30 Key mathematical operations involved include calculating Gini impurity to determine optimal splits and employing a voting mechanism to aggregate the results.

RF classifier.
The proposed RF algorithm for intelligent fault diagnosis of EVs is presented in Algorithm 2.
K-nearest neighbor (KNN)
KNN, is an instance-based learning algorithm that does not rely on parametric assumptions and is utilized for both classification and regression tasks (refer to Figure 4). The comprehensive mathematical formulation of the KNN algorithm is presented in Algorithm 3, which encompasses the methods for calculating distances, select the K nearest neighbors, 31 and executing majority voting for classification purposes. 32 This versatility allows KNN to effectively solve a variety of predictive modeling problems.

KNN classifier for intelligent fault diagnosis of EV.
Methodology
Electric vehicle (EV) case study
This section outlines a case study designed to implement our proposed approach, focusing on fault diagnosis in EVs. An EV is a type of automobile that is powered either entirely or partially by electricity,33–35 in contrast to traditional internal combustion engine vehicles that run on gasoline or diesel. EVs consist of several critical components, including high-voltage batteries, charging circuits, inverters, and electric motors. The auxiliary battery supports non-propulsion functions, while the inverter and rectifier facilitate the efficient conversion of energy between alternating current (AC) and direct current (DC). Other key elements include the transmission system, control systems, and various sensors that enhance performance, safety, and efficiency. Numerous governments offer financial incentives, such as tax credits and rebates, to encourage the purchase of electric vehicles, making them a more affordable option for consumers. The main components of an EV include (see Figure 5):
- Auxiliary battery: A secondary battery that powers non-propulsion components such as lights, infotainment systems, and climate control.
- Attraction battery HT/400 V (Battery Pack): A large array of rechargeable lithium-ion batteries that store electrical energy. The range and performance of an EV are largely dependent on the capacity and efficiency of its battery system. This high-tension battery powers the electric motor and provides the necessary voltage for high-performance operations.
- Charging circuit: The system responsible for managing the charging process of the vehicle’s batteries, ensuring safe and efficient energy transfer.
- Inverter AC/DC: A device that converts direct current (DC) from the battery into alternating current (AC) to drive the electric motor, and also converts AC back to DC during regenerative braking.
- Rectifier charger AC/DC: This component converts AC power from the grid into DC power to charge the vehicle’s battery.
- Electric motor: The primary propulsion component that converts electrical energy into mechanical energy, thus providing torque for the vehicle’s movement.
- Transmission group: The system that transmits the power generated by the electric motor to the vehicle’s wheels.
- Calculator motor: The electronic control unit that manages the operation of the electric motor and optimizes performance based on various driving conditions.
- Brake pump: A mechanism that provides hydraulic pressure to activate the braking system, often integrated with regenerative braking systems in EVs.
- Pneumatic pressure sensor: A sensor that measures the pressure in the braking system, allowing for adjustments and improved safety.
- Accelerator pedal sensor: A sensor that detects position and pressure on the accelerator pedal to control motor speed and responsiveness.

EV case study.
Proposed approach
In this part, we present our proposed approach for developing an intelligent fault diagnosis system specifically designed for EV components. This system will utilize three prominent ML classifiers: SVM, KNN, and RF.
The process begins with
Following data preparation, we proceed to
The next stage involves implementing
To optimize the classifiers, we use
After training the dataset the
High precision paired with high recall signifies that the used classifier accurately identifies significant faults while minimizing false alarms, making it a valuable tool for fault diagnosis in EVs. Through a comparative analysis, we analyze the efficacy of different classification strategies on the EV components failure-diagnosis task. Depending on the accuracy results from plotting and displaying them, one can infer which components are more reliable (those with lower RPN values generally) and which classifiers provide better overall generalization in predicting component failures, hence enabling automotive engineers to prioritize maintenance and interventions intelligently.
Finally, we conclude with a
Figure 6 outlines the essential steps in creating a fault diagnosis system for EVs using ML models including SVM, KNN, and RF. This process relies on FMECA data to accurately classify faults in various EV components. Each step is crucial for establishing a reliable and efficient system. By following this structured methodology, stakeholders can enhance the detection and management of faults in EVs, ultimately improving the overall reliability of the technology.

Flowchart of the proposed approach.
Experimental results and discussion
This part is dedicated to implementing the proposed intelligent fault diagnosis approach to the case study of EVs. Initially, we developed a structured FMECA table, which serves as the input data for the ML models. Following this, we present the results of the experimental analysis, which includes a comprehensive evaluation of three classifiers: RF, KNN, and SVM. A summarized version of the FMECA for the EV is provided in Table 1.
Electric vehicle FMECA table.
A personal computer equipped with an Intel® HD Graphics 630 and NVIDIA Quadro M1200 graphics card, an i7 processor, and 32 GB of RAM is used to assess the model’s diagnostic capabilities conduct this experiment in MATLAB software, the implementation provided evaluates the performance of an RF, KNN, and SVM classifiers designed for detecting faults across various electric vehicle components (e.g. Auxiliary battery, Electric motor, etc.) based on given data from FMECA approach. Performance metrics, including confusion matrix, accuracy, precision, recall, and F1-score, are computed and compared across all models.
Table 2 below summarizes the hyperparameters and optimal parameters identified through random search for each machine learning model, including RF, KNN, and SVM. These findings provide important insights into the optimized hyperparameter settings that contributed to improved performance for each model.
Hyperparameters of SVM, KNN, and RF models for fault classification.
Figure 7 displays visual representations of the confusion matrices (CMs) for all three models, enabling us to evaluate their performance in predicting component faults. The CM illustrates the alignment of each model’s predictions with the actual class labels. The diagonal entries reflect the number of correctly classified samples, while the off-diagonal entries represent instances of misclassification.

Confusion matrices of ML classifiers: (a) SVM, (b) KNN, and (c) RF for diagnosing faults in EV.
The CMs obtained from the three ML classifiers (SVM, RF, and KNN) demonstrate strong performance in diagnosing faults in EV components, achieving high accuracy in identifying most components. However, the SVM classifier exhibited a slightly higher rate of misclassifications, particularly for certain components. For example, the ‘charging circuit’ was correctly classified 45 times (true positives), but there were two instances of misclassification, as illustrated in Figure 7(a).
The RF classifier has a noticeable improvement in handling misclassifications (refer to Figure 7(c)); for instance, the ‘charging circuit’ component had very few errors, with only one misclassification (had 46 true positives and only 1 false positive). This model also shows strong performance, with very few misclassifications. The classification is particularly accurate for components like ‘electric motor’, ‘calculator motor’, ‘accelerator pedal sensor’, and ‘attraction battery’. The KNN classifier achieved good accuracy too (refer to Figure 7(b)), but slightly lower than RF, as indicated by the number of misclassifications across various components. Similar to SVM, the ‘charging circuit’ component had 45 true positives but only 1 false positive.
The KNN classifier shows comparable performance. Again, strong predictions are visible, with components like ‘calculator motor’, ‘accelerator pedal sensor’, and ‘attraction battery’, performing similarly to the SVM classifier.
Based on these findings, RF is the most appropriate classifier, followed closely by KNN. SVM also shows a robust performance, albeit lower than RF and KNN.
In summary, the CMs obtained from three ML classifiers (SVM, RF, and KNN) for diagnosing faults in EV components indicate strong performance, with high accuracy in correctly identifying most components. The RF classifier exhibited the fewest misclassifications overall, closely followed by the KNN classifier. The SVM classifier showed slightly more misclassifications, particularly for certain components, such as the transmission group and auxiliary battery. The RF classifier demonstrated superior efficiency, outperforming both KNN and SVM. Overall, these results suggest that ML techniques can be effectively utilized for fault diagnosis in EV systems. The components with higher concentration values along the diagonal of the CMs for SVM, RF, and KNN classifiers, such as the accelerator pedal, attraction battery, calculator motor, and electric motor (51 or 50) (see Figure 7), indicate high criticality and potential primary causes of failure within the EV system. This highlights the potential for improving reliability and maintenance strategies through the application of these ML methods.
The learning curves which plot the training and cross-validation scores over 100 iterations for each classifier, visualizes the model’s performance over time. The learning curves (see Figure 8) suggest that all classifiers (RF, KNN, and SVM) have high training scores (close to 100%) with slightly lower validation scores, indicating that the models generalize well to unseen data, affirming their robustness in diagnosing faults in EV components.

Learning curves of three classifiers.
The results from the ROC curve (refer to Figure 9) analysis and accuracy metrics indicate that the RF classifier significantly outperformed both the SVM and KNN (refer to Figures 9 and 10) classifiers in the context of fault diagnosis for electric vehicles. With an accuracy of 98.18% (see Figure 9(b)), the RF classifier demonstrates a superior ability to correctly classify instances compared to SVM and KNN, which achieved accuracies of 95.72% (refer to Figure 9(a)) and 97.21% (see Figure 9(c)), respectively. This can be attributed to several factors inherent to the nature of the RF algorithm. RF is an ensemble learning method that aggregates the predictions of multiple decision trees, leading to improved generalization by reducing the risk of overfitting to noise in the training data. This robustness is particularly beneficial in complex and noisy environments like electric vehicle fault diagnosis, where various factors can influence the data. The SVM classifier, while effective in high-dimensional spaces, may struggle with the complexity of data distributions, potentially leading to suboptimal performance. KNN, on the other hand, is sensitive to the choice of distance metric and the local density of data points, which can affect its performance in diverse conditions. Overall, the RF classifier’s ability to handle multiple features and interactions among them likely contributed to its superior performance, making it a more reliable choice for accurately diagnosing faults in electric vehicles.

ROC curves of: (a) SVM, (b) RF, and (c) KNN classifiers.

The total accuracy of each ML classifier.
The bar graph (refer to Figure 10) presents a clear comparative visualization of classifier accuracies, emphasizing the superior performance of RF.
Figure 11 presents the performance metrics (precision, recall, and F1-score) of the three ML algorithms used for classifying faults in EV components. Additionally, Table 3 provides a summary of the average metrics comparison, including average precision, average recall, and average F1-score, for the three classifiers (SVM, RF, and KNN).

Precision, recall, and F1-score of classifiers.
Comparison metrics of classifiers.
From Figure 11 and Table 3, it is evident that RF outperforms the other classifiers in terms of average precision, achieving a high precision rate of 98.31%, which indicates its effectiveness in minimizing false positives. KNN follows with a precision of 97.44%, while SVM has the lowest precision at 96.02%. In terms of average recall, RF again leads with a rate of 98.17%, demonstrating its ability to capture the majority of actual faults. KNN and SVM exhibit closely aligned recall rates of 97.18% and 95.70%, respectively. When evaluating the F1-score, RF maintains its top position with a score of 98.19%, reflecting its overall superior performance among the three classifiers. KNN ranks second with an F1-score of 97.23%, while SVM has the lowest F1-score at 95.77%.
In summary, RF consistently demonstrates the highest performance across precision, recall, and F1-score metrics, making it the most effective classifier among the three evaluated, with KNN following behind and SVM showing the least effectiveness.
Noteworthy error comparisons (see Figure 12) indicated that the RF classifier exhibited the lowest error rate at 1.82%. This was followed by the KNN classifier with an error rate of 2.79%, while the SVM had the highest error rate at 4.28%. Overall, the RF classifier demonstrated the most effectiveness in diagnosing faults in electric vehicle components, with KNN and SVM trailing closely behind.

Error comparison of each ML algorithm.
Figure 13 presents the RPN bar, which assesses the risk levels of various electric vehicle components and identifies key areas for preventive maintenance. High RPN values for components like the auxiliary battery, electric motor, calculator motor, and accelerator pedal sensor indicate their criticality and potential for failure within the EV system. Consequently, maintenance strategies should focus on these components to improve vehicle reliability and safety, emphasizing regular inspections and preventive measures to ensure they operate effectively and reduce breakdown risks.

RPN of EV components.
Results and discussion
This study validates the effectiveness of ML classifiers for intelligent fault diagnosis in EVs. Among SVM, RF, and KNN. The CM allows us to visualize the number of true positives against false classifications across the components. A well-structured CM would show high diagonal values, indicating most classifications are correct, while off-diagonal entries must be minimized to ensure model reliability. The training and validation curves demonstrate a convergence trend, indicating the model is learning effectively. The metrics (precision, recall, F1-score) plotted against epochs show promising performance, with a notable balance throughout training, indicating the model is learning adequately.
The RF classifier achieved the highest accuracy of 98.18%, followed closely by KNN at 97.21%, and SVM with 95.72%. Each classifier exhibited a different pattern of errors (4.28% for SVM, 1.82% for RF, and 2.79% for KNN), suggesting that the RF model is the most robust in distinguishing between faults, given its lower error rate, ensuring better accuracy and fewer misclassifications.
In Summary, RF is the best-performing classifier among the three for fault diagnosis in EVs, achieving the highest scores across all metrics (accuracy, precision, recall, and F1-score). KNN shows competitive performance, while SVM has the lowest scores across all metrics. These results suggest that RF is the most reliable choice for accurately diagnosing faults in EVs, as it not only identifies a high proportion of actual faults (high recall) but also minimizes false positives (high precision). The successful application of these ML techniques highlights their potential, in improving the reliability and maintenance strategies in EV systems, particularly through targeted inspections of high-risk components.
Table 4 presents a comparative analysis of various approaches used for fault classification and diagnosis in EVs, highlighting the performance of different ML models in terms of accuracy. The study conducted by Thirunavukkarasu et al. 36 showcases an advanced ML and data transformation technique optimized through BayesSearchCV, achieving impressive accuracy rates with models such as CatBoost (94.1%), RF (93.2%), AdaBoost (87.5%), and quadratic discriminant analysis (86.5%). In contrast, the research by Mishra et al. 37 focuses on fault detection and diagnosis using several artificial intelligence methods, reporting accuracy percentages of 58.86% for SVM, 63.32% for KNN, and even higher rates for RF (97.44%) and ANN (96.65%).
Comparison with other approach.
In comparison, the current study employs an ML-based FMECA strategy, optimized through random search, yielding the highest accuracy among the approaches compared: 98.18% for RF, 97.21% for KNN, and 95.72% for SVM. Our findings demonstrate significant performance improvements compared to other approaches, underscoring the robustness of the proposed methodology in enhancing fault classification accuracy in EVs and paving the way for further advancements in this field.
Conclusion and future work
This paper presents a hybrid framework that combines FMECA with ML techniques for intelligent fault diagnosis of EVs. By integrating FMECA data with advanced classifiers such as SVM, RF, and KNN, we develop an effective methodology for diagnosing faults in various EV components. Our comparative analysis demonstrates that the RF classifier outperforms the other methods, achieving an impressive accuracy of 98.18%. This performance surpasses that of the SVM and KNN classifiers, which recorded accuracies of 95.72% and 97.21%, respectively. Furthermore, the RF classifier excels not only in accuracy but also in precision and recall, indicating its effectiveness in minimizing false positives and accurately capturing true faults. The superior F1-score of 98.19% further underscores the RF classifier’s overall efficacy in reliable fault diagnosis. The findings underscore the potential for implementing these ML techniques in real-world applications to enhance the reliability and maintenance strategies for EV systems.
Additionally, the RPN analysis identifies critical components, such as the auxiliary battery, electric motor, calculator motor, and accelerator pedal sensor, which necessitate focused preventive maintenance efforts. By prioritizing these components in maintenance strategies, the reliability and safety of electric vehicles can be significantly enhanced, thereby reducing the likelihood of breakdowns and improving overall vehicle performance.
The primary objective of this paper is to identify the most effective ML classifier for diagnosing faults in EV systems while minimizing misclassification rates. Our findings not only highlight the robustness of the RF classifier in accurately detecting faults but also emphasize its superior performance in maintaining low false positive rates. This work illustrates the potential of integrating ML with traditional reliability analysis methods, paving the way for advanced diagnostic tools applicable across a range of vehicular components. Ultimately, our contribution establishes a comprehensive approach to intelligent fault diagnosis that enhances the diagnostic capabilities of electric vehicles, thus improving operational safety and efficiency.
Future research should explore several avenues to further enhance intelligent fault diagnosis of EVs. First, the integration of more advanced ML techniques, such as deep learning algorithms, could be investigated to assess whether they can offer even greater accuracy and reliability than the RF classifier. Additionally, expanding the dataset to include a variety of EV makes and models will help validate the robustness of the RF classifier across different scenarios and conditions. Furthermore, exploring the integration of Internet of Things (IoT) technology with our proposed framework could enable continuous monitoring of vehicle components, facilitating proactive fault detection and maintenance, and ultimately contributing to the development of smarter and more efficient electric vehicles.
Footnotes
Handling Editor: Chenhui Liang
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
