Power grid image anomaly detection method, device, equipment, medium and product

Through pre-trained visual basic models and adapters, feature extraction and abnormal identification of grid inspection images is solved, and the problems of low efficiency of grid image inspection and abnormal miss detection are realized, automatic abnormal detection is achieved, and operation and maintenance efficiency and defect discovery rate are improved. .

CN119181032APending Publication Date: 2024-12-24GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411207033.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The existing power grid image inspection mainly relies on manual methods, which are inefficient and easy to miss key information, resulting in abnormal missed inspections. Especially during drone inspections, the number of images is huge and the repetitiveness is high, resulting in time-consuming and labor-intensive work repetition.

Method used

The pre-trained large-scale visual basic model and adapter are used to extract the grid patrol image feature, obtain the abnormal score diagram through the discriminator and perform interpolation processing, identify the abnormal target and target area in the grid patrol image, and realize automatic abnormal detection .

Benefits of technology

Automatic abnormality detection of power grid images is realized, avoiding waste of human resources, quickly identifying and positioning abnormalities, improving operation and maintenance efficiency, reducing image processing burden, and improving defect discovery rate and line equipment reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119181032A_ABST
    Figure CN119181032A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power grids, and discloses a power grid image anomaly detection method, device and equipment, a medium and a product. The method comprises the steps that a power grid inspection image is acquired, feature extraction is performed on the power grid inspection image through a pre-trained large-scale visual basic model and an adapter, and adaptive features corresponding to the power grid inspection image are acquired; obtaining an abnormal score graph through a pre-trained discriminator according to the adaptive features, and performing interpolation processing on the abnormal score graph to obtain a standard abnormal score graph; and according to the standard anomaly score graph, identifying and obtaining an abnormal target and a corresponding target area in the power grid inspection image. According to the scheme of the embodiment, anomaly recognition is performed on the power grid inspection image based on the pre-trained large-scale visual basic model, the adapter and the discriminator, automatic anomaly detection of the power grid inspection image can be realized, waste of human resources can be avoided, anomaly can be quickly recognized and positioned, and operation and maintenance efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power grid technology, and in particular to a method, device, equipment, medium and product for detecting anomalies in power grid images. Background Art

[0002] Drone inspection has become a part of the daily work of the power grid. With the establishment of the production command center, drone inspections have gradually become centralized, and a large number of drone inspection tasks are concentrated on one team. Among them, browsing and checking drone inspection images is a task with a large workload, because using the automatic driving of the machine nest or drones in a day, thousands of images are obtained.

[0003] At present, the existing drone image inspection mainly adopts manual methods, which is time-consuming, labor-intensive and inefficient. In addition, due to the high frequency of automatic driving, the photo taking points are fixed and most of the photos are repeated, resulting in duplication of work. In addition, due to the large number of images, it is easy to miss key information when repeatedly reviewing similar photos, which can easily lead to missed detections of abnormalities. Summary of the invention

[0004] The present invention provides a method, device, equipment, medium and product for detecting anomalies in power grid images, which can realize automatic anomaly detection in power grid inspection images, avoid waste of human resources, quickly identify and locate anomalies, and improve operation and maintenance efficiency.

[0005] According to one aspect of the present invention, a method for detecting anomalies in a power grid image is provided, comprising:

[0006] Acquire a power grid inspection image, and extract features from the power grid inspection image using a pre-trained large-scale visual basic model and an adapter to obtain adaptation features corresponding to the power grid inspection image;

[0007] Obtaining an anomaly score map according to the adaptation features through a pre-trained discriminator, and performing interpolation processing on the anomaly score map to obtain a standard anomaly score map;

[0008] According to the standard anomaly score map, abnormal targets and corresponding target areas in the power grid inspection image are identified.

[0009] According to another aspect of the present invention, there is provided a device for detecting anomalies in a power grid image, comprising:

[0010] A feature extraction module is used to obtain a power grid inspection image, and extract features from the power grid inspection image through a pre-trained large-scale visual basic model and an adapter to obtain adaptation features corresponding to the power grid inspection image;

