Vehicle factory failure prediction method
By preprocessing and dimensionality reduction training of vehicle state parameter data using the random forest algorithm, the prediction of vehicle factory faults is achieved. This solves the problem of low efficiency in traditional detection methods, improves the accuracy and predictability of detection, and ensures the safety and reliability of vehicle operation.
Patent Information
- Application Number
- CN202411657608.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-11-19
AI Technical Summary
Traditional vehicle factory inspections rely on manual checks and periodic inspections, which are inefficient, difficult to cover all potential fault points, and lack predictive maintenance mechanisms. As a result, potential faults are only discovered after the vehicle has been put into use, affecting the stability and safety of operations.
The random forest algorithm is used to preprocess, reduce the dimensionality of vehicle state parameter data and train the model. Data is collected and analyzed through the vehicle network platform to predict vehicle factory failures and identify potential quality problems. The model performance is continuously monitored and optimized.
It improves detection efficiency and accuracy, provides early warning of potential faults, optimizes vehicle quality management, and ensures the safety and reliability of operations.
Smart Images

Figure CN119599186B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of special vehicle technology, specifically a method for predicting vehicle factory failures. Background Technology
[0002] In the modern aviation industry, specialized airport vehicles such as shuttle buses, baggage carts, and towing vehicles play a crucial role in ensuring efficient and safe airport operations. Traditional vehicle factory inspections mainly rely on manual checks and periodic inspections. These methods are often inefficient, fail to cover all potential fault points, and are susceptible to human error. Furthermore, although the inspection process generates a large amount of data, this data is often difficult to process effectively, leading to inefficient data mining and analysis.
[0003] In addition, existing detection methods mainly focus on static detection and lack predictive maintenance mechanisms, which means that potential faults are often only discovered after the vehicle has been put into use, affecting the stability and safety of operations.
[0004] Therefore, there is an urgent need for a technical solution that can intelligently process and analyze test data, realize factory failure prediction, and improve the accuracy and reliability of testing. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for predicting vehicle factory failures that can identify potential quality problems in advance, provide early warnings, and improve detection efficiency and accuracy.
[0006] The technical solution adopted by this invention to solve its technical problem is:
[0007] A method for predicting vehicle factory faults, characterized in that:
[0008] Step S1: Collect vehicle status parameter data and store the parameter data in a predetermined format;
[0009] Step S2: Extract parameter data and preprocess it to convert it into a standard data format;
[0010] Step S3: Perform dimensionality reduction on the preprocessed data to extract relevant features;
[0011] Step S4: Train the model using the random forest algorithm;
[0012] Step S5: Use the trained model to predict faults in vehicles leaving the factory and determine whether there are potential faults in the vehicles.
[0013] It can predict vehicle factory failures, identify potential quality problems, improve testing efficiency and accuracy, provide early warnings of possible failures, optimize vehicle quality management, and ensure the safety and reliability of vehicle operation.
[0014] The present invention also includes step S6, which involves continuously monitoring the predictive performance of the model, collecting new data and performing performance evaluation to determine whether the model has experienced a performance decline, and retraining and optimizing the model when the model shows a performance decline, in order to ensure long-term stability and predictive accuracy and adapt to the changing needs of vehicle factory inspection.
[0015] After training the model in step S4, this invention determines whether the model has reached the expected accuracy. If yes, it proceeds to step S5; otherwise, it adjusts the model's hyperparameters and then re-determines whether the model has reached the expected accuracy.
[0016] The specific method in step S1 of this invention is as follows:
[0017] Step S1.1: The vehicle will transmit the acquired status parameter data to the vehicle network platform. The parameter of the i-th vehicle is defined as Xi, and the fault of the i-th vehicle is defined as Yi. (Xi, Yi) is a standard sample.
[0018] Step S1.2: Extract the original format status parameter data from the vehicle networking platform, process it, and export the data into a standard CSV file. The exported CSV file can include all the parameter information of all vehicles and the set of faults that have occurred in each vehicle in one table.
[0019] The specific method in step S2 of this invention is as follows:
[0020] Step S2.1: Perform data cleaning using the median interpolation method. The formula is:
[0021]
[0022] Where, x i It is the original data value, x i ' is the processed data value, and Median(X) is the median of feature X;
[0023] Step S2.2: Tag value encoding
[0024] Step S2.2.1: Calculate the total number N of fault types in the database, arrange the fault types in a certain order and number them from 1 to N. The N serial numbers correspond one-to-one with the N fault types, and store them in a dictionary for future reference.
[0025] Step S2.2.2: Define an N-dimensional row vector yi, where i is the i-th vehicle;
[0026] Step S2.2.3: Query the fault status of each vehicle. If a vehicle has k types of faults out of N fault types, find the k serial numbers corresponding to these k types of faults in step S2.2.1, match the numbers corresponding to these k serial numbers in yi with the corresponding dimensions in yi, so that the component of the corresponding dimension of yi is 1 and the rest are 0.
[0027] Preprocessing the extracted raw data ensures data quality and model effectiveness. Data cleaning, by removing or repairing missing data and handling outliers, guarantees data integrity and consistency, eliminating noise and incomplete information that may affect model performance. Using median interpolation ensures that the data mean remains unchanged while minimizing the impact of outliers on the overall data pattern. Label value encoding structures the raw multidimensional data into a standardized format, meeting the input requirements of machine learning models. The encoding method is simple and easy to use. Finally, the preprocessed data is organized into a form that algorithms can directly read and analyze, ensuring that subsequent algorithms can accurately and efficiently extract useful information and make predictions.
[0028] The specific method for using PCA technology to reduce the dimensionality of data and extract features in step S3 of this invention is as follows:
[0029] Step S3.1: Define the special vehicle feature parameters as a matrix X of dimension n×p, that is, assume that there are n vehicles in the database, and each vehicle has p feature parameters;
[0030] Step S3.2: Standardize matrix X to obtain the standardized feature matrix Z;
[0031]
[0032] Where μ is the mean vector of each feature and σ is the standard deviation vector of each feature;
[0033] Step S3.3: Calculate the covariance matrix C of the standardized data;
[0034]
[0035] Step S3.4: Calculate the eigenvalues and eigenvectors of C, and select the eigenvectors corresponding to the first k eigenvalues according to their size to form a new k-order eigenmatrix V;
[0036] Step S3.5: The data matrix after dimensionality reduction is Y = ZV;
[0037] Where Y is the principal component matrix after dimensionality reduction, its dimension is reduced from n×p to n×k, that is, the number of vehicles remains the same but only the first k most important features are retained, and pk features with low correlation are removed.
[0038] Step S3.6: Rank the variables by importance. The importance of variables in a random forest is measured by the decrease in the Gini index.
[0039]
[0040] Among them, X j For a certain characteristic, T is the number of all numbers. (Gini) before and Gini after The Gini index before and after the split are respectively.
[0041] PCA (Programmable Array Analysis) is used to reduce the dimensionality of high-dimensional data and extract the most representative features while retaining the main information of the data. When the data is very high-dimensional, PCA can be used to reduce the computational cost first. Then, Random Forest is used for importance analysis, which can quantify the importance of features in the principal components of the vehicle to the prediction results. If computing resources are limited, this method can be used to further remove parameters with low correlation.
[0042] In step S3 of this invention, before using PCA technology to reduce the dimensionality of the data and extract features, low-correlation parameters are first manually removed from the preprocessed data. Since there are too many data features, there are low-correlation parameters that can be directly judged by experience. Based on experience, some obvious low-correlation parameters are first manually removed to ensure that the dataset covers parameters that have an important impact on vehicle fault prediction. The remaining features are then processed by PCA technology, which can improve the accuracy and efficiency of the algorithm and prevent low-correlation parameters from interfering with PCA.
[0043] The specific method for model training in step S4 of this invention is as follows:
[0044] Step S4.1: Divide the dataset into a training set and a validation set, and use the training set to build a decision tree model;
[0045] Step S4.2: Determine the final classification result by having the predictions of all decision trees be voted on by a majority vote;
[0046] Step S4.3: Hyperparameter tuning. Using grid search and cross-validation, the model's hyperparameters are adjusted to optimize model performance. Grid search iterates through parameter combinations to select the parameters that perform best on the validation set. The formula for hyperparameter tuning is:
[0047]
[0048] Where Θ represents the set of all parameter combinations, and θ is one of the parameter combinations;
[0049] Step S4.4: Save the parameter combination that performs best on the validation set; model training is now complete.
[0050] Step S4.5: Evaluate the trained model. Common evaluation metrics include accuracy, precision, recall, and F1 score. These metrics should be combined with k-fold cross-validation. The formula for k-fold cross-validation is as follows:
[0051]
[0052] In the formula, Accuracyi represents the accuracy of the i-th fold;
[0053] The calculation formulas for each indicator are as follows:
[0054]
[0055] In the formula, TP represents a true positive, TN represents a true negative, FP represents a false positive, and FN represents a false negative.
[0056] This algorithm improves the robustness and prediction accuracy of the model by constructing multiple decision trees and combining their prediction results, thereby enhancing the ability to accurately predict the condition of vehicles leaving the factory.
[0057] The method for constructing the decision tree in step S4.1 of this invention is as follows:
[0058] Step S4.1.1: Calculate the Gini index for all vehicle samples. Assuming there are n samples, calculate the Gini index G(X1), G(X2), ... G(Xn) for each of these n samples. The Gini index is defined as follows:
[0059]
[0060] Where, p k Let K be the proportion of the sample belonging to the k-th class, where K is the total number of classes.
[0061] Step S4.1.2: For each feature, calculate its weighted Gini index when splitting the dataset. The weighted Gini index is calculated considering each value of the feature and its corresponding subset.
[0062]
[0063] Where T is the dataset of the current node, X is the feature, Ti is the subset of data when feature X takes the i-th value, |Ti| is the number of samples in subset Ti, |T| is the number of samples in the dataset T of the current node, and G(Ti) is the Gini index of subset Ti.
[0064] Step S4.1.3: Select the feature with the smallest weighted Gini index as the first splitting feature of the root node. After the data is split, it is divided into different subsets. Recursively apply the same process on each subset, and continue to select the feature with the smallest Gini index for further splitting until the stopping condition is met;
[0065] By calculating the weighted Gini index of all features and selecting the feature with the smallest Gini index for data splitting, the feature with the smallest Gini index can minimize the uncertainty of the data set to the greatest extent. Therefore, it is considered the best splitting feature.
[0066] In step S4 of the present invention, the training data of each decision tree is constructed by Bootstrap sampling, which selects a part of the samples with replacement each time. To predict whether a certain vehicle fault yi will occur, first draw m samples from n samples with replacement, where m < n, to obtain a subset of all samples. Repeat this process to obtain p subsets. p different decision trees can be constructed using these p subsets, and they all give the prediction value of a certain fault yi;
[0067] Suppose more than half of the p decision trees think the value of yi is 0, and the remaining ones think the value of yi is 1. Then, according to the voting result, the random forest gives the final prediction value of yi as 0, that is, it is considered that the fault will not occur. The output result of the random forest is as shown in the formula:
[0068]
[0069] In the formula, B represents the number of decision trees, and each decision tree h b (x) will give a classification prediction result, and ck represents a certain category.
[0070] The beneficial effects of the present invention are as follows: It can achieve the prediction of vehicle factory faults, identify potential quality problems, improve the detection efficiency and accuracy, give early warnings of possible faults, optimize the quality management of vehicles, and ensure the safety and reliability of vehicle operation. Description of the Drawings
[0071] Figure 1 is the flowchart of the prediction of factory faults of airport special vehicles in the present invention.
[0072] Figure 2 are some parameters of the vehicle collected in the present invention.
[0073] Figure 3 is the original data format exported from the vehicle networking platform in the present invention.
[0074] Figure 4 is the style of the csv file exported in the present invention.
[0075] Figure 5This is a schematic diagram of the decision tree construction of the present invention. Detailed Implementation
[0076] The present invention will now be described in conjunction with the accompanying drawings and embodiments.
[0077] As attached Figure 1 As shown, a method for predicting vehicle factory defects.
[0078] Step S1: Collect vehicle status parameter data and store the parameter data in a predetermined format;
[0079] Step S1.1: The vehicle's acquired status parameter data is transmitted to the vehicle networking platform for real-time monitoring and subsequent data analysis. The collected parameter data includes detection data obtained from various sensors in the airport special vehicle (the vehicle is equipped with multiple sensors, such as speed sensors, throttle sensors, brake sensors, temperature sensors, etc.), performance testing equipment, and maintenance record systems. This data covers various performance indicators and historical operating status of the vehicle, including but not limited to sensor measurement data, component function test results, and maintenance history records. Figure 2 Some of the relevant parameters collected are shown;
[0080] like Figure 2 As shown, the parameters of the i-th vehicle in the vehicle networking platform are defined as Xi, where Xi is a row vector containing all the relevant parameters of the i-th vehicle. The fault of the i-th vehicle is defined as Yi, which is also a row vector. The value range of i changes dynamically with the increase or decrease of the number of vehicles in the vehicle networking platform. (Xi, Yi) is a standard sample.
[0081] Step S1.2: Extract the raw format status parameter data from the vehicle networking platform and process it. Figure 3 The original data format is shown. Parameter names and their corresponding values are usually not in the same table. Queries require searching in another database by ID. The data is exported as a standard CSV file for easy storage of structured data. Each row represents a sample, the columns are the state parameter data Xi, and the last column is the label value Yi. The exported CSV file can encompass all vehicle parameter information and the set of faults for each vehicle in a single table. The set (Xi, Yi) constitutes a sample. Figure 4 The standard CSV format for export is shown.
[0082] Step S2: Extract parameter data and preprocess it to convert it into a standard data format that can be read by the algorithm;
[0083] Step S2.1: Perform data cleaning using the median interpolation method. The formula is:
[0084]
[0085] Where, x i It is the original data value, x i ' is the processed data value, and Median(X) is the median of feature X;
[0086] by Figure 4 Taking the data as an example, two null values appeared. If the data is read directly at this time, the program will report an error because the data is abnormal. The data needs to be cleaned. Median interpolation is used. The median of the normal values in the "motor speed" and "S2 pressure" columns can be calculated in Excel and set as m and n respectively. The two null values are replaced with m and n respectively, which can eliminate the abnormal values in the data, ensure the integrity and consistency of the data, and thus not affect the normal operation of the algorithm program.
[0087] Step S2.2: Tag value encoding
[0088] Step S2.2.1: Calculate the total number N of fault types in the database, arrange the fault types in a certain order and number them from 1 to N. The N serial numbers correspond one-to-one with the N fault types, and store them in a dictionary for future reference.
[0089] Step S2.2.2: Define an N-dimensional row vector yi (i is the i-th vehicle);
[0090] Step S2.2.3: Query the fault status of each vehicle. If a vehicle has k types of faults out of N fault types, find the k serial numbers corresponding to these k types of faults in step S2.2.1, match the numbers corresponding to these k serial numbers in yi with the corresponding dimensions in yi, so that the component of the corresponding dimension of yi is 1 and the rest are 0.
[0091] For example, the database contains 10 types of vehicle faults, namely (1-accelerator pedal open circuit, 2-accumulator pressure sensor short circuit, 3-hydraulic bypass valve output fault, 4-low-pressure battery fault, 5-left front encoder fault, 6-instrument fault, 7-power battery fault, 8-air conditioning disconnection, 9-high-voltage power distribution system fault, 10-coolant low level). After querying, the database shows that the j-th vehicle has the faults corresponding to serial numbers 1, 3, 5, 7, and 9. Define a 10-dimensional vector yj, and assign 1 to the first, third, 5, 7, and 9th dimensions of yj, and 0 to the rest. Then the fault information of the j-th special vehicle is transformed from (accelerator pedal open circuit, hydraulic bypass valve output fault, left front encoder fault, power battery fault, high-voltage power distribution system fault) into yj: (1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0). The encoding method is simple and easy to use, and can be recognized by the random forest algorithm.
[0092] Preprocessing the extracted raw data ensures data quality and model effectiveness. Data cleaning, by removing or repairing missing data and handling outliers, guarantees data integrity and consistency, eliminating noise and incomplete information that may affect model performance. Using median interpolation ensures that the data mean remains unchanged while minimizing the impact of outliers on the overall data pattern. Label value encoding structures the raw multidimensional data into a standardized format, meeting the input requirements of machine learning models. The encoding method is simple and easy to use. Finally, the preprocessed data is organized into a form that algorithms can directly read and analyze, ensuring that subsequent algorithms can accurately and efficiently extract useful information and make predictions.
[0093] Step S3: Perform dimensionality reduction on the preprocessed data to extract relevant features;
[0094] Step S3.1: First, low-correlation parameters are manually removed from the preprocessed data. Due to the large number of data features, there are low-correlation parameters that can be directly judged by experience. Based on experience, some obvious low-correlation parameters are manually removed to ensure that the dataset covers parameters that have an important impact on vehicle fault prediction. Features related to vehicle performance and operating status are extracted, such as engine temperature, oil pressure, speed sensor, battery voltage, etc. The extracted features are then processed by PCA technology to improve the accuracy and efficiency of the algorithm and prevent low-correlation parameters from interfering with PCA.
[0095] Step S3.2: Use PCA technology to reduce the dimensionality of the data and extract features. Define the feature parameters of special vehicles as a matrix X of dimension n×p, that is, assume that there are n vehicles in the database and each vehicle has p feature parameters.
[0096] Step S3.3: Standardize matrix X to eliminate the influence of different feature dimensions and obtain the standardized feature matrix Z;
[0097]
[0098] Where μ is the mean vector of each feature and σ is the standard deviation vector of each feature;
[0099] Step S3.4: Calculate the covariance matrix C of the standardized data;
[0100]
[0101] Step S3.5: Calculate the eigenvalues and eigenvectors of C, and select the eigenvectors corresponding to the first k eigenvalues according to their size to form a new k-order eigenmatrix V;
[0102] Step S3.6: The data matrix after dimensionality reduction is Y = ZV;
[0103] Where Y is the principal component matrix after dimensionality reduction, its dimension is reduced from n×p to n×k, that is, the number of vehicles remains the same but only the first k most important features are retained, and pk features with low correlation are removed.
[0104] Step S3.7: Rank the variables by importance. The importance of variables in a random forest is measured by the decrease in the Gini index.
[0105]
[0106] Among them, X j For a certain characteristic, T is the number of all numbers. (Gini) before and Gini after The Gini index before and after the split are respectively.
[0107] PCA (Programmable Array Analysis) is used to reduce the dimensionality of high-dimensional data and extract the most representative features while retaining the main information of the data. When the data is very high-dimensional, PCA can be used to reduce the computational cost first. Then, Random Forest is used for importance analysis, which can quantify the importance of features in the principal components of the vehicle to the prediction results. If computing resources are limited, this method can be used to further remove parameters with low correlation.
[0108] Step S4: The improved random forest algorithm is used to train the model on the vehicle's factory inspection data. The specific method for model training is as follows:
[0109] Step S4.1: Divide the dataset into a training set and a validation set, and use the training set to build a decision tree model;
[0110] Step S4.1.1: Construct split features using the Gini index. Calculate the Gini index for all vehicle samples. Assuming there are n samples, calculate the Gini index G(X1), G(X2), ... G(Xn) for each of these n samples. The Gini index is defined as follows:
[0111]
[0112] Where, p k Let K be the proportion of the sample belonging to the k-th class, where K is the total number of classes.
[0113] Step S4.1.2: For each feature, calculate its weighted Gini index when splitting the dataset. The weighted Gini index is calculated considering each value of the feature and its corresponding subset.
[0114]
[0115] Among them, T is the data set of the current node, X is the feature, Ti is the data subset when the feature X takes the i-th value, |Ti| is the number of samples in the subset Ti, |T| is the number of samples in the current node data set T, and G(Ti) is the Gini index of the subset Ti;
[0116] Step S4.1.3: Select the feature with the smallest weighted Gini index as the first splitting feature of the root node. After the data is split, it is divided into different subsets. Apply the same process recursively on each subset, continue to select the feature with the smallest Gini index for further splitting until the stopping condition is met, such as the maximum depth of the tree, the number of samples in the node is lower than a certain threshold, or the Gini index of the node is lower than a certain threshold. Thus, the construction of a decision tree is completed;
[0117] By calculating the weighted Gini index of all features and selecting the feature with the smallest Gini index for data splitting, the feature with the smallest Gini index can minimize the uncertainty of the data set to the greatest extent. Therefore, it is considered the best splitting feature;
[0118] Step S4.2: Determine the final classification result by having the prediction results of all decision trees vote majority;
[0119] For example, to predict whether a certain vehicle fault yi will occur, first, through Bootstrap sampling, m samples (m < n) are drawn with replacement from n samples to obtain a subset of the entire sample. Repeat this process to obtain p subsets. p different decision trees can be constructed using these p subsets, and they all give the predicted value of a certain fault yi. Suppose more than half of the p decision trees think the value of yi is 0, and the remaining ones think the value of yi is 1. Then, according to the voting result, the random forest gives the final predicted value of yi as 0, that is, it is considered that the fault will not occur. The output result of the random forest is as shown in the formula:
[0120]
[0121] In the formula, B represents the number of decision trees, and each decision tree h b (x) will give a classification prediction result, and ck represents a certain category;
[0122] Step S4.3: Hyperparameter tuning. Use the grid search and cross-validation methods to adjust the hyperparameters of the model to optimize the model performance. The grid search selects the parameters that perform best on the validation set by traversing the parameter combinations. The formula for hyperparameter tuning is:
[0123]
[0124] Among them, Θ represents the set of all parameter combinations, and θ is one of the parameter combinations;
[0125] Step S4.4: Save the parameter combination that performs best on the validation set; model training is now complete.
[0126] Step S4.5: Evaluate the trained model. Common evaluation metrics include accuracy, precision, recall, and F1 score. These metrics should be combined with k-fold cross-validation. The formula for k-fold cross-validation is as follows:
[0127]
[0128] In the formula, Accuracyi represents the accuracy of the i-th fold;
[0129] The calculation formulas for each indicator are as follows:
[0130]
[0131] In the formula, TP represents a true positive, TN represents a true negative, FP represents a false positive, and FN represents a false negative.
[0132] The k-fold cross-validation method involves having N samples on the device. These N samples are then divided equally and randomly into k parts. The first part is used as the validation set, and the remaining k-1 parts are used as the training set to calculate the accuracy once. Next, the second part is used as the validation set, and the remaining k-1 parts are used as the training set to calculate the accuracy again. This process continues until every part of the sample has been used as a validation set in the calculation. The average of the k accuracies is then used as the cross-validation accuracy.
[0133] Taking 5x cross-validation as an example, there are 100 samples of special vehicles. The 100 samples are averaged and randomly divided into five equal parts. The first part is used as the validation set, and the other four parts are used as the training set to calculate the accuracy once. Then, the second part is used as the validation set, and the other four parts are used as the training set to calculate the accuracy again. This process continues until every part of the sample has been used as the validation set in the calculation. The average of the five accuracies is taken as the cross-validation accuracy.
[0134] This algorithm improves the robustness and prediction accuracy of the model by constructing multiple decision trees and combining their prediction results, thereby enhancing the ability to accurately predict the condition of vehicles leaving the factory.
[0135] After model training, determine whether the model has reached the expected accuracy. If yes, proceed to step S5. If no, adjust the model's hyperparameters and then re-determine whether the model has reached the expected accuracy.
[0136] Step S5: Use the trained improved random forest model to predict the faults of vehicles leaving the factory, determine whether there are potential faults in the vehicles, and realize the prediction of vehicle factory faults. The prediction results are sent to the client through the vehicle network platform for engineers to view in real time, identify potential quality problems, improve detection efficiency and accuracy, give early warning of possible faults, and take necessary measures to reduce the risks of vehicles in actual operation, optimize vehicle quality management, and ensure the safety and reliability of vehicle operation.
[0137] Step S6: Continuously monitor and improve the prediction performance of the random forest model. By collecting new data and evaluating performance, determine whether the model has experienced a performance decline. When the model shows a decrease in accuracy or insufficient adaptability, retrain and optimize the model to ensure long-term stability and prediction accuracy, and adapt to the changing needs of vehicle factory inspection.
[0138] The above steps enable the prediction of vehicle factory failures, identification of potential quality problems, improvement of testing efficiency and accuracy, early warning of possible failures, optimization of vehicle quality management, and assurance of vehicle operation safety and reliability.
[0139] This application is not only applicable to the prediction of factory failures of special vehicles at airports, but also to vehicles used in other scenarios.
Claims
1. A method for predicting vehicle factory faults, characterized in that: Step S1: Collect vehicle status parameter data and store the parameter data in a predetermined format; Step S1.1: The vehicle will transmit the acquired status parameter data to the vehicle network platform. The collected parameter data includes the detection data obtained from the sensors, performance testing equipment and maintenance record system of the airport special vehicles. The parameter of the i-th vehicle is defined as Xi, and the fault of the i-th vehicle is defined as Yi. Xi is a row vector, and Yi is also a row vector. (Xi, Yi) is a standard sample. Step S1.2: Extract the original format status parameter data from the vehicle network platform, process it, and export the data into a standard CSV file. The exported CSV file can include all the parameter information of all vehicles and the set of faults that have occurred in each vehicle in one table. Step S2: Extract parameter data and preprocess it to convert it into a standard data format; Step S2.1: Clean the data using median interpolation; Step S2.2: Tag value encoding Step S2.2.1: Count the total number N of fault types that appear in the database, arrange the fault types in a certain order and number them from 1 to N. The N serial numbers correspond one-to-one with the N fault types, and store them in a dictionary for future reference. Step S2.2.2: Define an N-dimensional row vector yi, where i is the i-th vehicle; Step S2.2.3: Query the fault status of each vehicle. If a vehicle has k types of faults out of N fault types, find the k serial numbers corresponding to these k types of faults in step S2.2.1, match the numbers corresponding to these k serial numbers in yi with the corresponding dimensions in yi, so that the component of the corresponding dimension of yi is 1 and the rest are 0. Step S3: Use PCA technology to reduce the dimensionality of the preprocessed data and extract relevant features. Then, rank the extracted features by variable importance. The importance of variables in the random forest is measured by the reduction of the Gini index. Among them, X j For a certain characteristic, T is the number of all numbers. (Gini) before and Gini after The Gini index before and after the split are respectively. Step S4: Train the model using the random forest algorithm; Step S4.1: Divide the dataset into a training set and a validation set, and use the training set to build a decision tree model; Step S4.1.1: Calculate the Gini index for all vehicle samples. Assuming there are n samples, calculate the Gini index G(X1), G(X2), ... G(Xn) for each of these n samples. The Gini index is defined as follows: Where, p k Let K be the proportion of the sample belonging to the k-th class, where K is the total number of classes. Step S4.1.2: For each feature, calculate its weighted Gini index when splitting the dataset. The weighted Gini index is calculated considering each value of the feature and its corresponding subset. Where T is the dataset of the current node, X is the feature, Ti is the subset of data when feature X takes the i-th value, |Ti| is the number of samples in subset Ti, |T| is the number of samples in the dataset T of the current node, and G(Ti) is the Gini index of subset Ti. Step S4.1.3: Select the feature with the smallest weighted Gini index as the first splitting feature of the root node. After the data is split, it is divided into different subsets. The same process is recursively applied to each subset to continue selecting the feature with the smallest Gini index for further splitting until the stopping condition is met. Step S4.2: Determine the final classification result by having the predictions of all decision trees be voted on by a majority vote; If more than half of the p decision trees predict the value of yi to be 0, and the remainder predict the value of yi to be 1, then based on the voting results, the random forest will give a final prediction value of 0 for yi, meaning it believes the failure will not occur. The output of the random forest is shown in the formula: In the formula, B represents the number of decision trees, and h represents the number of decision trees. b (x) will give a classification prediction result, where ck represents a certain category; Step S4.3: Hyperparameter tuning. Using grid search and cross-validation, the model's hyperparameters are adjusted to optimize model performance. Grid search iterates through parameter combinations to select the parameters that perform best on the validation set. The formula for hyperparameter tuning is: Where Θ represents the set of all parameter combinations, and θ is one of the parameter combinations; Step S4.4: Save the parameter combination that performs best on the validation set; model training is now complete. Step S4.5: Evaluate the trained model; Step S5: Use the trained model to predict faults in vehicles leaving the factory and determine whether there are potential faults in the vehicles.
2. The vehicle factory fault prediction method according to claim 1, characterized in that: It also includes step S6, which involves continuously monitoring the model's predictive performance by collecting new data and evaluating its performance to determine if the model has experienced a performance decline. When the model shows a performance decline, it is then retrained and optimized.
3. A method for predicting vehicle factory faults according to claim 1 or 2, characterized in that: After training the model in step S4, determine whether the model has reached the expected accuracy. If yes, proceed to step S5. If no, adjust the model's hyperparameters and then re-determine whether the model has reached the expected accuracy.
4. A method for predicting vehicle factory faults according to claim 1 or 2, characterized in that: The formula for data cleaning using median interpolation is: Where, x i It is the original data value, x i ' is the processed data value, and Median(X) is the median of feature X.
5. A method for predicting vehicle factory faults according to claim 1 or 2, characterized in that: In step S3, the PCA technique is used to reduce the dimensionality of the data and extract features. The specific method is as follows: Step S3.1: Define the special vehicle feature parameters as a matrix X of dimension n×p, that is, assume that there are n vehicles in the database, and each vehicle has p feature parameters; Step S3.2: Standardize matrix X to obtain the standardized feature matrix Z; Where μ is the mean vector of each feature and σ is the standard deviation vector of each feature; Step S3.3: Calculate the covariance matrix C of the standardized data; Step S3.4: Calculate the eigenvalues and eigenvectors of C, and select the eigenvectors corresponding to the first k eigenvalues according to their size to form a new k-order eigenmatrix V; Step S3.5: The data matrix after dimensionality reduction is Y = ZV; Where Y is the principal component matrix after dimensionality reduction, its dimension is reduced from n×p to n×k, that is, the number of vehicles remains the same but only the top k most important features are retained, and pk features with low correlation are removed.
6. The method for predicting vehicle factory faults according to claim 5, characterized in that: In step S3, before using PCA to reduce the dimensionality of the data and extract features, low-correlation parameters are manually removed from the preprocessed data.
7. A method for predicting vehicle factory faults according to claim 1, 2, or 6, characterized in that: In step S4.5, the common evaluation criteria include Accuracy, Precision, Recall, and F1 value. All these evaluation criteria need to be combined with k-fold cross-validation. The formula for k-fold cross-validation is as follows: In the formula, Accuracyi is the accuracy of the i-th fold; The calculation formulas for each index are as follows: In the formula, TP is the true positive, TN is the true negative, FP is the false positive, and FN is the false negative.
8. A method for predicting vehicle factory faults according to claim 1, 2, or 6, characterized in that: In step S4.2, the training data of each decision tree is constructed by Bootstrap sampling, which selects a part of the samples with replacement each time. To predict whether a certain vehicle fault yi will occur, first, m samples are drawn from n samples with replacement (m < n) to obtain a subset of all samples. Repeat this process to obtain p subsets. p different decision trees can be constructed using the p subsets, and they all give the predicted values of a certain fault yi.
Citation Information
Patent Citations
Oil well fault diagnosis and prediction method and system based on multi-factor fusion analysis
CN118094379A
Optical module, optical line terminal and processing method for optical fiber fault detection
CN118631331A