CN116704175A - Power scene anomaly detection method and device based on difficult sample mining - Google Patents

Power scene anomaly detection method and device based on difficult sample mining Download PDF

Info

Publication number
CN116704175A
CN116704175A CN202310707028.8A CN202310707028A CN116704175A CN 116704175 A CN116704175 A CN 116704175A CN 202310707028 A CN202310707028 A CN 202310707028A CN 116704175 A CN116704175 A CN 116704175A
Authority
CN
China
Prior art keywords
candidate
iteration
loss
power scene
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310707028.8A
Other languages
Chinese (zh)
Inventor
何宇浩
周震震
黄和燕
宋云海
李强
王黎伟
何森
何珏
丁伟锋
赖光霖
杨育丰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Corp Ultra High Voltage Transmission Co Electric Power Research Institute
Original Assignee
China Southern Power Grid Corp Ultra High Voltage Transmission Co Electric Power Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Southern Power Grid Corp Ultra High Voltage Transmission Co Electric Power Research Institute filed Critical China Southern Power Grid Corp Ultra High Voltage Transmission Co Electric Power Research Institute
Priority to CN202310707028.8A priority Critical patent/CN116704175A/en
Publication of CN116704175A publication Critical patent/CN116704175A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Abstract

The application relates to a power scene anomaly detection method, a device, a computer device, a storage medium and a computer program product based on difficult sample mining. The method comprises the following steps: generating a plurality of candidate frames according to the electric power scene image data set, and judging positive and negative sample types of the candidate frames; performing iterative operations on the candidate boxes: forward propagating the candidate frame output in the last iteration, and acquiring a corresponding target loss; sorting the target losses, and selecting candidate frames according to the sorting result and the preset proportion of positive and negative samples; backward propagation is carried out on the selected candidate frames, target parameters are updated and shared until the forward propagation and backward propagation processes are carried out, and the next iteration operation is carried out based on the target parameters; and finishing the iterative operation, taking the corresponding candidate frame output by the last iteration as a difficult sample to train a classification model, and carrying out power scene anomaly detection by using the classification model. The method can optimize the effect of detecting the abnormal target in the power scene by using the mined difficult sample.

Description

