A rat recognition method for substation infrared images based on deep learning

Through the deep learning-based mouse identification method in substation infrared images, using technologies such as infrared image data sets and feature extraction modules, the problems of low efficiency and poor accuracy of traditional monitoring methods have been solved, and efficient, real-time monitoring and early warning of mice in substations have been achieved. Improved the safety of the power system.

CN118314532BActive Publication Date: 2024-08-27GUANGXI XIANG IND INTELLIGENCE TECHNOLOGY CO LTD

Patent Information

Application Number
CN202410741819.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-08-27
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

Traditional substation mouse monitoring methods are inefficient and not real-time. Ordinary cameras are insensitive to mouse targets and difficult to achieve high-precision detection, making it difficult to effectively prevent potential safety hazards in the power system.

Method used

A deep learning-based method for mouse identification in substation infrared images is adopted. By obtaining infrared image data sets for preprocessing, a feature extraction module, a spatial pyramid pooling structure and a multi-sensory target detection head are constructed to train the infrared image detection algorithm and deploy it in the infrared camera. , to achieve real-time monitoring and early warning.

Benefits of technology

It improves the efficiency and accuracy of rat detection, reduces labor costs, enhances the safety of substations, realizes real-time monitoring and early warning of rat hazards, and improves the safety of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118314532B
    Figure CN118314532B
Patent Text Reader

Abstract

The present invention discloses a substation infrared image rat recognition method based on deep learning, which belongs to the field of deep learning technology and includes the following steps: obtaining an infrared image data set of rats in a substation and performing preprocessing; constructing a substation infrared image rat detection algorithm based on a feature extraction module, a spatial pyramid pooling structure, and a multi-sensory target detection head; training the substation infrared image rat detection algorithm based on the preprocessed infrared image data set; deploying the trained substation infrared image rat detection algorithm in an infrared camera of the substation to perform real-time monitoring and early warning of rats in the substation. The present invention establishes an easy-to-train substation infrared image rat target detection network, which has the characteristics of high accuracy and high generalization. After the modeling is completed, it can be deployed in the infrared cameras in various substation scenes, and a corresponding early warning and monitoring system is established to achieve real-time monitoring of rat targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of deep learning, and in particular relates to a substation infrared image rat recognition method based on deep learning. Background Art

[0002] Infrared imaging technology is a non-contact monitoring method that uses infrared radiation to image and analyze targets. Infrared cameras can accurately and quickly extract images of mice in substations. As an important part of the power system, substations undertake the key tasks of power transmission and distribution. However, the daily operation of substations is often disturbed by small rodents such as mice. Such situations may cause serious safety hazards in substations, such as gnawing wires or equipment, causing damage to power equipment or even fire, bringing unpredictable risks to the power system.

[0003] Traditional substation rat monitoring methods mainly rely on manual inspections and mousetrap settings. Such methods are inefficient, not real-time, and are often discovered when problems have already occurred. In addition, rat hazard detection data are mostly collected through ordinary cameras in substations. Ordinary cameras are not sensitive to rat animal targets and it is difficult to achieve high-precision detection. In view of the shortcomings of traditional manual methods of rat identification in substations, the present invention proposes a substation infrared image rat identification method based on deep learning to achieve automatic monitoring of rats in substations, improve rat detection efficiency, reduce labor costs, and ensure the safety of substations in power systems. Summary of the invention

[0004] In order to solve the above technical problems, the present invention proposes a rat recognition method for substation infrared images based on deep learning, which uses deep learning technology to detect rats in substation infrared images. In practical applications, the constructed detection algorithm and early warning system are deployed to the infrared camera and server of the substation, which can realize the detection of rat hazards in various areas of the substation, so as to solve the problems existing in the above-mentioned prior art.

[0005] To achieve the above object, the present invention provides a substation infrared image rat recognition method based on deep learning, comprising the following steps:

[0006] Obtain infrared image datasets of rats in substations and perform preprocessing;

[0007] Based on the feature extraction module, spatial pyramid pooling structure and multi-sensory target detection head, a rat detection algorithm for substation infrared images is constructed;

[0008] Training the substation infrared image rat detection algorithm based on the preprocessed infrared image dataset;

[0009] The trained substation infrared image rat detection algorithm is deployed in the substation’s infrared camera to conduct real-time monitoring and early warning of rats in the substation.

[0010] Optionally, the process of preprocessing the infrared image data set includes: preprocessing the infrared image data set based on temperature disturbance simulation technology and image transformation technology, and dividing the preprocessed infrared image data set into training data and verification data.

[0011] Optionally, the process of processing the infrared image of mice in the substation based on the feature extraction module includes: performing feature extraction on the infrared image to be processed to obtain a first feature map, inputting the first feature map into a deformable convolution to perform a deformable convolution operation, and performing batch normalization and ReLU function operations on the first feature map after the deformable convolution operation to obtain a second feature map; performing a channel splitting operation on the second feature map in the channel dimension to obtain a third feature map and a fourth feature map whose channel numbers are half of the number of channels of the second feature map; inputting the fourth feature map into the deformable convolution, and then performing batch normalization and ReLU function operations in sequence to output a fifth feature map; inputting the fifth feature map into the deformable attention module for processing, and outputting a sixth feature map; performing a residual connection on the third feature map and the sixth feature map in the channel dimension to obtain a seventh feature map whose channel number is the sum of the channel numbers of the third feature map and the sixth feature map; performing a convolution operation on the seventh feature map, and then performing batch normalization and ReLU function operations in sequence to output an eighth feature map.

[0012] Optionally, the process of inputting the fifth feature map into the deformable attention module for processing includes: processing the dimension of the input fifth feature map to generate a uniform reference grid, multiplying the fifth feature map by the parameter matrix for linear projection to obtain a query vector, and then inputting the query vector into an offset subnetwork to obtain an offset based on the reference grid; adding each reference point in the reference grid to the corresponding offset to obtain the shifted point of each reference point after the shift; then using bilinear interpolation to perform feature sampling on the coordinates of the shifted point to obtain sampled features, linearly projecting the sampled features to obtain key vectors and numerical vectors; processing the key vectors and numerical vectors based on multi-head attention to obtain features of each attention head, connecting the obtained features of each attention head, and then multiplying the connected features with the output weight matrix to output the sixth feature map.

[0013] Optionally, the process of processing the infrared image of mice in the substation based on the spatial pyramid pooling structure includes: extracting features of the infrared image to be processed to obtain a first pooling feature map, inputting the first pooling feature map into a depthwise separable convolution, and then inputting the first pooling feature map into a batch normalization layer to output a second pooling feature map; inputting the second pooling feature map into a global attention mechanism module, performing a channel attention enhancement operation, and outputting a third pooling feature map; inputting the third pooling feature map into a maximum pooling layer to obtain a fourth pooling feature map, and then inputting the second pooling feature map into two layers of maximum pooling layers in sequence to obtain a fifth pooling feature map and a sixth pooling feature map respectively; splicing the third pooling feature map, the fourth pooling feature map, the fifth pooling feature map and the sixth pooling feature map along the channel dimension to output a seventh pooling feature map; inputting the seventh pooling feature map into a depthwise separable convolution, and then inputting the second pooling feature map into a batch normalization layer to output an eighth pooling feature map.

[0014] Optionally, the process of processing the infrared image of mice in the substation based on the multi-sensory target detection head includes: the multi-sensory target detection head includes a scale perception module, a spatial perception module and a task perception module; feature extraction is performed on the infrared image to be processed to obtain a first perception feature map, and the first perception feature map is input into the scale perception module. In the scale perception module, the first feature map is first input into the average pooling layer, and then sequentially input into the SPD convolution layer and the batch normalization layer, and then activated using the LeakyReLU function to obtain a second perception feature map, and the second perception feature map is element-wise multiplied with the first perception feature map to output a third perception feature map; the third perception feature map is input into the spatial perception module, and in the spatial perception module, the third feature map is first input into the adaptive kernel SPD convolution, and the inputs of different levels are unified into the output of one level, and then the output immediately enters the batch normalization layer, and then enters the offset layer and the batch normalization layer in sequence to output. The fourth feature map; the fourth feature map is activated by the LeakyReLU function to output the fifth feature map. At the same time, the fourth feature map is input into the convolution layer and the batch normalization layer to obtain the sixth feature map; the fourth feature map, the fifth feature map and the sixth perceptual feature map are element-wise multiplied to output the seventh feature map; the seventh feature map is input into the task perception module, in which the seventh feature map is first input into the average pooling layer to output the eighth perceptual feature map, and then the eighth perceptual feature map is sequentially input into the fully connected layer, the LeakyReLU function, the fully connected layer and the H_Sigmoid activation function for operation to output the ninth perceptual feature map. At the same time, the task perception module defines a threshold control vector and a fixed vector. After the threshold control vector and the fixed vector are added, the ninth perceptual feature map is scaled and offset to obtain the tenth perceptual feature map; the tenth perceptual feature map is element-wise multiplied with the eighth perceptual feature map to output the eleventh perceptual feature map.

[0015] Optionally, the structure of the substation infrared image rat detection algorithm includes: a convolution layer plus a batch normalization layer at the input; the main body connected to the input is divided into a two-layer feature extraction structure, wherein the first feature extraction structure is a combination of a feature extraction module, a convolution layer and a feature extraction module, and the second feature extraction structure is a combination of a feature extraction module, a convolution layer, a feature extraction module and a spatial pyramid pooling structure; then the feature pyramid and the path aggregation structure are used to connect the main part, and then a multi-sensory target detection head is used to connect the feature pyramid and the path aggregation structure respectively, and finally a regression and classifier is designed to connect the multi-sensory target detection head to complete the construction of the substation infrared image rat detection algorithm.

[0016] Optionally, the process of training the substation infrared image rat detection algorithm includes: initializing various parameters and hyperparameters of the substation infrared image rat detection algorithm, inputting training data and verification data into the substation infrared image rat detection algorithm for training, and updating various parameters and hyperparameters until the loss value converges, and the training ends.

[0017] Optionally, indicators for verifying the trained substation infrared image rat detection algorithm include: accuracy and recall rate.

[0018] Optionally, the process of real-time monitoring and early warning of rats in the substation includes: first setting a probability threshold of the substation infrared image rat detection algorithm when detecting rats, and when the category confidence in the target output channel captured by the infrared camera exceeds the probability threshold, an early warning is issued, and the infrared image of the corresponding infrared camera when capturing the rat target, the position or number of the corresponding infrared camera in the substation, the position of the target coordinate frame of the corresponding detection result, the number of target coordinate frames of the corresponding detection result, the confidence value of whether it is a rat and the time point corresponding to the detection result are saved, the above-mentioned early warning related information is saved, and sent to the staff responsible for rodent control in the substation in the form of communication.

[0019] Compared with the prior art, the present invention has the following advantages and technical effects:

[0020] (1) After collecting the power transmission line defect dataset, the present invention uses temperature perturbation simulation and image rotation and cropping data preprocessing to simulate the infrared images under different temperature conditions through temperature perturbation, which can enrich the infrared image mouse dataset and make the subsequent detection algorithm more generalizable.

[0021] (2) The present invention designs a feature extraction module, which better fits the mouse target in the feature map through the combination of deformable convolution and deformable attention modules and the residual connection structure of the features.

[0022] (3) The present invention designs a spatial pyramid pooling structure, in which depthwise separable convolution is used to reduce computational costs. At the same time, global attention is combined to amplify global interaction features during the downsampling process to avoid feature information loss and spatial distortion.

[0023] (4) The present invention designs a multi-sensory target detection head, which pays attention to the features of the input detection head part from multiple angles, enriches the feature details of the rat target in the substation infrared image, increases the detection accuracy of the algorithm, and facilitates better detection of rat targets in the substation infrared image.

[0024] (5) The present invention establishes an easy-to-train substation infrared image rat target detection network with the characteristics of high accuracy and high generalization. After the modeling is completed, it can be deployed in the infrared cameras in various substation scenes, and a corresponding early warning and monitoring system can be established to achieve real-time monitoring of rat targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0026] Figure 1 A schematic diagram of a method for identifying rats in infrared images of a substation based on deep learning according to an embodiment of the present invention;

[0027] Figure 2 This is a schematic diagram of the structure of a substation infrared image rat detection algorithm according to an embodiment of the present invention;

[0028] Figure 3 This is a schematic diagram of the structure of a feature extraction module according to an embodiment of the present invention;

[0029] Figure 4 Schematic diagram of the spatial pyramid pooling structure of an embodiment of the present invention;

[0030] Figure 5 This is a schematic diagram of the structure of a multi-sensing target detection head according to an embodiment of the present invention;

[0031] Figure 6 The figure is a flowchart of the alarm system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0033] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] Embodiment 1

[0035] like Figure 1 As shown, this embodiment provides a substation infrared image rat recognition method based on deep learning, including the following steps:

[0036] Step 1: Use an infrared camera to obtain image data of the area where rats exist in the substation and mark the data.

[0037] Infrared technology is more sensitive when detecting animal body temperature. Therefore, this embodiment uses an infrared camera to obtain image data of the area where rats exist in the substation, which can improve image quality and recognition rate. After the substation infrared image acquisition is completed, the LabelImg image annotation tool is used to annotate all rat targets in the substation infrared images one by one according to coordinates and categories. Among them, LabelImg is a visual image calibration tool used for data set annotation of target detection.

[0038] Step 2: Use temperature disturbance simulation and image transformation technology to preprocess the infrared image mouse dataset, and randomly divide the preprocessed data into training data and verification data.

[0039] The principle of infrared imaging technology is to obtain images through infrared radiation emitted by infrared cameras. Infrared radiation is closely related to the temperature of objects. Therefore, by simulating infrared images under different temperature conditions through temperature disturbance, the infrared image mouse data set can be enriched, making the subsequent detection algorithm more generalizable. After obtaining the infrared image after temperature disturbance simulation, image transformation technology is used to continue data preprocessing, including rotating and cropping the image data to increase the diversity of infrared image mouse training data. After data preprocessing, the data is randomly divided into training data and verification data in proportion.

[0040] Step 3: Propose a substation infrared image rat recognition algorithm for identifying rat targets in the substation. The network structure of the substation infrared image rat recognition algorithm constructed in this embodiment is as follows: Figure 2 shown.

[0041] Step 3.1: A feature extraction module DSIM (Deformable Small Target Information Capture Module) is designed. By fusing deformable convolution within the module and increasing the trainable offset, it can adapt to the different forms of rats collected in the substation, better fit the rat targets in the feature map, and enhance the generalization ability of rat detection in substation infrared images.

[0042] This embodiment designs a DSIM module. For the first feature map of the input substation infrared image The structure of this module is as follows Figure 3 shown.

[0043] Step 3.1.1: The first feature map Input deformable convolution, which adds an offset to the standard convolution sampling point position , the complete process is defined as:

[0044]

[0045] In the formula, Refers to the locations of all sampling points, Refers to each position in the input feature map, For weighted operation, Refers to the sampling position of the input feature map.

[0046] First feature map After the above deformable convolution operation, batch normalization and ReLU function operation are performed to obtain the second feature map .

[0047] Step 3.1.2: The second feature map The channel splitting operation is performed on the channel dimension, and the number of channels is The third characteristic map of the channel number 1 / 2 And the fourth characteristic diagram .

[0048] Step 3.1.3: The fourth feature map Input into the deformable convolution, followed by batch normalization and ReLU function operations, to obtain the output fifth feature map .

[0049] Step 3.1.4: The fifth feature map Input to a DAT (Deformable Attention) deformable attention module, in which the fifth feature map is first input Generate a uniform reference grid of dimensions , the fifth feature map Multiply it with the parameter matrix for linear projection to get a query vector , and then Input into an offset subnetwork offset to get the offset based on the reference grid ,Right now The reference point The corresponding offset By adding them together, we get the shift point of each reference point after offset. Then, we use bilinear interpolation to sample the coordinates of the shift point to get a sampled feature. Linearly project the sampled feature to get a key vector and a numeric vector , the calculation process is as follows:

[0050]

[0051] In the formula, express The input is a depth-wise separable convolution of size k×k and stride r, a GELU activation function, and an offset subnetwork consisting of a 1×1 convolution. , and are the parameter matrices for linear projection of q, k and v respectively, represents a learnable parameter used to control the offset, Indicates bilinear interpolation. After obtaining q, k, and v respectively, the output result is calculated based on multi-head attention:

[0052]

[0053] In the formula, Indicates the DAT module Finally, the features of each attention head are concatenated, and then the concatenated features are multiplied by the output weight matrix to obtain the output sixth feature map .

[0054] Step 3.1.5: The third feature map And the sixth characteristic diagram Perform residual connection on the channel dimension to obtain a feature map with the number of channels as the third And the sixth characteristic diagram The seventh feature map of the sum of the number of channels .

[0055] Step 3.1.6: Substation infrared characteristic map Input into the convolution, and then perform batch normalization and ReLU function operations in sequence to obtain the output eighth feature map .

[0056] Step 3.2: A DG-SPPF (DWConv GAM Spatial Pyramid Pooling Factorization) is designed to downsample in the network, amplify global interaction features while reducing the risk of overfitting, and avoid feature information loss and spatial distortion. The structure of DG-SPPF is as follows Figure 4 shown.

[0057] Step 3.2.1: Extract the features of the infrared feature map of the substation to be processed and obtain the first pooled feature map Input into the depth separable convolution, and then input into the batch normalization layer to get the output second pooling feature map .

[0058] Step 3.2.2: The second pooling feature map Input to the global attention mechanism module GAM (GlobalAttention Mechanism), in which the second pooling feature map is first Perform channel attention enhancement operation:

[0059]

[0060] In the formula, Represents the channel attention enhancement operation, Indicates element-by-element multiplication, and then outputs the result Perform spatial attention enhancement operation to obtain the output third pooling feature map of GAM :

[0061]

[0062] In the formula, Represents a spatial attention enhancement operation.

[0063] Step 3.2.3: Pool the output of the GAM module into the third feature map Input to the maximum pooling layer to get the fourth pooling feature map , and then input two layers of maximum pooling layers in sequence to obtain the fifth pooling feature map And the sixth pooling feature map .

[0064] Step 3.2.4: The third pooling feature map , the fourth pooling feature map , the fifth pooling feature map And the sixth pooling feature map Splicing along the channel dimension to obtain the output seventh pooling feature map .

[0065] Step 3.2.5: The seventh pooled feature map after splicing in the channel dimension Input into the depth separable convolution, and then input into the batch normalization layer to obtain the output eighth pooling feature map of DG-SPPF .

[0066] Step 3.3: If Figure 5 As shown in the figure, a multi-perception target detection head MP-Head (Multi Perception Head) is designed, which consists of a scale perception module, a space perception module and a task perception module. It perceives the target from multiple angles on the feature map to enhance the detection accuracy, and integrates SPD convolution to enrich the detailed features of the mouse target in the infrared image of the substation.

[0067] Step 3.3.1: Extract the features of the infrared feature map of the substation to be processed and obtain the first perception feature map , input scale perception module, first perception feature map In this module, it first enters the average pooling layer, then enters the SPD convolution layer and batch normalization layer in sequence, and then uses the Leaky ReLU function for activation to avoid gradient disappearance. Finally, the second perceptual feature map obtained after the Leaky ReLU function operation is First Perceptual Feature Map Perform element-by-element multiplication to obtain the output third perception feature map of the scale perception module The expression of the scale-aware module is as follows:

[0068]

[0069] In the formula, BN represents the batch normalization layer, S represents the width and height product of the feature map, and C represents the number of channels of the feature map. Through the above-mentioned scale perception module, the output third perception feature map is obtained .

[0070] Step 3.3.2: The third perceptual feature map Input spatial perception module, third perception feature map In this module, the adaptive kernel SPD convolution is first entered. The adaptive kernel means that the convolution will use SPD convolution with different numbers of convolution kernels according to the different input levels, and unify the inputs of different levels into the output of one level. After the output, it immediately enters the batch normalization layer, and then enters the offset layer and batch normalization layer in turn to obtain the output fourth perceptual feature map . The fourth perceptual feature map Activate through a Leaky ReLU function to get the output fifth perceptual feature map At the same time, the fourth perceptual feature map Input the convolution layer and batch normalization layer to get the sixth perception feature map Finally, the fourth perceptual feature map 、Fifth Perception Characteristic Map 、Sixth Perception Characteristics Perform element-by-element multiplication to obtain the seventh perceptual feature map output by the spatial perception module The expression of the spatial perception module is as follows:

[0071]

[0072] Where L represents the level of feature map. represents the number of sparse sampling locations, is the learnable weight parameter, The spatial offset that indicates the self-learning is concentrated in the moving position of the unique area, which is used to focus on some discriminative positions, Indicates that the self-learning is in position The important scalar at The intermediate level is learned. After being processed by the spatial perception module, the features of the mouse target will become clearer, and the foreground targets at various positions will then be able to be identified.

[0073] Step 3.3.3: The seventh perceptual feature map Input task perception module, seventh perception feature map In this module, we first enter the average pooling layer to get the output eighth perceptual feature map , and then the output eighth perceptual feature map The full connection layer, Leaky ReLU function, full connection layer and H_Sigmoid activation function are input in sequence to perform operations, and the output ninth perceptual feature map is obtained. ,At the same time, the task perception module defines the threshold control vector [ ], and a fixed vector [ ], which is used to dynamically control the switches of different feature map channels according to different tasks. The threshold control vector and the fixed vector are added to output the ninth perceptual feature map of the upper layer. After scaling and translation of the vector, the output tenth perceptual feature map is obtained. Finally, the tenth perceptual feature map The eighth perceptual characteristic diagram Perform element-by-element multiplication to obtain the output eleventh perception feature map of the task perception module The expression of the perception module is as follows:

[0074]

[0075] In the formula, Represents the feature slice of the Cth channel.

[0076] Step 3.4: This embodiment proposes a detection algorithm based on the feature extraction module designed in Step 3.1, the spatial pyramid pooling structure designed in Step 3.2, and the multi-sensory target detection head designed in Step 3.3 to realize rat detection in infrared images of substations. Figure 2 shown.

[0077] In this algorithm, a convolution layer plus a batch normalization layer is first designed at the input of the infrared image to process the mouse infrared image Input convolution layer plus batch normalization layer, get output , Secondly, it is the main part of the model. This embodiment designs a two-layer feature extraction structure in this part, wherein the first feature extraction structure is a combination of DSIM module + convolution layer + DSIM module, and the second feature extraction structure is a combination of DSIM module + convolution layer + DSIM module + DG-SPPF module, After inputting these two layers of structures in sequence, the results of feature extraction are output respectively and Then, this embodiment designs a feature pyramid and a path aggregation structure to extract the main part features. and The feature pyramid is used to transfer the mouse feature information in the infrared image from the high dimension to the low dimension through upsampling, which plays a role in feature fusion. The path aggregation structure is used to transfer the mouse feature information from the shallow layer to the deep layer of the network, increasing the mouse feature expression ability in the shallow infrared image. After the feature pyramid and the path aggregation structure complete the infrared feature map of the substation, the processing results of the two branches are output. and , corresponding to the two-branch feature processing results of small and large targets respectively. Next, this embodiment designs the detection head part of the algorithm, and connects the processing results of the two branches of the feature pyramid and the path aggregation structure respectively. and And identify; In particular, this embodiment defines the number of multi-sensory detection heads MP-Head connected to each branch of the upper layer as 2. Compared with a single multi-sensory detection head, the multi-angle perception of the two-branch processing results output by the feature pyramid and path aggregation structure is strengthened, and the recognition is completed in the upper and lower multi-sensory detection heads. and After that, the recognition result of the detection head of the two branches is output and , then, this embodiment will and Merge, that is, merge the recognition results of the two-branch detection head of small and large targets to get the output Finally, this embodiment designs a regression and classifier to connect the processing results of the upper layer detection head part , by adjusting The number of channels is converted to include the target coordinate frame and category confidence, and the final mouse target detection result of the algorithm is obtained. .

[0078] Step 4: Input the training data and verification data into the substation infrared image rat detection algorithm for training until the algorithm loss function converges.

[0079] Initialize the parameters and hyperparameters of the substation infrared image rat recognition algorithm, such as the number of training times, batch size, optimizer, learning rate type, and initial learning rate.

[0080] After completing the above preparations, input the training data and verification data into the substation infrared image rat detection algorithm for training until the algorithm loss function converges. In each round of training, the algorithm grabs the substation infrared image rat recognition data in the training set according to the batch preset value for training, updates the loss value and various parameters in the algorithm, and after each round of training, grabs the substation infrared image rat recognition data in the verification set according to the batch preset value for verification to check the effectiveness of each round of training. When the algorithm is trained until the loss value tends to converge, the substation infrared image rat recognition algorithm training is completed.

[0081] Step 5: Algorithm testing and application

[0082] After the training of the substation infrared image rat detection algorithm is completed, infrared image data of rat targets in several substations are collected as test data, and the test data is input into the substation infrared image rat detection algorithm with the optimal network parameters after training to conduct rat target test of substation infrared images.

[0083] This embodiment uses the accuracy and recall As an indicator of algorithm verification, the accuracy of the test target and recall When the expected effect is achieved, it will be deployed in actual applications for pilot application. The detection algorithm will be deployed to the infrared cameras in the pilot substations. The detection algorithm will be used to extract and identify the hidden dangers of rat targets in the substations in real time, and detect the rat targets captured by the infrared cameras.

[0084] Step 6: Alarm and Monitoring

[0085] In Step 5, the substation infrared image rat detection algorithm of this embodiment is deployed to the infrared camera of the pilot substation to monitor rat targets in real time, and then a corresponding alarm system is designed to achieve early warning. The workflow of the alarm system is as follows: Figure 6 shown.

[0086] First, the probability threshold of rat detection algorithm in substation infrared images is set. When the category confidence in the target output channel captured by the infrared camera exceeds the threshold, the system will determine that there is a rat hazard in this area of ​​the substation and trigger the alarm program.

[0087] In the alarm program, first save the infrared image where the corresponding infrared camera captures the rat target, the position or number of the corresponding infrared camera in the substation, the position of the target coordinate frame of the corresponding detection result, the number of target coordinate frames of the corresponding detection result, the confidence value of whether it is a rat and the time point corresponding to the detection result, and save the above alarm related information to the server. At the same time, the relevant information is sent to the staff responsible for rodent control in the substation through email and other communication methods, so that the relevant staff can carry out corresponding treatment measures in time.

[0088] Embodiment 2

[0089] In the substation with infrared cameras deployed in the power system, the target area where rats exist in the station is captured. After capturing 500 infrared image data containing rat targets, the LabelImg image annotation tool is used to annotate the rat targets in all infrared images with categories and coordinate frame information. In the LabelImg tool, first select the VOC annotation format so that the generated annotation file is in .xml format. Then, for each collected infrared image data containing rat targets, drag the anchor box to select it, and select the corresponding category label after selecting it. When annotating a new category for the first time, enter the category information in the category pre-selection box. The category of this data is a single rat category. Each image contains one or more rat targets. If there are multiple rat targets, the corresponding infrared image rat targets need to be selected with multiple anchor boxes. After the rat targets of all infrared images are annotated, 500 XML-formatted annotation files can be obtained. The name of each annotation file is consistent with the name of the corresponding infrared image. Each annotation file can contain annotation anchor box information and category information of multiple targets.

[0090] After all the infrared image mouse targets are labeled, the temperature perturbation technology is used to preprocess the infrared image data set. First, the original infrared image is read through the OpenCV library function Then, the normal() function of the random sub-library of the Numpy library is used to add Gaussian noise that obeys the normal distribution to the infrared image. The standard deviation parameter of the distribution of this function is selected as 25, and the size parameter is selected as the length and width of the infrared image. The output is , and then Compared with the original infrared image Add together and get Output after temperature disturbance simulation , and then use Gaussian filtering to smooth , and get the output after reducing the noise effect At this point, the temperature disturbance simulation process of an infrared image is completed. Image transformation technology is used for data enhancement preprocessing, mainly for rotating and cropping infrared images. For the rotation process: import the OpenCV library and use the getRotationMatrix2D() function of the OpenCV library to construct the rotation matrix Then, use the warpAffine() function to Perform an affine transformation. The affine transformation parameter of this function is the rotation matrix. , the rotated infrared image is obtained by affine transformation , so far, the rotation process of an infrared image is completed. For the cropping process: Since the infrared image can exist in the form of a Numpy array in the Python code, the input image can be directly To crop, set the random cropping starting point coordinates and the width and height of the cropping area within the appropriate threshold range, and perform the slicing operation on the Numpy array. Cut and get the output after cutting ,At this point, the cropping process of an infrared image is completed. After completing the above data preprocessing process, the number of images and annotation file data of the original annotated infrared image dataset becomes 1500, of which 500 are data after data preprocessing, 500 are data after temperature disturbance simulation and rotation, and 500 are data after temperature disturbance simulation and cropping.

[0091] After the infrared image data set preprocessing is completed, the data set is divided. In order to ensure that the detection algorithm of this embodiment has sufficient training data, this embodiment randomly divides the training set and the verification set into 8:2 ratios. After the division, 1200 sets of training data and 300 sets of verification data can be obtained.

[0092] The detection algorithm designed according to this embodiment is used to train the training and verification data corresponding to the above-mentioned preprocessed infrared images to complete the modeling of the substation infrared image rat detection algorithm.

[0093] First, initialize the various parameters and hyperparameters of the algorithm training. This embodiment explains several important parameters in the algorithm training: initialize the corresponding training batch size according to the hardware environment, initialize the optimizer to the optimizer, initialize the training rounds to 200, the learning rate type to the cosine learning rate, and the initial learning rate to 0.001. These parameters need to be adjusted according to the results of multiple algorithm training until the algorithm modeling achieves the optimal effect.

[0094] After completing the initialization of the basic parameters of the algorithm training, the model training begins. The pre-processed data is input into the substation infrared image mouse detection algorithm of the present invention. Assume that the input substation infrared image is In this network, the input substation infrared feature map is first Input convolution layer and batch normalization layer to get output Then, the feature map is input into the DSIM module, convolution, and DSIM module for feature extraction, and the output is obtained. , and then the substation infrared characteristic map Input DSIM module, convolution, DSIM module, and DG-SPPF module in sequence for feature extraction, and get At this point, the feature extraction of the backbone part of the network is completed. Next, the detection algorithm of this scheme will use the infrared feature map of the substation Input two parts for processing respectively. The first part is input into the DSIM module to get the output The second part realizes the transfer of deep features to shallow features in the feature pyramid: First, the infrared feature map of the substation Perform bilinear interpolation to get the output , then, the infrared characteristic map of the substation and Splice along the channel dimension to get the splicing result , then Input into DSIM module for feature extraction and get output At this point, the process of transferring deep features to shallow features in the feature pyramid is completed. The first part is the process of transferring shallow features to deep feature information in path aggregation, which converts the infrared feature map of the substation into Input DSIM module and DSIM module in turn to transfer feature information from shallow features to deep features, and get output , and then the substation infrared characteristic map and Splice and get the output At this point, the process of transferring shallow features to deep features in path aggregation is completed. and After the detection output of the two scales, the infrared characteristic map of the substation is and Both input the combination of two multi-sensory detection heads and obtain and , and then the substation infrared characteristic map and To merge, and Two feature maps of different sizes are superimposed element by element to obtain a comprehensive output In order to obtain the infrared signature of the substation In the output, we can get whether the target is a mouse and the corresponding coordinate frame position in the infrared image. Enter the final regression and classifier, in which the The number of channels only contains the category index, target coordinate box and category confidence. Finally, the overlapping bounding boxes are removed through non-maximum suppression to obtain the final output of the algorithm. The training of the detection algorithm of the present invention is to update the parameters within the algorithm through the back propagation of the loss function. In the loss function described in the present invention, the loss of the bounding box coordinates of the mouse target adopts the WIoUv3 loss, the confidence loss of the bounding box adopts the binary cross entropy loss, and the classification loss of whether it is a mouse adopts the cross entropy loss. The above loss function is updated round by round during the gradient back propagation process of algorithm training. The algorithm gradually converges in the rounds of training, and the detection accuracy gradually improves. After all rounds of training are completed, the algorithm will call the divided verification data to test the accuracy of the algorithm. and recall After the algorithm training is completed, a number of infrared image data with rat targets are collected by the infrared camera in the substation as test data, and the data is input into the substation infrared image rat detection algorithm with optimal network parameters after training to test the effect.

[0095] After the substation infrared image rat detection algorithm with the optimal network parameters is trained by the present invention, the substation infrared image rat detection algorithm is deployed to the infrared camera of the pilot substation to realize rat target monitoring in various areas of the substation. The probability threshold of the substation infrared image rat detection algorithm when detecting rats is set to 0.7. When the detection algorithm deployed in the infrared camera detects that the category confidence of the target exceeds the threshold during continuous monitoring, the system determines that there is a rat hazard in the area, and then saves the infrared image of the corresponding infrared camera when it captures the target. , the corresponding infrared camera position or number in the substation , the target coordinate frame position corresponding to the detection result , the number of target coordinate frames corresponding to the detection results , whether it is the confidence value of a mouse The time point corresponding to the test result to the database of the server where the system is located, and at the same time, in the system backend, the above information is used to construct an email object through the SMTP protocol service of the smtplib library, and then the relevant mouse hazard information is sent through the sendmail() function of the smtplib library. Sent to staff to remind relevant staff to take appropriate measures in a timely manner.

[0096] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A rat recognition method for substation infrared images based on deep learning, It is characterized in that The following steps are involved: Obtain infrared image datasets of rats in substations and perform preprocessing; Based on the feature extraction module, spatial pyramid pooling structure and multi-sensory target detection head, a rat detection algorithm for substation infrared images is constructed; Training the substation infrared image rat detection algorithm based on the preprocessed infrared image dataset; The trained substation infrared image rat detection algorithm is deployed in the substation's infrared camera to conduct real-time monitoring and early warning of rats in the substation; The process of processing the infrared image of the mouse in the substation based on the feature extraction module includes: extracting features of the infrared image to be processed to obtain a first feature map, inputting the first feature map into a deformable convolution to perform a deformable convolution operation, performing batch normalization and ReLU function operation on the first feature map after the deformable convolution operation to obtain a second feature map; performing a channel splitting operation on the second feature map in the channel dimension to obtain a third feature map and a fourth feature map whose channel numbers are half of the channel number of the second feature map; inputting the fourth feature map into the deformable convolution, and then performing batch normalization and ReLU function operations in sequence to output a fifth feature map; inputting the fifth feature map into the deformable attention module for processing, and outputting a sixth feature map; performing a residual connection on the third feature map and the sixth feature map in the channel dimension to obtain a seventh feature map whose channel number is the sum of the channel numbers of the third feature map and the sixth feature map; performing a convolution operation on the seventh feature map, and then performing batch normalization and ReLU function operations in sequence to output an eighth feature map; The process of inputting the fifth feature map into the deformable attention module for processing includes: processing the dimension of the input fifth feature map to generate a uniform reference grid, multiplying the fifth feature map by the parameter matrix for linear projection to obtain a query vector, and then inputting the query vector into an offset subnetwork to obtain an offset based on the reference grid; adding each reference point in the reference grid to the corresponding offset to obtain the shift point after each reference point is shifted; then using bilinear interpolation to perform feature sampling on the coordinates of the shift point to obtain sampled features, linearly projecting the sampled features to obtain key vectors and numerical vectors; extracting features from the key vectors and numerical vectors based on multi-head attention, connecting the extracted features of each attention head, and then multiplying the connected features with the output weight matrix to output the sixth feature map; The process of processing the infrared image of mice in the substation based on the spatial pyramid pooling structure includes: extracting features of the infrared image to be processed to obtain a first pooling feature map, inputting the first pooling feature map into a depthwise separable convolution, and then inputting the first pooling feature map into a batch normalization layer to output a second pooling feature map; inputting the second pooling feature map into a global attention mechanism module, performing a channel attention enhancement operation, and outputting a third pooling feature map; inputting the third pooling feature map into a maximum pooling layer to obtain a fourth pooling feature map, and then inputting the second pooling feature map into two layers of maximum pooling layers in sequence to obtain a fifth pooling feature map and a sixth pooling feature map respectively; splicing the third pooling feature map, the fourth pooling feature map, the fifth pooling feature map and the sixth pooling feature map along the channel dimension to output a seventh pooling feature map; inputting the seventh pooling feature map into a depthwise separable convolution, and then inputting the second pooling feature map into a batch normalization layer to output an eighth pooling feature map.

2. The substation infrared image rat recognition method based on deep learning according to claim 1, It is characterized in that The process of preprocessing the infrared image data set includes: preprocessing the infrared image data set based on temperature disturbance simulation technology and image transformation technology, and dividing the preprocessed infrared image data set into training data and verification data.

3. The substation infrared image rat recognition method based on deep learning according to claim 1, It is characterized in that The process of processing the infrared image of mice in the substation based on the multi-sensory target detection head includes: the multi-sensory target detection head includes a scale perception module, a spatial perception module and a task perception module; feature extraction is performed on the infrared image to be processed to obtain a first perception feature map, and the first perception feature map is input into the scale perception module. In the scale perception module, the first feature map is first input into the average pooling layer, and then sequentially input into the SPD convolution layer and the batch normalization layer, and then activated using the LeakyReLU function to obtain a second perception feature map, and the second perception feature map is element-wise multiplied with the first perception feature map to output a third perception feature map; the third perception feature map is input into the spatial perception module, and in the spatial perception module, the third feature map is first input into the adaptive kernel SPD convolution, and the inputs of different levels are unified into the output of one level, and then the output immediately enters the batch normalization layer, and then enters the offset layer and the batch normalization layer in sequence to output the fourth feature map; activate the fourth feature map through the LeakyReLU function to output the fifth feature map, and at the same time, input the fourth feature map into the convolution layer and the batch normalization layer to obtain the sixth feature map; multiply the fourth feature map, the fifth feature map and the sixth perceptual feature map element by element to output the seventh feature map; input the seventh feature map into the task perception module, in the task perception module, the seventh feature map is first input into the average pooling layer to output the eighth perceptual feature map, and then the eighth perceptual feature map is sequentially input into the fully connected layer, the LeakyReLU function, the fully connected layer and the H_Sigmoid activation function for operation to output the ninth perceptual feature map. At the same time, the task perception module defines a threshold control vector and a fixed vector, and after adding the threshold control vector and the fixed vector, the ninth perceptual feature map is scaled and offset to obtain the tenth perceptual feature map; the tenth perceptual feature map is element-wise multiplied with the eighth perceptual feature map to output the eleventh perceptual feature map.

4. The substation infrared image rat recognition method based on deep learning according to claim 1, It is characterized in that The structure of the substation infrared image rat detection algorithm includes: the input is a convolution layer plus a batch normalization layer; the main body connected to the input is divided into a two-layer feature extraction structure, wherein the first feature extraction structure is a combination of a feature extraction module, a convolution layer and a feature extraction module, and the second feature extraction structure is a combination of a feature extraction module, a convolution layer, a feature extraction module and a spatial pyramid pooling structure; then the feature pyramid and the path aggregation structure are used to connect the main part, and then a multi-sensory target detection head is used to connect the feature pyramid and the path aggregation structure respectively, and finally a regression and classifier are designed to connect the multi-sensory target detection head to complete the construction of the substation infrared image rat detection algorithm.

5. The substation infrared image rat recognition method based on deep learning according to claim 2, It is characterized in that The process of training the substation infrared image rat detection algorithm includes: initializing various parameters and hyperparameters of the substation infrared image rat detection algorithm, inputting training data and verification data into the substation infrared image rat detection algorithm for training, and updating various parameters and hyperparameters until the loss value converges and the training ends.

6. The substation infrared image rat recognition method based on deep learning according to claim 5, It is characterized in that The indicators for verifying the trained substation infrared image rat detection algorithm include: accuracy and recall rate.

7. The substation infrared image rat recognition method based on deep learning according to claim 1, It is characterized in that The process of real-time monitoring and early warning of rats in the substation includes: firstly, setting the probability threshold of the rat detection algorithm of the substation infrared image when detecting rats, and when the category confidence in the target output channel captured by the infrared camera exceeds the probability threshold, issuing an early warning, saving the early warning related information, and then sending it to the staff responsible for rat control in the substation in the form of communication; Among them, the warning-related information includes the infrared image when the infrared camera captures the mouse target, the position or number of the corresponding infrared camera in the substation, the target coordinate frame position of the corresponding detection result, the number of target coordinate frames of the corresponding detection result, the confidence value of whether it is a mouse and the time point corresponding to the detection result.

Citation Information

Patent Citations

  • Method for recognizing transformer substation insulator infrared image detection model in any direction based on artificial intelligence

    CN112199993A

  • Dynamic head for object detection

    CN117099136A

  • Mouse detection model construction method and mouse detection method and device

    CN117671597A

  • Substation operation site foreign matter intrusion detection method based on improved yolov4

    CN118038021A

  • Layout-Independent License Plate Detection and Recognition System Based on Attention Method

    KR102625312B1

Cited By

  • Domino type mouse repelling device for transformer substation and operation control method

    CN120092767A

  • A domino mouse repelling device for a substation and a method of operation control

    CN120092767B

  • Domino type mouse repelling device for transformer substation

    CN223994283U