[0011] An anomaly score map acquisition module, used to acquire an anomaly score map according to the adaptation features through a pre-trained discriminator, and perform interpolation processing on the anomaly score map to obtain a standard anomaly score map;

[0012] The abnormality identification module is used to identify abnormal targets and corresponding target areas in the power grid inspection image according to the standard abnormality score map.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] 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 execute the method for detecting anomalies in a power grid image described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program is used to enable a processor to implement the method for detecting anomalies in a power grid image according to any embodiment of the present invention when executed.

[0018] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method for detecting anomalies in a power grid image according to any one of the embodiments of the present invention is implemented.

[0019] The technical solution of the embodiment of the present invention obtains a power grid inspection image, and extracts features of the power grid inspection image through a pre-trained large-scale visual basic model and an adapter to obtain adaptation features corresponding to the power grid inspection image; obtains an anomaly score map based on the adaptation features through a pre-trained discriminator, and interpolates the anomaly score map to obtain a standard anomaly score map; identifies abnormal targets and corresponding target areas in the power grid inspection image based on the standard anomaly score map; and performs anomaly recognition on the power grid inspection image based on a pre-trained large-scale visual basic model, an adapter and a discriminator, thereby realizing automatic anomaly detection of the power grid inspection image, avoiding waste of human resources, quickly identifying and locating anomalies, and improving operation and maintenance efficiency.

[0020] 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

[0021] 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.

[0022] Figure 1 is a flow chart of a method for detecting anomalies in a power grid image provided according to the first embodiment of the present invention;

[0023] Figure 2 Schematic diagram of the training and testing process of the image anomaly recognition model provided according to the first embodiment of the present invention;

[0024] Figure 3 is a schematic diagram of the structure of a power grid image anomaly detection device provided according to Embodiment 2 of the present invention;

[0025] Figure 4 It is a structural schematic diagram of an electronic device for implementing the abnormality detection method of a power grid image according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] 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.

[0027] It should be noted that the terms "first", "second", "target", 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 clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] Embodiment 1

[0029] Figure 1A flowchart of a method for detecting anomalies in power grid images is provided for the first embodiment of the present invention. This embodiment is applicable to the case where anomalies are identified and located in power grid inspection images of drones. The method can be performed by an anomaly detection device for power grid images. The anomaly detection device for power grid images can be implemented in the form of hardware and / or software. Typically, the anomaly detection device for power grid images can be configured in an electronic device, such as a computer device or a server. Figure 1 As shown, the method includes:

[0030] S110, acquiring a power grid inspection image, and performing feature extraction on the power grid inspection image through a pre-trained large-scale visual basic model and an adapter to acquire adaptation features corresponding to the power grid inspection image.

[0031] In this embodiment, drones can be used to patrol and inspect power grid lines regularly along set routes. During the inspection process, high-definition cameras, thermal imaging cameras or other special sensors carried by the drones can be used to capture images of power grid lines as power grid inspection images.

[0032] In this embodiment, an image anomaly recognition model can be pre-trained, and the power grid inspection image can be input into the image anomaly recognition model to obtain the anomaly recognition result output by the image anomaly recognition model. Among them, the image anomaly recognition model can include four parts: a large-scale visual foundation model (Foundation Model), an adapter (Adaptor), a discriminator (Discriminator) and a generator (Generator). The large-scale visual foundation model is used for feature extraction, the adapter is used to migrate features to drone data, the generator is used to generate abnormal features, and the discriminator is used to determine whether the feature is normal or abnormal.

[0033] Specifically, the power grid inspection image can be first input into a pre-trained large-scale visual basic model to obtain image features of different scales, and then the obtained image features of different scales can be input into a pre-trained adapter to obtain adaptation features.

[0034] Optionally, before extracting features from the power grid inspection image using a pre-trained large-scale visual basic model and an adapter to obtain adaptation features corresponding to the power grid inspection image, the method may further include:

[0035] Acquire historical inspection images, and preprocess the historical inspection images to obtain preprocessed historical inspection images;

[0036] Generate training sets, validation sets, and test sets based on preprocessed historical inspection images;