Power scene anomaly detection method and device based on difficult sample mining
Technical Field
The application relates to the technical field of computer data processing, in particular to a method and a device for detecting power scene abnormality based on difficult sample mining.
Background
Under the background of gradual expansion of a power system, the safe and efficient power transmission and transformation project is particularly important for social stability and civil stability. Because the power system of China has wide coverage and complex working environment, the possibility of abnormal power transformation lines is increased. Therefore, it is needed to perform a safety inspection on the power transformation system by means of the capability of the algorithm, and identify the abnormal power transformation scene in the first time, so as to ensure the stable operation of the power transformation system.
With the rapid development of cloud computing and deep learning in recent years, many students have proposed many general target detection algorithms based on deep learning based on public data sets, but the application effect of the power transformation anomaly detection scenes of these algorithms is still unsatisfactory. Firstly, the distribution of image data in a power transformation service scene is greatly different from that of a general public data set, for example, the angles, the sizes and the like of power transformation equipment shot by a patrol robot or a monitoring camera in a complex environment are different; at this time, the defect characteristics of part of the transformer equipment are not obvious and are difficult to identify by an algorithm, such as sign damage/blurring, silica gel cylinder damage and the like. These factors all make the generic target detection algorithm poorly effective in power business scenarios.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method and apparatus for detecting an abnormality in a power scenario based on difficult sample mining, which can improve the detection effect of an abnormal target.
In a first aspect, the application provides a power scene anomaly detection method based on difficult sample mining. The method comprises the following steps:
acquiring a power scene image dataset; the power scene image dataset includes outlier targets;
generating a plurality of candidate frames aiming at abnormal targets according to the electric power scene image data set, and judging the types of the candidate frames; the types of candidate boxes include positive and negative samples;
performing iterative operations on the candidate boxes: forward propagation is carried out on the candidate frame output by the previous iteration, and the target loss corresponding to the candidate frame output by the previous iteration is obtained; sorting the target loss, and selecting the candidate frame output by the previous iteration from the candidate frames output by the previous iteration according to the sorting result and the preset proportion of the positive and negative samples; the candidate frames output by the iteration are propagated backward, target parameters are updated and shared to the forward propagation and backward propagation processes, and the next iteration operation is carried out based on the target parameters;
And when the iteration reaches the preset condition, ending the iteration operation, taking the corresponding candidate frame output by the last iteration as a difficult sample training classification model, and carrying out power scene anomaly detection by using the classification model.
In one embodiment, the target loss includes a classification loss and a bounding box loss; the target parameter includes a corresponding weight of the classification loss and a corresponding weight of the boundary box loss, and a constraint condition that the corresponding weight of the classification loss is not smaller than the corresponding weight of the boundary box loss exists between the corresponding weight of the classification loss and the corresponding weight of the boundary box loss.
In one embodiment, generating a plurality of candidate frames for the abnormal target according to the power scene image dataset, and judging the type of each candidate frame comprises:
performing feature extraction on the power scene image dataset by using a high-resolution feature extractor to obtain an image feature map;
generating a plurality of candidate frames based on the image feature map by utilizing an RPN module; and judging the corresponding type of the candidate frame by acquiring the RPN loss function corresponding to each candidate frame.
In one embodiment, performing an iterative operation on the candidate box includes:
adopting an ROI pooling layer and a classification regression layer to carry out forward propagation and backward propagation;
The ROI pooling layer is used for dividing and pooling the feature images corresponding to the candidate frames which are transmitted forward or backward to obtain feature images with preset sizes;
the classification regression layer is used for acquiring category information and position information from a feature map with preset size, judging the category according to the category information and adjusting the positioning of the candidate frames for forward propagation or backward propagation according to the position information.
In one embodiment, sorting the target loss, and selecting the candidate frame of the previous iteration output from the candidate frames of the previous iteration output according to the sorting result and the preset proportion of the positive and negative samples includes:
sorting the target losses in descending order;
acquiring the confidence corresponding to the candidate frame output in the last iteration by using a Soft NMS (network management system);
and selecting the candidate frame output by the iteration from the candidate frames output by the previous iteration according to the confidence level, the sorting result and the proportion of the positive and negative samples.
In one embodiment, when the iteration reaches a preset condition, ending the iteration operation and taking the corresponding candidate frame output by the last iteration as a difficult sample to train a classification model, and performing power scene anomaly detection by using the classification model comprises the following steps:
The classification model is trained using GIOUloss.
In a second aspect, the present application provides a device for detecting power scene anomalies based on difficult sample mining, which is characterized in that the device comprises:
the data acquisition module is used for acquiring a power scene image data set; the power scene image dataset includes outlier targets;
the candidate frame generation module is used for generating a plurality of candidate frames aiming at abnormal targets according to the power scene image data set and judging the types of the candidate frames; the types of candidate boxes include positive and negative samples;
the iteration module is used for executing iteration operation on the candidate frames: forward propagation is carried out on the candidate frame output by the previous iteration, and the target loss corresponding to the candidate frame output by the previous iteration is obtained; sorting the target loss, and selecting the candidate frame output by the previous iteration from the candidate frames output by the previous iteration according to the sorting result and the preset proportion of the positive and negative samples; the candidate frames output by the iteration are propagated backward, target parameters are updated and shared to the forward propagation and backward propagation processes, and the next iteration operation is carried out based on the target parameters;
and the training module is used for ending the iterative operation and taking the corresponding candidate frame output by the last iteration as a difficult sample to train a classification model when the iteration reaches the preset condition, and carrying out power scene anomaly detection by using the classification model.
In a third aspect, the application provides a computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor when executing the computer program performs the steps of:
acquiring a power scene image dataset; the power scene image dataset includes outlier targets;
generating a plurality of candidate frames aiming at abnormal targets according to the electric power scene image data set, and judging the types of the candidate frames; the types of candidate boxes include positive and negative samples;
performing iterative operations on the candidate boxes: forward propagation is carried out on the candidate frame output by the previous iteration, and the target loss corresponding to the candidate frame output by the previous iteration is obtained; sorting the target loss, and selecting the candidate frame output by the previous iteration from the candidate frames output by the previous iteration according to the sorting result and the preset proportion of the positive and negative samples; the candidate frames output by the iteration are propagated backward, target parameters are updated and shared to the forward propagation and backward propagation processes, and the next iteration operation is carried out based on the target parameters;
and when the iteration reaches the preset condition, ending the iteration operation, taking the corresponding candidate frame output by the last iteration as a difficult sample training classification model, and carrying out power scene anomaly detection by using the classification model.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor performs the steps of:
acquiring a power scene image dataset; the power scene image dataset includes outlier targets;
generating a plurality of candidate frames aiming at abnormal targets according to the electric power scene image data set, and judging the types of the candidate frames; the types of candidate boxes include positive and negative samples;
performing iterative operations on the candidate boxes: forward propagation is carried out on the candidate frame output by the previous iteration, and the target loss corresponding to the candidate frame output by the previous iteration is obtained; sorting the target loss, and selecting the candidate frame output by the previous iteration from the candidate frames output by the previous iteration according to the sorting result and the preset proportion of the positive and negative samples; the candidate frames output by the iteration are propagated backward, target parameters are updated and shared to the forward propagation and backward propagation processes, and the next iteration operation is carried out based on the target parameters;
and when the iteration reaches the preset condition, ending the iteration operation, taking the corresponding candidate frame output by the last iteration as a difficult sample training classification model, and carrying out power scene anomaly detection by using the classification model.
In a fifth aspect, the application provides a computer program product comprising a computer program, characterized in that the computer program when executed by a processor realizes the steps of:
acquiring a power scene image dataset; the power scene image dataset includes outlier targets;
generating a plurality of candidate frames aiming at abnormal targets according to the electric power scene image data set, and judging the types of the candidate frames; the types of candidate boxes include positive and negative samples;
performing iterative operations on the candidate boxes: forward propagation is carried out on the candidate frame output by the previous iteration, and the target loss corresponding to the candidate frame output by the previous iteration is obtained; sorting the target loss, and selecting the candidate frame output by the previous iteration from the candidate frames output by the previous iteration according to the sorting result and the preset proportion of the positive and negative samples; the candidate frames output by the iteration are propagated backward, target parameters are updated and shared to the forward propagation and backward propagation processes, and the next iteration operation is carried out based on the target parameters;
and when the iteration reaches the preset condition, ending the iteration operation, taking the corresponding candidate frame output by the last iteration as a difficult sample training classification model, and carrying out power scene anomaly detection by using the classification model.
According to the power scene anomaly detection method and device based on difficult sample mining, the candidate frame aiming at the anomaly target is generated according to the power scene image dataset, and whether the candidate frame is a positive sample or a negative sample is judged. Forward propagation is carried out on the candidate frames, and target loss is obtained; sorting the target losses, selecting candidate frames according to the target losses, and restricting the mutual proportion of positive samples and negative samples by a preset proportion; backward propagation is carried out on the selected candidate frames so as to update target parameters, and the updated target parameters are shared to a forward propagation process and a backward propagation process; based on the target parameters, forward propagation is carried out on the selected candidate frames again, and the target parameters are updated iteratively; and when the iteration is finished and the preset condition is met, the candidate frame output by the last iteration is used as a difficult sample to train a classification model, and the trained classification model is used for detecting the power scene abnormality. According to the application, the target parameters are continuously updated through iterative operation until the preset conditions are met, and then the difficult sample can be obtained. The classification model trained by the difficult sample can increase the proportion of the difficult-to-separate sample and reduce the proportion of the easy-to-separate sample, so that the value of the training sample is improved, and the training effect of the classification model is further improved.
Drawings
FIG. 1 is an application environment diagram of a power scenario anomaly detection method based on difficult sample mining in one embodiment;
FIG. 2 is a flow diagram of a method for power scene anomaly detection based on difficult sample mining in one embodiment;
FIG. 3 is a flow diagram of candidate block generation and iteration in one embodiment;
FIG. 4 is a flow diagram of a high resolution feature extractor in one embodiment;
FIG. 5 is a block diagram of a power scenario anomaly detection device based on difficult sample mining in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The power scene anomaly detection method based on difficult sample mining provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, a method for detecting power scene anomalies based on difficult sample mining is provided, and the method is applied to the terminal 102 in fig. 1 for illustration, and includes the following steps:
step 202, acquiring a power scene image dataset; the power scene image dataset includes outlier targets.
Wherein, the electric power scene is such as transformer substation, transmission line, power station etc.. The power scene image dataset can be acquired by a patrol robot, an unmanned aerial vehicle, a fixed camera and the like. The anomalies of the power scene can comprise three major categories, namely equipment defects, personnel behavior anomalies and equipment state anomalies. Wherein the defects of the equipment comprise breather oil seal damage, dial blurring, dial damage, insulator breakage, ground oil stain, silica gel cylinder damage, abnormal box door closing, suspended matters hanging, bird nest, cover plate damage and the like; the abnormal behaviors of the personnel comprise smoking, wearing no tooling, wearing no safety helmet and the like; the abnormal equipment state comprises abnormal oil level of the oil seal of the respirator, color change of silica gel and the like. And (3) the abnormality in the power scene is an abnormal target, and the acquired images with the abnormal target are arranged to form a data set, so that the power scene image data set can be obtained.
In this embodiment, the power scene image dataset further includes anomaly markers for anomaly targets, the markers including types and locations of anomaly targets.
Step 204, generating a plurality of candidate frames aiming at abnormal targets according to the power scene image data set, and judging the types of the candidate frames; the types of candidate boxes include positive and negative samples.
The method of generating the candidate box includes sliding a window and selectively searching. The sliding window method adopts windows with different sizes and length-width ratios to perform sliding search from left to right and from top to bottom on the image, classifies the windows, and realizes candidate frame searching of the whole image. The window size and the step length set by the sliding window method have great influence on the candidate frame searching result. The selective search is used for searching the most likely target-containing region in the image to improve the efficiency, firstly, the input image is segmented to generate a plurality of small regions (such as 2000), and the region method substitution merging is adopted according to the similarity (color, texture, size and the like) of the small regions by adopting a region merging method to generate circumscribed rectangles, namely candidate frames. The selective search not only improves the operation efficiency, but also can contain candidate frames with various sizes.
After generating the candidate frame, it is also necessary to determine whether the candidate frame is a positive sample or a negative sample. Positive samples refer to samples containing foreground images, i.e., candidate boxes containing outlier objects; the negative samples are samples that do not contain foreground images but only background images, i.e. candidate boxes that do not contain abnormal objects. And judging the type of the candidate frame through the mark of the power scene image data set on the abnormal target.
Step 206, performing iterative operation on the candidate frame: forward propagation is carried out on the candidate frame output by the previous iteration, and the target loss corresponding to the candidate frame output by the previous iteration is obtained; sorting the target loss, and selecting the candidate frame output by the previous iteration from the candidate frames output by the previous iteration according to the sorting result and the preset proportion of the positive and negative samples; and carrying out backward propagation on the candidate frame output by the iteration, updating the target parameters, sharing the target parameters to the forward propagation and backward propagation processes, and carrying out the next iteration operation based on the target parameters.
In each iteration, forward propagation only carries out forward reasoning, candidate frames are selected from the reasoning result, then the selected candidate frames are propagated reversely, so that target parameters are obtained, and the gradient is updated.
In this embodiment, when selecting a candidate frame, a candidate frame with a large target loss is selected according to the sorting result, and the ratio between positive samples and samples in the selected candidate frame is maintained, so as to reduce the influence of imbalance between positive and negative samples.
And step 208, when iteration is carried out until the preset condition is met, ending the iteration operation, taking the corresponding candidate frame output by the last iteration as a difficult sample to train a classification model, and carrying out power scene anomaly detection by using the classification model.
The candidate frames which are iteratively output under the preset condition have larger target loss and relatively accurate positions, so that the candidate frames can be used as difficult samples to train the classification model, and the training effect of the classification model is improved.
In the power scene anomaly detection method based on difficult sample mining, a candidate frame for an anomaly target is generated according to a power scene image dataset, and whether the candidate frame is a positive sample or a negative sample is judged. Forward propagation is carried out on the candidate frames, and target loss is obtained; sorting the target losses, selecting candidate frames according to the target losses, and restricting the mutual proportion of positive samples and negative samples by a preset proportion; backward propagation is carried out on the selected candidate frames so as to update target parameters, and the updated target parameters are shared to a forward propagation process and a backward propagation process; based on the target parameters, forward propagation is carried out on the selected candidate frames again, and the target parameters are updated iteratively; and when the iteration is finished and the preset condition is met, the candidate frame output by the last iteration is used as a difficult sample to train a classification model, and the trained classification model is used for detecting the power scene abnormality. According to the application, the target parameters are continuously updated through iterative operation until the preset conditions are met, and then the difficult sample can be obtained. The classification model trained by the difficult sample can increase the proportion of the difficult-to-separate sample and reduce the proportion of the easy-to-separate sample, so that the value of the training sample is improved, and the training effect of the classification model is further improved.
In one embodiment, the target loss includes a classification loss and a bounding box loss; the target parameter includes a corresponding weight of the classification loss and a corresponding weight of the boundary box loss, and a constraint condition that the corresponding weight of the classification loss is not smaller than the corresponding weight of the boundary box loss exists between the corresponding weight of the classification loss and the corresponding weight of the boundary box loss.
Wherein, classification loss (cls_loss): this penalty is used to determine if the model can accurately identify the object in the image and classify it into the correct class. Bounding box loss (box_loss): this loss is used to measure the difference between the model predicted bounding box and the real bounding box, which helps ensure that the model is able to accurately locate objects.
The target penalty may be expressed as a weighted sum of the classification penalty and the bounding box penalty, while the corresponding weight of the classification penalty should not be smaller than the corresponding weight of the bounding box penalty. In this embodiment, the corresponding weight of the classification loss and the corresponding weight of the bounding box loss are learnable weights. For example, a weight parameter a is set, constrained to 0.5-1. The bounding box loss corresponds to weight a and the classification loss corresponds to weight 1-a.
As shown in fig. 3, in one embodiment, step 204 includes: performing feature extraction on the power scene image dataset by using a high-resolution feature extractor to obtain an image feature map; generating a plurality of candidate frames based on the image feature map by utilizing an RPN module; and judging the corresponding type of the candidate frame by acquiring the RPN loss function corresponding to each candidate frame.
The high resolution feature extractor (Deep High Resolution Net, HRNet) is shown in fig. 4, among others. First, the stage 1 builds a high-resolution sub-network, and the subsequent stage adds a high-to-low resolution sub-network step by step and connects multiple resolution sub-networks in parallel. The multiscale fusion is guided by exchanging information across the parallel multiscale subnetworks and the process is repeated continuously. A high resolution representation of the extracted features can be maintained throughout the process. The acquired image feature map is represented in a matrix form, thereby obtaining a feature vector matrix.
An RPN (region proposal network, regional generation network) module that functions to generate and classify candidate boxes. In the RPN module, two-class calculation is carried out on each generated candidate frame through softmax, whether the candidate frames belong to the foreground or not is judged, the candidate frames are marked as positive samples, and otherwise, the candidate frames are marked as negative samples. And then, the position and the size of the foreground candidate frame are adjusted by using regression, the foreground candidate frame is closer to a real foreground area, and finally, the adjusted foreground candidate frame is input into an iterative process. In this embodiment, the binary calculation obtains an RPN loss function, which may be an IOU (Intersection over Union, cross-over ratio).
In this embodiment, in order to make the coverage area wider, the detected objects are more, and for each point of the feature map, transformation is performed based on 3 anchor frames with different sizes and 3 different scale transformations, so as to obtain 9 candidate frames in the original map area.
In one embodiment, step 206 includes: adopting an ROI pooling layer and a classification regression layer to carry out forward propagation and backward propagation; the ROI pooling layer is used for dividing and pooling the feature images corresponding to the candidate frames which are transmitted forward or backward to obtain feature images with preset sizes; the classification regression layer is used for acquiring category information and position information from a feature map with preset size, judging the category according to the category information and adjusting the positioning of the candidate frames for forward propagation or backward propagation according to the position information.
As shown in fig. 3, both the forward propagation and the backward propagation use the same network structure, i.e., the structure of ROI (Region of Interest ) pooling layer and classification regression layer connection. Wherein the classification regression layer comprises two fully connected layers. The structure of the connection between the ROI pooling layer and the classification regression layer is only forward reasoning and is not updated. In one iteration, the forward propagation result of the upper layer is sent to a difficult sample sampler to obtain difficult samples with fixed positive and negative sample ratios, and then the samples are propagated in the opposite direction to the structure of the connection of the ROI pooling layer and the classification regression layer below so as to update the target parameters and further update the gradient.
The ROI pooling layer divides feature images corresponding to foreground candidate frames with different sizes screened by the RPN module into grids with fixed sizes, and pooling operation is carried out to obtain feature images with preset sizes. The feature map serves as an input to the difficult sample mining portion shown in fig. 3.
And the classification regression layer obtains the characteristics containing the category information and the position information through the two layers of full-connection layers by utilizing the characteristic diagram output by the ROI pooling layer in the step. And judging the category of the candidate area (namely the abnormal category of the power scene) by utilizing the characteristics, and simultaneously, adjusting the positioning of the candidate frame again to ensure that the abnormal target detection positioning is more accurate.
In one embodiment, the sorting the target loss in step 206, and selecting the candidate frame output in the previous iteration from the candidate frames output in the previous iteration according to the sorting result and the preset proportion of the positive and negative samples includes: sorting the target losses in descending order; acquiring the confidence corresponding to the candidate frame output in the last iteration by using a Soft NMS (network management system); and selecting the candidate frame output by the iteration from the candidate frames output by the previous iteration according to the confidence level, the sorting result and the proportion of the positive and negative samples.
The difficult sample sampler shown in fig. 3 performs the steps in this embodiment.
The Soft NMS is a function of adding an IOU based on a classical NMS (Non-Maximum Suppression ), the function is mainly used for pressing the confidence Si of each frame, the confidence is lower than a confidence threshold value for the candidate frames with low original confidence, and the confidence is still high even if the candidate frames with high confidence are pressed, and finally the confidence is reserved.
From the above it can be seen that the IOU of Soft-NMS is mainly used to compress the confidence of the candidate box. The present embodiment uses a gaussian function to compress the confidence. Specifically, if the IOU is larger, the influence on Si is larger, so that Si is smaller, and thus the value of Si of each candidate frame is updated. And finally screening out candidate frames in a mode that Si is larger than a confidence threshold value.
In this embodiment, each positive sample is firstly arranged in descending order according to the confidence level of the category, then a bounding box with the highest confidence level in the category is selected for reservation, and when the intersection ratio (IOU) of the remaining box and the candidate box with the highest confidence level is greater than a threshold value, a gaussian weight function is adopted for score attenuation.
The formula of the Gaussian weight function score decay is:
wherein Si represents the confidence score corresponding to the i-th type candidate frame, N represents a manually set threshold, max represents the candidate frame with the largest current confidence, and B represents the rest candidate frames.
In the embodiment, redundant frames in the candidate frames are screened through confidence, and effective candidate frames are obtained. And obtaining a candidate frame with more training value through the sequencing result of the target loss. The problem of imbalance of positive and negative samples is avoided by limiting the positive and negative sample ratio.
In one embodiment, step 208 includes: the classification model is trained using GIOUloss.
The minimum closure area of the two candidate frames is calculated firstly, then the proportion of the closure area which does not belong to the two candidate frames in the closure area is calculated, then the IOU is calculated, and finally the proportion is subtracted by the IOU to obtain GIOU (generalized intersection over union) loss. The minimum closure region is the smallest bounding rectangle of the two candidate boxes.
GIOUloss takes the value of [ -1,1], 1 when the two are coincident, and takes the value of-1 when the distance is infinitely far, so that compared with IOU, the GIOUloss takes the value of-1, the GIOUS is a very good distance measurement index.
The algorithm flow of GIOUloss is shown in Table 1 below:
TABLE 1 algorithm flow, GIOU loss
Compared with the method for detecting the power scene abnormality by directly utilizing the traditional Faster-rcnn, the method has the advantages that the performance is remarkably improved, and the specific test mode is as follows:
a power scene image dataset is acquired comprising about 200 images per class, for a total of 2664 images per step 202. 2364 sheets are randomly extracted as training set, and the rest 300 sheets are used as test set.
The average accuracy average value mAP (average value of the average accuracy AP for each target class) is used as an evaluation index. The AP is the curve area of the detection accuracy and recall rate of the classification model under different IOU threshold values, wherein the calculation formulas of the accuracy and the recall rate are as follows:
precision represents accuracy, and recovery represents recall; TP is a positive sample of the positive sample predicted by the classification model; FP is a negative sample of the positive sample predicted by the classification model; FN is the positive sample that the classification model predicts as negative.
To demonstrate the effectiveness of the proposed method, ablation experiments were performed on each improvement over the conventional Faster-rcnn, as shown in Table 2. From table 2, it can be seen that the improvement from the angles of positive and negative sample mining strategies, regression loss functions and candidate frame deduplication strategies in the test stage all play a good role.
Table 2 results of algorithm comparison experiments
The reason for the performance improvement exhibited by the above experiments was analyzed as follows:
1) The variety of abnormal scenes in the power transformation system is various, and different abnormal categories can cause the phenomenon of sample difficulty imbalance in the training process of the classification model due to different obvious degrees of the characteristics of the abnormal scenes. And the positive and negative sample sampling strategy algorithm based on difficult sample mining is designed to sort the difficulty of the samples, so that the model samples the difficult samples preferentially, and the model training efficiency is improved.
2) The traditional Faster-rcnn uses Smooth L1 Loss in a regression Loss function, and the Loss function independently calculates the Loss according to the coordinates of four vertexes of a detection frame and then summarizes the Loss, so that the method has two defects: a) The correlation between vertices is not exploited; b) Targets of different sizes exist in the power transformation scene, and vertex coordinate offsets of the same size can cause distinct IOUs for targets of different sizes. In a power scene, the correlation among the vertices of the prediction frame can be more fully utilized by using GIOUloss, and the influence of vertex coordinate offset on targets with different sizes is processed.
3) Conventional Faster-rcnn uses a conventional NMS algorithm in the reasoning process. In the calculation process of the traditional NMS algorithm, each positive sample is firstly arranged in descending order according to the confidence level of the category, then the bounding box with the highest confidence level in the category is selected for reservation, and then the rest boxes close to the bounding box are deleted according to the fixed IOU threshold. Adjacent very close objects will often occur in the power scene image dataset, and the use of conventional NMS algorithms will result in missed checks. The Soft NMS retains the boxes of the traditional NMS missed check in a manner that suppresses the scores of the non-maxima boxes.
As can be seen from the above experiments, the difficult sample mining method based on the power scene has a larger advantage in abnormal target detection compared with the prior art, and improves the detection effect.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a power scene anomaly detection device based on difficult sample mining, which is used for realizing the power scene anomaly detection method based on difficult sample mining. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of the device for detecting power scene anomalies based on difficult sample mining provided below may be referred to the limitation of the method for detecting power scene anomalies based on difficult sample mining hereinabove, and will not be repeated here.
In one embodiment, as shown in fig. 5, there is provided a power scene anomaly detection apparatus based on difficult sample mining, including: a data acquisition module 502, a candidate box generation module 504, an iteration module 506, and a training module 508, wherein:
a data acquisition module 502 for acquiring a power scene image dataset; the power scene image dataset includes outlier targets.
The candidate frame generation module 504 is configured to generate a plurality of candidate frames for an abnormal target according to the power scene image dataset, and determine types of the candidate frames; the types of candidate boxes include positive and negative samples.
An iteration module 506, configured to perform an iteration operation on the candidate box: forward propagation is carried out on the candidate frame output by the previous iteration, and the target loss corresponding to the candidate frame output by the previous iteration is obtained; sorting the target loss, and selecting the candidate frame output by the previous iteration from the candidate frames output by the previous iteration according to the sorting result and the preset proportion of the positive and negative samples; and carrying out backward propagation on the candidate frame output by the iteration, updating the target parameters, sharing the target parameters to the forward propagation and backward propagation processes, and carrying out the next iteration operation based on the target parameters.
And the training module 508 is used for ending the iterative operation and taking the corresponding candidate frame output by the last iteration as a difficult sample to train the classification model when the iteration reaches the preset condition, and carrying out power scene anomaly detection by using the classification model.
Wherein the target loss includes a classification loss and a bounding box loss; the target parameter includes a corresponding weight of the classification loss and a corresponding weight of the boundary box loss, and a constraint condition that the corresponding weight of the classification loss is not smaller than the corresponding weight of the boundary box loss exists between the corresponding weight of the classification loss and the corresponding weight of the boundary box loss.
The candidate frame generation module 504 is further configured to perform feature extraction on the power scene image dataset by using the high-resolution feature extractor, and obtain an image feature map; generating a plurality of candidate frames based on the image feature map by utilizing an RPN module; and judging the corresponding type of the candidate frame by acquiring the RPN loss function corresponding to each candidate frame.
The iteration module 506 is further configured to perform forward propagation and backward propagation by using the ROI pooling layer and the classification regression layer; the ROI pooling layer is used for dividing and pooling the feature images corresponding to the candidate frames which are transmitted forward or backward to obtain feature images with preset sizes; the classification regression layer is used for acquiring category information and position information from a feature map with preset size, judging the category according to the category information and adjusting the positioning of the candidate frames for forward propagation or backward propagation according to the position information.
The iteration module 506 is further configured to sort the target losses in descending order; acquiring the confidence corresponding to the candidate frame output in the last iteration by using a Soft NMS (network management system); and selecting the candidate frame output by the iteration from the candidate frames output by the previous iteration according to the confidence level, the sorting result and the proportion of the positive and negative samples.
The classification model is trained in the training module 508 using GIOUloss.
The above-described power scene anomaly detection apparatus based on difficult sample mining may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing a power scene image dataset. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method for power scene anomaly detection based on difficult sample mining.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input means. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements a method for power scene anomaly detection based on difficult sample mining.
It will be appreciated by those skilled in the art that the structure shown in FIG. 6 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing all the method embodiments described above when executing the computer program.
In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, implements all of the method embodiments described above.
In an embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, implements all the method embodiments described above.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (10)

