Semi-supervised photovoltaic cell surface anomaly detection method based on image inpainting

By constructing a semi-supervised anomaly detection model, and utilizing a repair sub-network and a segmentation sub-network combined with a hybrid masking strategy and a CAM module, the problems of high cost and low accuracy in photovoltaic cell anomaly detection are solved, achieving efficient and accurate anomaly detection and localization.

CN116051530BActive Publication Date: 2026-02-27HEBEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310101607.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-13
Publication Date
2026-02-27
Estimated Expiration
2043-02-13

AI Technical Summary

Technical Problem

In existing technologies, photovoltaic cell anomaly detection methods suffer from high cost, high error rate, and low efficiency. Supervised learning requires a large amount of labeling work, while unsupervised learning is prone to degenerate into identity mapping and cannot effectively identify anomalies.

Method used

A semi-supervised method based on image inpainting is adopted to construct an anomaly detection model, including an inpainting subnetwork and a segmentation subnetwork. Simulated anomaly images are generated through a hybrid masking strategy. The model is trained using a small number of anomaly samples and a large number of normal samples. The CAM module is combined to capture long and short distance information to improve detection accuracy.

Benefits of technology

It improves the accuracy and efficiency of photovoltaic cell anomaly detection, and can accurately classify and locate abnormal areas. The AUCs reach 97.4% and 99.2% respectively, which significantly improves the model's generalization ability and detection performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116051530B_ABST
    Figure CN116051530B_ABST
Patent Text Reader

Abstract

The application discloses a semi-supervised photovoltaic cell surface anomaly detection method based on image inpainting. The anomaly detection model used in the method comprises an inpainting subnetwork and a segmentation subnetwork. The inpainting subnetwork is used for inpainting an input image into a non-anomaly image. The segmentation subnetwork is used for judging whether the input image is an anomaly image and positioning an anomaly region. Through processing the non-anomaly image, a hybrid mask strategy is used to generate an anomaly mask image, and a simulated anomaly image is generated. The non-anomaly image, the simulated anomaly image and the anomaly mask image are input into an initialized model. The inpainting subnetwork outputs a repaired image. The repaired image is spliced with the simulated anomaly image and then input into the segmentation subnetwork. The model is trained. The trained anomaly detection model is used for photovoltaic cell anomaly detection. The method introduces anomaly prior knowledge, trains the inpainting subnetwork to repair the simulated anomaly into a normal state, captures long and short distance information through a CAM module, improves the image inpainting quality, and improves the anomaly detection and positioning precision.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of photovoltaic cell anomaly detection, and particularly relates to a semi-supervised photovoltaic cell surface anomaly detection method based on image restoration. BACKGROUND

[0002] A photovoltaic cell (PV) is a carrier of photovoltaic power generation, and defects such as black spots, hidden cracks and broken grids inevitably occur in the photovoltaic cell during production and manufacturing, transportation, installation and use, thereby limiting the service life of the photovoltaic cell. Therefore, anomaly detection of the photovoltaic cell is of great significance for improving the service life of the cell and ensuring the power generation efficiency.

[0003] Electroluminescence (EL) imaging technology has been widely used for detecting potential defects of photovoltaic cells and component products. The principle is that, under dark room conditions, a forward bias voltage is applied to a crystalline silicon solar cell, the power supply injects a large number of non-equilibrium carriers into the photovoltaic cell, the non-equilibrium carriers continuously recombine and emit light, and the industrial camera captures these photons. After computer processing, the image is displayed. The place with defects appears darker in the electroluminescence image, so the electroluminescence image can effectively detect whether the photovoltaic cell has an anomaly.

[0004] The traditional manual detection method collects photovoltaic cell images and judges whether there is a defect by visual inspection, which has the disadvantages of high cost, high error rate and low efficiency, and the judgment of defects is also subjective. With the development of convolutional neural networks, deep learning technology is widely used to solve the problem of photovoltaic cell anomaly detection. According to whether the training sample label exists, it can be divided into supervised learning and unsupervised learning. Supervised learning is usually based on target detection technology, such as Yolo, Faster R-cnn network, which needs to collect a large number of abnormal samples and needs to be accurately labeled. The sample collection and labeling workload is large, and it is not suitable for industrial scenes. Unsupervised learning can only use normal samples during model training, so that the model can obtain the ability to reconstruct the anomaly as normal. According to the difference before and after reconstruction, the anomaly is detected. Since the model has not learned the anomaly during the training process, it is easy to degenerate into an identity mapping, and it is difficult to obtain the ability to reconstruct the anomaly as normal, which leads to the inability to identify the anomaly.