[0037] An initial large-scale visual basis model, an initial adapter and an initial discriminator are established, and the positive sample set and the negative sample set are used to iteratively train the initial large-scale visual basis model, the initial adapter and the initial discriminator to obtain trained large-scale visual basis models, adapters and discriminators.

[0038] In this embodiment, the high-definition camera, thermal imaging camera or other special sensors carried by the drone can be used to obtain image data of the target area in kml, uavx and other file formats at different times and under different weather conditions as historical inspection data. The image data of each line, each tower and each photo point is continuously updated.

[0039] Among them, preprocessing can include at least one of image damage detection, damaged image replacement, image resolution consistency processing, image geometry correction and image color correction. It should be noted that in the task of detecting abnormalities in drone inspection images, the quality of image data directly affects the subsequent recognition and analysis effects, so data preprocessing is a key step to ensure image quality and model performance. Data preprocessing can help reduce noise, standardize input data, enhance the robustness of the model, and improve the training efficiency of the model.

[0040] Typically, image damage detection, damaged image replacement, and image resolution consistency processing are used to achieve image quality inspection. Image geometry correction is used to correct image distortion caused by drone movement or camera angle, including lens distortion correction and perspective correction. Image color correction is used to adjust the color balance of the image to make the color of the image consistent under different shooting conditions.

[0041] Specifically, first, after obtaining the pre-processed historical inspection images, the historical inspection images can be divided into training set, validation set and test set according to the set ratio, such as 8:1:1. Among them, the training set comes from the kml, uavx files and inspection images of the first inspection. There are only normal images in the training set, and there are both normal images and abnormal images in the validation set and the test set. Abnormal images refer to the presence of abnormal targets in the image, such as trees, plastic bags, etc. Then, based on the set model parameters, the initial large-scale visual basic model, initial adapter and initial discriminator can be established respectively, and the training set, validation set and test set can be used to train the initial large-scale visual basic model, initial adapter and initial discriminator until the preset training termination conditions are met, such as the loss function value is less than the set value, the number of iterations reaches the set number, etc., to obtain the trained large-scale visual basic model, adapter and discriminator.

[0042] Optionally, based on the preprocessed historical inspection images, a training set, a validation set, and a test set are generated, which may include:

[0043] Performing data enhancement processing on the preprocessed historical inspection images to obtain image samples, and generating a training set, a verification set, and a test set based on the image samples;

[0044] The data enhancement processing includes at least one of scaling, random cropping, flipping, rotation, translation, contrast adjustment, color jittering and standardization. In this embodiment, by performing data enhancement processing on the pre-processed historical inspection images, the data sample size can be increased, which can help the model better generalize to new data.

[0045] Typically, scaling and random cropping can adjust all images to the same size to fit the requirements of the model input layer. For example, resize the image to 224×224 pixels to fit the pre-trained ResNet or Transformer model. Standardization can include mean normalization and standard deviation normalization. The former normalizes the pixel values ​​to a certain range (usually [0,1]), which helps to speed up training and improve the stability of the model; the latter uses the pixel mean and standard deviation of the entire dataset to standardize each image (the range is usually [-1,1]), which is particularly useful for using pre-trained models (such as ResNet, Transformer, etc.) because these models are usually pre-trained under specific normalization conditions.

[0046] Optionally, using the training set, the validation set and the test set to iteratively train the initial large-scale visual base model, the initial adapter and the initial discriminator to obtain the trained large-scale visual base model, the adapter and the discriminator may include:

[0047] The training set, validation set and test set are used to iteratively train the initial large-scale visual base model, the initial adapter and the initial discriminator based on the truncated L1 loss function to obtain the trained large-scale visual base model, adapter and discriminator.

[0048] Among them, the truncated L1 loss function can effectively limit the impact of outliers on the training process by truncating large errors while retaining sensitivity to small errors. During the training process, the model gradually adjusts its parameters to minimize the truncated L1 loss value, thereby improving the overall prediction accuracy and robustness. This loss function is particularly effective in fields such as image processing, anomaly detection, or financial forecasting, and can significantly improve the performance of the model when processing abnormal data.