1. A method for detecting power scene anomalies in difficult sample mining, the method comprising:
acquiring a power scene image dataset; the power scene image dataset includes outlier targets;
generating a plurality of candidate frames aiming at abnormal targets according to the power scene image data set, and judging the types of the candidate frames; the types of the candidate boxes comprise positive samples and negative samples;
Performing an iterative operation on the candidate box: forward propagating the candidate frame output by the previous iteration, and acquiring the target loss corresponding to the candidate frame output by the previous iteration; sorting the target loss, and selecting the candidate frame output by the previous iteration from the candidate frames output by the previous iteration according to the sorting result and the preset proportion of positive and negative samples; the candidate frames output by the iteration are transmitted backwards, target parameters are updated and shared to forward transmission and backward transmission processes, and the next iteration operation is carried out based on the target parameters;
and when the iteration reaches the preset condition, ending the iteration operation, taking the corresponding candidate frame output by the last iteration as a difficult sample to train a classification model, and carrying out power scene anomaly detection by using the classification model.
2. The method according to claim 1, characterized in that:
the target loss includes a classification loss and a bounding box loss; the target parameter comprises a corresponding weight of the classification loss and a corresponding weight of the boundary frame loss, and a constraint condition that the corresponding weight of the classification loss is not smaller than the corresponding weight of the boundary frame loss exists between the corresponding weight of the classification loss and the corresponding weight of the boundary frame loss.
3. The method of claim 2, wherein generating a plurality of candidate boxes for anomaly targets from the power scene image dataset, and determining a type of each of the candidate boxes comprises:
extracting features of the power scene image dataset by using a high-resolution feature extractor to obtain an image feature map;
generating a plurality of candidate frames based on the image feature map by using an RPN module; and judging the corresponding type of the candidate frame by acquiring the RPN loss function corresponding to each candidate frame.
4. The method of claim 1, wherein performing an iterative operation on the candidate box comprises:
adopting an ROI pooling layer and a classification regression layer to carry out forward propagation and backward propagation;
the ROI pooling layer is used for dividing and pooling feature images corresponding to the candidate frames which are transmitted forward or backward, and obtaining feature images with preset sizes;
the classification regression layer is used for acquiring category information and position information from the feature map with the preset size, judging the category according to the category information and adjusting the positioning of the candidate frame for forward propagation or backward propagation according to the position information.
5. The method of claim 1, wherein sorting the target loss, selecting the candidate box of the previous iteration output from the candidate boxes of the previous iteration output according to the sorting result and the preset proportion of positive and negative samples comprises:
sorting the target losses in descending order;
acquiring the confidence coefficient corresponding to the candidate frame output in the last iteration by using a Soft NMS (network management system);
and selecting the candidate frame output by the iteration from the candidate frames output by the previous iteration according to the confidence degree, the sorting result and the proportion of the positive and negative samples.
6. The method according to claim 1, wherein when the iteration reaches a preset condition, ending the iteration operation and training a classification model by using the corresponding candidate frame output by the last iteration as a difficult sample, and performing power scene anomaly detection by using the classification model comprises:
and training the classification model by using GIOUloss.
7. An apparatus for detecting power scene anomalies based on difficult sample mining, the apparatus comprising:
the data acquisition module is used for acquiring a power scene image data set; the power scene image dataset includes outlier targets;
The candidate frame generation module is used for generating a plurality of candidate frames aiming at abnormal targets according to the power scene image data set and judging the types of the candidate frames; the types of the candidate boxes comprise positive samples and negative samples;
an iteration module, configured to perform an iteration operation on the candidate frame: forward propagating the candidate frame output by the previous iteration, and acquiring the target loss corresponding to the candidate frame output by the previous iteration; sorting the target loss, and selecting the candidate frame output by the previous iteration from the candidate frames output by the previous iteration according to the sorting result and the preset proportion of positive and negative samples; the candidate frames output by the iteration are transmitted backwards, target parameters are updated and shared to forward transmission and backward transmission processes, and the next iteration operation is carried out based on the target parameters;
and the training module is used for ending the iterative operation and taking the corresponding candidate frame output by the last iteration as a difficult sample to train a classification model when the iteration reaches the preset condition, and carrying out power scene anomaly detection by using the classification model.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202310707028.8A 2023-06-14 2023-06-14 Power scene anomaly detection method and device based on difficult sample mining Pending CN116704175A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310707028.8A CN116704175A (en) 2023-06-14 2023-06-14 Power scene anomaly detection method and device based on difficult sample mining

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310707028.8A CN116704175A (en) 2023-06-14 2023-06-14 Power scene anomaly detection method and device based on difficult sample mining

