An insulator detection method based on non-equilibrium deep learning

By using an imbalanced deep learning approach, deep networks and quintuple constraints are employed to address the problem of uneven sample distribution in image recognition and detection. This improves the robustness of detection and computational speed, while avoiding information loss and the introduction of human noise.

CN116030287BActive Publication Date: 2026-02-06STATE GRID JIANGSU ELECTRIC POWER CO LTD RESEARCH INSTITUTE +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111546879.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-16
Publication Date
2026-02-06
Estimated Expiration
2041-12-16

AI Technical Summary

Technical Problem

In image recognition and detection, due to the uneven distribution of samples, especially the fact that some data classes are large while others are small, it is difficult to extract effective features from classes with fewer samples. Traditional methods such as resampling and cost-sensitive learning have failed to effectively solve the problem of insufficient sample size.

Method used

We employ an imbalanced deep learning approach, utilizing deep networks and quintuple constraints, along with K-Means clustering and loss function optimization. We construct a loss function and perform backpropagation to update the CNN network parameters. Combined with network model compression, we extract differentiated deep representations to address the problem of imbalanced data distribution.

Benefits of technology

It improves the robustness and computation speed of detection, reduces the impact of sample distribution imbalance, avoids information loss in traditional undersampling, and repeats five-fold sampling during CNN training to avoid the introduction of artificial noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116030287B_ABST
    Figure CN116030287B_ABST
Patent Text Reader

Abstract

The application discloses an insulator detection method based on unbalanced deep learning, and specific steps are as follows: step 1: manually extracting or obtaining M-dimensional prior features from a trained transformer substation insulator identification model; step 2: according to a sample feature set, using a K-Means method to cluster the features of the samples in each class respectively; step 3: constructing a five-element table for all extracted samples; step 4: inputting five elements in the five-element table into five same CNN network structures respectively, constructing a loss function to calculate loss and performing reverse gradient propagation to update CNN network parameters; and step 5: iteratively executing steps 2-4 to obtain updated CNN networks. The application uses five-element constraints, emphasizes the boundaries between clusters and classes through a deep network, can extract more differentiated deep representations, solves the differentiated problems caused by uneven data distribution, and performs network model compression, so that the calculation speed can be accelerated when convergence is tested.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, and in particular to an insulator detection method based on unbalanced class deep learning. BACKGROUND

[0002] In image recognition detection, sometimes the sample distribution is unbalanced, and part of the data class is large and the other part of the data class is small, which often causes the sample class with less quantity to contain less features, and it is difficult to extract the rules from it. For image edge detection, the sample often presents a power-law distribution.

[0003] And the traditional solution is usually divided into two categories, resampling and cost-sensitive learning, the former changes the data distribution, and the latter introduces restrictions, but neither changes the problem of insufficient sample quantity and information scarcity.

[0004] In order to solve this problem, adjacent minority class instances can be inserted. However, by artificially synthesizing noise and boundaries, the expanded decision region is still prone to errors. Therefore, although potential valuable information may be deleted, undersampling is usually better than oversampling. The cost-sensitive alternative avoids these problems by imposing heavier penalties directly on the misclassification of the minority group. For example, the classic SVM is cost-sensitive to improve classification on highly skewed data sets. Combine cost-sensitive methods with ensemble approaches to further improve classification accuracy. SUMMARY

[0005] In order to solve the problems in the prior art, the present application provides an insulator detection method based on unbalanced class deep learning, which uses five-tuple constraints, passes through a deep network, emphasizes the boundaries between clusters and classes, can extract more differentiated deep features, solves the differentiation problem caused by unbalanced data distribution, and performs network model compression, which can speed up the calculation when testing whether it converges.

[0006] The technical scheme mainly adopted in the present application is as follows:

[0007] An insulator detection method based on unbalanced class deep learning, the specific steps are as follows:

[0008] Step 1: manually extract or obtain M-dimensional prior features from a trained substation insulator recognition model to obtain a sample feature set P={p1, p2, …, p m}, m is the number of features;

[0009] Step 2: according to the extracted sample feature set P={p1, p2, …, p m}, use the K-Means method to cluster the features of the samples in each class respectively;

[0010] Step 3: Repeat sampling small batches equally from each class, and construct a five-element table for all extracted samples;

[0011] Step 4: Input the five elements in the five-element table into five identical CNN network structures respectively, construct a loss function to calculate the loss and back-propagate the gradient to update the CNN network parameters;

[0012] Step 5: Iteratively perform steps 2-4 until a preset number of iterations is reached, and obtain an updated CNN network for implementing detection of insulators.