[0049] In a specific implementation of this embodiment, the training and testing process of the image anomaly recognition model can be as follows: Figure 2 As shown in the figure, the Foundation Model consists of 4 self-attention mechanism modules (Transformer).

[0050] It should be noted that the Foundation Model has made significant progress in visual tasks of natural images, among which the visual Transformer has become the main choice due to its good scalability and representation capabilities. The Foundation Model in this embodiment is pre-trained on a large-scale remote sensing image dataset, and has learned a variety of ground features such as rich surface, vegetation, etc. These feature representations are widely applicable to image processing and can help identify and classify various types of ground objects. These feature representations can also be well generalized for image datasets taken by drones. That is, fine-tuning the model on image data of a specific area taken by a drone can better adapt to the feature distribution of the area. In this way, the performance of this task can be further optimized while taking advantage of the advantages of the pre-trained model. Therefore, this embodiment uses an ordinary visual Transformer with approximately 100 million parameters as a pre-trained model to extract features of drone inspection images.

[0051] Given an image, the pre-trained Transformer will extract features at different depths of the image. In the Transformer, the outputs of different layers represent features at different levels of abstraction. Shallower layers usually capture lower-level local features, while deeper layers capture more complex global features. Specifically, the input image is first divided into fixed-size image blocks through Patch embedding. Each image block is flattened into a one-dimensional vector and mapped to a high-dimensional space through a linear transformation. Subsequently, these vectors are input into the first TransformerBlock after adding position encoding.

[0052] In the Transformer Block, each input vector (patch) is calculated in relation to all other vectors through a multi-head self-attention mechanism. This mechanism can capture global information and help the model understand the relationship between different parts of the image. The multi-head attention mechanism allows the model to learn different feature representations in different subspaces. After the self-attention calculation, each vector is nonlinearly transformed through a feedforward neural network. The output vector of the current Transformer Block is used as the input of the next Transformer Block, and each Transformer Block corresponds to a different dimension.

[0053] After a given image passes through Transformer to obtain image features of four different scales, the feature pyramid network will first upsample the deepest high-level features layer by layer, and fuse them with the low-level features of the corresponding scale through lateral connections. This not only retains high-level semantic information, but also combines low-level spatial details, thereby generating a pyramid hierarchy with rich feature representation. Since remote sensing images usually have different distributions from the datasets of drone inspection images, this embodiment uses an adapter to transfer the training features to the target domain. The feature adapter can be composed of simple neural blocks, such as a fully connected layer.

[0054] It should be noted that in order to train the Discriminator to estimate the possibility that a sample is normal, the simplest method is to sample negative samples (i.e., abnormal features) and optimize them together with normal samples. However, in the training set of this embodiment, there are only normal images (i.e., no abnormal features). In this embodiment, the abnormal features can be generated by the Generator by adding Gaussian noise to the normal images.

[0055] Finally, the Discriminator acts as a normality scorer to directly estimate whether each position in the image feature is normal. During the model training process, the discriminator receives normal features and abnormal features perturbed by Gaussian noise as input, and is expected to output positive values ​​for normal features and negative values ​​for abnormal features. The Discriminator uses a 2-layer multilayer perceptron (MLP) structure, and the output normality score represents the normality of the feature, which is used to distinguish between normal and abnormal situations.

[0056] Optionally, extracting features from the power grid inspection image using a pre-trained large-scale visual basic model and an adapter to obtain adaptation features corresponding to the power grid inspection image may include:

[0057] Segmenting the power grid inspection image into a plurality of image blocks, and obtaining an image vector corresponding to each image block;

[0058] Through multiple self-attention mechanism modules, a multi-head self-attention mechanism is used to extract features from each of the image vectors to obtain image features of multiple different scales;

[0059] The adaptation features corresponding to the power grid inspection image are obtained through a pre-trained adapter according to image features of multiple different scales.

[0060] Specifically, first, the power grid inspection image can be divided into multiple image blocks based on the set size, and each image block can be converted into a corresponding image vector; then, after adding position encoding to the image vector, it is input into each Transformer Block in turn to extract image features of different scales based on the multi-head self-attention mechanism; finally, a feature pyramid can be generated according to the image features of different scales, and the feature pyramid can be input into the adapter to obtain the adaptation features corresponding to the power grid inspection image.