[0005] Therefore, the present application proposes a semi-supervised photovoltaic cell surface anomaly detection method based on image restoration to solve the above problems. SUMMARY

[0006] In view of the deficiencies of the prior art, the technical problem to be solved by the present application is to provide a semi-supervised photovoltaic cell surface anomaly detection method based on image restoration.

[0007] The application solves the technical problem by adopting the technical scheme as follows:

[0008] A semi-supervised photovoltaic cell surface anomaly detection method based on image inpainting, characterized in that the method comprises the following steps:

[0009] Firstly, collecting electroluminescence images of photovoltaic cells, including abnormal and non-abnormal images; normalizing the images, and randomly selecting multiple non-abnormal images to form a training set, and the remaining images form a test set;

[0010] Secondly, constructing an anomaly detection model; the anomaly detection model comprises an inpainting sub-network and a segmentation sub-network, the inpainting sub-network is used for inpainting the input image into a non-abnormal image, and the segmentation sub-network is used for judging whether the input image is an abnormal image and positioning the abnormal area;

[0011] Thirdly, preprocessing the training set, the preprocessed training set comprises non-abnormal images, simulated abnormal images and abnormal mask images, and the preprocessed training set is used for training the anomaly detection model;

[0012] Inputting the training set, generating a random number greater than zero and less than 1, if the random number is greater than or equal to 0.5, no data enhancement is needed, an abnormal mask image corresponding to each non-abnormal image in the training set is generated, and each abnormal mask image is superimposed with the corresponding non-abnormal image to form a simulated abnormal image;

[0013] If the random number is less than 0.5, data enhancement is needed, a hybrid mask strategy is used to generate an abnormal mask image; the abnormal mask image is multiplied with the non-abnormal image and the enhanced abnormal texture source image respectively, and then the two results are added after proportional mixing to obtain a simulated abnormal area; the background image of the abnormal mask image is multiplied with the non-abnormal image, and then the result is added with the simulated abnormal area to obtain a simulated abnormal image; wherein, the abnormal texture source image is sampled from a describable texture data set;

[0014] The preprocessed training set is input into the initialized anomaly detection model, the inpainting sub-network outputs an inpainting image; the inpainting image and the simulated abnormal image are spliced and then input into the segmentation sub-network; after the model converges, a trained anomaly detection model is obtained;

[0015] Fourthly, normalizing the image of the photovoltaic cell to be detected, and then inputting the image into the trained anomaly detection model for anomaly detection.

[0016] Further, in the third step, the hybrid mask strategy means that the abnormal mask image is obtained by two means, one is to label the abnormal area of the abnormal image to obtain the abnormal mask image, and the other is to generate a noise image by noise, and then to obtain the abnormal mask image by binaryzation processing of the noise image.

[0017] Further, the repair sub-network includes CBR*2_MaxPool modules, CBR modules, CAM modules and Up_CBR-CBR*2 modules, four CBR*2_MaxPool modules are connected in turn, four Up_CBR-CBR*2 modules are connected in turn, the fourth CBR*2_MaxPool module is connected with the first Up_CBR-CBR*2 module through a CBR module and a CAM module, and the fourth Up_CBR-CBR*2 module obtains the output of the repair sub-network through a convolutional layer;

[0018] The segmentation sub-network includes CBR*2_MaxPool modules, CBR modules and Up_CBR-CBR*2 modules, five CBR*2_MaxPool modules are connected in turn, five Up_CBR-CBR*2 modules are connected in turn, the fifth CBR*2_MaxPool module is connected with the first Up_CBR-CBR*2 module through a CBR module; there is a skip connection between the fifth CBR*2_MaxPool module and the first Up_CBR-CBR*2 module, the fourth CBR*2_MaxPool module and the second Up_CBR-CBR*2 module, the third CBR*2_MaxPool module and the third Up_CBR-CBR*2 module, the second CBR*2_MaxPool module and the fourth Up_CBR-CBR*2 module, and the first CBR*2_MaxPool module and the fifth Up_CBR-CBR*2 module, that is, the feature maps output by the CBR*2_MaxPool modules are spliced with the feature maps output by the Up_CBR modules of the corresponding Up_CBR-CBR*2 modules, and then input to the CBR*2 modules of the Up_CBR-CBR*2 modules; the feature maps output by the fifth Up_CBR-CBR*2 module are input into a convolutional layer to obtain a segmentation mask graph; the segmentation mask graph is locally averaged and pooled to obtain the output of the anomaly detection model;