[0013] Preferably, in step 2, the sample feature set P = {p1, p2, …, p m} is classified, denoted as b = {0, 1}, where, a minority class containing targets, denotes a majority class not containing targets, and the specific steps of clustering the features of samples in each class using the K-Means method are as follows:

[0014] Step 2-1: Randomly select k initial centroids from the class where n = 0;

[0015] Step 2-2: Calculate the Euclidean distance between all samples p i in the class and each centroid, as shown in formula (1):

[0016]

[0017] where, denotes the jth centroid of the nth iteration;

[0018] Step 2-3: Compare the Euclidean distances calculated in step 2-2, and divide each sample p i into the cluster to which the nearest centroid belongs, thereby dividing the class into k clusters, as shown in formula (2):

[0019]

[0020] where, denotes the cluster set after the nth iteration;

[0021] Step 2-4: Recalculate the centroid of each cluster , as shown in formula (3):

[0022]

[0023] in, Let c represent the j-th cluster in the nth iteration. j p represents the number of samples within a cluster. Intra-cluster sample characteristics;

[0024] Step 2-5: Update the new centroid based on the information obtained in Step 2-4. If there are no changes, proceed to steps 2-6. If the new centroid... If a change occurs, let n = n + 1, return to step 2-2, and continue until the updated centroid is reached. There were no changes;

[0025] Steps 2-6: The results of clustering based on the final centroid are shown in equation (4):

[0026]

[0027] Where N is the final iteration number.

[0028] Preferably, in step 3, the quinary table is defined as follows:

[0029] p i Select an individual;

[0030] p i The individual furthest from its cluster;

[0031] p i The nearest cluster of the same kind in the cluster is at a distance p i The most recent individual;

[0032] p i The nearest cluster of the same kind in the cluster is at a distance p i The furthest individual;

[0033] p′ i Distance p i The most recent different type of individual;

[0034] The following constraints must be met:

[0035]

[0036] in, For p i and Euclidean distance:

[0037] For p i and Euclidean distance:

[0038] For p i With Euclidean distance between p and p':

[0039] D(p i , p') for p i Euclidean distance between p and p': i i

[0040] In step 4, the loss function is preferably constructed as follows:

[0041] The loss function is defined as shown in equation (5):

[0042]

[0043] Subject to:

[0044]

[0045] where ε i , τ i , σ i are slack variables, W is the CNN network parameter, λ is the regularization parameter, f(p) is the new feature vector of sample individual p obtained by CNN, g1 is the minimum margin maintained between clusters in a class in the multi-dimensional space, g2 is the maximum margin between clusters in a class, and g3 is the maximum margin between classes;

[0046] Assuming there are a total of L training samples, and assuming the size of a certain class is L c , the radius of the hypersphere is defined as s = 0,..., 1, l clusters are generated for each class, and the lower limit of g1, g2, and g3 is zero. When all clusters are compressed into a point, the upper limit is as follows:

[0047]

[0048] The objective function for optimization is as follows:

[0049]

[0050] Subject to:

[0051]

[0052] In step 4, the specific updating steps of the CNN network parameter are as follows:

[0053] ​​S4-1: Compress the CNN model after backpropagation into a binary network. The operation of the convolutional layer is represented by q*W, where q represents the validation sample and the dimension is c×w. in ×h in W is a parameter of the CNN network with dimensions c×w×h. A binary convolutional kernel B and a scale parameter α are used to replace W, as shown in equation (6):

[0054]

[0055] in, For a convolution operation that involves only addition and subtraction without multiplication, W is expanded into an M = c × w × h dimensional vector, where α is a positive number, and B is also an M-dimensional vector. Therefore, we can obtain:

[0056] W≈αB;

[0057] S4-2: The error between the compressed model and the original model is shown in equation (7):

[0058] J(α, B) = ||W - αB||| 2 (7);

[0059] S4-3: The optimal value can be obtained according to equation (7) as shown in equation (8):

[0060] α * B * =argmin α,B J(α, B) (8);

[0061] In the formula, α * B * Let J(α, B) be the optimal value of α and B respectively, and its expansion is shown in equation (9):

[0062] J(α, B) = α 2 B T S-2αW T B+W T W (9);

[0063] Where B is a binary matrix, and the values ​​in the matrix are either +1 or -1, so B T B is a fixed value H, as shown in equation (10):

[0064] B T B = H (10);

[0065] S5-4: Due to W T W is also a constant, therefore the optimal value of B can be obtained according to the expansion. * The calculation formula is shown in equation (11):

[0066] B *= argmax B (W T B), constrained to B e {-1, +1} (11);

[0067] From equation (11), the optimal value of B is B * Depending on the sign of W, when the value of W is negative, the value of B is -1, when the value of W is positive, the value of B is +1, and when the value of W is 0, the value of B is 0.

[0068] Then we have:

[0069]

[0070] S4-5: Taking the derivative of J (alpha, B), we get:

[0071]

[0072] When , we get alpha * The calculation formula of alpha

[0073]

[0074] S4-6: Substituting equation (12) into equation (14), we get equation (15):

[0075]

[0076] Therefore, the trained and optimized CNN network parameters are as shown in equation (16):

[0077] W * = alpha * B * (16)。

[0078] Preferably, the preset number of iterations in step S5 is 5000.

[0079] Beneficial effects: the present application provides an insulator detection method based on non-equilibrium class deep learning, which has the following advantages:

[0080] (1) In traditional image feature extraction, two images are considered similar as long as they belong to the same class. Compared with traditional image feature extraction, the present application requires that the images be close in both class and cluster to be considered similar, providing more abundant information and stronger constraints.

[0081] (2) The present invention can use the most discriminative samples to establish local boundaries, ignore irrelevant samples in the class, make the local boundaries robust, emphasize the local boundaries, weaken the problem of unbalanced distribution between classes, reduce the impact of unbalanced sample distribution, and improve the robustness of detection.

[0082] (3) Repeated five-fold sampling during CNN training avoids a large amount of information loss in traditional random undersampling and does not introduce artificial noise compared with oversampling strategies. Attached Figure Description

[0083] Figure 1 This is a schematic diagram of the construction of the quinary table of the present invention;

[0084] Figure 2 This is a schematic diagram of the network model of the present invention. Detailed Implementation

[0085] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application are clearly and completely described below. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0086] Example 1 (This example uses Python as the implementation platform)