[0061] S120 . Obtain an anomaly score map according to the adaptation features through a pre-trained discriminator, and perform interpolation processing on the anomaly score map to obtain a standard anomaly score map.

[0062] Among them, the discriminator is a normality scorer. Typically, the discriminator can be a 2-layer multi-layer perceptron structure. In this embodiment, the adaptation feature can be input into the pre-trained discriminator to obtain an abnormal score map. The score value of each position in the abnormal score map indicates the normality of the pixel at the corresponding position in the power grid inspection map, which is used to distinguish between normal and abnormal situations. For example, if the score value is a positive value, it means that the pixel at the corresponding position in the power grid inspection map is normal. If the score value is a negative value, it means that the pixel at the corresponding position in the power grid inspection map is abnormal.

[0063] Secondly, in order to make the size of the abnormal score map and the power grid inspection Figure 1 If the anomaly score map is consistent, the anomaly score map can be interpolated to obtain a standard anomaly score map. In addition, for the boundary of the anomaly score map after the interpolation process, a Gaussian filter can be used for smoothing. The method of interpolation process may not be specifically limited in this embodiment.

[0064] S130 . Identify abnormal targets and corresponding target areas in the power grid inspection image according to the standard abnormal score map.

[0065] Specifically, the abnormal target and the corresponding target area can be identified in the power grid inspection map according to the score value of each position in the standard abnormal score map. Typically, it is determined whether there is an area with a negative score value in the standard abnormal score map. If so, it is determined that there is an abnormal target, and the position corresponding to the area in the power grid inspection image can be determined as the target area corresponding to the abnormal target.

[0066] Optionally, after determining the target area corresponding to the abnormal target, a regional shape matching method can also be used, that is, based on the mapping relationship between the preset regional shape and the target type, and the current regional shape of the target area, the target type corresponding to the abnormal target, such as trees, animals, etc., is determined.

[0067] The technical solution of the embodiment of the present invention obtains a power grid inspection image, and extracts features of the power grid inspection image through a pre-trained large-scale visual basic model and an adapter to obtain adaptation features corresponding to the power grid inspection image; obtains an anomaly score map based on the adaptation features through a pre-trained discriminator, and interpolates the anomaly score map to obtain a standard anomaly score map; identifies abnormal targets and corresponding target areas in the power grid inspection image based on the standard anomaly score map; and performs anomaly recognition on the power grid inspection image based on a pre-trained large-scale visual basic model, an adapter and a discriminator, thereby realizing automatic anomaly detection of the power grid inspection image, avoiding waste of human resources, quickly identifying and locating anomalies, and improving operation and maintenance efficiency.

[0068] In this embodiment, the trained image anomaly recognition model can be integrated into the drone automatic driving system to realize the anomaly detection and positioning of real-time captured images. Alternatively, by deploying the model on an edge device or a cloud server, the images taken by the drone will be transmitted to the model in real time for analysis. The model first determines whether there is an anomaly in the image, and further accurately locates the abnormal area when an anomaly is detected. The detection results will be returned to the operator in the form of images and heat maps, thereby supporting timely maintenance and decision-making. This model deployment process can ensure the efficiency and accuracy of automatic driving inspection tasks, reduce the burden of image processing, reduce the number of images that need to be viewed, improve the defect detection rate, and improve the reliability of line equipment.

[0069] Embodiment 2

[0070] Figure 3 This is a schematic diagram of the structure of a power grid image anomaly detection device provided in Embodiment 2 of the present invention. Figure 3 As shown, the device includes: a feature extraction module 210, an abnormal score map acquisition module 220 and an abnormality identification module 230; wherein,

[0071] The feature extraction module 210 is used to obtain a power grid inspection image, and perform feature extraction on the power grid inspection image through a pre-trained large-scale visual basic model and an adapter to obtain an adaptation feature corresponding to the power grid inspection image;

[0072] An anomaly score map acquisition module 220, used to acquire an anomaly score map according to the adaptation features through a pre-trained discriminator, and perform interpolation processing on the anomaly score map to obtain a standard anomaly score map;

