Defect monitoring method, device and equipment based on reconstruction network and storage medium
By adopting a defect monitoring method based on the reconstruction network in the substation, using defect-free images to simulate multi-angle and complex environments, building multi-scale training images, and training the reconstruction network, solving the defect detection accuracy in the existing technology The problem of low and poor noise robustness achieves high accuracy and low cost defect detection.
Patent Information
- Application Number
- CN202411286868.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art has problems such as low accuracy, poor noise interference and the need for large amounts of sample data in the detection of substation defects, making it difficult to adapt to the complex environment of substations.
Using a defect monitoring method based on the reconstruction network, a multi-angle and complex environment simulation processing is obtained by obtaining defect-free images, multi-scale training images are constructed, and the reconstruction network is trained to obtain the reconstruction image model. The image to be monitored is input to the reconstructed image model, and defect detection and positioning are performed through image difference processing and thresholding segmentation processing.
It realizes the accuracy and robustness of defect detection without requiring a large amount of sample data, reduces detection costs and risks, and provides reliable support for the operation and maintenance of the power system.
Smart Images

Figure CN119445463A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a defect monitoring method, device, equipment and storage medium based on a reconstruction network. Background Art
[0002] As a core component of the power system, substations undertake important energy conversion and distribution functions. During the long-term operation of substations, complex environmental factors and human factors can easily lead to substation damage, such as equipment damage, ground oil pollution and insulator rupture. These defects pose certain hidden dangers to the safety, stability and normal operation of the power system. Timely discovery of similar defects and appropriate repairs and maintenance can effectively avoid accidents and improve the reliability and safety of substations.
[0003] In the current existing technology, computer vision technology is usually used to detect defects. Traditional defect monitoring methods based on thresholds, regions and edges cannot guarantee the existence of closed and continuous edge areas, and lack robustness to noise interference. Image recognition based on machine learning analyzes images for individual devices and requires a large amount of training data. In many industrial situations, the defect types of products are often unpredictable, so it is difficult to collect a large number of defect training samples. Therefore, there is an urgent need for a defect detection method that is highly accurate, does not require a large amount of sample data, and is suitable for substations. Summary of the invention
[0004] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and to provide a defect monitoring method, device, equipment and storage medium based on a reconstructed network.
[0005] The present invention provides the following technical solutions:
[0006] In a first aspect, an embodiment of the present disclosure provides a defect monitoring method based on a reconstructed network, the method comprising:
[0007] Acquire a defect-free image, and perform multi-angle simulation processing and complex environment simulation processing on the defect-free image to obtain an initial image;
[0008] Performing image pyramid processing on the initial image to obtain a multi-scale training image, and training a reconstruction network according to the multi-scale training image to obtain a reconstructed image model;
[0009] The image to be monitored is input into the reconstructed image model, and a reconstructed image is output. The reconstructed image and the image to be monitored are subjected to image difference processing for defect detection, and the reconstructed image and the image to be monitored are subjected to threshold segmentation processing for defect location.
[0010] According to a specific implementation method disclosed in the present application, the step of acquiring a defect-free image, performing multi-angle simulation processing and complex environment simulation processing on the defect-free image, and obtaining an initial image includes:
[0011] The multi-angle simulation processing includes image rotation processing, translation processing and mirror processing;
[0012] The complex environment simulation process includes adding random illumination processing and random contrast change processing.
[0013] According to a specific implementation manner disclosed in the present application, the steps of performing image pyramid processing on the initial image to obtain a multi-scale training image, and training a reconstruction network according to the multi-scale training image to obtain a reconstructed image model include:
[0014] Performing multi-path convolution feature extraction on the multi-scale training image to obtain image features of the multi-scale training image;
[0015] Performing encoding transformation and decoding transformation on the image features to obtain an initial reconstructed image;
[0016] The initial reconstructed images are fused using a Laplace pyramid fusion algorithm to obtain a final reconstructed image.
[0017] According to a specific implementation method disclosed in the present application, the step of performing encoding transformation and decoding transformation on the image features to obtain an initial reconstructed image includes:
[0018] Initialize the convolution module and deconvolution module;
[0019] Add a residual connection between the input and output of each convolution module, pass the image features through each convolution module in turn, and output a feature map;
[0020] Input the feature map into a deconvolution module, and output an initial reconstructed image through multi-path deconvolution;
[0021] The encoding transform and the decoding transform are defined as:
[0022] in, is the encoding transform, γ is the decoding transform, G∈RW×H is the spatial domain of the image, and H is the corresponding image feature in the hidden space;
[0023] The process of the encoding transformation and the decoding transformation is:
[0024] Where G' is the reconstructed image, is the convolution, σ is the activation function, W is the encoding convolution kernel, W' is the decoding convolution kernel, b is the encoding bias, and b' is the decoding bias.
[0025] According to a specific implementation manner disclosed in the present application, the step of fusing the initial reconstructed image using a Laplacian pyramid fusion algorithm to obtain a final reconstructed image includes:
[0026] Establishing Gaussian pyramids of two initial reconstructed images, and establishing Laplacian pyramids of the two images based on the Gaussian pyramids;
[0027] The images of the Laplacian pyramid are added according to a preset mask to obtain a first pyramid image, and the N+1 layers of the Gaussian pyramids of the two images are added according to the preset mask to obtain a second pyramid image;
[0028] Upsampling the second pyramid image and adding the upsampled image to the top layer of the first pyramid image to obtain a third pyramid image;
[0029] After repeating the preset number of times, the final reconstructed image is obtained.
[0030] According to a specific embodiment disclosed in the present application, the loss function of the reconstructed network includes a multi-scale SSIM loss function, and the construction process of the multi-scale SSIM loss function includes:
[0031] Among them, u x and u y is the mean of x and y, σ x and σ y is the variance of x and y, σ xy is the covariance between x and y, c 1 =(k 1 L) 2 、c 2 =(k 2 L) 2 and c 3 =c 2 / 2 are three constants to avoid the denominator being 0, k 1 With k 2 is 0.01 and 0.03, and L is the range of image pixel values.
[0032] According to a specific embodiment disclosed in the present application, the steps of inputting the image to be monitored into the reconstructed image model, outputting the reconstructed image, performing defect detection on the reconstructed image and the image to be monitored by image difference processing, and performing defect location on the reconstructed image and the image to be monitored by threshold segmentation processing include:
[0033] Calculating the reconstruction error between the reconstructed image after denoising and the image to be monitored by a reconstruction error calculation formula, and judging whether the image to be monitored has defects according to the reconstruction error;
[0034] If the image to be monitored has defects, setting the first image value and the second image value of the image to be monitored;
[0035] The image to be monitored is divided into a first area and a second area according to the first image value and the second image value, and the second area is determined as a defect area.
[0036] In a second aspect, an embodiment of the present disclosure provides a defect monitoring device based on a reconstructed network, the device comprising:
[0037] An acquisition module is used to acquire a defect-free image, and perform multi-angle simulation processing and complex environment simulation processing on the defect-free image to obtain an initial image;
[0038] A training module, used for performing image pyramid processing on the initial image to obtain a multi-scale training image, and training a reconstruction network according to the multi-scale training image to obtain a reconstructed image model;
[0039] The monitoring module is used to input the image to be monitored into the reconstructed image model, output the reconstructed image, perform defect detection on the reconstructed image and the image to be monitored through image difference processing, and perform defect location on the reconstructed image and the image to be monitored through threshold segmentation processing.
[0040] In a third aspect, an electronic device is provided in an embodiment of the present disclosure, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the defect monitoring method based on reconstructed network described in any one of the first aspects when executing the computer program.
[0041] In a fourth aspect, a computer-readable storage medium is provided in an embodiment of the present disclosure, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the defect monitoring method based on reconstructed network described in any one of the first aspects are implemented.
[0042] The defect monitoring method based on reconstruction network provided by the above-mentioned application obtains a defect-free image, performs multi-angle simulation processing and complex environment simulation processing on the defect-free image to obtain an initial image, performs image pyramid processing on the initial image to obtain a multi-scale training image, trains the reconstruction network according to the multi-scale training image to obtain a reconstructed image model, inputs the image to be monitored into the reconstructed image model, outputs the reconstructed image, performs defect detection on the reconstructed image and the image to be monitored through image difference processing, and performs defect location on the reconstructed image and the image to be monitored through threshold segmentation processing. By constructing a multi-scale training image for the defect-free image, the network can have reconstruction capability without a large number of samples, realizes defect location and identification, reduces the cost and risk of detection, and provides reliable support for the operation and maintenance of the power system. By adopting the reconstruction model to monitor defects, the accuracy and robustness of detection are improved, and it can better adapt to the complex environment of the power system.
[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work. In each of the drawings, similar components are numbered similarly.
[0045] Figure 1 A schematic diagram of a defect monitoring method based on a reconstructed network provided in an embodiment of the present application is shown;
[0046] Figure 2 A schematic diagram of the structure of a defect monitoring device based on a reconstruction network provided in an embodiment of the present application is shown;
[0047] Figure 3 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0048] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0049] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. In contrast, when an element is referred to as being "directly on" another element, there is no intermediate element. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0050] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0051] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of the template are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0053] Example 1
[0054] According to research, in the defect monitoring process of substation components in the prior art, due to the scarcity of defect samples, large differences in defect characteristics, and the occasional occurrence of unknown defects, defect monitoring using a large number of defect samples is difficult to use. The present invention provides a technical solution that can perform defect monitoring using only a small amount of defect sample data. Figure 1 FIG. 1 is a flow chart of a defect monitoring method based on a reconstructed network provided in an embodiment of the present application. The defect monitoring method based on a reconstructed network provided in an embodiment of the present application includes the following steps:
[0055] Step S101 , obtaining a defect-free image, performing multi-angle simulation processing and complex environment simulation processing on the defect-free image, and obtaining an initial image.
[0056] Specifically, in the substation scene, defect image samples are difficult to obtain, the defect types are numerous, and the environment is complex. This scheme uses a small number of defect-free substation component sample images as the input of the network model, and performs multi-angle processing and complex environment simulation on the defect-free images to simulate the actual complex scene of the substation.
[0057] The step of acquiring a defect-free image, performing multi-angle simulation processing and complex environment simulation processing on the defect-free image, and obtaining an initial image comprises:
[0058] The multi-angle simulation processing includes image rotation processing, translation processing and mirror processing;
[0059] The complex environment simulation process includes adding random illumination processing and random contrast change processing.
[0060] Specifically, by performing complex environment simulation processing on defect-free images, it can be ensured that the reconstructed model can still accurately monitor defects under extreme conditions. Adding random lighting processing includes simulating changes in light intensity, simulating changes in light direction, and simulating changes in light color. Adding random contrast change processing includes simulating contrast reduction, simulating contrast enhancement, and simulating contrast fluctuation.
[0061] Step S102, performing image pyramid processing on the initial image to obtain a multi-scale training image, and training a reconstruction network according to the multi-scale training image to obtain a reconstructed image model.
[0062] Specifically, the initial image is scaled and adjusted to 1024×1024 pixels as the input of the pyramid, and is pooled into multi-scale training images of 512×512, 256×256 and 128×128 through image pyramid processing, and the multi-scale training images are input into the reconstruction network.
[0063] The step of performing image pyramid processing on the initial image to obtain a multi-scale training image, and training a reconstruction network according to the multi-scale training image to obtain a reconstructed image model comprises:
[0064] Performing multi-path convolution feature extraction on the multi-scale training image to obtain image features of the multi-scale training image;
[0065] Performing encoding transformation and decoding transformation on the image features to obtain an initial reconstructed image;
[0066] The initial reconstructed images are fused using a Laplace pyramid fusion algorithm to obtain a final reconstructed image.
[0067] Specifically, multi-path convolution feature extraction is performed on the multi-scale training images using three paths of 1×1, 3×3 and 3×3 connected to 3×3, respectively, which can extract feature maps at different scales and different receptive fields, reducing the amount of calculation and the number of parameters.
[0068] The step of performing encoding transformation and decoding transformation on the image features to obtain an initial reconstructed image comprises:
[0069] Initialize the convolution module and deconvolution module;
[0070] Add a residual connection between the input and output of each convolution module, pass the image features through each convolution module in turn, and output a feature map;
[0071] Input the feature map into a deconvolution module, and output an initial reconstructed image through multi-path deconvolution;
[0072] The encoding transform and the decoding transform are defined as:
[0073] in, is the encoding transform, γ is the decoding transform, G∈RW×H is the spatial domain of the image, and H is the corresponding image feature in the hidden space;
[0074] The process of the encoding transformation and the decoding transformation is as follows:
[0075] Where G' is the reconstructed image, is the convolution, σ is the activation function, W is the encoding convolution kernel, W' is the decoding convolution kernel, b is the encoding bias, and b' is the decoding bias.
[0076] Specifically, a 3×3 convolution layer, a batch normalization layer, and a nonlinear activation layer are configured for each convolution module. A residual connection is added between the input and output of each convolution module, that is, the output of the previous layer is added to the output of the current layer as the input of the next layer. Through each convolution module in turn, the features are gradually extracted and compressed. A 3×3 deconvolution layer, a batch normalization layer, and a nonlinear activation layer are configured for each deconvolution module. The lowest resolution feature map output by the encoder is used as the input of the decoder. The size and details of the image are gradually restored through layer-by-layer deconvolution, and the initial reconstructed image is output.
[0077] The step of fusing the initial reconstructed images by using a Laplace pyramid fusion algorithm to obtain a final reconstructed image comprises:
[0078] Establishing Gaussian pyramids of two initial reconstructed images, and establishing Laplacian pyramids of the two images based on the Gaussian pyramids;
[0079] The images of the Laplacian pyramid are added according to a preset mask to obtain a first pyramid image, and the N+1 layers of the Gaussian pyramids of the two images are added according to the preset mask to obtain a second pyramid image;
[0080] Upsampling the second pyramid image and adding the upsampled image to the top layer of the first pyramid image to obtain a third pyramid image;
[0081] After repeating the preset number of times, the final reconstructed image is obtained.
[0082] Specifically, the initial reconstructed image is up-sampled to restore it to its original size, and the up-sampling includes bilinear interpolation and bicubic interpolation.
[0083] The loss function of the reconstructed network includes a multi-scale SSIM loss function, and the construction process of the multi-scale SSIM loss function includes:
[0084] Among them, u x and u y is the mean of x and y, σ x and σ y is the variance of x and y, σ xy is the covariance between x and y, c 1 =(k 1 L) 2 、c 2 =(k 2 L) 2 and c 3 =c 2 / 2 are three constants to avoid the denominator being 0, k 1 With k 2 is 0.01 and 0.03, and L is the range of image pixel values.
[0085] In the defect monitoring task, the design of the loss function directly affects the training results and monitoring accuracy of the network. When training the reconstruction network, the reconstruction error between the initial image and the reconstructed image is used as the loss function. The structural similarity evaluation function is introduced to evaluate the similarity index of the two images, and a multi-scale SSIM (Structural Similarity) loss function is constructed according to the image pyramid.
[0086] Step S103, inputting the image to be monitored into the reconstructed image model, outputting the reconstructed image, performing defect detection on the reconstructed image and the image to be monitored through image difference processing, and performing defect location on the reconstructed image and the image to be monitored through threshold segmentation processing.
[0087] The steps of inputting the image to be monitored into the reconstructed image model, outputting the reconstructed image, performing defect detection on the reconstructed image and the image to be monitored by image difference processing, and performing defect location on the reconstructed image and the image to be monitored by threshold segmentation processing include:
[0088] Calculating the reconstruction error between the reconstructed image after denoising and the image to be monitored by a reconstruction error calculation formula, and judging whether the image to be monitored has defects according to the reconstruction error;
[0089] If the image to be monitored has defects, setting the first image value and the second image value of the image to be monitored;
[0090] The image to be monitored is divided into a first area and a second area according to the first image value and the second image value, and the second area is determined as a defect area.
[0091] Specifically, the image to be monitored is input into the reconstructed image model, and the reconstructed image model reconstructs the image to be monitored into a defect-free reconstructed image. The reconstructed image processed by the reconstructed image model usually shows many noise points, which are easy to form pseudo defects and thus affect defect monitoring. The reconstructed image is denoised by mean filtering. The reconstruction error of the reconstruction network for the defective area can be obtained by performing image difference processing on the image to be monitored and the reconstructed image. If it is determined that there is a defect in the image to be monitored, the first image value of the image to be monitored is set to 0, and the second image value is set to 1. The first area and the second area are segmented by the adaptive threshold segmentation method to achieve defect location.
[0092] The defect monitoring method based on reconstruction network provided in the present embodiment obtains a defect-free image, performs multi-angle simulation processing and complex environment simulation processing on the defect-free image to obtain an initial image, performs image pyramid processing on the initial image to obtain a multi-scale training image, trains a reconstruction network according to the multi-scale training image to obtain a reconstructed image model, inputs the image to be monitored into the reconstructed image model, outputs a reconstructed image, performs defect detection on the reconstructed image and the image to be monitored through image difference processing, performs defect location on the reconstructed image and the image to be monitored through threshold segmentation processing, constructs a multi-scale training image for the defect-free image, enables the network to have reconstruction capability without a large number of samples, realizes defect location and identification, reduces the cost and risk of detection, provides reliable support for power system operation and maintenance, and improves the accuracy and robustness of detection by adopting the reconstruction model to monitor defects, which can better adapt to the complex environment of the power system.
[0093] Example 2
[0094] like Figure 2FIG. 2 is a schematic diagram of a defect monitoring device 200 based on a reconstructed network provided in an embodiment of the present application, wherein the device includes:
[0095] An acquisition module 201 is used to acquire a defect-free image, and perform multi-angle simulation processing and complex environment simulation processing on the defect-free image to obtain an initial image;
[0096] A training module 202 is used to perform image pyramid processing on the initial image to obtain a multi-scale training image, and train a reconstruction network according to the multi-scale training image to obtain a reconstructed image model;
[0097] The monitoring module 203 is used to input the image to be monitored into the reconstructed image model, output the reconstructed image, perform defect detection on the reconstructed image and the image to be monitored through image difference processing, and perform defect location on the reconstructed image and the image to be monitored through threshold segmentation processing.
[0098] The defect monitoring device 200 based on a reconstructed network provided in this embodiment can implement the defect monitoring method based on a reconstructed network shown in Embodiment 1, which will not be described again to avoid repetition.
[0099] The defect monitoring device based on reconstruction network provided in the embodiment of the present application obtains a defect-free image, performs multi-angle simulation processing and complex environment simulation processing on the defect-free image to obtain an initial image, performs image pyramid processing on the initial image to obtain a multi-scale training image, trains a reconstruction network according to the multi-scale training image to obtain a reconstructed image model, inputs the image to be monitored into the reconstructed image model, outputs a reconstructed image, performs defect detection on the reconstructed image and the image to be monitored through image difference processing, performs defect location on the reconstructed image and the image to be monitored through threshold segmentation processing, constructs a multi-scale training image for the defect-free image, enables the network to have reconstruction capability without a large number of samples, realizes defect location and identification, reduces the cost and risk of detection, provides reliable support for power system operation and maintenance, and improves the accuracy and robustness of detection by adopting the reconstruction model to monitor defects, so as to better adapt to the complex environment of the power system.
[0100] Example 3
[0101] In addition, an embodiment of the present disclosure provides an electronic device 300, including a memory and a processor, wherein the memory stores a computer program.
[0102] For details, see Figure 3 The electronic device 300 includes: a receiver 301, a bus interface and a processor 302.
[0103] In the embodiment of the present invention, the electronic device 300 further includes a memory 303. Figure 3 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 302 and memory represented by memory 303. The bus architecture may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The receiver 301 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 302 is responsible for managing the bus architecture and general processing, and the memory 303 may store data used by the processor 302 when performing operations.
[0104] The electronic device 300 provided in the embodiment of the present invention can implement the defect monitoring method based on reconstructed network shown in Embodiment 1, which will not be described again to avoid repetition.
[0105] The electronic device provided in the present embodiment obtains a defect-free image, performs multi-angle simulation processing and complex environment simulation processing on the defect-free image to obtain an initial image, performs image pyramid processing on the initial image to obtain a multi-scale training image, trains a reconstruction network according to the multi-scale training image to obtain a reconstructed image model, inputs the image to be monitored into the reconstructed image model, outputs a reconstructed image, performs defect detection on the reconstructed image and the image to be monitored through image difference processing, performs defect location on the reconstructed image and the image to be monitored through threshold segmentation processing, constructs a multi-scale training image for the defect-free image, enables the network to have reconstruction capability without a large number of samples, realizes defect location and identification, reduces the cost and risk of detection, provides reliable support for power system operation and maintenance, and improves detection accuracy and robustness by adopting the reconstruction model to monitor defects, so as to better adapt to the complex environment of the power system.
[0106] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow chart, and the combination of boxes in the structure diagram and / or the flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0107] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0108] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0109] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A defect monitoring method based on a reconstructed network, characterized in that: The method comprises: Acquire a defect-free image, and perform multi-angle simulation processing and complex environment simulation processing on the defect-free image to obtain an initial image; Performing image pyramid processing on the initial image to obtain a multi-scale training image, and training a reconstruction network according to the multi-scale training image to obtain a reconstructed image model; The image to be monitored is input into the reconstructed image model, and a reconstructed image is output. The reconstructed image and the image to be monitored are subjected to image difference processing for defect detection, and the reconstructed image and the image to be monitored are subjected to threshold segmentation processing for defect location.
2. The defect monitoring method based on reconstructed network according to claim 1 is characterized in that: The step of acquiring a defect-free image, performing multi-angle simulation processing and complex environment simulation processing on the defect-free image, and obtaining an initial image comprises: The multi-angle simulation processing includes image rotation processing, translation processing and mirror processing; The complex environment simulation process includes adding random illumination processing and random contrast change processing.
3. The defect monitoring method based on reconstructed network according to claim 1 is characterized in that: The step of performing image pyramid processing on the initial image to obtain a multi-scale training image, and training a reconstruction network according to the multi-scale training image to obtain a reconstructed image model comprises: Performing multi-path convolution feature extraction on the multi-scale training image to obtain image features of the multi-scale training image; Performing encoding transformation and decoding transformation on the image features to obtain an initial reconstructed image; The initial reconstructed images are fused using a Laplace pyramid fusion algorithm to obtain a final reconstructed image.
4. The defect monitoring method based on reconstructed network according to claim 3 is characterized in that: The step of performing encoding transformation and decoding transformation on the image features to obtain an initial reconstructed image comprises: Initialize the convolution module and deconvolution module; Add a residual connection between the input and output of each convolution module, pass the image features through each convolution module in turn, and output a feature map; Input the feature map into a deconvolution module, and output an initial reconstructed image through multi-path deconvolution; The encoding transform and the decoding transform are defined as: γ:H→G in, is the encoding transform, γ is the decoding transform, G∈RW×H is the spatial domain of the image, and H is the corresponding image feature in the hidden space; The process of the encoding transformation and the decoding transformation is: Where G' is the reconstructed image, is the convolution, σ is the activation function, W is the encoding convolution kernel, W' is the decoding convolution kernel, b is the encoding bias, and b' is the decoding bias.
5. The defect monitoring method based on reconstructed network according to claim 3 is characterized in that: The step of fusing the initial reconstructed images by using a Laplace pyramid fusion algorithm to obtain a final reconstructed image includes: Establishing Gaussian pyramids of two initial reconstructed images, and establishing Laplacian pyramids of the two images based on the Gaussian pyramids; The images of the Laplacian pyramid are added according to a preset mask to obtain a first pyramid image, and the N+1 layers of the Gaussian pyramids of the two images are added according to the preset mask to obtain a second pyramid image; Upsampling the second pyramid image and adding the upsampled image to the top layer of the first pyramid image to obtain a third pyramid image; After repeating the preset number of times, the final reconstructed image is obtained.
6. The defect monitoring method based on reconstructed network according to claim 1 is characterized in that: The loss function of the reconstructed network includes a multi-scale SSIM loss function, and the construction process of the multi-scale SSIM loss function is include: L Ms-SSIM (x,y)=1-ΠL SSIM (x,y) L SSIM (x,y)=1-SSIM(x,y) SSIM(x,y)=(l(x,y)) α (c(x,y)) β (s(x,y)) γ Among them, u x and u y is the mean of x and y, σ x and σ y is the variance of x and y, σ xy is the covariance between x and y, c1=(k1L) 2 、c2=(k2L) 2 And c3=c2 / 2 are three constants to avoid the denominator being 0, k1 and k2 are 0.01 and 0.03, and L is the range of image pixel values.
7. The defect monitoring method based on reconstructed network according to claim 1 is characterized in that: The steps of inputting the image to be monitored into the reconstructed image model, outputting the reconstructed image, performing defect detection on the reconstructed image and the image to be monitored by image difference processing, and performing defect location on the reconstructed image and the image to be monitored by threshold segmentation processing include: Calculating the reconstruction error between the reconstructed image after denoising and the image to be monitored by a reconstruction error calculation formula, and judging whether the image to be monitored has defects according to the reconstruction error; If the image to be monitored has defects, setting the first image value and the second image value of the image to be monitored; The image to be monitored is divided into a first area and a second area according to the first image value and the second image value, and the second area is determined as a defect area.
8. A defect monitoring device based on a reconstructed network, characterized in that: The device comprises: An acquisition module is used to acquire a defect-free image, and perform multi-angle simulation processing and complex environment simulation processing on the defect-free image to obtain an initial image; A training module, used for performing image pyramid processing on the initial image to obtain a multi-scale training image, and training a reconstruction network according to the multi-scale training image to obtain a reconstructed image model; The monitoring module is used to input the image to be monitored into the reconstructed image model, output the reconstructed image, perform defect detection on the reconstructed image and the image to be monitored through image difference processing, and perform defect location on the reconstructed image and the image to be monitored through threshold segmentation processing.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the defect monitoring method based on reconstructed network described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the defect monitoring method based on reconstructed network described in any one of claims 1 to 7 are implemented.