[0087] An insulator detection method based on non-equilibrium deep learning, the specific steps of which are as follows:

[0088] Step 1: Manually extract or obtain M-dimensional prior features from the pre-trained substation insulator identification model to obtain the sample feature set P = {p1, p2, ..., p...} m}, where m is the number of features;

[0089] Step 2: For the sample feature set P = {p1, p2, ..., p...} m} Classify them as b = {0, 1}, where, Minority classes containing targets Represents a majority class that does not contain a target, such as Figure 1 As shown, the specific steps for clustering the features of samples in each class using the K-Means method are as follows:

[0090] Step 2-1: From class Randomly select k initial centroids Where n = 0;

[0091] Step 2-2: Calculation Class all samples p in P i Euclidean distance between each sample p and each centroid c, as shown in equation (1):

[0092]

[0093] wherein, denotes the jth centroid in the nth iteration;

[0094] Step 2-3: compare the Euclidean distances calculated in step 2-2, and divide each sample p i into the cluster to which the nearest centroid belongs, thereby dividing the class into k clusters, as shown in equation (2):

[0095]

[0096] wherein, denotes the cluster set after the nth iteration;

[0097] Step 2-4: recalculate the centroid of each cluster c , as shown in equation (3):

[0098]

[0099] wherein, denotes the jth cluster in the nth iteration, c j denotes the number of samples in the cluster, and p denotes the sample feature in the cluster;

[0100] Step 2-5: update the new centroid c according to step 2-4, and if the new centroid c is the same as the previous centroid c , proceed to step 2-6, and if the new centroid c is different from the previous centroid c

[0101] , set n = n + 1 and return to step 2-2, and repeat until the new centroid c is the same as the previous centroid c

[0102] .

[0103] wherein, N is the final iteration number.

[0104] Step 3: repeatedly sample a small batch of samples equally from each class (the specific sampling amount can be selected by a person skilled in the art according to the size of the sample set, which is a routine technical means and thus not described in detail), and construct a fine-grained table for all extracted samples, wherein the fine-grained table is defined as follows:

[0105] pi Select an individual;

[0106] p i The individual furthest from its cluster;

[0107] p i The nearest cluster of the same kind in the cluster is at a distance p i The most recent individual;

[0108] p i The nearest cluster of the same kind in the cluster is at a distance p i The furthest individual;

[0109] p′ i Distance p i The most recent different type of individual;

[0110] The following constraints must be met:

[0111]

[0112] in, For p i and Euclidean distance:

[0113] For p i and Euclidean distance:

[0114] For p i and Euclidean distance:

[0115] D(p i , p′ i ) is p i With p′ i Euclidean distance:

[0116] For a single cluster, i.e., a cluster with only one sample:

[0117]

[0118]