[0019] The CAM module is used to capture long and short distance information; the CBR*2_MaxPool module includes two CBR modules and a maximum pooling layer, the two CBR modules are connected in turn, and the maximum pooling layer is located after the second CBR module; the Up_CBR-CBR*2 module includes an Up_CBR module and two CBR modules connected in turn, and the Up_CBR module is located before the first CBR module; the CBR module includes a convolutional layer, a normalization layer and an activation layer connected in turn; the Up_CBR module includes an up-sampling layer, a convolutional layer, a normalization layer and an activation layer connected in turn.

[0020] Further, the CAM module includes two branches, one branch is that the input image of the CAM module passes through a CBR module, then passes through two strip pooling layers with different kernel sizes respectively, the feature maps output by the two strip pooling layers are spliced, then pass through a CBR module and a channel separation operation to be divided into two feature maps, the two feature maps pass through a CB module respectively and then are added, the added feature map passes through an activation layer and a CBR module to obtain the feature map output by the branch; the other branch is that the input image of the CAM model passes through a CBR module, then passes through two average pooling layers with different kernel sizes respectively, the feature map output by the average pooling layer with a large kernel size passes through a CBR module and up-sampling, and is added to the feature map output by the average pooling layer with a small kernel size, the added feature map passes through a CBR module and up-sampling, and is added to the feature map output by the first CBR module of the branch, the added feature map passes through a CBR module to obtain the feature map output by the branch; the feature maps output by the two branches are added, then pass through a CB module, and then are added to the input image of the CAM module, pass through an activation layer to obtain the feature map output by the CAM module; wherein the CB module includes a convolution layer and a normalization layer.

[0021] Further, the kernels of the two strip pooling layers are 1xN and Nx1 respectively, and N is a positive integer; the kernels of the two average pooling layers are 2x2 and 4x4 respectively.

[0022] Compared with the prior art, the present application has the following beneficial effects:

[0023] 1. The anomaly detection model of the present application includes a repair sub-network and a segmentation sub-network, the input image is repaired into a normal image by the repair sub-network, and the segmentation sub-network compares the input image with the repaired image to determine whether the input image is an abnormal image and to locate the abnormality. The CAM module of the repair sub-network is a context attention module, which is used to capture long and short distance information to improve the repair performance of the repair sub-network, improve the image repair quality, and further improve the anomaly detection and positioning accuracy.

[0024] 2. In the training sample preprocessing process, a mixed mask strategy is used to generate a simulated abnormal area, and then a simulated abnormal image is generated, and the samples participating in the training include normal images, simulated abnormal images and abnormal masks Figure Three part, the prior knowledge of the abnormality is introduced to train the repair sub-network to repair the simulated abnormal area to normal, prevent the model from degrading, and also make full use of a large number of easily collected normal samples and a small number of collectable abnormal samples, so that the model maintains the generalization ability of recognizing multiple abnormalities, and improves the detection ability of the model to real abnormalities. BRIEF DESCRIPTION OF DRAWINGS

[0025] Figure 1Structure diagram of the anomaly detection model of the present application;

[0026] Figure 2 Structure diagram of the CAM module of the present application;

[0027] Figure 3 Structure diagram of the CB module, the CBR module and the Up_CBR module;

[0028] Figure 4 Generation principle diagram of the simulated anomaly image;

[0029] Figure 5 Simulated anomaly image generated by the present application;

[0030] Figure 6 Photovoltaic cell image to be detected;

[0031] Figure 7 Detection result diagram obtained by the anomaly detection model. DETAILED DESCRIPTION

[0032] The technical solutions of the present application will be described in detail below in combination with the drawings and specific embodiments, but the protection scope of the present application is not limited thereto.

[0033] The present application provides a semi-supervised photovoltaic cell surface anomaly detection method based on image inpainting (referred to as method), comprising the following steps:

[0034] Step 1: Constructing a photovoltaic cell dataset;