Publications (1)

Publication Number Publication Date
CN116704175A true CN116704175A (en) 2023-09-05

Family

ID=87835434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310707028.8A Pending CN116704175A (en) 2023-06-14 2023-06-14 Power scene anomaly detection method and device based on difficult sample mining

Country Status (1)

Country Link
CN (1) CN116704175A (en)

Similar Documents

Publication Publication Date Title
CN110991311B (en) Target detection method based on dense connection deep network
CN106682697B (en) End-to-end object detection method based on convolutional neural network
CN111339858A (en) Oil and gas pipeline marker identification method based on neural network
CN107292886B (en) Target object intrusion detection method and device based on grid division and neural network
CN107665498B (en) Full convolution network aircraft detection method based on typical example mining
CN113076871B (en) Fish shoal automatic detection method based on target shielding compensation
CN106056101A (en) Non-maximum suppression method for face detection
CN115239644B (en) Concrete defect identification method, device, computer equipment and storage medium
CN112766170B (en) Self-adaptive segmentation detection method and device based on cluster unmanned aerial vehicle image
CN115205264A (en) High-resolution remote sensing ship detection method based on improved YOLOv4
CN110910360B (en) Positioning method of power grid image and training method of image positioning model
CN113537180B (en) Tree obstacle identification method and device, computer equipment and storage medium
CN110874590A (en) Training and visible light infrared visual tracking method based on adapter mutual learning model
CN111815576B (en) Method, device, equipment and storage medium for detecting corrosion condition of metal part
CN113033516A (en) Object identification statistical method and device, electronic equipment and storage medium
CN114639102B (en) Cell segmentation method and device based on key point and size regression
CN111292377B (en) Target detection method, device, computer equipment and storage medium
CN115527036A (en) Power grid scene point cloud semantic segmentation method and device, computer equipment and medium
CN113487610B (en) Herpes image recognition method and device, computer equipment and storage medium
CN117156442B (en) Cloud data security protection method and system based on 5G network
CN113536944A (en) Distribution line inspection data identification and analysis method based on image identification
CN117218545A (en) LBP feature and improved Yolov 5-based radar image detection method
CN116543333A (en) Target recognition method, training method, device, equipment and medium of power system
CN116823793A (en) Device defect detection method, device, electronic device and readable storage medium
CN115761888A (en) Tower crane operator abnormal behavior detection method based on NL-C3D model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination