Image recognition method and device, electronic equipment and storage medium
By using lightweight backbone networks and feature enhancement modules in the power equipment recognition model, the problems of slow detection rate and low recognition accuracy in power equipment detection are solved, and efficient recognition in complex scenarios is achieved.
Patent Information
- Application Number
- CN202410758583.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-17
AI Technical Summary
Existing power equipment detection methods based on infrared images have a large number of parameters in the target detection model, resulting in a slow detection rate, and high missed detection and false detection rates in specific scenarios such as target occlusion, long distances, small targets, and multiple similar targets. The problem of low recognition accuracy.
It uses a lightweight backbone network combined with feature enhancement modules, including the starting module, MBConv module and Fused-MBConv module, uses the coordinate attention mechanism to obtain channel and spatial information, and optimizes the number of parameters to improve detection efficiency and recognition accuracy.
It improves the detection efficiency and accuracy of the power equipment identification model, reduces the missed detection rate and false detection rate, and is suitable for power equipment identification in complex scenarios.
Smart Images

Figure CN118657992A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition, and in particular to an image recognition method, device, electronic equipment and storage medium. Background Art
[0002] As my country's power system continues to increase its requirements for intelligence, automation and safety, artificial intelligence inspection methods are gradually replacing traditional manual inspection methods. Using artificial intelligence technology to conduct large-scale inspections of power equipment is essential for identifying key equipment, monitoring equipment status and diagnosing faults. This technology can effectively improve inspection efficiency and accuracy, while reducing safety risks and accident rates, and enhancing the stability and reliability of the power system.
[0003] At present, the detection methods of power equipment based on infrared images mainly include traditional image processing methods and deep learning methods. Both types of target detection methods have been widely used in power inspection. Traditional image processing methods rely on manual design and extraction of image features, which cannot meet the requirements of efficient and intelligent power equipment inspection and real-time detection in actual working conditions. As substations gradually enter the big data era of intelligent inspection, the images collected by inspection equipment are not only huge in number, but also diverse in types. Traditional recognition methods are difficult to meet the needs of the big data era. In this context, relying on computer vision detection technology, it has become a necessary research to realize intelligent recognition of power equipment from massive image data. In recent years, deep learning has been used more and more widely in target detection and fault identification. The power equipment detection method based on deep learning technology has stronger capabilities in feature extraction and anti-interference, and has a natural advantage in image recognition of multi-scale and highly similar targets. Based on the current research on infrared image recognition of substation equipment, the following problems exist:
[0004] 1) The target detection model has a large number of parameters, resulting in a slow detection rate;
[0005] 2) In certain scenarios such as when the target is obscured, when there are small targets at a long distance, or when there are multiple similar targets, the missed detection rate and false detection rate are high, resulting in low overall recognition accuracy. Summary of the invention
[0006] The present invention provides an image recognition method, device, electronic device and storage medium to solve the above technical problems.
[0007] According to one aspect of the present invention, there is provided an image recognition method, comprising:
[0008] Acquire an infrared image of a substation equipment, and load a substation equipment recognition model corresponding to the infrared image of the substation equipment;
[0009] Inputting the infrared image of the substation equipment into the substation equipment recognition model for detection to obtain a predicted boundary box of the substation equipment in the infrared image;
[0010] The substation equipment identification model includes a lightweight backbone network, a feature fusion network and a prediction network, the lightweight backbone network includes a starting module, multiple MBConv modules and multiple Fused-MBConv modules without an attention mechanism, wherein the multiple MBConv modules and the multiple Fused-MBConv modules without an attention mechanism are combined based on a preset stacking method;
[0011] The starting module is used to perform preliminary processing and feature extraction on the infrared image; the MBConv module is used to perform further feature extraction on the feature map output by the starting module; a feature enhancement module is embedded in the MBConv module, and the feature enhancement module is established based on the coordinate attention mechanism, and is used to simultaneously obtain the channel dimension information and spatial dimension information of the infrared image, and learn adaptive channel weights to enhance the feature expression capability of channel information and spatial information; the Fused-MBConv module is used to optimize the number of parameters while maintaining the performance of the model.
[0012] According to another aspect of the present invention, there is provided an image recognition device, comprising:
[0013] A substation equipment recognition model loading module, used to obtain an infrared image of a substation equipment and load a substation equipment recognition model corresponding to the infrared image of the substation equipment;
[0014] An image recognition module, used for inputting the infrared image of the substation equipment into the substation equipment recognition model for detection, and obtaining a predicted boundary box of the substation equipment in the infrared image;
[0015] The substation equipment identification model includes a lightweight backbone network, a feature fusion network and a prediction network, the lightweight backbone network includes a starting module, multiple MBConv modules and multiple Fused-MBConv modules without an attention mechanism, wherein the multiple MBConv modules and the multiple Fused-MBConv modules without an attention mechanism are combined based on a preset stacking method;
[0016] The starting module is used to perform preliminary processing and feature extraction on the infrared image; the MBConv module is used to perform further feature extraction on the feature map output by the starting module; a feature enhancement module is embedded in the MBConv module, and the feature enhancement module is established based on the coordinate attention mechanism, and is used to simultaneously obtain the channel dimension information and spatial dimension information of the infrared image, and learn adaptive channel weights to enhance the feature expression capability of channel information and spatial information; the Fused-MBConv module is used to optimize the number of parameters while maintaining the performance of the model.
[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0018] at least one processor; and
[0019] a memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the image recognition method described in any embodiment of the present invention.
[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image recognition method described in any embodiment of the present invention when executed.
[0022] The technical solution of the embodiment of the present invention, by using a lightweight backbone network, can reduce the amount of network parameters while ensuring feature extraction performance, thereby solving the problem of slow detection rate of the target detection model due to the large amount of parameters; improving the detection efficiency of the substation equipment recognition model; at the same time, integrating a feature enhancement module into the lightweight backbone network to improve the ability to capture channel space information related to substation equipment in specific scenarios, solving the problem of high missed detection rate and false detection rate and low overall recognition accuracy in specific scenarios such as target occlusion, small targets at long distances, and multiple similar targets, thereby improving the accuracy of recognition of the substation equipment recognition model.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 is a flow chart of an image recognition method provided by Embodiment 1 of the present invention;
[0026] Figure 2 is a schematic diagram of the structure of the starting module provided in the first embodiment of the present invention;
[0027] Figure 3 is a schematic diagram of the structure of the MBConv module provided in the first embodiment of the present invention;
[0028] Figure 4 Schematic diagram of a depth-wise separable convolution provided in the first embodiment of the present invention;
[0029] Figure 5 is a schematic diagram of the structure of a feature enhancement module provided in Embodiment 1 of the present invention;
[0030] Figure 6 This is a schematic diagram of the structure of the Fused-MBConv module provided in the first embodiment of the present invention.
[0031] Figure 7 is a structural schematic diagram of an image recognition device provided by Embodiment 2 of the present invention;
[0032] Figure 8 It is a structural schematic diagram of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] Embodiment 1
[0036] Figure 1 This is a flowchart of an image recognition method provided by the first embodiment of the present invention. This embodiment is applicable to the case of identifying power equipment in infrared images in a substation scene. The method can be executed by an image recognition device, which can be implemented in the form of hardware and / or software. The image recognition device can be configured in electronic devices such as computers and servers. Figure 1 As shown, the method includes:
[0037] S110, acquiring an infrared image of a substation equipment, and loading a substation equipment recognition model corresponding to the infrared image of the substation equipment.
[0038] Among them, infrared images refer to infrared images containing a variety of substation equipment. Specifically, during the intelligent inspection process, infrared images of substation equipment in the power scene are collected by image acquisition equipment. The substation equipment includes but is not limited to common substation equipment such as voltage transformers, current transformers, lightning arresters, and transformers.
[0039] Among them, the substation equipment recognition model includes a lightweight backbone network, a feature fusion network and a prediction network. The lightweight backbone network is used to extract feature layers of multiple scales. The feature fusion network is used to fuse the feature layers extracted by the backbone network and output the fused feature map. The prediction network is used to predict the target's location, category and other attribute information based on the fused feature map and input the predicted bounding box of the target; wherein the predicted bounding box includes the target's location and category information.
[0040] The lightweight backbone network includes a starting module, multiple MBConv modules and multiple Fused-MBConv modules without an attention mechanism, wherein the multiple MBConv modules and the multiple Fused-MBConv modules without an attention mechanism are combined based on a preset stacking method.
[0041] The starting module is used to perform preliminary processing and feature extraction on infrared images, such as Figure 2 As shown in the figure, by using smaller convolution kernels and pooling layers in the initial stage of the lightweight backbone network, the starting module can improve the feature extraction capability of the input substation equipment image to a certain extent while keeping the number of network parameters and the amount of calculation unchanged, thereby improving the operation efficiency of the model. In addition, the starting module is designed at the first step of the lightweight backbone network, which can more efficiently guide the information flow to the correct path.
[0042] The MBConv module is used to further extract features from the feature map output by the starting module. The feature enhancement module is embedded in the MBConv module. The feature enhancement module is based on the coordinate attention mechanism and is used to simultaneously obtain the channel dimension information and spatial dimension information of the infrared image, and learn adaptive channel weights to enhance the feature expression ability of channel information and spatial information. Specifically, Figure 3 As shown in FIG. 1 , the MBConv module includes a 1×1 dimensionality-increasing convolution, a 3×3 depth-separable convolution, the feature enhancement module, a 1×1 dimensionality-reducing convolution, and a first fusion module connected in sequence; the first feature fusion module is used to fuse the input of the MBConv module and the output of the 1×1 dimensionality-reducing convolution. In the MBConv module, the 1×1 dimensionality-increasing convolution is used to expand the dimension of the data, and the 3×3 depth-separable convolution realizes feature extraction through channel-wise convolution and point-wise convolution, as shown in FIG. Figure 4 As shown in the figure, for channel-wise convolution, each channel has a dedicated convolution filter to process it, and the channel is only convolved with the filter, so the number of output feature layers is consistent with the number of channels in the input layer. Point-wise convolution is similar to standard convolution, and an updated feature map is formed by weighted fusion in the depth dimension of the feature map. Therefore, the number of output feature maps is equal to the number of convolution kernels. Compared with standard convolution, depthwise separable convolution, as an efficient convolution method, can significantly reduce the computational complexity of the network convolution process, thereby reducing the computational pressure of the algorithm when it is deployed on edge devices and improving the algorithm's operating efficiency and stability.
[0043] Based on the above embodiment, optionally, the feature enhancement module includes two pooling kernels in different directions, a convolution module and a weight update module; the two pooling kernels in different directions include a pooling kernel in a horizontal direction and a pooling kernel in a vertical direction, and the convolution module includes a 1×1 fused convolution and two 1×1 separate convolutions.
[0044] It should be noted that the background of the substation is complex. Although the infrared image has highlighted the main information of the power equipment to a certain extent, there is still a problem of insufficient feature extraction in certain specific scenarios. For example, there are many similar targets in the image area, the target size in the distance is small, and the feature information is blurred; or part of the target area is blocked, and the feature information is further weakened, making it difficult for the network to use the device features for accurate positioning.
[0045] In this embodiment, a feature enhancement module is established based on the coordinate attention mechanism (CA). The coordinate attention mechanism can accurately obtain the channel dimension and spatial dimension information of the infrared image of the substation equipment at the same time, and can learn adaptive channel weights, so that the model pays more attention to the features related to the equipment and suppresses useless features, thereby enhancing the ability to extract details of features in specific scenes. Figure 5 As shown in the figure, the feature enhancement module includes two pooling kernels in different directions, a convolution module and a weight update module. The feature enhancement module can be regarded as a spatial transformation function used to enhance the feature expression ability. It can take any feature map of the same size as input X and output a feature map Y of the same size with enhanced feature expression ability. Assuming that the dimension of input X is C×H×W, two pooling kernels (H, 1) and (1, W) are used to encode different channels of X in the horizontal and vertical directions, horizontal features and vertical features; further, the horizontal features and vertical features are spliced, and the spliced features are transformed based on 1×1 fused convolution to obtain fused features, and the fused features are split along the spatial dimension based on two 1×1 separated convolutions to obtain horizontal tensors and vertical tensors; further, the horizontal tensors and vertical tensors are expanded, and the expanded horizontal tensors and vertical tensors are used as attention weights, and the feature map Y is determined based on the input feature map X and the attention weights.
[0046] The Fused-MBConv module is used to optimize the number of parameters while maintaining the performance of the model. Specifically, Figure 6 As shown, the Fused-MBConv module includes a 3×3 convolution, a 1×1 convolution, and a second fusion module connected in sequence; the second fusion module is used to fuse the input of the Fused-MBConv module and the output of the 1×1 convolution. In this embodiment, by using Fused-MBConv without an attention mechanism, the model can be further simplified and the number of parameters can be reduced.
[0047] Based on the above embodiments, optionally, the training method of the substation equipment recognition model includes: obtaining an infrared image of the substation equipment, and performing pseudo-color enhancement on the infrared image to obtain an enhanced image; establishing a data set based on the annotated enhanced image; training a pre-constructed target detection model based on the data set to obtain a substation equipment recognition model; wherein the loss function for training the target detection model is the Focal-EIOU loss function.
[0048] Among them, the enhanced image refers to a color image after pseudo-color enhancement. In this embodiment, an infrared image of a substation is obtained, and the infrared image is pseudo-color enhanced to obtain an enhanced image; further, the enhanced image is annotated, and a data set is established based on the annotated enhanced image, and the data set includes a training set, a verification set, and a test set; further, a target detection model is trained based on the training set and the target detection model is verified based on the verification set to obtain a substation equipment recognition model; further, the trained substation equipment recognition model is tested based on the test set to obtain a test result.
[0049] Exemplarily, the calculation formula of the Focal-EIoU loss function is as follows:
[0050] L Focal-EIoU =IoU α L EIoU
[0051]
[0052] Among them, IoU represents the ratio of the intersection and union of the real bounding box A and the predicted bounding box B, which is an indicator used to evaluate the degree of overlap between the predicted bounding box and the real bounding box, also known as the intersection-over-union ratio. LEIoU represents the regression loss, and α is the weight factor for suppressing abnormal loss values, with a value between 0 and 5.
[0053] In some embodiments, optionally, the method for determining the preset stacking mode includes: pre-acquiring multiple initial substation equipment identification models, the stacking modes of the MBConv module and the Fused-MBConv module in the multiple initial substation equipment identification models are different, and the stacking modes include stacking quantity and / or stacking structure; evaluating the initial substation equipment identification models to obtain evaluation results, and determining the target substation equipment identification model based on the evaluation results of each initial substation equipment identification model; and determining the stacking mode of the MBConv module and the Fused-MBConv module in the target substation equipment identification model as the preset stacking mode.
[0054] Among them, multiple initial substation equipment identification models refer to substation equipment identification models with different stacking methods of pre-trained MBConv modules and Fused-MBConv modules. Specifically, the stacking method of MBConv modules and Fused-MBConv modules in the initial substation equipment identification model includes the stacking number and / or stacking structure of MBConv modules and Fused-MBConv modules. In this embodiment, multiple initial substation equipment identification models are obtained in advance, the initial substation equipment identification models are evaluated, and the evaluation results are obtained. The target substation equipment identification model is determined based on the evaluation results of each initial substation equipment identification model; the stacking method of MBConv modules and Fused-MBConv modules in the target substation equipment identification model is determined as a preset stacking method. Among them, the target substation equipment identification model refers to the substation equipment identification model with the best stacking method of MBConv modules and Fused-MBConv modules in multiple initial substation equipment identification models. It should be noted that the evaluation method of the initial substation equipment identification model includes but is not limited to recognition accuracy, recognition speed, model complexity, etc., which are not limited here.
[0055] In some embodiments, optionally, the method for determining the preset stacking method further includes: constructing a search space; the search space is composed of two neural network structures, namely, an MBConv module and a Fused-MBConv module; searching in the search space based on a preset search strategy to obtain multiple candidate network structures, wherein the stacking methods of the MBConv module and the Fused-MBConv module in the multiple candidate network structures are different; evaluating the multiple candidate network structures based on a preset evaluation criterion to obtain a target network structure, and determining the stacking method of the MBConv module and the Fused-MBConv module in the target network structure as the preset stacking method.
[0056] The preset search strategy refers to a search strategy for finding the optimal network structure in the search space. Specifically, the preset search strategy includes but is not limited to random search, genetic algorithm, reinforcement learning or gradient-based algorithm.
[0057] In this embodiment, a search space is constructed; a search is performed in the search space based on a preset search strategy to obtain multiple candidate network structures, wherein the candidate network structure refers to a network structure composed of MBConv modules and Fused-MBConv modules searched in the search space by the preset search strategy, and the stacking methods of MBConv modules and Fused-MBConv modules in different candidate network structures are different; further, multiple candidate network structures are evaluated based on preset evaluation criteria to obtain a target network structure, and the stacking method of MBConv modules and Fused-MBConv modules in the target network structure is determined as the preset stacking method. Among them, the preset evaluation criteria include but are not limited to the accuracy of the network model, the training speed, the number of parameters, etc., to determine the target network structure, and the target network structure refers to the network structure with the optimal stacking method of MBConv modules and Fused-MBConv modules in multiple candidate network structures.
[0058] S120: Input the infrared image of the substation equipment into the substation equipment recognition model for detection to obtain a predicted boundary box of the substation equipment in the infrared image.
[0059] In this embodiment, the infrared image of the substation equipment is input into the substation equipment recognition model for target detection to obtain a predicted boundary box of the substation equipment in the infrared image, wherein the predicted boundary box includes the location information and category information of the substation equipment.
[0060] The technical solution of this embodiment, by using a lightweight backbone network, can reduce the amount of network parameters while ensuring feature extraction performance, thereby solving the problem of slow detection rate of the target detection model due to the large amount of parameters; improving the detection efficiency of the substation equipment recognition model; at the same time, incorporating a feature enhancement module into the lightweight backbone network to improve the ability to capture channel spatial information related to substation equipment in specific scenarios, solving the problem of high missed detection rate and false detection rate and low overall recognition accuracy in specific scenarios such as target occlusion, small targets at a long distance, and multiple similar targets, thereby improving the recognition accuracy of the substation equipment recognition model.
[0061] Embodiment 2
[0062] Figure 7 FIG. 1 is a schematic diagram of the structure of an image recognition device provided by Embodiment 2 of the present invention. Figure 7 As shown, the device comprises:
[0063] The substation equipment recognition model loading module 710 is used to obtain an infrared image of the substation equipment and load the substation equipment recognition model corresponding to the infrared image of the substation equipment;
[0064] An image recognition module 720 is used to input the infrared image of the substation equipment into the substation equipment recognition model for detection, and obtain a predicted boundary box of the substation equipment in the infrared image;
[0065] The substation equipment identification model includes a lightweight backbone network, a feature fusion network and a prediction network, wherein the lightweight backbone network includes a starting module, multiple MBConv modules and multiple Fused-MBConv modules without an attention mechanism, wherein the multiple MBConv modules and the multiple Fused-MBConv modules without an attention mechanism are combined based on a preset stacking method;
[0066] The starting module is used to perform preliminary processing and feature extraction on the infrared image; the MBConv module is used to perform further feature extraction on the feature map output by the starting module; a feature enhancement module is embedded in the MBConv module, and the feature enhancement module is established based on the coordinate attention mechanism, and is used to simultaneously obtain the channel dimension information and spatial dimension information of the infrared image, and learn adaptive channel weights to enhance the feature expression capability of channel information and spatial information; the Fused-MBConv module is used to optimize the number of parameters while maintaining the performance of the model.
[0067] The technical solution of this embodiment, by using a lightweight backbone network, can reduce the amount of network parameters while ensuring feature extraction performance, thereby solving the problem of slow detection rate of the target detection model due to the large amount of parameters; improving the detection efficiency of the substation equipment recognition model; at the same time, incorporating a feature enhancement module into the lightweight backbone network to improve the ability to capture channel spatial information related to substation equipment in specific scenarios, solving the problem of high missed detection rate and false detection rate and low overall recognition accuracy in specific scenarios such as target occlusion, small targets at a long distance, and multiple similar targets, thereby improving the recognition accuracy of the substation equipment recognition model.
[0068] On the basis of the above embodiment, optionally, the device also includes a first preset stacking mode determination module, which is used to pre-acquire multiple initial substation equipment identification models, in which the stacking modes of the MBConv module and the Fused-MBConv module are different, and the stacking modes include stacking quantity and / or stacking structure; the initial substation equipment identification models are evaluated to obtain evaluation results, and the target substation equipment identification model is determined based on the evaluation results of each initial substation equipment identification model; and the stacking mode of the MBConv module and the Fused-MBConv module in the target substation equipment identification model is determined as a preset stacking mode.
[0069] Based on the above embodiment, optionally, the device also includes a second preset stacking method determination module, which is used to construct a search space; the search space is composed of two neural network structures, an MBConv module and a Fused-MBConv module; based on a preset search strategy, a search is performed in the search space to obtain multiple candidate network structures, and the stacking methods of the MBConv module and the Fused-MBConv module in the multiple candidate network structures are different; based on a preset evaluation standard, the multiple candidate network structures are evaluated to obtain a target network structure, and the stacking method of the MBConv module and the Fused-MBConv module in the target network structure is determined to be the preset stacking method.
[0070] Based on the above embodiments, optionally, the MBConv module includes a 1×1 dimensionality increase convolution, a 3×3 depthwise separable convolution, the feature enhancement module, a 1×1 dimensionality reduction convolution and a first fusion module connected in sequence; the first feature fusion module is used to fuse the input of the MBConv module and the output of the 1×1 dimensionality reduction convolution.
[0071] Based on the above embodiment, optionally, the feature enhancement module includes two pooling kernels in different directions, a convolution module and a weight update module; the two pooling kernels in different directions include a pooling kernel in a horizontal direction and a pooling kernel in a vertical direction, and the convolution module includes a 1×1 fused convolution and two 1×1 separate convolutions.
[0072] Based on the above embodiment, optionally, the Fused-MBConv module includes a 3×3 convolution, a 1×1 convolution and a second fusion module connected in sequence; the second fusion module is used to fuse the input of the Fused-MBConv module and the output of the 1×1 convolution.
[0073] On the basis of the above embodiment, optionally, the device also includes a training module for a substation equipment recognition model, which is used to obtain an infrared image of the substation equipment, and perform pseudo-color enhancement on the infrared image to obtain an enhanced image; establish a data set based on the annotated enhanced image; train a pre-constructed target detection model based on the data set to obtain a substation equipment recognition model; wherein the loss function for training the target detection model is a Focal-EIOU loss function.
[0074] The image recognition device provided in the embodiment of the present invention can execute the image recognition method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0075] Embodiment 3
[0076] Figure 81 is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0077] like Figure 8 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0078] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0079] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as an image recognition method.
[0080] In some embodiments, the image recognition method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the image recognition method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the image recognition method in any other appropriate manner (e.g., by means of firmware).
[0081] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0082] The computer programs for implementing the image recognition method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0083] Embodiment 4
[0084] Embodiment 4 of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute an image recognition method, the method comprising:
[0085] Acquire an infrared image of the substation equipment, and load a substation equipment recognition model corresponding to the infrared image of the substation equipment;
[0086] The infrared image of the substation equipment is input into the substation equipment recognition model for detection to obtain a predicted bounding box of the substation equipment in the infrared image;
[0087] The substation equipment recognition model includes a lightweight backbone network, a feature fusion network and a prediction network. The lightweight backbone network includes a starting module, multiple MBConv modules and multiple Fused-MBConv modules without an attention mechanism. The multiple MBConv modules and multiple Fused-MBConv modules without an attention mechanism are combined based on a preset stacking method.
[0088] The starting module is used to perform preliminary processing and feature extraction on the infrared image; the MBConv module is used to further extract features from the feature map output by the starting module; a feature enhancement module is embedded in the MBConv module. The feature enhancement module is based on the coordinate attention mechanism and is used to simultaneously obtain the channel dimension information and spatial dimension information of the infrared image, and learn adaptive channel weights to enhance the feature expression capability of channel information and spatial information; the Fused-MBConv module is used to optimize the number of parameters while maintaining the performance of the model.
[0089] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0090] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0091] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0092] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0093] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0094] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An image recognition method, characterized in that: include: Acquire an infrared image of a substation equipment, and load a substation equipment recognition model corresponding to the infrared image of the substation equipment; Inputting the infrared image of the substation equipment into the substation equipment recognition model for detection to obtain a predicted boundary box of the substation equipment in the infrared image; The substation equipment identification model includes a lightweight backbone network, a feature fusion network and a prediction network, the lightweight backbone network includes a starting module, multiple MBConv modules and multiple Fused-MBConv modules without an attention mechanism, wherein the multiple MBConv modules and the multiple Fused-MBConv modules without an attention mechanism are combined based on a preset stacking method; The starting module is used to perform preliminary processing and feature extraction on the infrared image; the MBConv module is used to perform further feature extraction on the feature map output by the starting module; a feature enhancement module is embedded in the MBConv module, and the feature enhancement module is established based on the coordinate attention mechanism, and is used to simultaneously obtain the channel dimension information and spatial dimension information of the infrared image, and learn adaptive channel weights to enhance the feature expression capability of channel information and spatial information; the Fused-MBConv module is used to optimize the number of parameters while maintaining the performance of the model.
2. The method according to claim 1, characterized in that The method for determining the preset stacking mode includes: Pre-acquire multiple initial substation equipment identification models, wherein the stacking modes of the MBConv modules and the Fused-MBConv modules in the multiple initial substation equipment identification models are different, and the stacking modes include the stacking quantity and / or the stacking structure; The initial substation equipment identification model is evaluated to obtain an evaluation result, and a target substation equipment identification model is determined based on the evaluation results of each initial substation equipment identification model; and the stacking method of the MBConv module and the Fused-MBConv module in the target substation equipment identification model is determined as a preset stacking method.
3. The method according to claim 2, characterized in that The method for determining the preset stacking mode further includes: Constructing a search space; the search space is composed of two neural network structures, the MBConv module and the Fused-MBConv module; Searching in the search space based on a preset search strategy to obtain multiple candidate network structures, wherein the stacking modes of MBConv modules and Fused-MBConv modules in the multiple candidate network structures are different; The multiple candidate network structures are evaluated based on a preset evaluation criterion to obtain a target network structure, and a stacking mode of the MBConv module and the Fused-MBConv module in the target network structure is determined as the preset stacking mode.
4. The method according to claim 1, characterized in that: The MBConv module includes a 1×1 dimensionality increase convolution, a 3×3 depthwise separable convolution, the feature enhancement module, a 1×1 dimensionality reduction convolution and a first fusion module connected in sequence; the first feature fusion module is used to fuse the input of the MBConv module and the output of the 1×1 dimensionality reduction convolution.
5. The method according to claim 1 or 4, characterized in that: The feature enhancement module includes two pooling kernels in different directions, a convolution module and a weight update module; the two pooling kernels in different directions include a pooling kernel in the horizontal direction and a pooling kernel in the vertical direction, and the convolution module includes a 1×1 fused convolution and two 1×1 separate convolutions.
6. The method according to claim 1, characterized in that The Fused-MBConv module includes a 3×3 convolution, a 1×1 convolution, and a second fusion module connected in sequence; the second fusion module is used to fuse the input of the Fused-MBConv module and the output of the 1×1 convolution.
7. The method according to claim 1, characterized in that The training method of the substation equipment identification model includes: Acquire an infrared image of the substation equipment, and perform pseudo-color enhancement on the infrared image to obtain an enhanced image; Establishing a data set based on the annotated enhanced image; A pre-built target detection model is trained based on the data set to obtain a substation equipment recognition model; wherein the loss function for training the target detection model is a Focal-EIOU loss function.
8. An image recognition device, characterized in that: include: A substation equipment recognition model loading module, used to obtain an infrared image of a substation equipment and load a substation equipment recognition model corresponding to the infrared image of the substation equipment; An image recognition module, used for inputting the infrared image of the substation equipment into the substation equipment recognition model for detection, and obtaining a predicted boundary box of the substation equipment in the infrared image; The substation equipment identification model includes a lightweight backbone network, a feature fusion network and a prediction network, the lightweight backbone network includes a starting module, multiple MBConv modules and multiple Fused-MBConv modules without an attention mechanism, wherein the multiple MBConv modules and the multiple Fused-MBConv modules without an attention mechanism are combined based on a preset stacking method; The starting module is used to perform preliminary processing and feature extraction on the infrared image; the MBConv module is used to perform further feature extraction on the feature map output by the starting module; a feature enhancement module is embedded in the MBConv module, and the feature enhancement module is established based on the coordinate attention mechanism, and is used to simultaneously obtain the channel dimension information and spatial dimension information of the infrared image, and learn adaptive channel weights to enhance the feature expression capability of channel information and spatial information; the Fused-MBConv module is used to optimize the number of parameters while maintaining the performance of the model.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the image recognition method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image recognition method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Power equipment infrared image detection method and system based on deep learning
CN114463257A
Automobile part detection method, system and equipment based on AI identification and storage medium
CN114861801A
Lightweight infrared weak and small target real-time detection method
CN115223026A
Method and system for identifying defects of conductor hardware fittings of overhead transmission line
CN115861854A
Automatic landslide identification method, system and device based on lightweight convolutional neural network and double attention, and medium
CN116206214A