[0035] Based on electroluminescence imaging technology, photovoltaic cell images including abnormal and non-abnormal images are obtained by an industrial camera; each image contains multiple cell pieces, so the original size is 3600x618 pixels; the original image is cut into groups of two cell pieces and normalized to 640x590 pixels; a total of 1508 images are obtained, including 1100 non-abnormal images and 408 abnormal images; 90% of the non-abnormal images are randomly selected by man-machine as a training set; multiple abnormal images are randomly selected, and pixel-level labeling of binarization of the abnormal regions is performed to obtain abnormal mask images, which are used for training of the anomaly detection model in step three; the remaining non-abnormal images and abnormal images are used as a test set, and the abnormal regions of the abnormal images in the test set are pixel-level labeled by binarization, which are used for abnormal region positioning calculation during model testing; the labeling of the abnormal images mainly includes black spots, hidden cracks, broken grids and linear defects, and the labeling information only represents that the region is an abnormal region, but not a specific abnormal category.

[0036] Step 2, constructing an anomaly detection model;

[0037] As Figure 1As shown, the anomaly detection model includes a repair subnetwork and a segmentation subnetwork, the repair subnetwork is used for repairing the input image into a non-anomalous image, and the segmentation subnetwork is used for locating the abnormal area and determining whether the input image is an abnormal image; the repair subnetwork includes a CBR*2_MaxPool module, a CBR module, a CAM module and an Up_CBR-CBR*2 module, four CBR*2_MaxPool modules are connected in turn, four Up_CBR-CBR*2 modules are connected in turn, the fourth CBR*2_MaxPool module is connected with the first Up_CBR-CBR*2 module through a CBR module and a CAM module, and the fourth Up_CBR-CBR*2 module obtains the output of the repair subnetwork, i.e. a repaired image, through a convolution layer (CONV);

[0038] The segmentation subnetwork includes a CBR*2_MaxPool module, a CBR module and an Up_CBR-CBR*2 module, five CBR*2_MaxPool modules are connected in turn, five Up_CBR-CBR*2 modules are connected in turn, the fifth CBR*2_MaxPool module is connected with the first Up_CBR-CBR*2 module through a CBR module, and there is a skip connection between the fifth CBR*2_MaxPool module and the first Up_CBR-CBR*2 module, the fourth CBR*2_MaxPool module and the second Up_CBR-CBR*2 module, the third CBR*2_MaxPool module and the third Up_CBR-CBR*2 module, the second CBR*2_MaxPool module and the fourth Up_CBR-CBR*2 module, and the first CBR*2_MaxPool module and the fifth Up_CBR-CBR*2 module, that is, the feature map output by the fifth CBR*2_MaxPool module is spliced with the feature map output by the Up_CBR module of the first Up_CBR-CBR*2 module, and then input to the CBR*2 module of the first Up_CBR-CBR*2 module, and the rest of the skip connections are the same; the feature map output by the fifth Up_CBR-CBR*2 module is input into a convolution layer to obtain a segmentation mask image; the segmentation mask image is subjected to local average pooling (Local AvgPool), and the maximum value of the local average pooling is selected as the label output by the anomaly detection model, i.e. the anomaly score of the image to be detected.

[0039] The CAM module includes two branches. One branch is that the input image of the CAM module passes through a CBR module, then passes through two strip pooling layers (StripPool) with different kernel sizes, respectively, the feature maps output by the two strip pooling layers are spliced (Concat), then pass through a CBR module and a channel split (Channel Split) operation to be divided into two feature maps, the two feature maps pass through a CB module in sequence and are added (Add), the added feature map passes through an activation layer and a CBR module to obtain the feature map output by the branch. The other branch is that the input image of the CAM module passes through a CBR module, then passes through two average pooling layers (AvgPool) with different kernel sizes, respectively, the feature map output by the average pooling layer with a large kernel size passes through a CBR module and up-sampling, and is added to the feature map output by the average pooling layer with a small kernel size, the added feature map passes through a CBR module and up-sampling, and is added to the feature map output by the first CBR module of the branch, the added feature map passes through a CBR module to obtain the feature map output by the branch. The feature maps output by the two branches are added, then pass through a CB module, and are added to the input image of the CAM module, and then pass through an activation layer to obtain the feature map output by the CAM module. The CAM module uses two strip pooling layers with different direction kernels to capture long-distance information, uses two average pooling layers with different kernel sizes to converge short-distance information, and finally combines the long-distance and short-distance information to help repair a high-quality image, thereby improving the ability to locate an abnormal area.

