Abnormality detection method and device of target object, storage medium and electronic device

By improving the abnormality detection model, using feature extraction and fusion technology of backbone network and head network, the problem of insufficient accuracy of YOLO model when dealing with defect size changes, irregular shapes and complex backgrounds in photovoltaic cell images is solved, and the accuracy of YOLO model is insufficient when dealing with defect size changes, irregular shapes and complex backgrounds in photovoltaic cell images is achieved, and the results are improved. Efficient and accurate photovoltaic cell defect detection.

CN119399148APending Publication Date: 2025-02-07HUANENG JILIN POWER GENERATION JIUTAI ELECTRIC FACTORY +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411454898.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

When the existing YOLO model faces the changes in size, irregular shape and complex backgrounds in the photovoltaic cell images, the detection accuracy is insufficient, making it difficult to achieve efficient and accurate abnormal detection.

Method used

By improving the anomaly detection model, the backbone network and the head network are introduced. The backbone network extracts features through partial convolution and switchable hollow convolution technology, and the head network performs feature fusion and anomaly detection through feature pyramid network and prediction module.

Benefits of technology

It improves the accuracy and robustness of photovoltaic cell defect detection, can more effectively deal with defects of different scales and shapes, adapt to complex backgrounds, and enhances the detection performance of the model under different environmental conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399148A_ABST
    Figure CN119399148A_ABST
Patent Text Reader

Abstract

The invention discloses an anomaly detection method and device of a target object, a storage medium and an electronic device, and relates to the field of computers.The anomaly detection method of the target object comprises the steps that image collection is conducted on the target object, and a first image is obtained; performing image preprocessing on the first image to obtain a second image; performing anomaly detection on the second image through an anomaly detection model to obtain an anomaly detection result of the target object; by adopting the above scheme, the problem that the accuracy of anomaly detection is affected due to the fact that a current anomaly detection model YOLO model still has certain defects when facing defect size changes, irregular shapes and complex backgrounds existing in a photovoltaic cell image in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and more specifically, to a method and device for detecting anomalies of a target object, a storage medium, and an electronic device. Background Art

[0002] Photovoltaic (PV) cells, as key components for converting solar energy into electrical energy, have become an important part of the renewable energy sector. In recent years, with the continuous growth of global energy demand and the emphasis on environmental protection, photovoltaic technology has developed rapidly, and the application scope of photovoltaic power generation systems has been expanding. However, during the manufacturing, transportation and actual use of photovoltaic cells, they may be affected by various factors, resulting in different types of defects and failures. These defects not only affect the power conversion efficiency of photovoltaic cells, but may also have a negative impact on the safety and stability of the entire photovoltaic power generation system.

[0003] In the process of photovoltaic cell manufacturing, defects may be introduced in every link, from the cutting, cleaning, and doping of silicon wafers to the final battery packaging. For example, microcracks may be generated during the cutting of silicon wafers; contaminants may be left behind during the cleaning process; and uneven doping may occur during the doping process. These defects may not be obvious in the early stage, but during the long-term use of photovoltaic cells, these defects may gradually expand and eventually affect the performance of photovoltaic cells. In addition, during the transportation and installation of photovoltaic cells, new defects may appear in photovoltaic cells or the expansion of existing defects may occur due to external factors such as vibration and impact. For example, photovoltaic cells may be affected by mechanical stress during transportation, resulting in new cracks or the expansion of existing cracks.

[0004] There are many types of defects in photovoltaic cells, the most common ones include microcracks, debris, black spots, welding defects, hot spots, etc. Microcracks are a common defect in photovoltaic cells, usually caused by mechanical stress, which will cause the electrical performance of photovoltaic cells to deteriorate or even cause the cells to fail. Debris refers to foreign matter on the surface or inside of photovoltaic cells, which will block sunlight and affect the photoelectric conversion efficiency of the cells. Black spots are usually caused by residual contaminants or uneven materials during the production process, which will also affect the performance of photovoltaic cells. Welding defects refer to the increase in contact resistance caused by poor welding during the welding process between the cell and the wire, thereby affecting the current output of the battery. Hot spots refer to overheating in local areas of photovoltaic cells, usually due to the presence of local high-resistance areas inside the cell or external obstructions. It not only affects the performance of the battery, but may also cause safety hazards such as fire.

