Electronic control detection model training method, electronic control system detection method and device
By generating new electronic control data samples, expanding the sample set and using dynamic neighborhood and feature adjustment functions, the sample imbalance problem in the electronic control detection model is solved, and the fault recognition accuracy and model generalization ability are improved.
Patent Information
- Application Number
- CN202410489966.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-04-23
AI Technical Summary
When faced with samples of multiple fault types, the existing electronic control detection model is limited by sample imbalance problem, resulting in a decline in classification capability, especially the small number of fault type samples that are difficult to fully learn, which in turn affects the accuracy of fault identification.
By generating new electronic control data samples, expanding the sample set, using dynamic neighborhood and feature adjustment functions, more representative samples are generated to train the model, ensuring that the model fully learns a small amount of fault type data.
It effectively solves the problems of insufficient training samples and unbalanced data, improves the accuracy of the electronic control detection model for identifying fault types, and enhances the generalization ability and diagnostic accuracy of the model.
Smart Images

Figure CN118092403B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic control detection technology, and in particular to an electronic control detection model training method, an electronic control system detection method and device. Background Art
[0002] The electronic control system is one of the core technologies of industrial equipment. Its stability and reliability are crucial to ensure the normal operation and safety of the equipment. Therefore, in order to realize the fault detection of the electronic control system, the detected electronic control data, such as the temperature data of the motor, can be input into the electronic control detection model based on neural network training for detection, so as to judge the fault type corresponding to the electronic control data according to the fault label output by the electronic control detection model. Therefore, the fault identification accuracy of the electronic control system depends on the electronic control detection model.
[0003] In the related art, for the training of the electronic control detection model for electronic control system detection, the electronic control data corresponding to various fault types are used as data samples and input into the initial model for training to obtain the electronic control detection model. However, in actual situations, the electronic control data of different fault types present a long-tail distribution, and the samples are extremely unbalanced, resulting in a decrease in the classification ability of the model when facing samples of multiple fault types, and an increase in the difficulty of training. At the same time, due to the imbalance of samples of electronic control data of different fault types, the number of samples of electronic control data of most fault types is usually small. Therefore, during the training process, the model will tend to favor fault types with a large number of samples, and fault types with a small number will not be fully learned. Although the downsampling method can be used to make samples with fewer fault types be used repeatedly, this method is likely to cause overfitting of the model, affecting the accuracy of the electronic control detection model in identifying the fault types corresponding to the electronic control data. 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 an electric control detection model training method, which can improve the accuracy of the electric control detection model in identifying the fault type corresponding to the electric control data.
[0005] According to the first aspect of the present application, the electronic control detection model training method includes:
[0006] Determine the current dynamic neighborhood of any of the electric control data samples according to the feature vector distance between each electric control data sample in the current sample set and the preset number of neighbors;
[0007] Generate new electronically controlled data samples multiple times according to the target data samples in each of the electronically controlled data samples and each electronically controlled data sample in the current dynamic domain of the target data sample, and add them to the current sample set, so as to update the current dynamic neighborhood of each of the electronically controlled data samples based on the updated current sample set, until the number of iterations of the current sample set reaches a preset number, thereby obtaining a target sample set;
[0008] Training an electric control detection model according to each of the electric control data samples in the target sample set to obtain a trained electric control detection model;
[0009] Among them, the number of electronic control data samples corresponding to the actual fault type to which the target data sample belongs is less than a preset value.
[0010] The current dynamic neighborhood of any electric control data sample is determined by the feature vector distance between each electric control data sample in the current sample set and the preset number of neighbors, and new electric control data samples are generated multiple times according to the target data samples in each electric control data sample and each electric control data sample in the current dynamic field of the target data sample, and added to the current sample set, so as to update the current dynamic neighborhood of each electric control data sample based on the updated current sample set, until the number of iterations of the current sample set reaches the preset number, and after the target sample set is obtained, the electric control data samples in the target sample set are used to train the electric control detection model to obtain a trained electric control detection model, so that data samples with fewer fault types can be expanded to generate more representative and diverse electric control data samples to train the model, thereby effectively solving the problems of insufficient training samples and data imbalance, improving the training effect of the electric control detection model, and further improving the recognition accuracy of the electric control detection model for the actual fault type corresponding to the electric control data.
[0011] According to an embodiment of the present application, generating a new electronically controlled data sample according to a target data sample in each of the electronically controlled data samples and each electronically controlled data sample in a current dynamic field of the target data sample includes:
[0012] The target data sample and each electric control data sample in the current dynamic field of the target data sample are input into the synthesis parameter , generating deterministic equivalent samples ;
[0013] According to the adjustment formula , adjusting the deterministic equivalent sample to generate a new electronic control data sample;
[0014] in, Represents the target data sample , with the target data sample Each electronic control data sample in the current dynamic field The difference function between represents the weight factor, Indicates the preset number of neighbors, represents the new electronic control data sample, represents the feature adjustment function, Including preset feature expansion coefficients and preset offsets, Represents the preset impact factor of the target data sample.
[0015] According to one embodiment of the present application, it also includes:
[0016] After each new electronic control data sample is obtained, the actual fault type corresponding to the new electronic control data sample and the adjustment function are adjusted. , updating the weight factor, the preset feature expansion coefficient and the preset offset;
[0017] in, represents the parameter adjustment function, represents the gradient of the fitness function, Indicates the corresponding actual fault type, Represents the fitness function.
[0018] According to one embodiment of the present application, the electronic control detection model includes a feature extraction sub-model;
[0019] According to each of the electric control data samples in the target sample set, an electric control detection model is trained to obtain a trained electric control detection model, including:
[0020] The target fitness of each network parameter in the network parameter set of the feature extraction sub-model is determined multiple times based on the electric control data samples in the target sample set. Each time, after selecting one of the network parameters as the current network parameter of the feature extraction sub-model, the target fitness of the current network parameter in the feature extraction sub-model is calculated based on the predicted fault type obtained after the electric control data sample is input into the electric control detection model and the actual fault type of the electric control data sample, so as to generate a target network parameter based on the target fitness of the current network parameter and add it to the network parameter set until the target fitness of the target network parameter reaches a preset value, or the number of updates of the network parameter set reaches a preset number, and a trained feature extraction sub-model is generated based on the target network parameter.
[0021] According to an embodiment of the present application, according to the predicted fault type obtained after the electric control data sample is input into the electric control detection model and the actual fault type of the electric control data sample, the target fitness of the current network parameter in the feature extraction submodel is calculated, so as to generate the target network parameter according to the target fitness of the current network parameter and add it to the network parameter set, including:
[0022] The predicted fault type of the electric control data sample and the actual fault type of the electric control data sample are input into a nonlinear function , get the initial fitness of the current i-th network parameter in the feature extraction sub-model ;
[0023] The initial fitness Enter the fitness function , get the individual fitness of the current i-th network parameter ;
[0024] According to the function And the function , obtain the target fitness of the current i-th network parameter;
[0025] According to the function , get the target network parameters adding to the network parameter set;
[0026] in:
[0027] , and represents the weights and biases in the i-th network parameters, is a function of genetic factors, is the inverse of the loss function determined according to the predicted fault type and the actual fault type, is a nonlinear function that describes the dynamic interaction between the current i-th network parameter and the environmental variable. Sig() is the Sigmoid activation function. is the preset weight coefficient;
[0028] , and Represents the preset weight coefficient, represents the variance of the weight and the bias;
[0029] , Represents the preset weight coefficient, Represents the environment variable elements, Representation and environment variables The associated input features, represents the hyperbolic tangent function;
[0030] , represents the loss function, Indicates the actual fault type, is the predicted fault type, obtained by a preset Softmax function;
[0031] Represents the weight adjustment coefficient, which represents the degree of influence of the interaction between network parameters. Indicates the current network parameters and network parameter sets The interaction strength between the network parameters is Indicates the current network parameters and network parameter sets The competition intensity between network parameters, , , , and Respectively represent The network parameters and The network parameters are The demand for resources, Indicates the total number of resource categories. , , and represent the adaptive functions for adjusting the competition and symbiosis intensity, represents the performance feedback function, express The amount of change;
[0032] represents the ecological interaction matrix, with elements Indicates The network parameters and The type of relationship between the network parameters, Indicates the preset environment complexity coefficient, represents the environmental change factor, ;
[0033] , Indicates the preset step size, Represents the gradient pointing in the direction of maximum fitness increase.
[0034] According to one embodiment of the present application, the electronic control detection model includes a feature dimensionality reduction sub-model;
[0035] According to each of the electric control data samples in the target sample set, an electric control detection model is trained to obtain a trained electric control detection model, including:
[0036] Inputting each of the electric control data samples into a trained feature extraction sub-model to obtain feature data of each of the electric control data samples;
[0037] Input each of the feature data into the encoder of the feature dimension reduction sub-model in sequence, and after obtaining the compressed data output by the encoder each time, input the compressed data into the decoder to obtain reconstructed data, and according to the matching result between the feature data and the reconstructed data, use the gradient descent method to adjust the network parameters of the encoder and the decoder through error back propagation, and then perform the next training until the number of training times reaches the preset number;
[0038] In each training, when the loss of the encoder drops to a preset threshold, the parameter adjustment of the encoder is suspended; when the loss value of the decoder drops to a preset threshold, the parameter adjustment of the decoder is suspended.
[0039] According to one embodiment of the present application, the electronic control detection model includes a classification sub-model;
[0040] According to each of the electric control data samples in the target sample set, an electric control detection model is trained to obtain a trained electric control detection model, including:
[0041] Inputting the feature data of each of the electric control data samples into the trained feature dimension reduction sub-model to obtain the target feature of each of the electric control data samples;
[0042] Each of the target features is input into the classification sub-model in sequence, and the classification sub-model is trained by the extreme learning machine algorithm. When the prediction accuracy of the classification sub-model trained by the extreme learning machine algorithm does not reach a preset value at any time, the network parameters of the classification sub-model are reset to retrain the classification sub-model until the predicted fault type obtained by the target feature of the electric control data sample input each time matches the actual fault type corresponding to the electric control data sample input this time, thereby obtaining the trained classification sub-model.
[0043] According to the second aspect of the present application, the electronic control system detection method includes:
[0044] Acquire the electronic control data to be tested;
[0045] Inputting the electric control data into a trained electric control detection model to obtain an actual fault type of the electric control data;
[0046] Wherein, the electronic control detection model is trained by the electronic control detection model training method described in any of the above embodiments.
[0047] According to the third aspect of the present application, the electronic control detection model training device includes:
[0048] A dynamic domain determination module, used to determine the current dynamic neighborhood of any of the electric control data samples according to the feature vector distance between the electric control data samples in the current sample set and the preset number of neighbors;
[0049] A data sample expansion module, used for generating new electronically controlled data samples according to target data samples in each of the electronically controlled data samples and each electronically controlled data sample in the current dynamic domain of the target data sample for multiple times, and adding the new electronically controlled data samples to the current sample set, so as to update the current dynamic neighborhood of each of the electronically controlled data samples based on the updated current sample set, until the number of iterations of the current sample set reaches a preset number, thereby obtaining a target sample set;
[0050] A detection model training module, used to train an electric control detection model according to each of the electric control data samples in the target sample set to obtain a trained electric control detection model;
[0051] Among them, the number of electronic control data samples corresponding to the actual fault type to which the target data sample belongs is less than a preset value.
[0052] According to the fourth aspect of the present application, the electric control detection model training device includes:
[0053] An electric control data acquisition module, used for acquiring electric control data to be detected;
[0054] An electric control system detection module, used for inputting the electric control data into a trained electric control detection model to obtain an actual fault type of the electric control data;
[0055] Wherein, the electronic control detection model is trained by the electronic control detection model training method described in any of the above embodiments.
[0056] According to the electronic device of the fifth aspect of the present application, the electronic device includes a processor and a memory storing a computer program. When the processor executes the computer program, the electronic control detection model training method described in any of the above embodiments or the electronic control system detection method described in any of the above embodiments is implemented.
[0057] According to the computer-readable storage medium of the fourth aspect of the present application, a computer program is stored thereon, and when the computer program is executed by a processor, the electronic control detection model training method described in any of the above embodiments, or the electronic control system detection method described in any of the above embodiments is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] 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.
[0059] Figure 1 It is a flowchart of the electric control detection model training method provided in the embodiment of the present application;
[0060] Figure 2 It is a flow chart of the electric control system detection method provided in the embodiment of the present application;
[0061] Figure 3 It is a structural schematic diagram of the electric control detection model training device provided in an embodiment of the present application;
[0062] Figure 4 is a schematic diagram of the structure of an electric control system detection device provided in an embodiment of the present application;
[0063] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] 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.
[0065] Below, the electronic control detection model training method, electronic control system detection method and device provided in the embodiments of the present application will be introduced and explained in detail through several specific embodiments.
[0066] In one embodiment, a method for training an electric control detection model is provided, which is applied to a terminal device for training an electric control 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.
[0067] like Figure 1As shown, this embodiment provides an electric control detection model training method, the method comprising:
[0068] Step 101, determining a current dynamic neighborhood of any of the electric control data samples according to the feature vector distance between the electric control data samples in the current sample set and the preset number of neighbors;
[0069] Step 102, generating new electronically controlled data samples multiple times according to the target data samples in each of the electronically controlled data samples and each electronically controlled data sample in the current dynamic domain of the target data sample, and adding the new electronically controlled data samples to the current sample set, so as to update the current dynamic neighborhood of each of the electronically controlled data samples based on the updated current sample set, until the number of iterations of the current sample set reaches a preset number, thereby obtaining a target sample set;
[0070] Step 103, training an electric control detection model according to each of the electric control data samples in the target sample set to obtain a trained electric control detection model;
[0071] Among them, the number of electronic control data samples corresponding to the actual fault type to which the target data sample belongs is less than a preset value.
[0072] In some embodiments, multiple electric control data samples of determined actual fault types may be collected to form an original sample set. The actual fault types may include various fault types such as minor faults, major faults, and emergency shutdowns. The electric control data samples may be readings of sensors of the electric control system, or events of the electric control system during operation recorded in the system log of the electric control system. Exemplarily, the electric control data samples may be the temperature of the motor in the electric control system, the power of the motor, the operating time of the electric control system, and the like.
[0073] After obtaining the original sample set, each electric control sample data obtained in the original sample set can be vectorized to obtain each electric control data sample represented by a feature vector. For example, the original data set can be represented as ,in is the electric control data sample represented by the feature vector, Indicates the actual fault type corresponding to the electronic control sample data, is the number of electronic control data samples.
[0074] After obtaining the original sample set, the original sample set can be used as the current sample set, and then the dynamic neighborhood selection of each electric control data sample in the current sample set is performed based on the feature vector distance between each electric control data sample in the current sample set and the preset number of neighbors. For example, for each electric control data sample in the current sample set, the size of its current dynamic neighborhood is determined based on the feature vector distance of its k-nearest neighbor (k-NN) and the preset number of neighbors, ensuring that the selection of the neighborhood can reflect the characteristics of the local data structure and adapt to the global distribution of the data. For example, assuming that the preset number of neighbors is 5, for a certain electric control data sample, the 5 electric control data samples with the closest feature vector distance to it can be obtained from the current sample set to form the current dynamic neighborhood of the electric control data sample.
[0075] After determining the current dynamic domain of each electric control data sample, the electric control data sample whose number of electric control data samples of the actual fault type is less than the preset value can be used as the target data sample, and then the target data sample is combined with each electric control data sample in its current dynamic domain to form a new electric control data sample to be added to the current sample set to update the current sample set. After the current sample set is updated, the current dynamic neighborhood of any electric control data sample can be updated again based on the feature vector distance between each electric control data sample in the updated current sample set and the preset number of neighbors, and then a new electric control data sample is generated based on the target data sample in each electric control data sample and each electric control data sample in the current dynamic domain of the target data sample, and the actual fault type of the new electric control data sample is determined based on the actual fault type to which the target data sample belongs, that is, the new electric control data sample is the same as the actual fault type to which the target data sample belongs. And so on, until the number of iterations of the current sample set reaches a preset number, such as 500 times, or the number of samples in each actual fault type reaches the set value, the update is stopped, and the current sample set obtained at this time is used as the target sample set for subsequent training of the electronic control detection model.
[0076] Among them, for the generation of new electric control data samples, the deterministic equivalent SMOTE algorithm can be used to perform adaptive heterogeneous data generation on the target data sample and each electric control data sample in the current dynamic field of the target data sample to obtain a new electric control data sample. For example, in the current dynamic field of the target data sample, a new electric control data sample is generated according to a preset generation strategy and an adaptive adjustment factor. Exemplarily, for the target data sample , the way to generate new electric control data samples can be expressed as:
[0077]
[0078] in, Represents the target sample And each electronic control data sample in its current dynamic field The difference function between is the weight factor, indicating the importance of the neighbor, This is the preset number of neighbors, which can be set according to actual conditions. For example, it can be set to 5. is a deterministic equivalent sample generated by a deterministic equivalent process.
[0079] After obtaining the deterministic equivalent sample After that, the deterministic equivalent sample Mark as new electronic control data sample.
[0080] After obtaining the target sample set, each electronic control data sample in the target sample set can be input into the electronic control detection model for training to obtain a trained electronic control detection model. For example, each electronic control data sample in the target sample set is input into the trained electronic control detection model in sequence. After obtaining the predicted fault type output by the electronic control detection model each time, the predicted fault type is matched with the actual fault type corresponding to the electronic control data sample input this time. In the case where the two do not match, the gradient descent method is used to adjust the network parameters of the electronic control detection model through error back propagation, and then the next training is performed until the predicted fault type obtained by each input electronic control data sample matches the actual fault type corresponding to the input electronic control data sample this time, which means that the training of the electronic control detection model is completed and the pre-trained electronic control detection model is obtained.
[0081] The current dynamic neighborhood of any electric control data sample is determined by the feature vector distance between each electric control data sample in the current sample set and the preset number of neighbors, and new electric control data samples are generated multiple times according to the target data samples in each electric control data sample and each electric control data sample in the current dynamic field of the target data sample, and added to the current sample set, so as to update the current dynamic neighborhood of each electric control data sample based on the updated current sample set, until the number of iterations of the current sample set reaches the preset number, and after the target sample set is obtained, the electric control data samples in the target sample set are used to train the electric control detection model to obtain a trained electric control detection model, so that data samples with fewer fault types can be expanded to generate more representative and diverse electric control data samples to train the model, thereby effectively solving the problems of insufficient training samples and data imbalance, improving the training effect of the electric control detection model, and further improving the recognition accuracy of the electric control detection model for the actual fault type corresponding to the electric control data.
[0082] In order to further improve the training effect of the electric control detection model, in some embodiments, according to the target data sample in each of the electric control data samples and each electric control data sample in the current dynamic field of the target data sample, a new electric control data sample is generated, including:
[0083] The target data sample and each electric control data sample in the current dynamic field of the target data sample are input into the synthesis parameter , generating deterministic equivalent samples ;
[0084] According to the adjustment formula , adjusting the deterministic equivalent sample to generate a new electronic control data sample;
[0085] in, Represents the target data sample , with the target data sample Each electronic control data sample in the current dynamic field The difference function between represents the weight factor, Indicates the preset number of neighbors, represents the new electronic control data sample, represents the feature adjustment function, Including preset feature expansion coefficients and preset offsets, Represents the preset impact factor of the target data sample.
[0086] In some embodiments, for the generation of new electric control data samples, it is possible to first generate a target data sample based on the target data sample. Generate deterministic equivalent samples , specifically:
[0087]
[0088] After getting the deterministic equivalent sample Finally, the nonlinear relationship and diversity of sample features can be combined to generate richer and more diverse electric control data samples. For example, influencing factors can be introduced to adjust the target data samples. The expansion strength is as follows:
[0089]
[0090] in, Represents the target data sample The uncertainty measure in the original model is, and are the sensitivity and threshold parameters of the impact factor, respectively. Sensitivity and threshold are set to 0.1 and 0.5 respectively.
[0091] In determining the impact factor and the certainty equivalent sample After that, you can adjust the formula , adjust the deterministic equivalent sample to obtain a new electronic control data sample In this way, the target sample set obtained subsequently can be made richer and more diverse, thereby improving the training effect of the electronic control detection model.
[0092] In some embodiments, in order to further improve the training effect of the electric control detection model, after each new electric control data sample is obtained, the actual fault type corresponding to the new electric control data sample and the adjustment function , updating the weight factor, the preset feature expansion coefficient and the preset offset;
[0093] in, represents the parameter adjustment function, represents the gradient of the fitness function, Indicates the corresponding actual fault type, Represents the fitness function.
[0094] In some embodiments, each time a new electronic control data sample is obtained, the quality and diversity of the generated sample can be adaptively evaluated by the fitness function to ensure that the new sample can effectively improve the generalization ability and diagnostic accuracy of the model. The fitness function takes into account factors such as sample distribution consistency, boundary clarity, and intra-class diversity. Evaluate generated samples The quality of the and , the adjustment method can be expressed as:
[0095]
[0096] For example, the parameters The initial feature expansion factor and initial offset in can be set to 1.2 and 0.1 respectively.
[0097] By expanding the data of the current sample set in the above way, the target sample set can be finally obtained. ,in represents the electric control data samples in the target sample set, Indicates the actual fault type of the electronic control data sample, is the number of samples after expansion.
[0098] After obtaining the target sample set, the target sample set can be input into the electric control detection model for training to obtain a trained electric control detection model.
[0099] In some embodiments, the electric control detection model may include a feature extraction sub-model, a feature dimension reduction sub-model, and a classification sub-model. By training the feature extraction sub-model, the feature dimension reduction sub-model, and the classification sub-model, a trained electric control detection model can be obtained. The training of the feature extraction sub-model includes:
[0100] The target fitness of each network parameter in the network parameter set of the feature extraction sub-model is determined multiple times based on the electric control data samples in the target sample set. Each time, after selecting one of the network parameters as the current network parameter of the feature extraction sub-model, the target fitness of the current network parameter in the feature extraction sub-model is calculated based on the predicted fault type obtained after the electric control data sample is input into the electric control detection model and the actual fault type of the electric control data sample, so as to generate a target network parameter based on the target fitness of the current network parameter and add it to the network parameter set until the target fitness of the target network parameter reaches a preset value, or the number of updates of the network parameter set reaches a preset number, and a trained feature extraction sub-model is generated based on the target network parameter.
[0101] In some embodiments, the feature extraction submodel may include an input layer, a hidden layer, and an output layer, wherein the number of neurons in the input layer is determined according to the number of samples in the target sample set, and the hidden layer may be a multi-layer hidden layer, such as 2 hidden layers, each of which is provided with a different number of neurons, such as 50 and 80 neurons in the 2 hidden layers. The output layer may be provided with a larger number of neurons, such as 100 neurons.
[0102] When training the feature extraction sub-model, an ecosystem including N network parameters can be constructed first. Each network parameter can include the weight of the neural network. and bias After selecting a network parameter, assuming that the i-th network parameter is the current network parameter of the feature extraction sub-model, the electric control data sample is input into the electric control detection model to obtain the predicted fault type output by the electric control detection model. , and then based on the predicted fault type and actual fault types of electronic control data samples , through the performance evaluation function , evaluate the current network parameters Among them, Represents the loss function.
[0103] Then, the initial fitness of the current network parameters is evaluated, specifically:
[0104]
[0105] in, Represents environment variables, Represents genetic factors, is the i-th network parameter, that is, the current network parameter, including weight and bias ; is the initial fitness of the individual. is a function of genetic factors, is the inverse of the loss function, is a nonlinear function that describes the dynamic interaction between the current ith network parameter and the environmental variables. Sig() is the Sigmoid activation function. is the weight coefficient, which is used to balance the contribution of each factor to fitness.
[0106] Furthermore, the genetic factor function Considering the diversity and complexity of parameters, the calculation method can be expressed as:
[0107]
[0108] in, and is the weight coefficient, which is used to adjust the contribution of each item; Represents the variance of weights and biases, which is used to measure the diversity of parameters.
[0109] Environmental Interaction Function It is used to simulate the interaction between the current i-th network parameters and the environment, which can be expressed as:
[0110]
[0111] in, is the weight coefficient, Represents the environment variable elements, Delegates and Environment Variables The associated input features, is the hyperbolic tangent function.
[0112] Then, according to the fitness function , you can get the current network parameters, that is, the fitness of the i-th network parameters , according to the fitness , determine the current network parameters, that is, the target fitness of the i-th network parameter. As the target fitness of the current network parameters. Represents the initial fitness of the jth network parameter.
[0113] in, To consider the fitness after ecological interactions; is the weight adjustment coefficient, which represents the influence degree of interaction between different network parameters, that is, between different individuals; and is the ecological interaction parameter after adaptive adjustment. Can be set to 0.5.
[0114] Ecological interaction intensity Refers to the two network parameters in the ecosystem and Between two individuals and The degree of mutual influence between and symbiotic strength , which can be expressed as:
[0115]
[0116] in, is an intensity-adjusting balance factor that adjusts the relative importance of competition and symbiosis. Can be set to 0.6.
[0117] Competition intensity It can be calculated based on resource requirements and overlap, and the calculation method can be expressed as:
[0118]
[0119] in, is the network parameter and Between two individuals and The intensity of competition between and Represents network parameters and , that is, individual and For The demand for resources, is the total number of resource categories, exponential function The role of is to smooth the impact of different network parameters, that is, the demand differences between different individuals, to ensure that even small demand differences can be reflected in the competition intensity.
[0120] Moreover, the symbiotic strength It reflects two network parameters, namely the degree of mutual cooperation between two individuals, measured by the efficiency of their shared resources, which can be expressed as:
[0121]
[0122] in, is the network parameter and Between, that is, individuals and The strength of symbiosis between them.
[0123] and The adaptive adjustment is based on the ecological network status assessment Adjust for competitive intensity and symbiotic strength Perform adaptive adjustment, the adjustment method can be expressed as:
[0124]
[0125]
[0126] in, and are adaptive functions that adjust the intensity of competition and symbiosis, is the performance feedback function, represent The amount of change in , that is, the difference between the current evaluation and the previous evaluation.
[0127] Furthermore, the performance feedback function The overall status of the current ecological network is evaluated based on the performance of the neural network on the validation set. In one embodiment, the performance feedback function The calculation method can be expressed as:
[0128]
[0129] in, is the weight coefficient, which is used to balance the contribution of different indicators.
[0130] And, the functions of each component are:
[0131] Accuracy Function :
[0132] Complexity Function :
[0133] Diversity function :
[0134] Time function :
[0135] in, is the accuracy, is the average loss value; is the network complexity, which is proportional to the number of parameters in this embodiment; is the data diversity index, which is proportional to the variance of data features; is the training time, which is proportional to the number of iterations.
[0136] After obtaining the target fitness of the current network parameters, the target network parameters can be generated according to the target fitness, specifically:
[0137]
[0138] in, represents the target network parameters, Indicates the current network parameters. is the learning rate, which represents the step size of parameter update; is the gradient pointing in the direction of maximum fitness increase. For example, Can be set to 0.01.
[0139] After obtaining the target network parameters, the target network parameters can be added to the network parameter set to update the network parameter set, and then the network parameters whose target fitness has not been calculated are selected from the network parameter set and updated to the current network parameters of the feature extraction sub-model. For example, the target network parameters are updated to the current network parameters of the feature extraction sub-model, and then the above operation is performed again, and so on, until the target fitness of the target network parameters reaches the preset value, or the number of updates of the network parameter set reaches the preset number, then the target network parameters are used as the final network parameters of the feature extraction sub-model to generate a trained feature extraction sub-model.
[0140] In order to improve the optimization efficiency of the network parameters of the feature extraction sub-model and the performance of the model, in some embodiments, according to the predicted fault type obtained after the electric control data sample is input into the electric control detection model and the actual fault type of the electric control data sample, the target fitness of the current network parameters in the feature extraction sub-model is calculated, and the target network parameters are generated according to the target fitness of the current network parameters and added to the network parameter set, including:
[0141] The predicted fault type of the electric control data sample and the actual fault type of the electric control data sample are input into the function , get the initial fitness of the current i-th network parameter in the feature extraction sub-model ;
[0142] The initial fitness Enter the fitness function , get the individual fitness of the current i-th network parameter ;
[0143] According to the function And the function , obtain the target fitness of the current i-th network parameter;
[0144] According to the function , get the target network parameters adding to the network parameter set;
[0145] in, , represents the ecological interaction matrix, with elements Indicates The network parameters and The type of relationship between the network parameters, Indicates the preset environment complexity coefficient, represents the environmental change factor, .
[0146] In some embodiments, when calculating the individual fitness of the current i-th network parameter After that, the natural selection process is simulated to select network parameters with higher fitness, that is, individuals with higher fitness reproduce, while individuals with lower fitness are eliminated. Probability of being selected The calculation method can be expressed as:
[0147]
[0148] in, For individuals The probability of being selected.
[0149] Then, the selected individuals are regenerated and reproduced to simulate the genetic variation process of organisms. Individuals with higher fitness produce offspring through crossover and mutation operations in genetic algorithms. Specifically, suppose and is the parent individual, and its offspring Produced by the following crossover formula:
[0150]
[0151] in, is the crossover coefficient, which determines the fusion ratio of the genetic information of the parents; and is the parameter set of the parent individual. For example, Can be set to 0.7.
[0152] The mutation operation adds a random perturbation to achieve, whose size is affected by the mutation rate The control can be expressed as:
[0153]
[0154] in, is the parameter set of the offspring individuals; ' is the mutation rate, which controls the magnitude of the mutation operation. For example, the mutation rate Can be set to 0.1.
[0155] Genetic variation perturbation The role of is to increase the diversity of the population. The calculation method of this disturbance term can be expressed as:
[0156]
[0157] in, is the random perturbation in the mutation operation, is the disturbance amplitude control coefficient, is a Random vectors of the same dimension whose elements are uniformly distributed For example, Can be set to 0.05 to control the magnitude of variation.
[0158] After regeneration and reproduction, simulate the ecological interactions between individuals, such as competition and symbiosis, which affect the fitness and survival of individuals. Specifically, you can set the ecological interaction matrix , where the elements Represents an individual and The relationship type between them, which will affect the fitness update of the individual, can be expressed as:
[0159]
[0160] in, is the fitness update function after considering ecological interactions.
[0161] Then, the impact of environmental changes on the ecosystem, such as changes in resources, new adaptive challenges, etc., is simulated to force individuals to adapt to the new environment, leading to further optimization of parameters within the ecosystem. Specifically, environmental changes are achieved by modifying the environmental complexity coefficient To simulate, thus affecting the fitness calculation of individuals, the fitness adjustment caused by environmental pressure can be expressed as:
[0162]
[0163] in, is the final adjusted fitness, The environmental complexity coefficient is preset manually; is the environmental change factor, which describes the degree of environmental change from the previous generation to the current generation. The calculation method can be expressed as:
[0164]
[0165] in, Is an individual The fitness in the current environment, that is, the target fitness of the current i-th network parameter, is the fitness in the previous generation environment, is the environmental change factor.
[0166] After obtaining the target fitness of the i-th network parameter, the parameters of the neural network can be updated according to the fitness of individuals in the ecosystem and the ecological dynamics. Specifically, the fitness adjusted based on ecological interactions and environmental pressures , update the network parameters, which can be expressed as: .
[0167] In some embodiments, after the training of the feature extraction sub-model is completed, each electric control data sample in the target sample set can be input into the trained feature extraction sub-model to obtain feature data of each electric control data sample, and then the feature data of each electric control data sample is sequentially input into the encoder of the feature dimension reduction sub-model, and each time the compressed data output by the encoder is obtained, the compressed data is input into the decoder to obtain reconstructed data, and according to the matching result of the feature data and the reconstructed data, the gradient descent method is used to adjust the network parameters of the encoder and the decoder through error back propagation, and then the next training is performed until the number of training times reaches the preset number;
[0168] In each training, when the loss of the encoder drops to a preset threshold, the parameter adjustment of the encoder is suspended; when the loss value of the decoder drops to a preset threshold, the parameter adjustment of the decoder is suspended.
[0169] In some embodiments, before training the feature dimensionality reduction sub-model, the initial structure of the feature dimensionality reduction sub-model can be set, including the neural network layers and number of neurons of the encoder and decoder. The initial weights use small random values, and the bias term is set to a small constant. Specifically, the weight matrix of the encoder is set to , the bias vector is , the weight matrix of the decoder is , the bias vector is , then the initialization process can be expressed as:
[0170]
[0171]
[0172]
[0173]
[0174] in, The mean is 0 and the variance is The normal distribution of is a small constant.
[0175] Then, the characteristic data of the electronic control data sample is input into the encoder, and the compressed data is obtained through the weighted sum of the activation function and the network layer. The compressed data is then input into the decoder, reconstructed through forward propagation, and the reconstructed data is output. Assume that the input vector is , the encoding process can be expressed as:
[0176]
[0177] The decoding process is expressed as:
[0178]
[0179] in, is the ReLU activation function. Indicates compressed data. Represents reconstructed data.
[0180] Then, the information entropy loss function is combined with the traditional mean square error loss function to calculate the difference between the reconstructed data and the feature data. The calculation of the loss function is not only based on the reconstruction error, but also takes into account the information entropy of the data to optimize the expression ability of the feature. The loss function The calculation method can be expressed as:
[0181]
[0182] Among them, the calculation method of the mean square error loss function can be expressed as:
[0183]
[0184] Moreover, the calculation method of information entropy loss can be expressed as:
[0185]
[0186] , and is a coefficient used to balance the two losses, which can be a preset value. For example, the balance coefficient in the loss function is and Can be set to 0.7 and 0.3 respectively.
[0187] Then, the gradient of the loss function with respect to each parameter is calculated through the back-propagation algorithm, and the Adam optimization algorithm with adaptive learning rate is used to update the network parameters. In this process, the adaptive adjustment mechanism dynamically adjusts the network structure according to the change of information entropy, and the parameter update uses the gradient descent method. The update of each weight can be expressed as:
[0188]
[0189]
[0190]
[0191]
[0192] in, '' is the learning rate, gradient , , , Calculated by the chain rule. In one embodiment, the learning rate ''The initial setting is 0.01, and the learning rate decay strategy is adopted, multiplying by 0.95 after each iteration as a method to gradually reduce the learning rate.
[0193] With gradient As an example, the calculation of can be further expanded by the chain rule as follows:
[0194]
[0195] in, represents the partial derivative of the loss function with respect to the reconstructed input, represents the partial derivative of the reconstructed input with respect to the encoded feature, Represents the partial derivative of the encoded feature with respect to the weight.
[0196] Furthermore, we set an information entropy threshold ,like , then adjust and dimension, that is, increasing or decreasing the number of neurons. The specific adjustment method is based on the change of information entropy.
[0197] In some embodiments, the method of dynamically adjusting the network structure according to the change of information entropy can be achieved by defining an adjustment function To achieve, specifically, , adjust the function It can be defined as:
[0198]
[0199] in, is the adjustment sensitivity coefficient, is the information entropy threshold. Lower than hour, The value of will guide the network to add more neurons or connections, otherwise it will reduce. For example, the information entropy threshold Set to 0.5.
[0200] The parameters of the encoder and decoder can be updated asynchronously. For example, when the loss of the encoder drops to a preset threshold, the update of the encoder is suspended and the decoder is optimized until the loss of the decoder is stable, such as when the loss value of the decoder drops to a preset threshold. Then the update is performed synchronously again, and the cycle continues until the entire network reaches a stable state. Specifically, the update cycle is set. and are the update cycles of the encoder and decoder respectively. If the current number of iterations satisfy and , then update the encoder parameters; if , then update the decoder parameters.
[0201] After each training cycle, the validation data can be used to evaluate the model performance. The network parameters and structure can be adjusted according to the evaluation results, such as adjusting the number of neurons in the encoding layer, optimizing the connection weights, etc. Specifically, the validation loss is ,according to Adjust the learning rate by changing and information entropy threshold .
[0202] When the performance of the model on the validation set is no longer significantly improved over multiple consecutive training cycles, or when the preset maximum number of training cycles is reached, the training process is terminated. and tolerance ,like or , then stop training and get the trained feature dimensionality reduction sub-model. In this way, the trained feature dimensionality reduction sub-model can have better data compression and feature extraction effects, reduce the dimension and complexity of the data, and retain as much useful information as possible, so as to further improve the detection effect of the electric control detection model, and further improve the recognition accuracy of the electric control detection model for the fault type corresponding to the electric control data.
[0203] In some embodiments, after the training of the feature dimension reduction sub-model is completed, the feature data of each of the electric control data samples can be input into the trained feature dimension reduction sub-model to obtain the target feature of each of the electric control data samples. Then, each of the target features is sequentially input into the classification sub-model, and the classification sub-model is trained by the extreme learning machine algorithm. When the prediction accuracy of the classification sub-model trained by the extreme learning machine algorithm does not reach a preset value at any time, the network parameters of the classification sub-model are reset to retrain the classification sub-model until the predicted fault type obtained by the target feature of the electric control data sample input each time matches the actual fault type corresponding to the electric control data sample input this time, and the trained classification sub-model is obtained.
[0204] In some embodiments, an extreme learning machine algorithm based on reliability assessment can be used as a classification algorithm to train the classification sub-model to improve the accuracy and efficiency of the classification sub-model in fault classification. Among them, the extreme learning machine is mainly used to quickly train a single hidden layer feedforward neural network. The weights and biases of the hidden layer nodes are randomly initialized at the beginning of training and remain unchanged during the training process. The training mainly focuses on the linear weights of the output layer. During the training process of the extreme learning machine, if the model performance evaluation of the classification sub-model does not reach the preset value, it means that the performance improvement of the classification sub-model is not significant. At this time, some weights and biases of the hidden layer of the classification sub-model are randomly reset. At the same time, in each reset process, a reliability evaluation mechanism can also be introduced to measure the prediction reliability of the current classification sub-model.
[0205] For example, before training the classification sub-model, the classification sub-model may be initialized. is the number of hidden layer nodes, is the hidden layer weight, is the hidden layer bias; It means to generate N random numbers between -1 and 1. is the output layer weight of the ELM model; Represents the hidden layer output matrix The Moore-Penrose pseudoinverse; is the target output of the training data; is the output matrix of the hidden layer, is the activation function; For input data; The difference is the performance improvement; '' is the performance improvement threshold; To reset the ratio of weights and biases; is the weight after reset; is the deviation after reset; The reliability of the model; is the balance coefficient, which is used to weigh the weight of accuracy and stability; is the accuracy of the model on the validation set; It is an indicator of the stability of the model performance.
[0206] After completing the initialization of the classification sub-model, the hidden layer weights and biases of the ELM are randomly initialized, and at the same time, the parameters of the restart strategy, such as the restart frequency and reset ratio, are set. For example, the number of hidden layer nodes is set to , hidden layer weights and deviation The initialization formula is:
[0207]
[0208]
[0209] in, Indicates generation A random number between -1 and 1.
[0210] Then, the target features of each electronic control data sample are used to train the classification sub-model, calculate the output layer weight, and minimize the prediction error. Calculated as:
[0211]
[0212] in, Represents the hidden layer output matrix The Moore-Penrose pseudoinverse. is the target output of the electronic control data sample, that is, the actual fault type. The calculation method is ,in is the activation function, For input data.
[0213] Then, the original input data The weighted input data is obtained by weighting the feature importance score. It can be expressed as:
[0214]
[0215] in, It represents element-wise multiplication, that is, each eigenvalue is multiplied by its corresponding importance score.
[0216] Use the weighted input data again To train the classification sub-model, the calculation of the output layer weight is adjusted as follows:
[0217]
[0218] in, Enter data for use weighting The hidden layer output matrix of .
[0219] Then, the feature importance is dynamically updated. After each iterative training, the feature importance is updated according to the new model performance, which can be expressed as:
[0220]
[0221] in, is a smoothing parameter used to balance the influence between the old importance scores and the newly calculated scores. The performance of the current iteration.
[0222] Then, the classification sub-model is evaluated to obtain performance. If the performance improvement is not significant, some hidden layer weights and biases are reset according to the restart strategy. Specifically, the performance improvement threshold is set to '', the current number of iterations is , if the performance improvement is less than '', execute the restart operation, which can be expressed as:
[0223]
[0224] like , then restart.
[0225] Furthermore, the feature importance is evaluated and a feature importance evaluation function is set , used to calculate the target feature for each input The importance score of can be expressed as:
[0226]
[0227] in, Indicates the prediction accuracy of the classification sub-model for the The partial derivative of a feature reflects the impact of the feature change on the model performance.
[0228] After each restart, the reliability of the classification sub-model is re-evaluated. For example, the parameters of the restart strategy are adjusted, such as reducing the restart frequency of the model with high reliability. Specifically, in the restart strategy, the proportion of The weights and biases are reset:
[0229]
[0230]
[0231] Repeat the training-evaluation-restart process until the performance of the classification sub-model is stable to obtain a trained classification sub-model. According to the prediction accuracy and stability calculation of the model, it can be expressed as:
[0232]
[0233] in, It is the balance coefficient, which controls the weight of accuracy and stability. is the accuracy of the model on the validation set. It is an indicator of the stability of the model performance in consecutive iterations.
[0234] The specific performance can be determined as follows: until the predicted fault type obtained by the target feature of the electric control data sample input each time matches the actual fault type corresponding to the electric control data sample input this time, it means that the classification sub-model has completed training.
[0235] In some embodiments, Figure 2 As shown, a method for detecting an electric control system is also provided, comprising:
[0236] Step 201, obtaining the electronic control data to be detected;
[0237] Step 202, inputting the electric control data into a trained electric control detection model to obtain an actual fault type of the electric control data;
[0238] The electronic control detection model is trained by the electronic control detection model training method in any of the above embodiments.
[0239] The electronic control data to be detected may refer to electronic control data of a fault type to be determined, and specifically may be readings of sensors of the electronic control system, or events of the electronic control system during operation recorded in a system log of the electronic control system.
[0240] After completing the training of the feature extraction sub-model, feature dimensionality reduction sub-model and classification sub-model, the acquired electronic control data to be tested can be input into the trained electronic control detection model, so as to output the predicted fault type of the electronic control data through the electronic control detection model, thereby realizing fault detection of the electronic control system.
[0241] The electronically controlled detection model training device provided in the present application is described below. The electronically controlled detection model training device described below and the electronically controlled detection model training method described above can be referenced to each other.
[0242] In one embodiment, if Figure 3 As shown, an electronic control detection model training device is provided, comprising:
[0243] A dynamic domain determination module 210 is used to determine the current dynamic neighborhood of any of the electric control data samples according to the feature vector distance between the electric control data samples in the current sample set and the preset number of neighbors;
[0244] The data sample expansion module 220 is used to generate new electric control data samples according to the target data samples in each of the electric control data samples and each electric control data sample in the current dynamic field of the target data sample for multiple times, and add them to the current sample set, so as to update the current dynamic neighborhood of each of the electric control data samples based on the updated current sample set, until the number of iterations of the current sample set reaches a preset number, and the target sample set is obtained;
[0245] A detection model training module 230 is used to train an electric control detection model according to each of the electric control data samples in the target sample set to obtain a trained electric control detection model;
[0246] Among them, the number of electronic control data samples corresponding to the actual fault type to which the target data sample belongs is less than a preset value.
[0247] The current dynamic neighborhood of any electric control data sample is determined by the feature vector distance between each electric control data sample in the current sample set and the preset number of neighbors, and new electric control data samples are generated multiple times according to the target data samples in each electric control data sample and each electric control data sample in the current dynamic field of the target data sample, and added to the current sample set, so as to update the current dynamic neighborhood of each electric control data sample based on the updated current sample set, until the number of iterations of the current sample set reaches the preset number, and after the target sample set is obtained, the electric control data samples in the target sample set are used to train the electric control detection model to obtain a trained electric control detection model, so that data samples with fewer fault types can be expanded to generate more representative and diverse electric control data samples to train the model, thereby effectively solving the problems of insufficient training samples and data imbalance, improving the training effect of the electric control detection model, and further improving the recognition accuracy of the electric control detection model for the actual fault type corresponding to the electric control data.
[0248] In one embodiment, the data sample expansion module 220 is specifically used to:
[0249] The target data sample and each electric control data sample in the current dynamic field of the target data sample are input into the synthesis parameter , generating deterministic equivalent samples ;
[0250] According to the adjustment formula , adjusting the deterministic equivalent sample to generate a new electronic control data sample;
[0251] in, Represents the target data sample , with the target data sample Each electronic control data sample in the current dynamic field The difference function between represents the weight factor, Indicates the preset number of neighbors, represents the new electronic control data sample, represents the feature adjustment function, Including preset feature expansion coefficients and preset offsets, Represents the preset impact factor of the target data sample.
[0252] In one embodiment, the data sample expansion module 220 is further used to:
[0253] After each new electronic control data sample is obtained, the actual fault type corresponding to the new electronic control data sample and the adjustment function are adjusted. , updating the weight factor, the preset feature expansion coefficient and the preset offset;
[0254] in, represents the parameter adjustment function, represents the gradient of the fitness function, Indicates the corresponding actual fault type, Represents the fitness function.
[0255] In one embodiment, the electronic control detection model includes a feature extraction sub-model;
[0256] The detection model training module 230 is specifically used for:
[0257] The target fitness of each network parameter in the network parameter set of the feature extraction sub-model is determined multiple times based on the electric control data samples in the target sample set. Each time, after selecting one of the network parameters as the current network parameter of the feature extraction sub-model, the target fitness of the current network parameter in the feature extraction sub-model is calculated based on the predicted fault type obtained after the electric control data sample is input into the electric control detection model and the actual fault type of the electric control data sample, so as to generate a target network parameter based on the target fitness of the current network parameter and add it to the network parameter set until the target fitness of the target network parameter reaches a preset value, or the number of updates of the network parameter set reaches a preset number, and a trained feature extraction sub-model is generated based on the target network parameter.
[0258] In one embodiment, the detection model training module 230 is specifically used to:
[0259] The predicted fault type of the electric control data sample and the actual fault type of the electric control data sample are input into a nonlinear function , get the initial fitness of the current i-th network parameter in the feature extraction sub-model ;
[0260] The initial fitness Enter the fitness function , get the individual fitness of the current i-th network parameter ;
[0261] According to the function And the function , obtain the target fitness of the current i-th network parameter;
[0262] According to the function , get the target network parameters adding to the network parameter set;
[0263] in:
[0264] , and represents the weights and biases in the i-th network parameters, is a function of genetic factors, is the inverse of the loss function determined according to the predicted fault type and the actual fault type, is a nonlinear function that describes the dynamic interaction between the current i-th network parameter and the environmental variable. Sig() is the Sigmoid activation function. is the preset weight coefficient;
[0265] , and Represents the preset weight coefficient, represents the variance of the weight and the bias;
[0266] , ' indicates the preset weight coefficient, Represents the environment variable elements, Representation and environment variables The associated input features, represents the hyperbolic tangent function;
[0267] , represents the loss function, Indicates the actual fault type, is the predicted fault type, obtained by a preset Softmax function;
[0268] Represents the weight adjustment coefficient, which represents the degree of influence of the interaction between network parameters. Indicates the current network parameters and network parameter sets The interaction strength between the network parameters is Indicates the current network parameters and network parameter sets The competition intensity between network parameters, , , , and Respectively represent The network parameters and The network parameters are The demand for resources, Indicates the total number of resource categories. , , 'and represent the adaptive functions for adjusting the competition and symbiosis intensity, represents the performance feedback function, express The amount of change;
[0269] represents the ecological interaction matrix, with elements Indicates The network parameters and The type of relationship between the network parameters, Indicates the complexity coefficient of the preset environment, represents the environmental change factor, ;
[0270] , Indicates the preset step size, Represents the gradient pointing in the direction of maximum fitness increase.
[0271] In one embodiment, the electric control detection model includes a feature dimension reduction sub-model;
[0272] The detection model training module 230 is specifically used for:
[0273] Inputting each of the electric control data samples into a trained feature extraction sub-model to obtain feature data of each of the electric control data samples;
[0274] Input each of the feature data into the encoder of the feature dimension reduction sub-model in sequence, and after obtaining the compressed data output by the encoder each time, input the compressed data into the decoder to obtain reconstructed data, and according to the matching result between the feature data and the reconstructed data, use the gradient descent method to adjust the network parameters of the encoder and the decoder through error back propagation, and then perform the next training until the number of training times reaches the preset number;
[0275] In each training, when the loss of the encoder drops to a preset threshold, the parameter adjustment of the encoder is suspended; when the loss value of the decoder drops to a preset threshold, the parameter adjustment of the decoder is suspended.
[0276] In one embodiment, the electronic control detection model includes a classification sub-model;
[0277] The detection model training module 230 is specifically used for:
[0278] Inputting the feature data of each of the electric control data samples into the trained feature dimension reduction sub-model to obtain the target feature of each of the electric control data samples;
[0279] Each of the target features is input into the classification sub-model in sequence, and the classification sub-model is trained by the extreme learning machine algorithm. When the prediction accuracy of the classification sub-model trained by the extreme learning machine algorithm does not reach a preset value at any time, the network parameters of the classification sub-model are reset to retrain the classification sub-model until the predicted fault type obtained by the target feature of the electric control data sample input each time matches the actual fault type corresponding to the electric control data sample input this time, thereby obtaining the trained classification sub-model.
[0280] In one embodiment, if Figure 4 As shown, an electric control system detection device is provided, comprising:
[0281] The electric control data acquisition module 310 is used to acquire the electric control data to be detected;
[0282] An electric control system detection module 320, used for inputting the electric control data into a trained electric control detection model to obtain an actual fault type of the electric control data;
[0283] The electronic control detection model is trained by the electronic control detection model training method in any of the above embodiments.
[0284] 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 electric control detection model training method described in any of the above embodiments, or the electric control system detection method described in any of the above embodiments.
[0285] 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.
[0286] 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 electronic control detection model training method provided in the above embodiments, or the electronic control system detection method provided in the above embodiments.
[0287] 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.
[0288] 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.
[0289] 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 method for training an electronic control detection model, characterized in that: include: Determine the current dynamic neighborhood of any of the electric control data samples according to the feature vector distance between each electric control data sample in the current sample set and the preset number of neighbors; Generate new electronically controlled data samples multiple times according to the target data samples in each of the electronically controlled data samples and each electronically controlled data sample in the current dynamic neighborhood of the target data sample, and add them to the current sample set, so as to update the current dynamic neighborhood of each of the electronically controlled data samples based on the updated current sample set, until the number of iterations of the current sample set reaches a preset number, thereby obtaining a target sample set; Training an electric control detection model according to each of the electric control data samples in the target sample set to obtain a trained electric control detection model; The number of electric control data samples corresponding to the actual fault type to which the target data sample belongs is less than a preset value; The generating of a new electronically controlled data sample according to the target data sample in each of the electronically controlled data samples and each electronically controlled data sample in a current dynamic neighborhood of the target data sample comprises: The target data sample and each electronically controlled data sample in the current dynamic neighborhood of the target data sample are input into the synthesis parameter Generate deterministic equivalent samples bx′ i ; According to the adjustment formula bx″ i = bx′ i +β(bx i )·Φ(bx i ,Θ), adjust the deterministic equivalent sample to generate a new electronic control data sample; Among them, δ() represents the target data sample bx i , with the target data sample bx i Each electric control data sample in the current dynamic neighborhood The difference function between k represents the weight factor, K represents the preset number of neighbors, bx″ i represents a new electronic control data sample, Φ() represents a feature adjustment function, Θ includes a preset feature expansion coefficient and a preset offset, β(bx i ) represents the preset impact factor of the target data sample; The preset number of neighbors is greater than 1; The electric control detection model includes a feature extraction sub-model and a feature dimension reduction sub-model; According to each of the electric control data samples in the target sample set, an electric control detection model is trained to obtain a trained electric control detection model, including: Inputting each of the electric control data samples into a trained feature extraction sub-model to obtain feature data of each of the electric control data samples; Input each of the feature data into the encoder of the feature dimension reduction sub-model in sequence, and after obtaining the compressed data output by the encoder each time, input the compressed data into the decoder to obtain reconstructed data, and according to the matching result between the feature data and the reconstructed data, use the gradient descent method to adjust the network parameters of the encoder and the decoder through error back propagation, and then perform the next training until the number of training times reaches the preset number; In each training, when the loss of the encoder drops to a preset threshold, the parameter adjustment of the encoder is suspended; when the loss value of the decoder drops to a preset threshold, the parameter adjustment of the decoder is suspended.
2. The electronic control detection model training method according to claim 1, characterized in that: Also includes: After each new electronic control data sample is obtained, the actual fault type corresponding to the new electronic control data sample and the adjustment function are adjusted. Updating the weight factor, the preset feature expansion coefficient, and the preset offset; Among them, Adjust() represents the parameter adjustment function. Represents the gradient of the fitness function, by i Indicates the corresponding actual fault type, f(bx″ i ,by i ) represents the fitness function.
3. The electronic control detection model training method according to claim 1, characterized in that: According to each of the electric control data samples in the target sample set, an electric control detection model is trained to obtain a trained electric control detection model, including: The target fitness of each network parameter in the network parameter set of the feature extraction sub-model is determined multiple times based on the electric control data samples in the target sample set. Each time, after selecting one of the network parameters as the current network parameter of the feature extraction sub-model, the target fitness of the current network parameter in the feature extraction sub-model is calculated based on the predicted fault type obtained after the electric control data sample is input into the electric control detection model and the actual fault type of the electric control data sample, so as to generate a target network parameter based on the target fitness of the current network parameter and add it to the network parameter set until the target fitness of the target network parameter reaches a preset value, or the number of updates of the network parameter set reaches a preset number, and a trained feature extraction sub-model is generated based on the target network parameter.
4. The electronic control detection model training method according to claim 1, characterized in that: The electric control detection model includes a classification sub-model; According to each of the electric control data samples in the target sample set, an electric control detection model is trained to obtain a trained electric control detection model, including: Inputting the feature data of each of the electric control data samples into the trained feature dimension reduction sub-model to obtain the target feature of each of the electric control data samples; Each of the target features is input into the classification sub-model in sequence, and the classification sub-model is trained by the extreme learning machine algorithm. When the prediction accuracy of the classification sub-model trained by the extreme learning machine algorithm does not reach a preset value at any time, the network parameters of the classification sub-model are reset to retrain the classification sub-model until the predicted fault type obtained by the target feature of the electric control data sample input each time matches the actual fault type corresponding to the electric control data sample input this time, thereby obtaining the trained classification sub-model.
5. A method for detecting an electric control system, characterized in that: include: Acquire the electronic control data to be tested; Inputting the electric control data into a trained electric control detection model to obtain an actual fault type of the electric control data; Wherein, the electronically controlled detection model is trained by the electronically controlled detection model training method described in any one of claims 1-4.
6. An electronic control detection model training device, characterized in that: include: A dynamic neighborhood determination module, used to determine the current dynamic neighborhood of any of the electric control data samples according to the feature vector distance between the electric control data samples in the current sample set and the preset number of neighbors; A data sample expansion module, used for generating new electronically controlled data samples according to target data samples in each of the electronically controlled data samples and each electronically controlled data sample in a current dynamic neighborhood of the target data sample for multiple times, and adding the new electronically controlled data samples to the current sample set, so as to update the current dynamic neighborhood of each of the electronically controlled data samples based on the updated current sample set, until the number of iterations of the current sample set reaches a preset number, thereby obtaining a target sample set; A detection model training module, used to train an electric control detection model according to each of the electric control data samples in the target sample set to obtain a trained electric control detection model; The number of electric control data samples corresponding to the actual fault type to which the target data sample belongs is less than a preset value; The data sample expansion module is specifically used for: The target data sample and each electronically controlled data sample in the current dynamic neighborhood of the target data sample are input into the synthesis parameter Generate deterministic equivalent samples bx′ i ; According to the adjustment formula bx″ i = bx′ i +β(bx i )·Φ(bx i ,Θ), adjust the deterministic equivalent sample to generate a new electronic control data sample; Among them, δ() represents the target data sample bx i , with the target data sample bx i Each electric control data sample in the current dynamic neighborhood The difference function between k represents the weight factor, K represents the preset number of neighbors, bx″ i represents a new electronic control data sample, Φ() represents a feature adjustment function, Θ includes a preset feature expansion coefficient and a preset offset, β(bx i ) represents a preset impact factor of the target data sample; the preset number of neighbors is greater than 1; The electric control detection model includes a feature extraction sub-model and a feature dimension reduction sub-model; The detection model training module is specifically used for: Inputting each of the electric control data samples into a trained feature extraction sub-model to obtain feature data of each of the electric control data samples; Input each of the feature data into the encoder of the feature dimension reduction sub-model in sequence, and after obtaining the compressed data output by the encoder each time, input the compressed data into the decoder to obtain reconstructed data, and according to the matching result between the feature data and the reconstructed data, use the gradient descent method to adjust the network parameters of the encoder and the decoder through error back propagation, and then perform the next training until the number of training times reaches the preset number; In each training, when the loss of the encoder drops to a preset threshold, the parameter adjustment of the encoder is suspended; when the loss value of the decoder drops to a preset threshold, the parameter adjustment of the decoder is suspended.
7. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the electronic control detection model training method described in any one of claims 1 to 4, or the electronic control system detection method described in claim 5 is implemented.