[0040] The CBR*2_MaxPool module includes two CBR modules and a maximum pooling layer (MaxPool), the two CBR modules are connected in sequence, and the maximum pooling layer is located after the second CBR module. The maximum pooling layer is to halve the width and height of the feature map while keeping the channel number unchanged. The Up_CBR-CBR*2 module includes an Up_CBR module and two CBR modules connected in sequence, and the Up_CBR module is located before the first CBR module. The CBR module includes a convolution layer, a normalization layer (BN) and an activation layer (ReLu) connected in sequence. The Up_CBR module includes up-sampling, a convolution layer, a normalization layer and an activation layer connected in sequence. The CB module includes a convolution layer and a normalization layer.

[0041] The kernels of the two strip pooling layers are 1xN and Nx1 respectively, and the kernels of the two average pooling layers are 2x2 and 4x4 respectively. The convolution kernel size of all convolution layers is 3x3.

[0042] Step 3, training the anomaly detection model based on a semi-supervised manner;

[0043] 3.1) Model parameter initialization: initialize all weight values, bias values and batch normalization scale factor values, set the batch parameter (batch_size) of the model to 4, the maximum iteration number (epoch) to 200, the learning rate of the first 120 iterations to 0.0001, the learning rate of the 120-160 iterations to 0.00001, and the learning rate of the last 40 iterations to 0.000001, and the learning rate drop factor to 0.1;

[0044] 3.2) Preprocessing of the training set

[0045] Input the training set, generate a random number greater than zero and less than 1, if the random number is greater than or equal to 0.5, no data augmentation is needed, then generate an abnormal mask image corresponding to each abnormal-free image in the training set, and the pixel value is all zero, and then superimpose each abnormal mask image with the corresponding abnormal-free image to form a simulated abnormal image; if the random number is less than 0.5, data augmentation is needed, then a hybrid mask strategy is used to generate an abnormal mask image; the abnormal mask image is superimposed with an abnormal texture source image to form a simulated abnormal region, the abnormal texture source image is sampled from a distribution-independent describable texture dataset (DTD); the RandAugment strategy is used to enhance the abnormal texture source image, and the enhanced abnormal texture source image is multiplied with the abnormal mask image, the abnormal mask image is multiplied with the abnormal-free image, and the two multiplied images are added to form a simulated abnormal region; the background image of the abnormal mask image is multiplied with the abnormal-free image, and then added to the simulated abnormal region to obtain a simulated abnormal image; the preprocessed training set is composed of abnormal-free images, simulated abnormal images and abnormal mask images Figure Three .

[0046] The hybrid mask strategy refers to that the abnormal mask image is obtained by two means, one is to label the abnormal region of the abnormal image to obtain an abnormal mask image containing real abnormal information, and the other is to generate a noise image through Perlin noise, and the noise image is binarized through random uniform sampling threshold to obtain an artificially generated abnormal mask image; see Figure 4 , the abnormal texture source image A is enhanced through random enhancement (RandAugment) to obtain an enhanced abnormal texture source image A a , random enhancement can efficiently generate multiple abnormal regions containing different attribute information from a single texture source image; the enhanced abnormal texture source image A a is multiplied with the abnormal mask image M to obtain images A a ⊙M and I⊙M, and the two are mixed and added according to the proportion to obtain a simulated abnormal region A s ; finally, the background image 1-M of the abnormal mask image is multiplied with the abnormal-free image I, and then added to the simulated abnormal region A sAdd up to get the simulated abnormal image I a ; therefore the simulated abnormal image I a is defined as:

[0047] Ia = (1 - M) O I + As

[0048] As = a(M O I) + (1 - a)(Aa O M)

[0049] Aa = RandAugment(A)

[0050] Wherein, RandAugment(·) represents a random augmentation operation, O represents a multiplication operation, a represents a mixing ratio, which is randomly generated from [0, 1];

[0051] By superimposing the mask image on the non-abnormal image to simulate the abnormality, the model has the ability to repair the image, but this will cause the model to overfit to the simulated abnormality, and the decision boundary learned by the model cannot well generalize the real abnormality; using Perlin noise to randomly simulate abnormality can alleviate the overfitting of simulated abnormality while achieving efficient performance. However, random generation of abnormality cannot replace real abnormality, and in industrial scenarios, not all abnormal samples can be obtained. By using a small amount of labeled abnormal samples and randomly generated abnormalities, the model can achieve better performance with minimal labeling effort.