[0119] Step 4: As Figure 2As shown, five elements in the five-element table are respectively input into five identical CNN network structures, a loss function is constructed to calculate loss and backward gradient propagation is performed to update CNN network parameters, the M-dimensional prior feature extracted in step 1 is input into the new CNN network structure to obtain new M-dimensional feature parameters;

[0120] The specific construction method of the loss function is as follows:

[0121] The loss function is defined as shown in equation (5):

[0122]

[0123] Subject to:

[0124]

[0125] In the formula, ε i , τ i , σ i is a relaxation variable, W is a CNN network parameter, λ is a regularization parameter, f(p) is a new feature vector obtained by a sample individual p through a CNN, g1 is the minimum margin maintained between clusters in a class in a multi-dimensional space, g2 is the maximum margin between clusters in a class, and g3 is the maximum margin between classes;

[0126] Suppose there are a total of L training samples, and suppose the size of a certain class is L c , the radius of the hypersphere is defined as s = 0,..., 1, l clusters are generated for each class, and the lower limit of g1, g2, and g3 is zero. When all clusters are compressed into a point, the upper limit is as follows:

[0127]

[0128] The objective function of the optimization is as follows:

[0129]

[0130] Subject to:

[0131]

[0132] In step 4, the specific update steps of the CNN network parameters are as follows:

[0133] S4-1: The CNN model after backward gradient propagation is compressed into a binary network. The operation of the convolutional layer is represented as q*W, where q represents a validation sample, the dimension is c x w in x h in , W is a CNN network parameter, the dimension is c x w x h, a binary convolution kernel B and a scale parameter α are used to replace W, as shown in equation (6):

[0134]

[0135] in, For a convolution operation that involves only addition and subtraction without multiplication, W is expanded into an M = c × w × h dimensional vector, where α is a positive number, and B is also an M-dimensional vector. Therefore, we can obtain:

[0136] W≈αB:

[0137] S4-2: The error between the compressed model and the original model is shown in equation (7):

[0138] J(α, B) = ||W - αB|| 2 (7);

[0139] S4-3: The optimal value can be obtained according to equation (7) as shown in equation (8):

[0140] α * B * =argmin α,B J(α, B) (8);

[0141] In the formula, α * B * Let J(α, B) be the optimal value of α and B respectively, and its expansion is shown in equation (9):

[0142] J(α, B) = α 2 B T B-2αW T B+W T W (9);

[0143] Where B is a binary matrix, and the values ​​in the matrix are either +1 or -1, so B T B is a fixed value H, as shown in equation (10):

[0144] B T B = H (10);

[0145] S5-4: Due to W T W is also a constant, therefore the optimal value of B can be obtained according to the expansion. * The calculation formula is shown in equation (11):

[0146] B * =argmax B (W T B), which is subject to B∈{-1,+1} (11);

[0147] From equation (11), we can obtain the optimal value of B. *Depending on the sign of W, when the value of W is negative, the value of B is -1, when the value of W is positive, the value of B is +1, and when the value of W is 0, the value of B is 0;

[0148] Then, we have:

[0149]

[0150] S4-5: Deriving J(a, B), we have:

[0151]

[0152] When , we have a * The calculation formula of a is shown in formula (14):

[0153]

[0154] S4-6: Substituting formula (12) into formula (14), we have formula (15):

[0155]

[0156] Therefore, the trained and optimized CNN network parameters are shown in formula (16):

[0157] W * = a * B * (16).

[0158] Step 5: Iteratively performing steps 2-4 until a preset iteration number of 5000 times is reached, obtaining an updated CNN network for realizing the detection of insulators.

[0159] The CNN network trained in the above steps can be verified by the following steps:

[0160] S6-1: After the CNN network is updated and trained and compressed, the test set is input into the CNN network to obtain the feature q;

[0161] S6-2: Calculate the Euclidean distance between the feature q and all centroids in the class

[0162] S6-3: Determine the class whose maximum centroid distance is the minimum range of the difference between the minimum centroid distance to another class:

[0163]

[0164] wherein,​​ for the centroid, b={0,1};

[0165] S6-4: until all test set tests are completed, determine whether the test set converges, if it converges, the training is finished, if it does not converge, the training can continue to iterate.

[0166] In the present application, by compressing the CNN network into a binary network, the verification efficiency of the verification set can be greatly improved.

[0167] When the training is completed (the test set converges), since the compressed model will affect the accuracy of detection, therefore, when actual detection is performed, the original model W is often used as the convolution kernel for extracting features, and the compressed binary network (a, B) is only used for convergence verification, so that the accuracy is not affected, and the training speed is also accelerated.

[0168] The above only describes the preferred embodiments of the present application, and it should be noted that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should also be considered within the scope of protection of the present application.

Claims