[0005] In order to ensure the efficient operation and long life of photovoltaic cells, it is particularly important to detect and identify these defects in a timely and accurate manner. Traditional photovoltaic cell defect detection methods mainly include manual inspection and conventional imaging technology. Manual inspection usually relies on experienced operators to observe defects on the surface of the cell with the naked eye or a microscope. Although this method is intuitive, it is inefficient and difficult to meet the needs of large-scale production and application. Conventional imaging technologies such as electroluminescence imaging (EL), infrared imaging (IR) and voltage-current characteristic testing can detect and identify defects in photovoltaic cells to a certain extent, but these methods usually require complex equipment and high operating skills, and the detection speed is slow, making it difficult to achieve online real-time detection.

[0006] Electroluminescence imaging technology applies a forward voltage to photovoltaic cells to make them emit light. By taking electroluminescence images, defects inside the cells such as microcracks, fragments, and welding defects can be observed. Infrared imaging technology detects infrared radiation emitted by photovoltaic cells during operation to identify thermal defects such as hot spots. The voltage and current characteristic test measures the voltage and current characteristics of photovoltaic cells under different working conditions to determine the overall performance and defects of the battery. Although these methods work well under laboratory conditions, they are difficult to promote and apply on a large scale in actual applications due to complex equipment, high cost, and slow detection speed.

[0007] With the development of computer vision and artificial intelligence technology, deep learning-based methods have shown great potential in photovoltaic cell defect detection. As a deep learning model, convolutional neural network (CNN) has attracted widespread attention due to its excellent performance in image recognition and target detection tasks. By automatically extracting image features, CNN can effectively handle complex backgrounds and different types of defects, thereby improving the accuracy and efficiency of detection. As a real-time target detection algorithm, the YOLO series model can simultaneously complete target positioning and classification tasks in a single neural network. It has the characteristics of fast detection speed and high accuracy, and is therefore considered to be an ideal choice for photovoltaic cell defect detection.

[0008] However, the existing YOLO model still has certain shortcomings when facing the defects in photovoltaic cell images, such as the variation in size, irregular shape and complex background. First, the defects in photovoltaic cells vary greatly in size and shape, and the traditional YOLO model may miss or misdetect objects when dealing with targets of different scales. Secondly, the image background of photovoltaic cells is complex and may contain various noises and irregularly shaped objects. Traditional convolution operations are difficult to effectively extract effective features from these complex backgrounds. Finally, in practical applications, photovoltaic cells may be affected by external environments such as lighting changes and shadow occlusion, resulting in a decrease in image quality, thereby affecting the accuracy of detection.

[0009] Regarding the related technologies, the current anomaly detection model YOLO model still has certain shortcomings when facing the defects with varying sizes, irregular shapes and complex backgrounds in photovoltaic cell images, which affects the accuracy of anomaly detection. No effective solution has been proposed yet.

[0010] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention

[0011] The embodiments of the present application provide a method and device for detecting anomalies of a target object, a storage medium, and an electronic device, so as to at least solve the problem in the related art that the current anomaly detection model YOLO model still has certain shortcomings when facing defect size changes, irregular shapes, and complex backgrounds in photovoltaic cell images, which affects the accuracy of anomaly detection.

[0012] According to one aspect of an embodiment of the present application, a method for detecting anomalies of a target object is provided, comprising: performing image acquisition on the target object to obtain a first image; performing image preprocessing on the first image to obtain a second image; and performing anomaly detection on the second image through an anomaly detection model to obtain an anomaly detection result of the target object.

[0013] In an exemplary embodiment, anomaly detection is performed on the second image through an anomaly detection model to obtain an anomaly detection result of the target object, including: performing feature extraction on the second image through a backbone network to obtain multiple first feature maps, wherein the resolutions of the multiple first feature maps are different; performing feature fusion on the multiple first feature maps, and performing anomaly detection on the obtained second feature maps through a head network to obtain the anomaly detection result, wherein the anomaly detection result includes: multiple abnormal targets, location information of the multiple abnormal targets, and abnormal probability scores of the multiple abnormal targets, and the anomaly detection model includes the backbone network and the head network.

