Fault identification method, fault identification model training method and device
Through the comparative learning method between student network and teacher network, the small sample learning model is trained using labelless data, which solves the problem of low recognition accuracy under a small amount of labeled data in the identification of pumping well faults, and improves the accuracy and performance of the model.
Patent Information
- Application Number
- CN202310777817.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2043-06-28
AI Technical Summary
In the identification of pump well faults, the prior art lacks a method to effectively utilize a small amount of labeled data, resulting in low training accuracy of model and inability to effectively identify a small number of power diagram images. The model relies on a large number of labeled samples, which is high in labeling costs.
Using the comparative learning method between the student network model and the teacher network model, the labelless data is input into the student and teacher network network, the parameters are updated and the student network model is trained, and its weight is obtained and it is used to train the small sample learning model, adjust its parameters, and form Fault identification model to improve the recognition accuracy under a small amount of labeled data.
It improves the accuracy of the fault identification model, can be effectively trained under a small amount of labeled data, makes up for the problem that the model training cannot be performed with few samples in the prior art, and improves the performance of pumping well fault identification.
Smart Images

Figure CN116883335B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a fault recognition method, a fault recognition model training method and a device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.
[0003] Most oil fields use rod pumps to produce oil, but due to the complex downhole factors, various faults of the pumping wells are easily caused. Once a fault occurs, it will not only cause the oil production to be unable to proceed in an orderly manner, increase the cost of oil production, reduce the production efficiency of oil pumping, damage the equipment, but also cause oil well safety accidents, causing serious losses of personnel and property. Therefore, it is necessary to diagnose the pumping wells in real time and accurately. The indicator diagram is an effective fault diagnosis method.
[0004] At present, the dynamometer diagram recognition method is to train the model on a certain number of labeled dynamometer diagram images, and then recognize them. It is impossible to train the model on a small number of dynamometer diagram images. On the one hand, there are a lot of unlabeled data in real life, but very few labeled data. The recognition accuracy of the model trained with a small number of labeled samples is often not high; on the other hand, traditional supervised learning is to train the model on a certain scale of data set. After the model is trained, it can be used for prediction. Given a test image, the model predicts the category of the image. The goal of learning is to let the machine recognize the images in the training set and generalize them to the test set. This results in the model training being completely dependent on the number of labeled samples. The more the number, the better the model effect, and the fewer the number, the worse the effect. In real life, there are very few labeled samples and the annotation cost is very high. Therefore, how to use a small number of sample data to learn the working condition model has become a technical development trend. Based on the above reasons, a new technology is urgently needed to make up for the shortcomings of the current working condition recognition method. Summary of the invention
[0005] The embodiment of the present invention provides a fault identification model training method, which is used to use samples for model training, improves the performance of fault identification, and makes up for the shortcomings of the fault identification method. The method includes:
[0006] The obtained unlabeled data are respectively input into the pre-established student network model and teacher network model to obtain the student network model parameters and the teacher network model parameters, the teacher network model parameters are updated according to the student network model parameters, and the student network model is trained according to the updated results to obtain a trained student network model;
[0007] The weight of the trained student network model is obtained, and the pre-established small sample learning model is trained according to the labeled data and the weight of the trained student network model. The trained small sample learning model is determined as the fault recognition model, and the parameters of the small sample learning model are adjusted during the training process.
[0008] The embodiment of the present invention further provides a fault identification model training device, which uses samples to perform model training, improves the performance of fault identification, and makes up for the shortcomings of the fault identification method. The device includes:
[0009] The student network model training module is used to input the obtained unlabeled data into the pre-established student network model and teacher network model respectively, obtain the student network model parameters and the teacher network model parameters, update the teacher network model parameters according to the student network model parameters, and train the student network model according to the updated results to obtain a trained student network model;
[0010] The small sample learning model training module is used to obtain the weights of the trained student network model, train the pre-established small sample learning model based on a small amount of labeled data and the weights of the trained student network model, determine the trained small sample learning model as the fault recognition model, and adjust the parameters of the small sample learning model during the training process.
[0011] The embodiment of the present invention provides a fault identification method for using samples to perform model training, thereby improving the performance of fault identification and making up for the shortcomings of the fault identification method. The method includes:
[0012] The dynamometer diagram generated according to the working condition data of the pumping unit to be tested is input into the trained small sample learning model to obtain the fault identification result of the pumping unit to be tested.
[0013] The embodiment of the present invention further provides a fault identification device, which is used to use samples for model training, improves the performance of fault identification, and makes up for the shortcomings of the fault identification method. The device includes:
[0014] The fault identification module is used to input the dynamometer diagram generated according to the working condition data of the oil pumping unit to be tested into the trained small sample learning model to obtain the fault identification result of the oil pumping unit to be tested.
[0015] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned fault identification method and fault identification model training method when executing the computer program.
[0016] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned fault identification method and fault identification model training method are implemented.
[0017] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned fault identification model training method is implemented.
[0018] In the embodiment of the present invention, the obtained unlabeled data is respectively input into the pre-established student network model and teacher network model to obtain the parameters of the student network model and the teacher network model, the parameters of the teacher network model are updated according to the parameters of the student network model, and the student network model is trained according to the update results to obtain a trained student network model; the weight of the trained student network model is obtained, and the pre-established small sample learning model is trained according to the labeled data and the weight of the trained student network model, and the trained small sample learning model is determined as a fault recognition model. During the training process, the parameters of the small sample learning model are adjusted. The comparative learning method is adopted to obtain the weight of the student network model, and the weight of the student network model is transmitted to the downstream small sample learning model. The small sample learning model is combined with the weight of the student network model obtained upstream for model training to determine the fault recognition model. The embodiment of the present invention enables the fault recognition model to perform model training on the basis of a small amount of labeled data, and better improves the accuracy of the model, thereby solving the problem that the existing technology cannot use a small sample for model training through the small sample learning model, and making up for the shortcomings of the fault recognition model training method. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0020] Figure 1 Flow chart of a fault identification model training method according to an embodiment of the present invention;
[0021] Figure 2 A schematic diagram of training a student network model in an embodiment of the present invention;
[0022] Figure 3 A schematic diagram of training a small sample learning model in an embodiment of the present invention;
[0023] Figure 4is an overall flow chart of fault identification model training in an embodiment of the present invention;
[0024] Figure 5 The pre-processed indicator diagram in the embodiment of the present invention;
[0025] Figure 6 It is a dynamometer diagram after multi-scale clipping in an embodiment of the present invention;
[0026] Figure 7 It is the indicator diagram after horizontal rotation in the embodiment of the present invention;
[0027] Figure 8 It is a dynamometer diagram after partial shielding in an embodiment of the present invention;
[0028] Fig. 9 Schematic diagram of a fault identification model training device in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0030] Figure 1 This is a flow chart of a fault identification model training method according to an embodiment of the present invention, the method comprising:
[0031] Step 101, input the obtained unlabeled data into the pre-established student network model and teacher network model respectively, obtain the student network model parameters and the teacher network model parameters, update the teacher network model parameters according to the student network model parameters, train the student network model according to the update results, and obtain a trained student network model;
[0032] Step 102, obtaining the weight of the trained student network model, training the pre-established small sample learning model according to the labeled data and the weight of the trained student network model, determining the trained small sample learning model as the fault recognition model, and adjusting the parameters of the small sample learning model during the training process;
[0033] Each step is described in detail below.
[0034] In one embodiment, before training the fault identification model, the following steps are included:
[0035] An indicator diagram generated according to historical pumping unit operating data is obtained, and data enhancement processing is performed on the indicator diagram to obtain a processed indicator diagram. The indicator diagram is used as a data set, including labeled data and unlabeled data.
[0036] In one embodiment, the data enhancement processing includes: one or any combination of horizontal rotation processing, multi-scale cropping processing and local occlusion processing.
[0037] In one embodiment, data enhancement processing is performed on the dynamometer diagram, including:
[0038] The indicator diagram is locally cropped and globally cropped respectively to obtain a locally cropped indicator diagram and a globally cropped indicator diagram.
[0039] In a specific embodiment, the measured displacement and load data of the oil beam pumping unit are collected and the indicator diagram is drawn. The indicator diagram is subjected to binarization, contour extraction, drawing of the minimum circumscribed rectangle and other operations. The indicator diagram is subjected to horizontal rotation, multi-scale cropping, local occlusion and other operations. By performing data processing, horizontal rotation, multi-scale cropping and other data enhancement operations on the input indicator diagram, the model can adapt to the working conditions under different data enhancements.
[0040] In step 101, the obtained unlabeled data is respectively input into the pre-established student network model and teacher network model to obtain the student network model parameters and the teacher network model parameters, the teacher network model parameters are updated according to the student network model parameters, and the student network model is trained according to the updated results to obtain a trained student network model.
[0041] In a specific embodiment, initialized student network model parameters and teacher network model parameters are obtained, the teacher network model parameters are updated according to the student network model parameters, the student network model is trained according to the updated results, and the initialization parameters of the student network model are adjusted during the training process.
[0042] In one embodiment, updating the teacher network model parameters according to the student network model parameters includes:
[0043] According to the parameters of the student network model and the teacher network model, a parameterized result is obtained;
[0044] Obtain the corresponding probability distribution data of the student network model and the probability distribution data of the teacher network model according to the parameterization results;
[0045] According to the probability distribution data of the student network model and the probability distribution data of the teacher network model, the cross entropy loss function is obtained;
[0046] According to the cross entropy loss function, the student network model is trained.
[0047] In a specific embodiment, during the training process, the teacher network parameters are updated by the exponential moving average of the student network parameters, and the cross entropy loss is used to measure the similarity of the output results of the student network and the teacher network. The gradient is propagated only through the student network to train and obtain the student network model. The similarity of the probability distribution data of the student network and the teacher network is used to determine whether they are the same type of indicator diagram. If the two probability distribution data are similar, it means that they are the same type of indicator diagram, otherwise they are not.
[0048] In a specific embodiment, the probability distribution data P is obtained by normalizing the output of the network architecture g using the SoftMax function. More specifically:
[0049]
[0050] Among them, P s (x) (i) Represents the probability data of the student network model of dimension i, θ s is the student network model parameter, τ s is the temperature parameter of the student network model, which controls the sharpness of the output distribution, g is the network architecture of the student network, and k represents the k-dimensionality. A similar formula is also applicable to the teacher network model. According to the probability distribution data of the student network model and the probability distribution data of the teacher network model, the cross entropy loss function is obtained:
[0051]
[0052] Among them, loss is the cross entropy loss function that minimizes the student network parameters, H is the cross entropy function, P t (x) is the probability distribution of the teacher network model, P s (x) is the probability distribution of the student network model.
[0053] Teacher network model parameters θ t is the parameter θ from the student network model s The specific update rule is θ t ←λθ t +(1-λ)θ s , where λ is a hyperparameter, usually set to 0.996. In addition, the output of the teacher network model needs to be centered and sharpened to avoid model collapse.
[0054] In one embodiment, training the student network model according to the cross entropy loss function includes:
[0055] The cross entropy loss function is used to measure the similarity between the probability distribution data of the student network model and the probability distribution data of the teacher network model;
[0056] Based on the similarity, the student network model is trained.
[0057] In a specific embodiment, cross entropy loss is used to measure the similarity between the output results of the student network and the teacher network.
[0058] In one embodiment, the unlabeled data is input into the pre-established student network model and the teacher network model respectively, including:
[0059] All local clipped dynamometer diagrams and global clipped dynamometer diagrams are input into the student network model;
[0060] All global cropped dynamometer diagrams are input to the teacher network model.
[0061] In a specific embodiment, the unlabeled data is input into the student network model and the teacher network model, such as Figure 2 As shown. The two networks have the same architecture but different parameters. The output of the teacher network model is centered on the mean value calculated on the batch. The two network models output their own K-dimensional features, which are normalized using temperature softmax on the feature dimension, and then the cross entropy loss function is used to determine the similarity of the features of the two network models. The specific steps are as follows:
[0062] A collection of different crops is obtained from the dynamometer diagram. The collection contains two global crops x1 and x2 and several local crops of smaller resolution. All crops are passed through the student network model, while only the global crop is passed through the teacher network model.
[0063] All the clippings are input into the network architecture g, the student network (student gθ s ) and the teacher network (teacher gθ t ) have the same network architecture g, (g consists of a backbone f and a projection head h, g = hf. The feature backbone weights used in the downstream task are the backbone f, that is, copy student f is the backbone of the copied student network model. The projection head (prejecthead), denoted as h, consists of 3 layers of multilayer perceptrons (MLP), normalized according to L2Norm (Euclidean norm), and the fully connected layer with K-dimensional weights is normalized. MLP consists of 3 Linear (fully connected) layers and 2 GELU activation functions. WeightNorm (directly normalizes the neural network weight matrix), it consists of 1 Linear. The projection head (Preject head) of the teacher network outputs a k-dimensional feature, k represents the number of categories, t1 and t2 represent the k-dimensional features of x1 and x2 output by the student network, and t1 and t2 represent the output features of the projection head (Preject head) of the teacher network respectively. The probability distribution data p of the student network model sIt is obtained by normalizing the output of the network architecture g using the softmax function. s The temperature parameter controls the sharpness of the output distribution, which is 0.1 here. Similarly, the Preject head of the student network outputs a k-dimensional feature, where k represents the number of categories. s1 and s2 represent the output features of the student network projection head (Preject head), and s1 and s2 represent the k-dimensional features of x1 and x2 output by the teacher network. The teacher network parameter θ t is the student network parameter θ s The exponential moving average is updated, where λ is a hyperparameter and takes 0.996. The teacher network output needs to be centered and sharpened to avoid model collapse. In the centering module, c is the output result of the centering, and m is a hyperparameter, which takes 0.996 here. Here x j Represents a certain picture, gθ t Represents the teacher network output. The probability distribution data p of the teacher network model t It is obtained by normalizing the centralized features using the softmax function. Finally, by minimizing the student network parameter θ s The cross entropy loss is used to learn to match these distributions P t and P s , where P t Yes t1 and p t2 Collection of P s Yes s1 and p s2 A collection of. t1 and p t2 is the probability distribution of x1 and x2 output by the teacher network, p s1 and p s2 It is the probability distribution of x1 and x2 output by the student network.
[0064] The two network models share the same architecture but have different parameter sets. The parameters of the student network model are determined by minimizing the loss function of the student network model. Finally, the trained student network model weights are saved for learning downstream tasks.
[0065] In one embodiment, the unlabeled data are respectively input into the pre-established student network model and the teacher network model to obtain the student network model parameters and the teacher network model parameters, including:
[0066] The parameters of the student network model are determined by minimizing the loss function of the student network model.
[0067] In one embodiment, the minimization loss function of the student network model is calculated according to the following formula:
[0068] loss θs =min θs (-p t1 log(p s2 )-p t2 log(p s1 ));
[0069] in, is the minimization loss function of the student network model, θ s are the parameters of the student network model, t1 and t2 are the different feature data output by the teacher network model, and p t1 is the probability distribution data output by the teacher network corresponding to t1, p t2 is the probability distribution data of the teacher network output corresponding to t2, s1 and s2 are different feature data output by the student network model, p s1 is the probability distribution data output by the student network corresponding to s1, p s2 The probability distribution data output by the student network corresponding to s2.
[0070] In step 102, the weight of the trained student network model is obtained, and the pre-established small sample learning model is trained according to the labeled data and the weight of the trained student network model to obtain the trained small sample learning model. During the training process, the parameters of the small sample learning model are adjusted.
[0071] In a specific embodiment, the weight of the trained student network model is obtained by the weight of the feature backbone network. Figure 3 As shown in the figure, the upper part is the training network for small sample learning, and the lower part is the fine-tuning network. The student model weights trained upstream are loaded, and the training set is input into the small sample learning model for training. After that, the trained feature backbone weights are extracted on the new few-sample data, and the enhanced support set of each task is optionally fine-tuned. Finally, the trained model is saved for the next prediction task. The test set is used to evaluate the training effect and model performance of the small sample learning model. The following is an explanation of its training process:
[0072] The training network is constructed in the form of a dataset of {(supp_x, supp_y, quer_x), quer_y}, (supp_x, supp_y, quer_x) as input, supp_x, supp_y, quer_x represents the corresponding input data, quer_y is the index label used to calculate the loss with the output of the small sample learning network, suppf is the feature vector of the output support set, and feat is the feature vector of the output query set. After the features of this dataset are extracted by the feature backbone weights trained upstream, the small sample learning network is trained on the labeled few-shot task using ProtoNet loss, where scale and b represent learnable parameters in the ProtoNet network, with initial values of 10 and 0. In the W weight, supp f represents the feature vector of the output support set, and suppy represents the corresponding label. Norm is the normalization function. After passing through the ProtoNet network, the logit (the output of the final fully connected layer) is obtained and the cross entropy loss is calculated with the label quer_y of the query set, and the gradient backpropagation updates the ProtoNet network parameters. Fine-tuning the network: Under a specific task, use a new dataset to fine-tune the small sample learning network. First, perform data augmentation on the support set supp_x to obtain supp_z (here supp_x, supp_y are the support set, and quer_x is the query set). After data augmentation, the data is extracted through the upstream feature extraction network f to obtain suppf and feat. The obtained features are sent to the upstream trained protoNet model for inference to obtain logit and calculate the cross entropy loss with supp_y. The gradient is calculated using the gradient descent method, and the parameters in the feature extraction network f are updated through back propagation. The parameters in the trained feature extraction network f are saved. After the query set que_x passes through the saved feature extraction network model, the extracted feature feat is obtained. After feat passes through the ProtoNet network to obtain logit, it is normalized and converted to a label value and the accuracy is calculated with quer_y (Accuracy is a commonly used performance metric used to evaluate the prediction accuracy of a classification model. Accuracy represents the ratio between the number of instances correctly classified by the model and the total number of instances). Deploy the feature backbone on new few-shot tasks and perform optional fine-tuning on the enhanced support set for each task. Finally, save the trained few-shot learning model weights for prediction on downstream tasks.
[0073] The present invention also provides a fault identification method of the above fault identification model training method, as described in the following embodiment, the method includes:
[0074] The dynamometer diagram generated according to the working condition data of the tested oil pump is input into the trained small sample learning model to obtain the fault identification result of the tested oil pump.
[0075] like Figure 4 As shown, the fault identification model training process in the embodiment of the present invention is as follows:
[0076] Step 1: By performing data enhancement on the input dynamometer diagram, the model can adapt to the working conditions under different data enhancements. Then, the teacher network model parameters are updated according to the student network model parameters. The student network model is trained according to the updated results to obtain the trained student network model for learning downstream tasks. Figure 4 The loss refers to the cross entropy loss between the output of the student network and the output of the teacher network. Here P t Represents the probability distribution set of the teacher network output, P s It represents the probability distribution set of the student network output, softmax is the normalization function, and centering represents the centralization module.
[0077] Among them, firstly, the displacement and load data of the dynamometer diagram are extracted and converted, and the dynamometer diagram is drawn. Then, the dynamometer diagram is binarized, contours are extracted, and the minimum circumscribed rectangle is drawn. Figure 5 The figure shows the preprocessed dynamometer diagram. Finally, the input dynamometer diagram image is horizontally rotated, multi-scale cropped, and partially blocked, as shown in Figure 1. Figure 6 Shown is the indicator diagram after multi-scale cropping; Figure 7 It is the indicator diagram after horizontal rotation; Figure 8 This is the indicator diagram after partial shading.
[0078] Step 2: Train the feature backbone on labeled few-shot tasks using a few-shot loss. Deploy the feature backbone on new few-shot tasks with optional fine-tuning on an augmented support set for each task.
[0079] Step 3: Input the dynamometer data to be tested into the trained small sample model for fault identification.
[0080] The present invention also provides a fault identification model training device in the embodiment described in the following embodiment. Since the principle of solving the problem by the device is similar to that of the fault identification model training method, the implementation of the device can refer to the implementation of the fault identification model training method, and the repeated parts will not be repeated. Fig. 9 As shown, the device comprises:
[0081] The student network model training module 901 is used to input the unlabeled data into the pre-established student network model and teacher network model respectively, obtain the student network model parameters and the teacher network model parameters, update the teacher network model parameters according to the student network model parameters, and train the student network model according to the update results to obtain a trained student network model;
[0082] The small sample learning model training module 902 is used to obtain the weights of the trained student network model, train the pre-established small sample learning model according to the labeled data and the weights of the trained student network model, obtain the trained small sample learning model, and adjust the parameters of the small sample learning model during the training process.
[0083] In one embodiment, the student network model training module 901 is specifically used for:
[0084] According to the parameters of the student network model and the teacher network model, a parameterized result is obtained;
[0085] Obtain the corresponding probability distribution data of the student network model and the probability distribution data of the teacher network model according to the parameterization results;
[0086] According to the probability distribution data of the student network model and the probability distribution data of the teacher network model, the cross entropy loss function is obtained;
[0087] According to the cross entropy loss function, the student network model is trained.
[0088] In one embodiment, the student network model training module 901 is specifically used for:
[0089] The cross entropy loss function is used to measure the similarity between the probability distribution data of the student network model and the probability distribution data of the teacher network model;
[0090] Based on the similarity, the student network model is trained.
[0091] In one embodiment, the student network model training module 901 is specifically used for:
[0092] The parameters of the student network model are determined by minimizing the loss function of the student network model.
[0093] In one embodiment, the student network model training module 902 is specifically used to calculate the minimized loss function of the student network model according to the following formula:
[0094]
[0095] in, is the minimization loss function of the student network model, θ s are the parameters of the student network model, t1 and t2 are the different feature data output by the teacher network model, and p t1 is the probability distribution data output by the teacher network corresponding to t1, p t2 is the probability distribution data of the teacher network output corresponding to t2, s1 and s2 are different feature data output by the student network model, ps1 is the probability distribution data output by the corresponding student network, p s2 The probability distribution data output by the student network corresponding to s2.
[0096] In one embodiment, a data enhancement processing module is further included, which is specifically used to:
[0097] The indicator diagram is locally cropped and globally cropped respectively to obtain a locally cropped indicator diagram and a globally cropped indicator diagram.
[0098] In one embodiment, the student network model training module 902 is further used to:
[0099] All local clipped dynamometer diagrams and global clipped dynamometer diagrams are input into the student network model;
[0100] All global cropped dynamometer diagrams are input to the teacher network model.
[0101] In one embodiment, the data enhancement processing includes: one or any combination of horizontal rotation processing, multi-scale cropping processing and local occlusion processing.
[0102] An embodiment of the present invention also provides a fault identification device for a fault identification model training method, as described in the following embodiment.
[0103] The fault identification module is used to input the dynamometer diagram generated according to the working condition data of the oil pumping unit to be tested into the trained small sample learning model to obtain the fault identification result of the oil pumping unit to be tested.
[0104] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned fault identification model training method when executing the computer program.
[0105] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned fault identification model training method is implemented.
[0106] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned fault identification model training method is implemented.
[0107] In the embodiment of the present invention, the obtained unlabeled data is respectively input into the pre-established student network model and teacher network model to obtain the parameters of the student network model and the teacher network model, the parameters of the teacher network model are updated according to the parameters of the student network model, and the student network model is trained according to the update results to obtain a trained student network model; the weight of the trained student network model is obtained, and the pre-established small sample learning model is trained according to the labeled data and the weight of the trained student network model, and the trained small sample learning model is determined as a fault recognition model. During the training process, the parameters of the small sample learning model are adjusted. The comparative learning method is adopted to obtain the weight of the student network model, and the weight of the student network model is transmitted to the downstream small sample learning model. The small sample learning model is combined with the weight of the student network model obtained upstream for model training to determine the fault recognition model. The embodiment of the present invention enables the fault recognition model to perform model training on the basis of a small amount of labeled data, and better improves the accuracy of the model, thereby solving the problem that the existing technology cannot use a small sample for model training through the small sample learning model, and making up for the shortcomings of the fault recognition model training method.
[0108] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0109] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0110] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0112] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A fault identification model training method, characterized in that: include: The obtained unlabeled data are respectively input into the pre-established student network model and teacher network model to obtain the initialized student network model parameters and teacher network model parameters, the teacher network model parameters are updated according to the student network model parameters, and the student network model is trained according to the updated results to obtain a trained student network model; Obtain the weight of the trained student network model, train the pre-established small sample learning model according to the labeled data and the weight of the trained student network model, determine the trained small sample learning model as the fault recognition model, and adjust the parameters of the small sample learning model during the training process; Before training the fault identification model, include: Obtain an indicator diagram generated according to historical pumping unit operating condition data, perform data enhancement processing on the indicator diagram, and obtain a processed indicator diagram, wherein the indicator diagram is used as a data set and includes labeled data and unlabeled data; The pre-established small sample learning model is trained and the trained small sample learning model is determined as a fault identification model, including: Training and fine-tuning networks for few-shot learning; The training network is constructed in the form of a dataset of {(supp_x, supp_y, quer_x), quer_y}, where supp_x, supp_y, and quer_x are used as inputs, quer_y is an index label used to calculate loss with the output of the small sample learning network, suppf is the feature vector of the output support set, and feat is the feature vector of the output query set. After the feature backbone weights of the upstream trained student model f are extracted, the ProtoNet loss is used to train the small sample learning network on the labeled few-sample task. In the ProtoNet network, scale and b represent learnable parameters. After the ProtoNet network, the final fully connected layer output logit is obtained and cross-entropy loss is calculated with quer_y, and the gradient backpropagation updates the ProtoNet network parameters. The fine-tuning network uses the new data set to fine-tune the small sample learning network: first, the support set supp_x is data enhanced to obtain supp_z, supp_x and supp_y are support sets, and quer_x is the query set; after data enhancement, the data is extracted through the upstream feature extraction network f to obtain suppf and feat, and the obtained features are sent to the trained protoNet model for inference to obtain logit and supp_y for cross entropy loss calculation, the gradient is calculated using the gradient descent method, and the parameters in the feature extraction network f are updated through back propagation; the parameters in the trained feature extraction network f are saved; finally, the trained small sample learning model is saved for the next prediction task.
2. The method according to claim 1, characterized in that Perform data enhancement processing on the dynamometer diagram, including: The indicator diagram is locally cropped and globally cropped respectively to obtain a locally cropped indicator diagram and a globally cropped indicator diagram.
3. The method according to claim 2, characterized in that The obtained unlabeled data is input into the pre-established student network model and teacher network model respectively, including: All local clipped dynamometer diagrams and global clipped dynamometer diagrams are input into the student network model; All global cropped dynamometer diagrams are input to the teacher network model.
4. The method according to claim 2, characterized in that The data enhancement processing includes: one or any combination of horizontal rotation processing, multi-scale cropping processing and local occlusion processing.
5. The method according to claim 1, characterized in that Update the teacher network model parameters according to the student network model parameters, including: According to the parameters of the student network model and the teacher network model, a parameterized result is obtained; Obtain the corresponding probability distribution data of the student network model and the probability distribution data of the teacher network model according to the parameterization results; According to the probability distribution data of the student network model and the probability distribution data of the teacher network model, the cross entropy loss function is obtained; According to the cross entropy loss function, train the student network model; During the training process, the teacher network parameters are updated by the exponential moving average of the student network parameters, and the cross entropy loss is used to measure the similarity between the output results of the student network and the teacher network.
6. The method according to claim 5, characterized in that According to the cross entropy loss function, the student network model is trained, including: The cross entropy loss function is used to measure the similarity between the probability distribution data of the student network model and the probability distribution data of the teacher network model; Based on the similarity, the student network model is trained.
7. The method according to claim 1, characterized in that Input the unlabeled data into the pre-established student network model and teacher network model respectively to obtain the student network model parameters and teacher network model parameters, including: The parameters of the student network model are determined by minimizing the loss function of the student network model.
8. The method according to claim 7, characterized in that The minimization loss function of the student network model is calculated according to the following formula: ; in, is the minimization loss function of the student network model, are the parameters of the student network model, , They are different feature data output by the teacher network model. for The corresponding probability distribution data output by the teacher network, for The corresponding probability distribution data output by the teacher network, They are different feature data output by the student network model. for s 1 The corresponding probability distribution data output by the student network, for The corresponding probability distribution data output by the student network.
9. A fault identification method of the fault identification model training method according to any one of claims 1 to 8, characterized in that: include: The dynamometer diagram generated according to the working condition data of the tested oil pump is input into the trained small sample learning model to obtain the fault identification result of the tested oil pump.
10. A fault identification model training device according to any one of claims 1 to 8, characterized in that: include: The student network model training module is used to input the obtained unlabeled data into the pre-established student network model and teacher network model respectively, obtain the student network model parameters and the teacher network model parameters, update the teacher network model parameters according to the student network model parameters, and train the student network model according to the updated results to obtain a trained student network model; The small sample learning model training module is used to obtain the weights of the trained student network model, train the pre-established small sample learning model based on a small amount of labeled data and the weights of the trained student network model, determine the trained small sample learning model as the fault recognition model, and adjust the parameters of the small sample learning model during the training process.
11. A fault identification device according to the method of claim 10, characterized in that: include: The fault identification module is used to input the dynamometer diagram generated according to the working condition data of the oil pumping unit to be tested into the trained small sample learning model to obtain the fault identification result of the oil pumping unit to be tested.
12. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Heterogeneous neural network knowledge recombination method based on common feature learning
CN111160409A
Training method and device of panoramic segmentation model and panoramic segmentation method and device
CN114067119A
Acne grading method, system and equipment based on semi-supervised learning and storage medium
CN115440346A
Pronunciation object recognition method and device and speaker recognition method and device in conference
CN116189688A
Method and apparatus for training image recognition model, and method and apparatus for recognizing image
US20220129731A1