1. A non-equilibrium deep learning-based insulator detection method, characterized in that, The specific steps are as follows: Step 1: Manually extract or get M-dimensional prior features from a trained substation insulator recognition model to obtain a sample feature set , is the number of features; Step 2: Clustering the features of the samples extracted using K-Means method respectively for each class of samples; In step 2, the sample feature set Classify them as follows: ,in, Minority classes containing targets The K-Means method is used to cluster the features of samples in each class, representing the majority class that does not contain the target. The specific steps are as follows: Step 2-1: Randomly select k initial centroids from the classes where k is the number of clusters , where ; Step 2-2: Calculate the class of all samples in the Euclidean distance between each centroid, as shown in equation (1): (1); wherein, represents the first iteration of the first centroid; Step 2-3: Compare the Euclidean distances calculated in Step 2-2, and classify each sample into the cluster to which the nearest centroid belongs, thereby dividing the classes into k clusters, as shown in Equation (2): (2); wherein, represents the cluster set after the th iteration; Step 2-4: Recompute the centroid of each cluster as shown in equation (3): (3); wherein, denotes the first iteration of the cluster, denotes the number of samples within the cluster, denotes the feature of a sample within the cluster; Step 2-5: Update the new centroid obtained from step 2-4 If all the values are unchanged, proceed to step 2-6, if the new centroid is changed, let n = n + 1, return to step 2-2 until the updated centroid are all unchanged; Step 2-6: The clustering result after the final centroid division is as shown in formula (4): (4); Wherein, N is the final iteration number; Step 3: Repeat sampling small batches equally from each class, and construct a five-element table for all extracted samples; In step 3, the five-element table is defined as follows: : selected individual; : the most distant individual in the cluster : distance to the nearest cluster of the same cluster nearest individual; : distance to the nearest cluster of the same cluster the most distant individual; : distance recently different class individuals; Satisfy the following constraints: ; wherein is with the Euclidean distance of ; For With Euclidean distance of ; For With Euclidean distance of ; For With Euclidean distance of ; Step 4: Input the five elements in the five-element table into five identical CNN network structures respectively, calculate the loss and back-propagate the gradient to update the CNN network parameters; In step 4, the specific construction method of the loss function is as follows: The definition of the loss function is as shown in formula (5): (5); Constrained by: ; wherein, , , is a slack variable, is a CNN network parameter, is a regularization parameter, is a sample individual a new feature vector obtained by the CNN, in a multi-dimensional space, is the minimum margin kept safe between clusters in a class, is the maximum margin between clusters in a class, is the maximum margin between classes; Assume there are total training samples, assume the size of a certain class is , define the radius of the hypersphere as , generate clusters for each class, , , The lower bound of the radius of the hypersphere is zero, and the upper bound is as follows when all clusters are compressed into a point: ; The optimized objective function is: ; Constrained by: ; Step 5: Iteratively execute steps 2-4 until the preset iteration number is reached, and obtain the updated CNN network for realizing the detection of the insulator. 2.The non-equilibrium deep learning-based insulator detection method according to claim 1, wherein, In step 4, the specific updating steps of the CNN network parameters are as follows: S4-1: compress the CNN model after back propagation into a binary network, the operation of the convolution layer adopts indicates, indicates a verification sample, the dimension is , is a CNN network parameter, the dimension is , a binary convolution kernel and a scale parameter replace , as shown in formula (6): (6); where, is a convolution operation with only addition and subtraction, and is expanded to a dimensional vector, is a positive number, and is also a dimensional vector, so we have: ; S4-2: The error of the compressed model and the original model is as shown in formula (7): (7); S4-3: According to formula (7), the optimal value can be obtained as shown in formula (8): (8); wherein respectively and the optimum value of is expanded as shown in equation (9): (9); where is a binary matrix, the values in the matrix are +1 or -1, so is a fixed value H, as shown in equation (10): (10); S5-4: Since Also constant, so from the expansion The optimal value of The formula is shown in equation (11): , (11); From equation (11), we can obtain that optimal value depending on The symbol, when When the value is negative, The value is -1 when When the value is positive, The value is +1, when When the value is 0, The value is 0; Then: (12); S4-5: To derivation, we have: (13); When the calculation formula of is shown as formula (14): (14); S4-6: Substitute formula (12) into formula (14) to obtain formula (15): (15): Therefore, the training optimized CNN network parameters are as shown in formula (16): (16)。 3.The non-equilibrium deep learning-based insulator detection method according to claim 1, wherein, The preset iteration update number in step 5 is 5000 times.

Citation Information

Patent Citations

  • Convolutional neural network training method and system, object classification method and classifier

    CN106127232A