[0014] In an exemplary embodiment, the second image is subjected to feature extraction through a backbone network to obtain a plurality of first feature maps, including: marking effective pixels of the second image through a binary mask to obtain a third image; and the third image is subjected to a feature extraction through a formula Perform partial convolution to obtain the first output tensor, where y i,j is the first output tensor, x is the first input tensor corresponding to the third image, w is the convolution kernel, m is the binary mask, The first output tensor is obtained by the formula Perform switchable dilated convolution to obtain the second output tensor, where y i is the second output tensor at position i in the third image, xi+j is the first output tensor, w j is the weight of filter j, r j is the void ratio, It is a binary switch function used to control whether it is at position i+jr j' Using a filter; generating the plurality of first feature maps according to the second output tensor.

[0015] In an exemplary embodiment, feature fusion is performed on the multiple first feature maps, and anomaly detection is performed on the obtained second feature map through a head network to obtain the anomaly detection result, including: feature fusion is performed on the multiple first feature maps through a feature pyramid network to obtain the second feature map; prediction processing is performed on the second feature map through a prediction module in the head network to obtain a third output tensor; and the third output tensor is decoded to obtain the anomaly detection result.

[0016] In an exemplary embodiment, before performing anomaly detection on the second image through an anomaly detection model to obtain an anomaly detection result of the target object, the method also includes: randomly selecting a target number of first training images, wherein the first training images are used to train the anomaly detection model; performing random contrast transformation on the first training images to obtain second training images; combining the target number of second training images to obtain a third training image; and training the anomaly detection model through the first training images and the third training images.

[0017] In an exemplary embodiment, image preprocessing is performed on the first image to obtain the second image, including: scaling the first image according to the size requirement of the anomaly detection model to obtain a fourth image; and normalizing the pixel values ​​of the fourth image to obtain the second image.

[0018] According to another aspect of an embodiment of the present application, a device for detecting an abnormality of a target object is also provided, including: an image acquisition module, used to acquire an image of the target object to obtain a first image; a preprocessing module, used to perform image preprocessing on the first image to obtain a second image; and an abnormality detection module, used to perform abnormality detection on the second image through an abnormality detection model to obtain an abnormality detection result of the target object.

[0019] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned target object anomaly detection method when running.

[0020] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the target object anomaly detection method through the computer program.

[0021] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0022] Through the present application, an image of the target object is firstly acquired to obtain a first image; then the first image is subjected to image preprocessing to obtain a second image adapted to an anomaly detection model; finally, anomaly detection is performed on the second image through the anomaly detection model to obtain an anomaly detection result of the target object; the above scheme is adopted to improve the accuracy and robustness of defect detection of photovoltaic cells (target objects) by using an improved anomaly detection model, thereby providing reliable technical support for the efficient operation and timely maintenance of photovoltaic cells; thereby solving the problem in the related art that the current anomaly detection model YOLO model still has certain deficiencies when facing defect size changes, irregular shapes and complex backgrounds in photovoltaic cell images, which affects the accuracy of anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0025] Figure 1 It is a hardware structure block diagram of a computer terminal of a method for detecting anomalies of a target object according to an embodiment of the present application;

[0026] Figure 2 is a flow chart of a method for detecting anomalies of a target object according to an embodiment of the present application;

[0027] Figure 3 is a schematic diagram of an optional partial convolution architecture according to an embodiment of the present application;

[0028] Figure 4 is a schematic diagram of an optional switchable dilated convolution according to an embodiment of the present application;

[0029] Figure 5 It is a structural block diagram of a target object anomaly detection device according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising 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.

[0032] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a method for detecting anomalies of a target object according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0033] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the abnormality detection method of the target object in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0034] A wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0035] In this embodiment, a method for detecting anomalies of a target object is provided. Figure 2 is a flow chart of a method for detecting anomalies of a target object according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps S202-S206:

[0036] Step S202: Capturing an image of the target object to obtain a first image;

[0037] Step S204: performing image preprocessing on the first image to obtain a second image;

[0038] Step S206: performing anomaly detection on the second image using an anomaly detection model to obtain an anomaly detection result of the target object.

[0039] Through the above steps, the target object is firstly imaged to obtain a first image; then the first image is image preprocessed to obtain a second image adapted to the anomaly detection model; finally, the second image is subjected to anomaly detection through the anomaly detection model to obtain an anomaly detection result of the target object; the above scheme is adopted to improve the accuracy and robustness of defect detection of photovoltaic cells (target objects) by using the improved anomaly detection model, thereby providing reliable technical support for the efficient operation and timely maintenance of photovoltaic cells; thus, the problem in the related art that the current anomaly detection model YOLO model still has certain deficiencies when facing defect size changes, irregular shapes and complex backgrounds in photovoltaic cell images, which affects the accuracy of anomaly detection.