[0052] 3.3) Training of the anomaly detection model

[0053] The training set preprocessed in step 3.2) is input into the initialized anomaly detection model, and each image is repaired using the repair subnetwork to obtain the repaired image. The repaired image is compared with the corresponding non-abnormal image to obtain the loss value. The repaired image and the simulated abnormal image obtained in step 3.2) are spliced and input into the segmentation subnetwork, and the segmentation subnetwork is used to locate the abnormal area. The confidence of each pixel in the mask image obtained by the segmentation subnetwork is calculated and compared with the corresponding mask image in the training set to obtain the loss value. The Adam optimizer is used for backpropagation to update the model parameters until the loss value converges, and the training of the anomaly detection model is completed.

[0054] 3.4) Testing of the anomaly detection model

[0055] The validation set obtained in the first step is input into the trained anomaly detection model, and the label output by the network model is compared with the true label to obtain the abnormal classification and positioning result, in order to test the reliability of the model and monitor whether the model has overfitting. The final result shows that the AUC of defect classification is greater than 97%, and the AUC of defect positioning is greater than 99%, proving the effectiveness of the anomaly detection model.

[0056] The fourth step is to use the trained anomaly detection model for photovoltaic cell surface anomaly detection.

[0057] The photovoltaic cell image to be detected is normalized and then input into the trained anomaly detection model, the anomaly detection model classifies the photovoltaic cell image to be detected according to whether there is an anomaly, and simultaneously obtains the abnormal position information of the abnormal photovoltaic cell.

[0058] Figure 6 For the photovoltaic cell image to be detected, Figure 7 The detection result of the anomaly detection model shows that the AUC of the anomaly classification and positioning of the model is 97.4% and 99.2% respectively, which can accurately detect whether the photovoltaic cell has an anomaly and perform anomaly positioning, and if the mixed mask strategy and the CAM module are not used, the AUC of the anomaly classification and positioning of the model is 95.2% and 96.4% respectively, which shows that the mixed mask strategy and the CAM module can obviously improve the detection accuracy.

[0059] The unmentioned part of the present application is applicable to the prior art.

Claims

1. A semi-supervised method for detecting surface anomalies in photovoltaic cells based on image inpainting, characterized in that, The method includes the following steps: The first step is to collect electroluminescence images of photovoltaic cells, including abnormal and normal images; normalize the images, randomly select multiple normal images to form a training set, and use the remaining images to form a test set. The second step is to construct an anomaly detection model. The anomaly detection model includes a repair sub-network and a segmentation sub-network. The repair sub-network is used to repair the input image into an image without anomalies, and the segmentation sub-network is used to determine whether the input image is an anomaly image and to locate the anomaly region. The third step is to preprocess the training set. The preprocessed training set includes images without anomalies, simulated anomaly images, and anomaly mask images. The anomaly detection model is trained using the preprocessed training set. Input the training set and generate a random number greater than zero and less than 1. If the random number is greater than or equal to 0.5, no data augmentation is needed. Then generate an anomaly mask image that corresponds one-to-one with the anomaly-free images in the training set and has all pixel values ​​of zero. Then overlay each anomaly mask image with the corresponding anomaly-free image to form a simulated anomaly image. If the random number is less than 0.5, data augmentation is required. In this case, a hybrid masking strategy is used to generate an anomaly mask image. The anomaly mask image is multiplied by the non-anomaly image and the augmented anomaly texture source image, and then proportionally mixed and added to obtain the simulated anomaly region. The background image of the anomaly mask image is multiplied by the non-anomaly image and then added to the simulated anomaly region to obtain the simulated anomaly image. The anomaly texture source image is sampled from the describable texture dataset. The preprocessed training set is input into the initialized anomaly detection model, and the repair sub-network outputs the repaired image; the repaired image is then concatenated with the simulated anomaly image and input into the segmentation sub-network; after the model converges, the trained anomaly detection model is obtained. The fourth step is to normalize the image of the photovoltaic cell to be detected and then input it into the trained anomaly detection model for anomaly detection.