[0073] The abnormality identification module 230 is used to identify abnormal targets and corresponding target areas in the power grid inspection image according to the standard abnormality score map.

[0074] The technical solution of the embodiment of the present invention obtains a power grid inspection image, and extracts features of the power grid inspection image through a pre-trained large-scale visual basic model and an adapter to obtain adaptation features corresponding to the power grid inspection image; obtains an anomaly score map based on the adaptation features through a pre-trained discriminator, and interpolates the anomaly score map to obtain a standard anomaly score map; identifies abnormal targets and corresponding target areas in the power grid inspection image based on the standard anomaly score map; and performs anomaly recognition on the power grid inspection image based on a pre-trained large-scale visual basic model, an adapter and a discriminator, thereby realizing automatic anomaly detection of the power grid inspection image, avoiding waste of human resources, quickly identifying and locating anomalies, and improving operation and maintenance efficiency.

[0075] Optionally, the abnormality detection device for power grid images further includes:

[0076] An image preprocessing module is used to obtain historical inspection images and preprocess the historical inspection images to obtain preprocessed historical inspection images;

[0077] A sample set generation module is used to generate a training set, a validation set, and a test set based on preprocessed historical inspection images;

[0078] The model training module is used to establish an initial large-scale visual base model, an initial adapter and an initial discriminator, and use the training set, the validation set and the test set to iteratively train the initial large-scale visual base model, the initial adapter and the initial discriminator to obtain a trained large-scale visual base model, adapter and discriminator.

[0079] Optionally, the preprocessing includes at least one of image damage detection, damaged image replacement, image resolution consistency processing, image geometry correction and image color correction.

[0080] Optionally, a sample set generation module is specifically used to perform data enhancement processing on the pre-processed historical inspection images to obtain image samples, and generate a training set, a verification set and a test set based on the image samples;

[0081] The data enhancement processing includes at least one of scaling, random cropping, flipping, rotation, translation, contrast adjustment, color jittering and standardization.

[0082] Optionally, a model training module is specifically used to use the training set, validation set and test set to iteratively train the initial large-scale visual base model, the initial adapter and the initial discriminator based on the truncated L1 loss function to obtain a trained large-scale visual base model, adapter and discriminator.

[0083] Optionally, the feature extraction module 210 is specifically used to divide the power grid inspection image into multiple image blocks and obtain an image vector corresponding to each image block;

[0084] Through multiple self-attention mechanism modules, a multi-head self-attention mechanism is used to extract features from each of the image vectors to obtain image features of multiple different scales;

[0085] The adaptation features corresponding to the power grid inspection image are obtained through a pre-trained adapter according to image features of multiple different scales.

[0086] The power grid image anomaly detection device provided in the embodiment of the present invention can execute the power grid image anomaly detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0087] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0088] Embodiment 3

[0089] Figure 4 A schematic diagram of the structure of an electronic device 30 that can be used to implement an embodiment of the present invention is shown. The electronic device 30 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 30 can 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.

[0090] like Figure 4As shown, the electronic device 30 includes at least one processor 31, and a memory connected to the at least one processor 31, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory 32 or the computer program loaded from the storage unit 38 to the random access memory 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 can also be stored. The processor 31, the ROM 32 and the RAM 33 are connected to each other through a bus 34. The input / output (I / O) interface 35 is also connected to the bus 34.

[0091] A number of components in the electronic device 30 are connected to the I / O interface 35, including: an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a disk, an optical disk, etc.; and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0092] The processor 31 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 31 include, but are not limited to, a central processing unit, a graphics processing unit, various special artificial intelligence computing chips, various processors running machine learning model algorithms, digital signal processors, and any appropriate processors, controllers, microcontrollers, etc. The processor 31 executes the various methods and processes described above, such as an abnormality detection method for power grid images.

[0093] In some embodiments, the abnormality detection method of the power grid image can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the abnormality detection method of the power grid image described above can be performed. Alternatively, in other embodiments, the processor 31 can be configured to execute the abnormality detection method of the power grid image by any other appropriate means (for example, by means of firmware).

[0094] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays, application specific integrated circuits, application specific standard products, systems on a chip, load programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various embodiments may 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.

[0095] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may 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 may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0096] 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 conjunction 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, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0097] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device 30 having: a display device (e.g., a cathode ray tube or a liquid crystal display) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device 30. 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).

[0098] 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: local area networks, wide area networks, blockchain networks, and the Internet.

[0099] A computing system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server.

[0100] This embodiment may also include a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the abnormality detection method for power grid images provided by any embodiment of the present invention.

[0101] 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.

[0102] 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. A method for detecting anomalies in a power grid image, characterized in that: include: Acquire a power grid inspection image, and extract features from the power grid inspection image using a pre-trained large-scale visual basic model and an adapter to obtain adaptation features corresponding to the power grid inspection image; Obtaining an anomaly score map according to the adaptation features through a pre-trained discriminator, and performing interpolation processing on the anomaly score map to obtain a standard anomaly score map; According to the standard anomaly score map, abnormal targets and corresponding target areas in the power grid inspection image are identified.

2. The method according to claim 1, characterized in that Before extracting features from the power grid inspection image through the pre-trained large-scale visual basic model and the adapter to obtain the adaptation features corresponding to the power grid inspection image, the method further includes: Acquire historical inspection images, and preprocess the historical inspection images to obtain preprocessed historical inspection images; Generate training sets, validation sets, and test sets based on preprocessed historical inspection images; An initial large-scale visual basis model, an initial adapter and an initial discriminator are established, and the initial large-scale visual basis model, the initial adapter and the initial discriminator are iteratively trained using the training set, the validation set and the test set to obtain a trained large-scale visual basis model, an adapter and a discriminator.

3. The method according to claim 2, characterized in that The preprocessing includes at least one of image damage detection, damaged image replacement, image resolution uniformity processing, image geometry correction and image color correction.

4. The method according to claim 2, characterized in that: Based on the preprocessed historical inspection images, the training set, validation set, and test set are generated, including: Performing data enhancement processing on the preprocessed historical inspection images to obtain image samples, and generating a training set, a verification set, and a test set based on the image samples; The data enhancement processing includes at least one of scaling, random cropping, flipping, rotation, translation, contrast adjustment, color jittering and standardization.

5. The method according to claim 2, characterized in that: The training set, the validation set and the test set are used to iteratively train the initial large-scale visual base model, the initial adapter and the initial discriminator to obtain the trained large-scale visual base model, the adapter and the discriminator, including: The training set, validation set and test set are used to iteratively train the initial large-scale visual base model, the initial adapter and the initial discriminator based on the truncated L1 loss function to obtain the trained large-scale visual base model, adapter and discriminator.

6. The method according to claim 1, characterized in that The power grid inspection image is subjected to feature extraction through a pre-trained large-scale visual basic model and an adapter to obtain adaptation features corresponding to the power grid inspection image, including: Segmenting the power grid inspection image into a plurality of image blocks, and obtaining an image vector corresponding to each image block; Through multiple self-attention mechanism modules, a multi-head self-attention mechanism is used to extract features from each of the image vectors to obtain image features of multiple different scales; The adaptation features corresponding to the power grid inspection image are obtained through a pre-trained adapter according to image features of multiple different scales.

7. A device for detecting abnormality of a power grid image, characterized in that: include: A feature extraction module is used to obtain a power grid inspection image, and extract features from the power grid inspection image through a pre-trained large-scale visual basic model and an adapter to obtain adaptation features corresponding to the power grid inspection image; An anomaly score map acquisition module, used to acquire an anomaly score map according to the adaptation features through a pre-trained discriminator, and perform interpolation processing on the anomaly score map to obtain a standard anomaly score map; The abnormality identification module is used to identify abnormal targets and corresponding target areas in the power grid inspection image according to the standard abnormality score map.

8. 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 execute the method for detecting anomalies in a power grid image according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to enable a processor to implement the method for detecting anomalies in a power grid image according to any one of claims 1 to 6 when the computer program is executed.

10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method for detecting anomalies in a power grid image according to any one of claims 1 to 6.