[0040] In an exemplary embodiment, anomaly detection is performed on the second image through an anomaly detection model to obtain an anomaly detection result of the target object, including: performing feature extraction on the second image through a backbone network to obtain multiple first feature maps, wherein the resolutions of the multiple first feature maps are different; performing feature fusion on the multiple first feature maps, and performing anomaly detection on the obtained second feature maps through a head network to obtain the anomaly detection result, wherein the anomaly detection result includes: multiple abnormal targets, location information of the multiple abnormal targets, and abnormal probability scores of the multiple abnormal targets, and the anomaly detection model includes the backbone network and the head network.

[0041] Optionally, this application selects YOLOv7 as the basic model and improves the model to obtain the above-mentioned anomaly detection model, which includes a backbone network and a head network. The backbone network is responsible for extracting features from the input image (i.e., the second image) and passing these features (i.e., multiple first feature maps) to the head network, which uses these features to predict the bounding box (position information) and category probability (abnormal probability score) of the target (abnormal target) in the image.

[0042] Optionally, extracting features from the second image through the backbone network to obtain a plurality of first feature maps includes: marking effective pixels of the second image through a binary mask to obtain a third image; and extracting features from the third image through the formula Perform partial convolution to obtain the first output tensor, where y i,j is the first output tensor, x is the first input tensor corresponding to the third image, w is the convolution kernel, m is the binary mask, The first output tensor is obtained by the formula Perform switchable dilated convolution to obtain the second output tensor, where i+jr j′ y i is the second output tensor at position i in the third image, xi+j is the first output tensor, w j is the weight of filter j, r j is the void ratio, is a binary switch function used to control whether to use a filter at a position; and generates the multiple first feature maps according to the second output tensor.

[0043] Partial convolution and switchable hole convolution techniques are introduced in the backbone network. Partial convolution is used to process irregular shapes and missing data in images, while switchable hole convolution adapts to defects of different sizes by adjusting the size of the receptive field.

[0044] Specifically, partial convolution: In order to deal with irregularities and missing data in photovoltaic cell images, we introduced partial convolution in the ELAN module of the backbone network. Partial convolution reduces computational redundancy and enhances the model's ability to handle incomplete data by applying convolution filters only on part of the input channels. The mathematical representation of partial convolution is as follows:

[0045] Among them, x is the input image, w is the convolution kernel, m is the binary mask, indicating which pixels are valid, and y is the output image. By introducing partial convolution, we can effectively reduce model parameters, improve computational efficiency, and enhance the ability to handle missing data in the image. The architecture diagram of partial convolution is shown in the figure below: Figure 3 shown.

[0046] Switchable Atrous Convolution: In order to improve the adaptability of the model to different defect scales, we introduced switchable atrous convolution in the backbone network. Switchable atrous convolution uses convolutional layers with different atrous rates and adaptively adjusts the receptive field size according to the input data, thereby effectively capturing defects of different scales. Its mathematical representation is:

[0047] Among them, y i is the output of position i, x i+j is the input feature map, w j is the weight of filter j, r j is the void ratio, To control whether it is at position i+jr j′ By using the binary switch function of the filter and introducing switchable dilated convolution, the present application can adaptively adjust the receptive field size of the convolution operation, effectively capture defects of different scales, and improve the detection performance of the model. Figure 4 shown.

[0048] Optionally, feature fusion is performed on the multiple first feature maps, and anomaly detection is performed on the obtained second feature map through the head network to obtain the anomaly detection result, including: feature fusion is performed on the multiple first feature maps through a feature pyramid network to obtain the second feature map; prediction processing is performed on the second feature map through the prediction module in the head network to obtain a third output tensor; and the third output tensor is decoded to obtain the anomaly detection result.

[0049] Specifically, the head network processes the data, and the overall process includes: first, the feature fusion of the multiple first feature maps is performed through the feature pyramid network to obtain the second feature map; then, the second feature map is predicted by the prediction module to obtain the third output tensor; finally, the third output tensor is decoded to obtain the anomaly detection result and output.

[0050] Optionally, before performing anomaly detection on the second image through the anomaly detection model to obtain the anomaly detection result of the target object, the method also includes: randomly selecting a target number of first training images, wherein the first training images are used to train the anomaly detection model; performing random contrast transformation on the first training images to obtain second training images; combining the target number of second training images to obtain a third training image; and training the anomaly detection model through the first training images and the third training images.

[0051] In order to enhance the robustness of the model under different environmental conditions, this application proposes a random contrast mosaic data augmentation count (RMosaic). This technology randomly selects four (target number) contrast-enhanced training images and combines them into a mosaic image to generate more diverse training samples (i.e., the third training image), thereby improving the generalization ability of the model. The specific implementation method is as follows: Among them, C() is a random contrast transformation, and I1, I2, I3, and I4 are four randomly selected training images. Through this data enhancement method, more diverse training samples can be generated, and the detection performance of the model under different lighting and noise conditions can be enhanced.

[0052] Optionally, performing image preprocessing on the first image to obtain the second image includes: scaling the first image according to the size requirement of the anomaly detection model to obtain a fourth image; and normalizing the pixel values ​​of the fourth image to obtain the second image.

[0053] Optionally, the process of performing image preprocessing on the first image includes: first adjusting the image size. The YOLOv7 model usually requires the input image to be of a specific size (i.e., size requirement), such as 640*640. Therefore, the input image is scaled and padded to meet the input requirements of the model. Normalization: Normalizing the image pixel values, usually scaling the pixel values ​​from the 0-255 range to the 0-1 range.

[0054] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0055] In this embodiment, a device for detecting anomalies of a target object is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0056] Figure 5 : is a structural block diagram of a target object anomaly detection device according to an embodiment of the present application, the device comprising:

[0057] An image acquisition module 52 is used to acquire an image of the target object to obtain a first image;

[0058] A preprocessing module 54, configured to perform image preprocessing on the first image to obtain a second image;

[0059] The anomaly detection module 56 is used to perform anomaly detection on the second image through an anomaly detection model to obtain an anomaly detection result of the target object.

[0060] Through the above-mentioned device, the target object is firstly imaged to obtain a first image; then the first image is image preprocessed to obtain a second image adapted to the anomaly detection model; finally, the second image is subjected to anomaly detection through the anomaly detection model to obtain an anomaly detection result of the target object; the above-mentioned scheme is adopted to improve the accuracy and robustness of defect detection of photovoltaic cells (target objects) by using the improved anomaly detection model, thereby providing reliable technical support for the efficient operation and timely maintenance of photovoltaic cells; thus, the problem in the related art that the current anomaly detection model YOLO model still has certain deficiencies when facing defect size changes, irregular shapes and complex backgrounds in photovoltaic cell images, which affects the accuracy of anomaly detection.

[0061] Optionally, the above-mentioned abnormality detection module 56 is also used to perform feature extraction on the second image through the backbone network to obtain multiple first feature maps, wherein the resolutions of the multiple first feature maps are different; perform feature fusion on the multiple first feature maps, and perform abnormality detection on the obtained second feature maps through the head network to obtain the abnormality detection result, wherein the abnormality detection result includes: multiple abnormal targets, location information of the multiple abnormal targets and abnormal probability scores of the multiple abnormal targets, and the abnormality detection model includes the backbone network and the head network.

[0062] Optionally, the above-mentioned abnormality detection module 56 is further used to mark the effective pixels of the second image through a binary mask to obtain a third image; and mark the effective pixels of the third image through the formula Perform partial convolution to obtain the first output tensor, where y i,j is the first output tensor, x is the first input tensor corresponding to the third image, w is the convolution kernel, m is the binary mask, The first output tensor is obtained by the formula Perform switchable dilated convolution to obtain the second output tensor, where y i is the second output tensor at position i in the third image, x i+j is the first output tensor, w j is the weight of filter j, r j is the void ratio, It is a binary switch function used to control whether it is at position i+jr j′ Using a filter; generating the plurality of first feature maps according to the second output tensor.

[0063] Optionally, the above-mentioned anomaly detection module 56 is also used to perform feature fusion on the multiple first feature maps through a feature pyramid network to obtain the second feature map; perform prediction processing on the second feature map through the prediction module in the head network to obtain a third output tensor; and decode the third output tensor to obtain the anomaly detection result.

[0064] Optionally, the above-mentioned anomaly detection module 56 is also used to randomly select a target number of first training images, wherein the first training images are used to train the anomaly detection model; perform random contrast transformation on the first training images to obtain second training images; combine the target number of second training images to obtain third training images; and train the anomaly detection model using the first training images and the third training images.

