Brake detection model training method and vehicle brake detection method and device
By generating adversarial networks and high-dimensional feature mapping and other technical means, the training samples of the vehicle brake detection model are expanded, and the overfitting problem caused by insufficient sample size in the existing technology is solved, and the detection accuracy and model generalization ability are improved.
Patent Information
- Application Number
- CN202411846503.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the vehicle braking detection model has a small number of brake data samples marked with detection tags during training, resulting in overfitting the model, affecting the detection accuracy.
Generative adversarial network is used for sample expansion. Through alternating training of discriminators and generators, augmented data samples with the same detection tags are generated, which enhances the diversity and representativeness of the sample set, and combines high-dimensional feature mapping and random forest model for training. .
It effectively solves the problem of insufficient training samples, improves the accuracy and generalization ability of the brake detection model, and makes vehicle brake detection more accurate.
Smart Images

Figure CN119312095A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle performance detection, and in particular to a braking detection model training method, a vehicle braking detection method and a device. Background Art
[0002] Braking performance is one of the core performances of a vehicle, and its safety is crucial to ensuring the normal driving of new energy vehicles. To achieve vehicle braking detection, the vehicle's braking data, such as braking pressure, braking distance, braking time, and braking temperature, can be input into a braking detection model trained based on a neural network for detection, so as to determine whether the vehicle's braking performance is abnormal based on the detection label output by the braking detection model. Therefore, the vehicle's braking detection accuracy depends on the braking detection model.
[0003] In the related art, the training of the brake detection model for vehicle brake detection is to input the brake data marked with different detection labels as data samples into the initial model for training to obtain the brake detection model. However, in actual situations, the number of brake data marked with detection labels actually collected is usually small, resulting in overfitting of the brake detection model when the brake detection model is trained with brake data with a small amount of data, which affects the accuracy of the brake detection model in brake detection. Summary of the invention
[0004] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes a brake detection model training method, which can improve the accuracy of brake detection of a vehicle using a brake detection model.
[0005] According to the first aspect of the present application, the braking detection model training method includes: According to the trained generative adversarial network, sample expansion is performed on any braking data sample collected from the target vehicle and marked with a detection label to obtain an expanded data sample having the same detection label as the braking data sample; Training a braking detection model according to a sample set consisting of each of the braking data samples and each of the expanded data samples to obtain a trained braking detection model; The generative adversarial network is obtained by performing multiple alternating training on the discriminator and the generator of the generative adversarial network, wherein the training of the discriminator includes training the discriminator through the current braking data sample input in each braking data sample and the target data sample currently output by the generative adversarial network; the training of the discriminator includes training the generator through the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the discrimination result of the discriminator on the target data sample; The braking data sample includes a plurality of sample data points, and the sample data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle.
[0006] By performing sample expansion on any braking data sample marked with a detection label according to a trained generative adversarial network, an expanded data sample with the same braking state as the braking data sample is obtained, and a braking detection model is trained according to a sample set composed of each braking data sample and each expanded data sample to obtain a trained braking detection model; wherein, the generative adversarial network is obtained by repeatedly training the discriminator and the generator of the generative adversarial network alternately, and the training of the discriminator includes training the discriminator through the current braking data sample input in each braking data sample and the target data sample currently output by the generative adversarial network; the training of the discriminator includes training the generator through the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the discrimination result of the discriminator on the target data sample. Therefore, the generative adversarial network based on the high-dimensional space similarity measurement can be used to expand the amount of braking data samples to generate more representative and diverse braking data samples to train the braking detection model, thereby effectively solving the problem of insufficient training samples. At the same time, data samples with more dimensions that may affect the braking state of the vehicle are used to train the braking detection model, making the training of the braking detection model more comprehensive, thereby improving the accuracy of braking detection of the vehicle using the braking detection model.
[0007] According to one embodiment of the present application, it also includes: Through high-dimensional feature mapping model , performing feature mapping on the current braking data sample and the target data sample to obtain feature distributions of the current braking data sample and the target data sample in a high-dimensional feature space; Determining feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space according to feature distribution of the current braking data sample and the target data sample in the high-dimensional feature space; in, represents the ReLU nonlinear activation function, represents the preset weight matrix, Preset bias vector, represents the current braking data sample or the target data sample.
[0008] According to one embodiment of the present application, the alternating training includes: The current braking data sample is input into the discriminator to obtain a first label output by the discriminator, and the target data sample is input into the discriminator to obtain a second label output by the discriminator, so as to calculate the loss function of the discriminator according to the first label and the second label, and back-propagate to update the network parameters of the discriminator, until the first label obtained by inputting the current braking data sample into the discriminator is a label representing real data, and the second label obtained by inputting the target data sample into the discriminator is a label representing false data, then the loss function of the generator is calculated according to the second label obtained by inputting the target data sample into the discriminator, and the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the network parameters of the loss discriminator are back-propagated to update, until one alternating training is completed when the target data sample is input into the generator and the second label obtained by inputting the discriminator is a label representing real data.
[0009] According to one embodiment of the present application, the loss function of the generator includes: ; in, represents the mathematical expectation, , represents the feature diffusion loss, represents the braking data sample, represents a target data sample generated by the generator according to the braking data sample, represents the second tag, represents the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, Represents the feature diffusion loss weight.
[0010] According to one embodiment of the present application, the characteristic diffusion loss weight , ; in, represents the initial loss weight, represents the attenuation coefficient, represents the network parameter vector of the generator, represents the network parameter vector of the discriminator, represents the Euclidean distance between the parameter vectors of the generator and the discriminator, represents the normalized sum of the parameter vectors of the generator and the discriminator.
[0011] According to one embodiment of the present application, the braking detection model includes a random forest model; According to the sample set composed of each of the braking data samples and each of the expanded data samples, a braking detection model is trained to obtain a trained braking detection model, including: Each data sample in the sample set is input into the random forest model to construct a decision tree. Each construction selects the sample data points and splitting points that reduce the information entropy the most in the data sample according to the conditional information entropy for node splitting until the construction of each decision tree is completed to obtain a trained random forest model.
[0012] According to one embodiment of the present application, the conditional information entropy ;in, represents the information entropy function, Representation Node Each data sample of According to the sample data points and split point The data samples of the nodes obtained after segmentation, when k=L, According to the sample data points and split point The data samples of the left node obtained after segmentation, when k=R, According to the sample data points and split point The data samples of the right node obtained after segmentation, Represents each data sample The number of samples, For selected features The information entropy of is the optimal splitting point.
[0013] A vehicle braking detection method according to a second aspect of the present application includes: Get the current braking data of the target vehicle; Inputting the current braking data into a trained braking detection model to obtain a braking detection result of the target vehicle; The current braking data includes a plurality of braking data points, and the braking data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle; The braking detection model is trained by the braking detection model training method described in any of the above embodiments.
[0014] A braking detection model training device according to a third aspect of the present application includes: A data sample expansion module is used to expand any braking data sample marked with a detection label collected from the target vehicle according to the trained generative adversarial network, so as to obtain an expanded data sample having the same detection label as the braking data sample; A detection model training module, used to train a braking detection model according to a sample set consisting of each of the braking data samples and each of the expanded data samples to obtain a trained braking detection model; The generative adversarial network is obtained by performing multiple alternating training on the discriminator and the generator of the generative adversarial network, wherein the training of the discriminator includes training the discriminator through the current braking data sample input in each braking data sample and the target data sample currently output by the generative adversarial network; the training of the discriminator includes training the generator through the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the discrimination result of the discriminator on the target data sample; The braking data sample includes a plurality of sample data points, and the sample data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle.
[0015] According to the fourth aspect of the present application, a braking detection model training device includes: A data acquisition module, used to acquire current braking data of a target vehicle; A vehicle detection module, used for inputting the current braking data into a trained braking detection model to obtain a braking detection result of the target vehicle; The current braking data includes a plurality of braking data points, and the braking data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle; The braking detection model is trained by the braking detection model training method in any of the above embodiments.
[0016] According to an electronic device of an embodiment of the fifth aspect of the present application, the electronic device comprises a processor and a memory storing a computer program, and when the processor executes the computer program, the braking detection model training method described in any of the above embodiments, or the braking detection method of the vehicle described in any of the above embodiments is implemented.
[0017] According to the computer-readable storage medium of the sixth aspect embodiment of the present application, a computer program is stored thereon, and when the computer program is executed by a processor, the braking detection model training method described in any of the above embodiments, or the braking detection method of the vehicle described in any of the above embodiments is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a flowchart of a brake detection model training method provided in an embodiment of the present application; Figure 2 It is a flow chart of a vehicle braking detection method provided in an embodiment of the present application; Figure 3 It is a structural schematic diagram of a braking detection model training device provided in an embodiment of the present application; Figure 4 is a schematic structural diagram of a vehicle braking detection device provided in an embodiment of the present application; Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0021] Below, the braking detection model training method, vehicle braking detection method and device provided in the embodiments of the present application will be introduced and explained in detail through several specific embodiments.
[0022] In one embodiment, a braking detection model training method is provided, which is applied to a terminal device for training a braking detection model. The terminal device may be a desktop terminal, a mobile terminal, a vehicle-mounted terminal, a server or other electronic device, and the server may be an independent server or a server cluster composed of multiple servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence sampling point devices.
[0023] like Figure 1 As shown, this embodiment provides a braking detection model training method, the method comprising: Step 101, performing sample expansion on any braking data sample marked with a detection label collected from a target vehicle according to a trained generative adversarial network, to obtain an expanded data sample having the same detection label as the braking data sample; Step 102, training a braking detection model according to a sample set consisting of each of the braking data samples and each of the expanded data samples to obtain a trained braking detection model; The generative adversarial network is obtained by performing multiple alternating training on the discriminator and the generator of the generative adversarial network, wherein the training of the discriminator includes training the discriminator through the current braking data sample input in each braking data sample and the target data sample currently output by the generative adversarial network; the training of the discriminator includes training the generator through the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the discrimination result of the discriminator on the target data sample; The braking data sample includes a plurality of sample data points, and the sample data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle.
[0024] In some embodiments, when the target vehicle is in a certain braking state, a braking data sample of the target vehicle in the braking state can be collected, and the braking state can be used as a detection label to mark the braking data sample. Wherein, the detection label can be a number 1 or 0, which is used to indicate normal braking or abnormal braking. 1 indicates normal braking, and 0 indicates abnormal braking. Normal braking indicates that the target vehicle can perform normal braking, and abnormal braking indicates that the target vehicle cannot perform normal braking. The braking data sample includes a plurality of sample data points, and the sample data points can be the braking pressure, braking distance, braking time, braking temperature, body weight, tire wear, and ABS state of the target vehicle. In addition to the target vehicle's own data, the sample data points can also be environmental parameters such as ambient temperature and road surface type. For example, the braking pressure, braking distance, braking time, braking temperature, body weight, tire wear, ABS state of the target vehicle, and the ambient temperature and road surface type of the vehicle's environment can be used as sample data points, respectively, to obtain a braking data sample including a plurality of sample data points. That is, the braking data sample = {braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree, ABS status, ambient temperature of the vehicle's environment, and road surface type of the vehicle's environment}.
[0025] Exemplarily, for a certain target vehicle, sample data points such as the target vehicle's braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear, ABS status, ambient temperature of the vehicle's environment, and road surface type of the vehicle's environment at the current moment can be collected to form a braking data sample, and then the braking data sample is marked with the target vehicle's detection label at the current moment to obtain a braking data sample marked with a detection label.
[0026] After obtaining each braking data sample marked with a detection label, any braking data sample can be input into a trained generative adversarial network. For example, by inputting the braking data sample and random noise into the generator of the trained generative adversarial network, a new data sample output by the generative adversarial network can be obtained as an expanded data sample, and the expanded data sample can be marked with the detection label of the braking data sample to obtain an expanded data sample with the same detection label as the braking data sample.
[0027] For training of generative adversarial networks, the network parameters of the generator and the discriminator can be initialized first. Specifically, the network parameters of the generator (G) and the discriminator (D) can be initialized by random numbers, such as .in, represents a normal distribution with a mean of 0 and a standard deviation of 0.01.
[0028] After the network parameters of the generator and discriminator of the generative adversarial network are initialized, different braking data samples can be input into the generative adversarial network to be trained for multiple times. Each training is to alternately train the generator and discriminator of the generative adversarial network. The process of an alternating training is to first train the discriminator once, and then train the generator once.
[0029] The training process of a discriminator is as follows: fix the current network parameters of the generator, input any braking data sample from each braking data sample as the current braking data sample into the generator, obtain the corresponding target data sample, then input the current braking data sample into the discriminator, obtain the first label output by the discriminator, and input the target data sample obtained by inputting the current braking data sample into the generator into the discriminator, obtain the second label output by the discriminator. The first label and the second label are the probability values that characterize the data sample input into the discriminator as real data.
[0030] After obtaining the first label and the second label output by the discriminator, the network parameters of the discriminator can be updated by back-propagation according to the first label and the second label until the first label obtained by inputting the current braking data sample into the discriminator is a label representing real data, such as the probability value of the first label is greater than or equal to the preset probability, and the second label obtained by inputting the target data sample into the discriminator is a label representing false data, such as the probability value of the second label is less than the preset probability, then the training of the discriminator is completed, and the generator is trained again at this time.
[0031] The training process of a generator is as follows: fix the current network parameters of the discriminator, then input any braking data sample from each braking data sample as the current braking data sample into the generator, obtain the target data sample output by the generator, and then map the current braking data sample and the target data sample to the high-dimensional feature space, obtain the feature distribution of the current braking data sample and the target data sample in the high-dimensional feature space, and obtain the feature similarity of the current braking data sample and the target data sample in the high-dimensional feature space according to the feature distribution of the current braking data sample and the target data sample in the high-dimensional feature space. After obtaining the feature similarity, the current network parameters of the generator can be adjusted according to the feature similarity and the second label obtained by inputting the target data sample into the discriminator, until the current braking data sample is input into the target data sample obtained by the generator, and the second label obtained by inputting the discriminator is a label representing the real data, and the training of the generator is completed.
[0032] After completing the training of the discriminator and the generator once, it means that one alternating training is completed. At this time, the next alternating training is carried out, and so on, until the number of alternating training reaches the preset number, such as 1000 times, it means that the training of the generative adversarial network is completed, and a trained generative adversarial network is obtained.
[0033] After obtaining the trained generative adversarial network, the braking data sample and random noise can be input into the trained generative adversarial network to obtain an expanded data sample with the same detection label as the braking data sample.
[0034] After obtaining each expanded data sample and each braking data sample, the sample set consisting of each expanded data sample and each braking data sample can be input into the braking detection model for training in sequence until any data sample in the sample set, such as the expanded data sample or the braking data sample in the sample set, is input into the braking detection model and the predicted braking state obtained is consistent with the detection label marked with the data sample. In this way, the training of the braking detection model is completed and a trained braking detection model is obtained.
[0035] By performing sample expansion on any braking data sample marked with a detection label according to a trained generative adversarial network, an expanded data sample with the same braking state as the braking data sample is obtained, and a braking detection model is trained according to a sample set composed of each braking data sample and each expanded data sample to obtain a trained braking detection model; wherein, the generative adversarial network is obtained by repeatedly training the discriminator and the generator of the generative adversarial network alternately, and the training of the discriminator includes training the discriminator through the current braking data sample input in each braking data sample and the target data sample currently output by the generative adversarial network; the training of the discriminator includes training the generator through the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the discrimination result of the discriminator on the target data sample. Therefore, the generative adversarial network based on the high-dimensional space similarity measurement can be used to expand the amount of braking data samples to generate more representative and diverse braking data samples to train the braking detection model, thereby effectively solving the problem of insufficient training samples. At the same time, data samples with more dimensions that may affect the braking state of the vehicle are used to train the braking detection model, making the training of the braking detection model more comprehensive, thereby improving the accuracy of braking detection of the vehicle using the braking detection model.
[0036] To further improve the training effect of the brake detection model, in some embodiments, the method further includes: Through high-dimensional feature mapping model , performing feature mapping on the current braking data sample and the target data sample to obtain feature distributions of the current braking data sample and the target data sample in a high-dimensional feature space; Determining feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space according to feature distribution of the current braking data sample and the target data sample in the high-dimensional feature space; in, represents the ReLU nonlinear activation function, represents the preset weight matrix, Preset bias vector, represents the current braking data sample or the target data sample.
[0037] For example, assuming that the current braking data sample is , the current braking data sample The target data sample obtained by inputting the generator is , the current braking data sample can be Input the high-dimensional feature mapping model to obtain the current braking data sample The feature distribution in the high-dimensional feature space is , and the target data sample Input the high-dimensional feature mapping model to obtain the target data sample The feature distribution in the high-dimensional feature space is .
[0038] After getting the current braking data sample Feature distribution in high-dimensional feature space , and the target data sample The feature distribution in the high-dimensional feature space is After that, the Euclidean distance between the two can be calculated to determine the feature similarity between the two in the high-dimensional feature space. For example:
[0039] In this way, the high-dimensional feature mapping model can be used to more effectively determine the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, so that the target data sample generated by the generator subsequently trained using feature similarity has a higher similarity with the braking data sample, thereby further improving the training effect of the braking detection model.
[0040] To further improve the training effect of the brake detection model, in some embodiments, the alternating training of the generative adversarial network includes: The current braking data sample is input into the discriminator to obtain a first label output by the discriminator, and the target data sample is input into the discriminator to obtain a second label output by the discriminator, so as to calculate the loss function of the discriminator according to the first label and the second label, and back-propagate to update the network parameters of the discriminator, until the first label obtained by inputting the current braking data sample into the discriminator is a label representing real data, and the second label obtained by inputting the target data sample into the discriminator is a label representing false data, then the loss function of the generator is calculated according to the second label obtained by inputting the target data sample into the discriminator, and the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the network parameters of the loss discriminator are back-propagated to update, until one alternating training is completed when the target data sample is input into the generator and the second label obtained by inputting the discriminator is a label representing real data.
[0041] In some embodiments, the process of an alternating training is to first train the discriminator and then train the generator.
[0042] Among them, the training process of a discriminator is: Fixed the network parameters of the generator and added random noise and the current braking data sample in each braking data sample Input the generator to get the target data sample ,Right now:
[0043] Then, the current braking data sample Input the discriminator and get the first label output by the discriminator , and the target data sample Input the discriminator and get the second label output by the discriminator . The first label and the second label are the probability values that characterize the data samples input to the discriminator as real data.
[0044] After getting the first label output by the discriminator and the second label After that, you can use the first tag and the second label , calculate the loss function of the discriminator: .in, Represents the expected operation. With the goal of maximizing the loss function of the discriminator, back propagation updates the current network parameters of the discriminator until the first label obtained by inputting the current braking data sample into the discriminator is the label representing the real data, and the second label obtained by inputting the target data sample into the discriminator is the label representing the false data. The training of the discriminator is completed once, and the generator is trained again at this time.
[0045] The training process of a generator is as follows: fix the current network parameters of the discriminator, and then use the current braking data sample and random noise Input the generator and get the target data sample output by the generator , and then the target data sample Input the discriminator to get the target data sample The second label Then, according to the second tag , and the current braking data sample And the target data sample Feature similarity in high-dimensional feature space , calculate the loss function of the generator: .
[0046] in, represents the mathematical expectation, , represents the feature diffusion loss, Represents the feature diffusion loss weight.
[0047] Then, with the goal of minimizing the generator's loss function, backpropagation is used to update the current network parameters of the generator until the current braking data sample is input into the generator to obtain the target data sample, and the second label obtained when input into the discriminator is the label representing the real data, then the training of the generator is completed.
[0048] After completing the training of the discriminator and the generator once, it means that one alternating training is completed. At this time, the next alternating training is carried out until the number of alternating training reaches the preset number, which means that the training of the generative adversarial network is completed.
[0049] In this way, the expanded data samples generated by the trained generative adversarial network can have a higher similarity with the braking data samples at the feature level, thereby improving the coverage of the sample set used for braking detection model training and the generalization ability of the model, and further improving the accuracy of the braking detection model for vehicle braking detection.
[0050] In some embodiments, in order to adapt to the performance improvement of the generator and the changes in the braking data samples, at different stages of training, the feature diffusion loss weight Set it dynamically. That is: Feature diffusion loss weight , ; in, represents the initial loss weight, represents the attenuation coefficient, represents the network parameter vector of the generator, represents the network parameter vector of the discriminator, represents the Euclidean distance between the parameter vectors of the generator and the discriminator, represents the normalized sum of the parameter vectors of the generator and the discriminator.
[0051] In some embodiments, the initial loss weight is the initial weight value of the feature diffusion loss weight, which can be set to 0.1. This is the feature diffusion loss weight of the generator in this training. Dynamically adjusted according to the performance of the model during training, which depends on the generator and the discriminator The balance between .
[0052] After completing the training of the generative adversarial network, the braking data samples and random noise can be input into the trained generative adversarial network to obtain an expanded data sample with the same braking state as the braking data sample, and the sample set consisting of each expanded data sample and each braking data sample can be sequentially input into the braking detection model for training.
[0053] In some embodiments, the brake detection model may include a random forest model; According to the sample set composed of each of the braking data samples and each of the expanded data samples, a braking detection model is trained to obtain a trained braking detection model, including: Each data sample in the sample set is input into the random forest model to construct a decision tree. Each construction selects the sample data points and splitting points that reduce the information entropy the most in the data sample according to the conditional information entropy for node splitting until the construction of each decision tree is completed to obtain a trained random forest model.
[0054] In some embodiments, for the random forest model, the random forest model can be initialized first, and the number of decision trees is set to For each decision tree, randomly select data samples and their features from the sample set, which can be expressed as:
[0055] in, represents the random forest model, Indicates decision trees. For example, Can be set to 100.
[0056] Each decision tree is randomly assigned data samples in the sample set to ensure the diversity and robustness of the model. It can be expressed as:
[0057] in, represents the sample set, Indicates The number of features selected by each tree, For the The number of data samples selected by each tree, To allocate to Each data sample of a tree, is the sampling function.
[0058] For any decision tree, the selected data samples can be input into the decision tree for decision tree construction, so that the decision tree selects the sample data points and splitting points that reduce the information entropy the most in the data samples according to the conditional information entropy for node splitting until the construction of the decision tree is completed.
[0059] For example, when constructing a decision tree, the process of selecting sample data points and splitting points for each node can be calculated based on dynamic information entropy. , select sample data points and split point The process can be expressed as:
[0060] in, represents the conditional information entropy, represents the information entropy function, Representation Node Each data sample of According to the sample data points and split point The nodes obtained after splitting For each data sample, when k=L, According to the sample data points and split point The data samples of the left node obtained after segmentation, when k=R, According to the sample data points and split point The data samples of the right node obtained after segmentation, Represents each data sample The number of samples, For selected features The information entropy of is the optimal splitting point.
[0061] by As input, the information entropy function The calculation method can be expressed as:
[0062] in, Yes Category At the node Each data sample The probability in can be expressed as:
[0063] In the formula, Indicates category exist The number of samples in .
[0064] The conditional information entropy is calculated for each possible splitting point of each feature, and the features and splitting points that reduce the conditional information entropy the most are selected for node splitting until the maximum depth of the decision tree is reached or the data sample no longer has splitting value, then a constructed decision tree can be obtained.
[0065] After the decision tree is built, the nodes that provide the minimum information gain can be evaluated and removed according to the preset pruning criteria to optimize the tree structure and reduce complexity. The information gain is , when satisfied When , pruning is performed. is a preset pruning threshold. Preferably, the pruning threshold Set to 0.01.
[0066] Among them, information gain calculation is used to evaluate the node The effectiveness of can be expressed as:
[0067] After all decision trees are optimized, a trained random forest model can be obtained based on each decision tree, so that the trained random forest model integrates the prediction results of all decision trees through majority voting to obtain the final classification decision.
[0068] For example, assuming Indicates A decision tree for a data sample The prediction label of The calculation method can be expressed as:
[0069] in, It is The weight of a decision tree can be calculated as:
[0070] in, It is The accuracy of the decision tree.
[0071] In some embodiments, Figure 2 As shown, a vehicle braking detection method is also provided, comprising: Step 201, obtaining current braking data of the target vehicle; Step 202, inputting the current braking data into a trained braking detection model to obtain a braking detection result of the target vehicle; The current braking data includes a plurality of braking data points, and the braking data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle; The braking detection model is trained by the braking detection model training method described in any of the above embodiments.
[0072] After completing the training of the braking detection model, the current braking data of the target vehicle can be input into the trained braking detection model, so as to output the current braking state of the target vehicle through the braking detection model, thereby realizing braking detection of the target vehicle.
[0073] The braking detection model training device provided in the present application is described below. The braking detection model training device described below and the braking detection model training method described above can be referenced to each other.
[0074] In one embodiment, if Figure 3 As shown, a braking detection model training device is provided, comprising: The data sample expansion module 210 is used to expand any braking data sample marked with a detection label collected from the target vehicle according to the trained generative adversarial network, so as to obtain an expanded data sample having the same detection label as the braking data sample; A detection model training module 220, used to train a braking detection model according to a sample set consisting of each of the braking data samples and each of the expanded data samples to obtain a trained braking detection model; The generative adversarial network is obtained by performing multiple alternating training on the discriminator and the generator of the generative adversarial network, wherein the training of the discriminator includes training the discriminator through the current braking data sample input in each braking data sample and the target data sample currently output by the generative adversarial network; the training of the discriminator includes training the generator through the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the discrimination result of the discriminator on the target data sample; The braking data sample includes a plurality of sample data points, and the sample data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle.
[0075] By performing sample expansion on any braking data sample marked with a detection label according to a trained generative adversarial network, an expanded data sample having the same braking state as the braking data sample is obtained, and a braking detection model is trained according to a sample set consisting of each braking data sample and each expanded data sample to obtain a trained braking detection model; wherein, the generative adversarial network is trained by inputting any braking data sample into the generative adversarial network to be trained for multiple times, and each time the generator and the discriminator of the generative adversarial network are alternately trained through the quantum state vector of the currently input braking data sample and the quantum state vector of the target data sample currently output by the generative adversarial network, until the number of alternating training reaches a preset number; the braking data sample includes multiple sample data points, and the sample data point is one of the battery parameters, vehicle speed, vehicle acceleration or environmental parameters of the vehicle. Therefore, quantum states can be used to expand data samples and control the diversity and quality of generated data samples in order to generate more representative and diverse data samples for model training, thereby effectively solving the problem of insufficient training samples. At the same time, more dimensional data samples that may affect the safety of power batteries are used to train the brake detection model, making the training of the brake detection model more sufficient, thereby improving the accuracy of using the brake detection model to detect the safety of power batteries.
[0076] In one embodiment, the data sample expansion module 210 is further used to: Through high-dimensional feature mapping model , performing feature mapping on the current braking data sample and the target data sample to obtain feature distributions of the current braking data sample and the target data sample in a high-dimensional feature space; Determining feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space according to feature distribution of the current braking data sample and the target data sample in the high-dimensional feature space; in, represents the ReLU nonlinear activation function, represents the preset weight matrix, Preset bias vector, represents the current braking data sample or the target data sample.
[0077] In one embodiment, the data sample expansion module 210 is further used to: The current braking data sample is input into the discriminator to obtain a first label output by the discriminator, and the target data sample is input into the discriminator to obtain a second label output by the discriminator, so as to calculate the loss function of the discriminator according to the first label and the second label, and back-propagate to update the network parameters of the discriminator, until the first label obtained by inputting the current braking data sample into the discriminator is a label representing real data, and the second label obtained by inputting the target data sample into the discriminator is a label representing false data, then the loss function of the generator is calculated according to the second label obtained by inputting the target data sample into the discriminator, and the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the network parameters of the loss discriminator are back-propagated to update, until one alternating training is completed when the target data sample is input into the generator and the second label obtained by inputting the discriminator is a label representing real data.
[0078] In one embodiment, the loss function of the generator includes: ; in, represents the mathematical expectation, , represents the feature diffusion loss, represents the braking data sample, represents a target data sample generated by the generator according to the braking data sample, represents the second tag, represents the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, Represents the feature diffusion loss weight.
[0079] In one embodiment, the feature diffusion loss weight , ; in, represents the initial loss weight, represents the attenuation coefficient, represents the network parameter vector of the generator, represents the network parameter vector of the discriminator, represents the Euclidean distance between the parameter vectors of the generator and the discriminator, represents the normalized sum of the parameter vectors of the generator and the discriminator.
[0080] In one embodiment, the brake detection model comprises a random forest model; The detection model training module 220 is specifically used for: Each data sample in the sample set is input into the random forest model to construct a decision tree. Each construction selects the sample data points and splitting points that reduce the information entropy the most in the data sample according to the conditional information entropy for node splitting until the construction of each decision tree is completed to obtain a trained random forest model.
[0081] In one embodiment, the conditional information entropy ;in, represents the information entropy function, Representation Node Each data sample According to the sample data points and split point The data samples of the nodes obtained after segmentation, when k=L, According to the sample data points and split point The data samples of the left node obtained after segmentation, when k=R, According to the sample data points and split point The data samples of the right node obtained after segmentation, Represents each data sample The number of samples, For selected features The information entropy of is the optimal splitting point.
[0082] In one embodiment, if Figure 4 As shown, a vehicle braking detection device is provided, comprising: The data acquisition module 310 is used to acquire the current braking data of the target vehicle; The vehicle detection module 320 is used to input the current braking data into the trained braking detection model to obtain the braking detection result of the target vehicle; The current braking data includes a plurality of braking data points, and the braking data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle; The braking detection model is trained by the braking detection model training method in any of the above embodiments.
[0083] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the computer program in the memory 830 to execute the braking detection model training method described in any of the above embodiments, or the braking detection method of the vehicle described in any of the above embodiments.
[0084] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0085] On the other hand, an embodiment of the present application also provides a storage medium, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the braking detection model training method provided in the above embodiments, or the vehicle braking detection method provided in the above embodiments.
[0086] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0087] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A braking detection model training method, characterized in that: include: According to the trained generative adversarial network, sample expansion is performed on any braking data sample collected from the target vehicle and marked with a detection label to obtain an expanded data sample having the same detection label as the braking data sample; Training a braking detection model according to a sample set consisting of each of the braking data samples and each of the expanded data samples to obtain a trained braking detection model; The generative adversarial network is obtained by performing multiple alternating training on the discriminator and the generator of the generative adversarial network, wherein the training of the discriminator includes training the discriminator through the current braking data sample input in each braking data sample and the target data sample currently output by the generative adversarial network; the training of the discriminator includes training the generator through the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the discrimination result of the discriminator on the target data sample; The braking data sample includes a plurality of sample data points, and the sample data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle.
2. The brake detection model training method according to claim 1, characterized in that: Also includes: Through high-dimensional feature mapping model , performing feature mapping on the current braking data sample and the target data sample to obtain feature distributions of the current braking data sample and the target data sample in a high-dimensional feature space; Determining feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space according to feature distribution of the current braking data sample and the target data sample in the high-dimensional feature space; in, represents the ReLU nonlinear activation function, represents the preset weight matrix, Preset bias vector, represents the current braking data sample or the target data sample.
3. The brake detection model training method according to claim 1 or 2, characterized in that: The alternating training includes: The current braking data sample is input into the discriminator to obtain a first label output by the discriminator, and the target data sample is input into the discriminator to obtain a second label output by the discriminator, so as to calculate the loss function of the discriminator according to the first label and the second label, and back-propagate to update the network parameters of the discriminator, until the first label obtained by inputting the current braking data sample into the discriminator is a label representing real data, and the second label obtained by inputting the target data sample into the discriminator is a label representing false data, then the loss function of the generator is calculated according to the second label obtained by inputting the target data sample into the discriminator, and the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the network parameters of the loss discriminator are back-propagated to update, until one alternating training is completed when the target data sample is input into the generator and the second label obtained by inputting the discriminator is a label representing real data.
4. The brake detection model training method according to claim 3, characterized in that: The loss function of the generator includes: ; in, represents the mathematical expectation, , represents the feature diffusion loss, represents the braking data sample, represents a target data sample generated by the generator according to the braking data sample, represents the second tag, represents the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, Represents the feature diffusion loss weight.
5. The brake detection model training method according to claim 4, characterized in that: The feature diffusion loss weight , ; in, represents the initial loss weight, represents the attenuation coefficient, represents the network parameter vector of the generator, represents the network parameter vector of the discriminator, represents the Euclidean distance between the parameter vectors of the generator and the discriminator, represents the normalized sum of the parameter vectors of the generator and the discriminator.
6. The brake detection model training method according to any one of claims 1, 2, 4 or 5, characterized in that: The braking detection model includes a random forest model; According to the sample set composed of each of the braking data samples and each of the expanded data samples, a braking detection model is trained to obtain a trained braking detection model, including: Each data sample in the sample set is input into the random forest model to construct a decision tree. Each construction selects the sample data points and splitting points that reduce the information entropy the most in the data sample according to the conditional information entropy for node splitting until the construction of each decision tree is completed to obtain a trained random forest model.
7. The brake detection model training method according to claim 6, characterized in that: The conditional information entropy ;in, represents the information entropy function, Representation Node Each data sample of According to the sample data points and split point The data samples of the nodes obtained after segmentation, when k=L, According to the sample data points and split point The data samples of the left node obtained after segmentation, when k=R, According to the sample data points and split point The data samples of the right node obtained after segmentation, Represents each data sample The number of samples, For selected features The information entropy of is the optimal splitting point.
8. A vehicle braking detection method, characterized in that: include: Get the current braking data of the target vehicle; Inputting the current braking data into a trained braking detection model to obtain a braking detection result of the target vehicle; The current braking data includes a plurality of braking data points, and the braking data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle; The braking detection model is trained by the braking detection model training method described in any one of claims 1-7.
9. A braking detection model training device, characterized in that: include: A data sample expansion module is used to expand any braking data sample marked with a detection label collected from the target vehicle according to the trained generative adversarial network, so as to obtain an expanded data sample having the same detection label as the braking data sample; A detection model training module, used to train a braking detection model according to a sample set consisting of each of the braking data samples and each of the expanded data samples to obtain a trained braking detection model; The generative adversarial network is obtained by performing multiple alternating training on the discriminator and the generator of the generative adversarial network, wherein the training of the discriminator includes training the discriminator through the current braking data sample input in each braking data sample and the target data sample currently output by the generative adversarial network; the training of the discriminator includes training the generator through the feature similarity between the current braking data sample and the target data sample in the high-dimensional feature space, and the discrimination result of the discriminator on the target data sample; The braking data sample includes a plurality of sample data points, and the sample data point is one of the braking pressure, braking distance, braking time, braking temperature, vehicle weight, tire wear degree and ABS status of the target vehicle.
10. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the braking detection model training method described in any one of claims 1 to 7, or the vehicle braking detection method described in claim 8 is implemented.
Citation Information
Patent Citations
Electricity stealing sample generation method and device, computer equipment and storage medium
CN113673564A
Training method of generative adversarial network, data classification method and related equipment
CN114118345A
Fingerprint identification model training method and device, fingerprint identification method and device and related equipment
CN115862075A
Training method and identification method of traffic accident identification model, and electronic equipment
CN116628500A
Face restoration method based on multi-scale face analysis graph fusion
CN116664435A