2. The semi-supervised photovoltaic cell surface anomaly detection method based on image inpainting according to claim 1, characterized in that, In the third step, the hybrid masking strategy refers to obtaining the anomaly mask image through two methods: one is to annotate the abnormal regions of the abnormal image to obtain the anomaly mask image; the other is to generate a noisy image through noise, and then perform binarization processing on the noisy image to obtain the anomaly mask image.

3. The semi-supervised photovoltaic cell surface anomaly detection method based on image inpainting according to claim 1 or 2, characterized in that, The repair sub-network includes a CBR*2_MaxPool module, a CBR module, a CAM module, and an Up_CBR-CBR*2 module. The four CBR*2_MaxPool modules are connected in sequence, and the four Up_CBR-CBR*2 modules are connected in sequence. The fourth CBR*2_MaxPool module is connected to the first Up_CBR-CBR*2 module through a CBR module and a CAM module. The fourth Up_CBR-CBR*2 module is passed through a convolutional layer to obtain the output of the repair sub-network. The segmented subnetwork includes a CBR*2_MaxPool module, a CBR module, and an Up_CBR-CBR*2 module. Five CBR*2_MaxPool modules are connected sequentially, and five Up_CBR-CBR*2 modules are connected sequentially. The fifth CBR*2_MaxPool module is connected to the first Up_CBR-CBR*2 module via a CBR module. The fifth CBR*2_MaxPool module is connected to the first Up_CBR-CBR*2 module, the fourth CBR*2_MaxPool module is connected to the second Up_CBR-CBR*2 module, and the third CBR*2_MaxPool module is connected to the third Up_CBR-CBR*2 module. There are skip connections between the R*2 module, the second CBR*2_MaxPool module and the fourth Up_CBR-CBR*2 module, and between the first CBR*2_MaxPool module and the fifth Up_CBR-CBR*2 module. Specifically, the feature map output from the CBR*2_MaxPool module is concatenated with the feature map output from the corresponding Up_CBR module of the Up_CBR-CBR*2 module, and then input into the CBR*2 module of the Up_CBR-CBR*2 module. The feature map output from the fifth Up_CBR-CBR*2 module is passed through a convolutional layer to obtain a segmentation mask image. Local average pooling is then applied to the segmentation mask image to obtain the output of the anomaly detection model. The CAM module is used to capture long and short distance information; the CBR*2_MaxPool module includes two CBR modules and a max pooling layer, with the two CBR modules connected in sequence and the max pooling layer located after the second CBR module; the Up_CBR-CBR*2 module includes one Up_CBR module and two CBR modules connected in sequence, with the Up_CBR module located before the first CBR module; the CBR module includes a convolutional layer, a normalization layer, and an activation layer connected in sequence; the Up_CBR module includes an upsampling layer, a convolutional layer, a normalization layer, and an activation layer connected in sequence.

4. The semi-supervised photovoltaic cell surface anomaly detection method based on image inpainting according to claim 3, characterized in that, The CAM module comprises two branches. In one branch, the input image of the CAM module passes through a CBR module, then through two strip pooling layers with different kernel sizes. The feature maps output by the two strip pooling layers are concatenated, then sequentially passed through a CBR module and undergo channel separation to divide them into two feature maps. The two feature maps are then passed through a CB module and added together. The resulting feature map is then passed through an activation layer and a CBR module to obtain the feature map output by this branch. In the other branch, the input image of the CAM model passes through a CBR module, then through two average pooling layers with different kernel sizes. The feature map output by the average pooling layer with the larger kernel is passed through a CBR module and upsampled, then added to the feature map output by the average pooling layer with the smaller kernel. The resulting feature map is then passed through a CBR module and upsampled, then added to the feature map output by the first CBR module of this branch. The resulting feature map is then passed through a CBR module to obtain the feature map output by this branch. The feature maps output from the two branches are added together and then passed through a CB module. After being added to the input image of the CAM module, the image is passed through an activation layer to obtain the feature map output by the CAM module. The CB module includes a convolutional layer and a normalization layer.

5. The semi-supervised photovoltaic cell surface anomaly detection method based on image inpainting according to claim 4, characterized in that, The kernels of the two strip pooling layers are 1×N and N×1, respectively, where N is a positive integer; the kernels of the two average pooling layers are 2×2 and 4×4, respectively.

Citation Information

Patent Citations

  • Texture image surface defect detection method based on depth convolution auto-encoder

    CN111815601A

  • Bolt anomaly detection method in complex scene based on depth feature reconstruction

    CN114897765A