[0065] Optionally, the preprocessing module 54 is further used to scale the first image according to the size requirement of the anomaly detection model to obtain a fourth image; and normalize the pixel values ​​of the fourth image to obtain the second image.

[0066] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0067] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0068] S1, collecting an image of a target object to obtain a first image;

[0069] S2, performing image preprocessing on the first image to obtain a second image;

[0070] S3: Perform anomaly detection on the second image through an anomaly detection model to obtain an anomaly detection result of the target object.

[0071] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0072] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0073] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0074] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0075] S1, collecting an image of a target object to obtain a first image;

[0076] S2, performing image preprocessing on the first image to obtain a second image;

[0077] S3: Perform anomaly detection on the second image through an anomaly detection model to obtain an anomaly detection result of the target object.

[0078] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0079] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0080] Optionally, in this embodiment, the above computer program may be configured to implement the following steps when executed by a processor:

[0081] S1, collecting an image of a target object to obtain a first image;

[0082] S2, performing image preprocessing on the first image to obtain a second image;

[0083] S3: Perform anomaly detection on the second image through an anomaly detection model to obtain an anomaly detection result of the target object.

[0084] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0085] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0086] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for detecting anomalies of a target object, characterized in that: include: Capturing an image of the target object to obtain a first image; Performing image preprocessing on the first image to obtain a second image; Anomaly detection is performed on the second image using an anomaly detection model to obtain an anomaly detection result of the target object.

2. The method according to claim 1, characterized in that Performing anomaly detection on the second image by using an anomaly detection model to obtain an anomaly detection result of the target object includes: Performing feature extraction on the second image through a backbone network to obtain a plurality of first feature maps, wherein the plurality of first feature maps have different resolutions; Feature fusion is performed on the multiple first feature maps, and anomaly detection is performed on the obtained second feature map through the head network to obtain the anomaly detection result, wherein the anomaly detection result includes: multiple abnormal targets, location information of the multiple abnormal targets and abnormal probability scores of the multiple abnormal targets, and the anomaly detection model includes the backbone network and the head network.

3. The method according to claim 2, characterized in that Performing feature extraction on the second image through the backbone network to obtain a plurality of first feature maps, including: Marking effective pixels of the second image by using a binary mask to obtain a third image; For the third image, the formula Perform partial convolution to obtain the first output tensor, where y i,j is the first output tensor, x is the first input tensor corresponding to the third image, w is the convolution kernel, m is the binary mask, The first output tensor is obtained by the formula Perform switchable dilated convolution to obtain the second output tensor, where y i is the second output tensor at position i in the third image, x i+j is the first output tensor, w j is the weight of filter j, r j is the void ratio, It is a binary switch function used to control whether it is at position i+jr j′ Use filters; The plurality of first feature maps are generated according to the second output tensor.

4. The method according to claim 3, characterized in that Performing feature fusion on the multiple first feature maps, and performing anomaly detection on the obtained second feature map through a head network to obtain the anomaly detection result, including: Performing feature fusion on the multiple first feature maps through a feature pyramid network to obtain the second feature map; Performing prediction processing on the second feature map by the prediction module in the head network to obtain a third output tensor; The third output tensor is decoded to obtain the anomaly detection result.

5. The method according to claim 1, characterized in that Before performing anomaly detection on the second image by using an anomaly detection model to obtain an anomaly detection result of the target object, the method further includes: randomly selecting a target number of first training images, wherein the first training images are used to train the anomaly detection model; Performing a random contrast transformation on the first training image to obtain a second training image; combining a target number of the second training images to obtain a third training image; The anomaly detection model is trained using the first training image and the third training image.

6. The method according to claim 1, characterized in that Performing image preprocessing on the first image to obtain a second image includes: Scaling the first image according to the size requirement of the anomaly detection model to obtain a fourth image; Normalizing the pixel values ​​of the fourth image to obtain the second image.

7. A target object anomaly detection device, characterized in that: include: An image acquisition module, used to acquire an image of a target object to obtain a first image; A preprocessing module, used for performing image preprocessing on the first image to obtain a second image; The anomaly detection module is used to perform anomaly detection on the second image through an anomaly detection model to obtain an anomaly detection result of the target object.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 6 when executed.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.