Diffusion-based photovoltaic cell defect detection semantic data enhancement method
Through the semantic data enhancement technology based on the diffusion model, high-quality photovoltaic cell images are generated, which solves the problem of insufficient data in photovoltaic cell defect detection, improves the generalization ability and detection accuracy of the model, and is suitable for various deep learning networks.
Patent Information
- Application Number
- CN202410885453.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-29
AI Technical Summary
Among existing photovoltaic cell defect detection methods, the amount of training data for deep learning models is limited, resulting in limited detection accuracy, and there is a lack of semantic data enhancement technology to improve model generalization capabilities.
A semantic data enhancement method based on the diffusion model is used to generate high-quality image data by training the conditional diffusion model and photovoltaic cell image synthesis, which is integrated into the deep classification model to improve the accuracy of defect detection.
It effectively increases the diversity of sample data, improves the generalization ability of the model, provides an architecture-free and flexible technology, is suitable for various deep learning networks, and improves the accuracy of photovoltaic cell defect detection.
Smart Images

Figure CN118864385A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer vision, and in particular relates to an image generation technology based on a diffusion model. Background Art
[0002] Research on photovoltaic cell defect detection generally involves three camera-based measurement methods: infrared (IR), photoluminescence (PL), and electroluminescence (EL) imaging. Among these methods, electroluminescence (EL) imaging is more conducive to detecting small defects by calculating the difference in luminescence intensity. In recent years, many deep learning methods have been widely and deeply studied in this field for defect detection, and they are formulated as image classification tasks. Due to their powerful feature extraction capabilities, deep learning-based defect detection methods have gradually surpassed traditional machine learning methods in terms of detection accuracy. Most existing methods focus on architecture customization to enhance the discriminative ability of defect detection models. These methods mainly attempt to redesign feature extractors by integrating new modules into backbone networks such as VGGNet and ResNet. In addition to the influence of network architecture, the performance of deep learning models is also significantly affected by training data. However, acquiring solar cell images in real scenarios, especially defective single and multi-crystalline images, faces limitations such as sampling difficulties, resulting in limited or even scarce model training data. Therefore, semantic data enhancement is crucial for PV cell defect detection, but it is still not studied in previous methods, so this area is relatively unexplored so far. Summary of the invention
[0003] Based on the above-mentioned deficiencies of the prior art, the present invention proposes an effective and highly versatile image generation technology based on a diffusion model. The architecture-free feature of the present invention allows it to be integrated into various types of deep classification models, and it has flexibility and adaptability in various types of deep learning networks (such as convolution-based and attention-based networks), thereby improving the accuracy of various defect detection models. The technical solution of the present invention is:
[0004] A diffusion-based semantic data enhancement method for photovoltaic cell defect detection includes the steps of (1) training a conditional diffusion model of photovoltaic cell images and (2) synthesizing photovoltaic cell images.
[0005] Further, the specific process of step (1) is:
[0006] Step (1.1), input image: the original real image is used as image input;
[0007] Step (1.2), the forward process, also known as the diffusion process: add Gaussian noise that follows the positive distribution to the original image. Specifically, based on the variance scheduling β1,...,β TGradually inject Gaussian noise into the known data distribution q(x0) (x0 represents a clear image), this process can be fixed as a Markov chain:
[0008]
[0009] Where T represents the predetermined total number of steps, t is the time step, and x t Represents the image at time t. Similarly, x t-1 represents the image at time t-1, represents the continuous multiplication from time t = 1 to time t = T, q(x t |x t-1 ) represents the existing x t-1 Under the condition x t The probability of q(x 1:T |x0) represents the final x obtained by continuous multiplication under the condition that x0 is known. T The probability of going from the initial state x0 to the final state x T The joint probability distribution of q(x t |x t-1 ) represents a given x t-1 After x t The conditional probability of , N represents the normal distribution, represents the mean, indicating the relationship between the current state and the previous state, β t I is the variance, which represents the noise intensity at time step t, and I is the identity matrix;
[0010] Step (1.3), get the noisy image x T :By combining the above two formulas, we can get the generated arbitrary image x t The derivation formula is as follows:
[0011]
[0012] in
[0013] Step (1.4), embedding conditional information: time step t and category label y∈{0,1,2,3} are embedded into the U-Net model as conditional information. Technically, time step t is processed by position encoding, while category label y is input into a learnable embedding layer. In this way, they have the same vector dimension for element-by-element summation:
[0014] τ=Embedding(y)+Pos_Encoding(t) (4)
[0015] The Embedding(y) function refers to inputting the category label y into the learnable embedding layer, the Pos_Encoding(t) function puts the time step t into the position encoding for processing, and τ represents the mixed conditional information that can be incorporated into the U-Net network;
[0016] Step (1.5), reverse process: a U-Net network is trained, i.e., a parameterized noise estimator, denoted as ε θ , gradually transform the noise image x T Denoising is a clear image x0. This process can be achieved by repeatedly applying the following equation from t=T to t=1, where t is embedded according to step (1.4) to obtain τ.
[0017]
[0018] where x t represents the image generated at time step t, ε θ is the trained U-Net network model and parameterized noise estimator, which depends on the current state x t and time step τ, is the scaling factor, where
[0019] Step (1.6), calculate the loss function: The training goal of the conditional diffusion model is to calculate the mean square error loss between the minimum predicted conditional noise and the true noise, which can be expressed by the following formula:
[0020] L DM =||ε θ (x t ,τ)-ε|| 2 (6)
[0021] Where ε is the true noise, and the smaller the error between the predicted noise and the true noise, the better. In addition, in order to produce higher quality images, a classifier-free bootstrap method is used, which utilizes both conditional and unconditional settings (y = φ) for model training.
[0022] Further, the specific process of step (2) is:
[0023] Step (2.1), add noise to the real image: After training the conditional diffusion model of different photovoltaic cells, pure noise with random Gaussian distribution is usually used as the initial input image x T , in this work, in order to generate more natural photovoltaic cell images, the initial input x TInstead, it is obtained by applying a forward diffusion process to a real reference image, that is, gradually filling the real photovoltaic cell image with normal distribution noise N(0,I). At the same time, the category label of the real image is used as conditional information to control the sampling process. Compared with pure noise input, this method allows the synthetic image to retain the structural information of the original real image;
[0024] Step (2.2), sampling process: The diffusion model predicts the conditional noise ε at each time step t through the trained U-Net θ (x t ,τ) and unconditional noise ε θ (x t ,t), then the conditional and unconditional prediction noises are linearly interpolated to form the combined noise ε θ (x t ,τ), as shown below:
[0025]
[0026] The hyperparameter ω is set to a constant 3 according to experience, indicating the guidance strength of the conditional label y. Next, by T By reducing the noise, we can get the denoised image x t-1 , as shown below:
[0027]
[0028] Furthermore, the T is set to 1000, and t is gradually increased from 1 to T
[0029] The beneficial effects of the present invention are:
[0030] (1) This invention is the first to explore a data enhancement method based on a diffusion model to solve the photovoltaic cell defect detection task. This simple, effective and highly versatile method can provide a novel idea for the future development of photovoltaic solar cell defect detection technology.
[0031] (2) The present invention proposes a diffusion-based semantic data enhancement technology for photovoltaic cell defect detection. Semantic labels are explicitly modeled as conditional information to guide the semantically-aware battery image synthesis process. Since the initial input is generated by gradually adding Gaussian noise to the real image, the resulting image retains richer and more detailed structural information than the classical diffusion image generation, so that high-quality images that are closer to the real data can be generated. The invented method can effectively increase the diversity of sample data, thereby improving the generalization ability of the model.
[0032] (3) The present invention provides a generally improved technology for photovoltaic cell defect detection. Its architecture-free characteristics allow it to be integrated into various types of deep classification models, and it has flexibility and adaptability in various types of deep learning networks (such as convolution-based and attention-based networks), improving the accuracy of various defect detection models. Unlike previous deep learning methods for photovoltaic cell defect detection that focus on architecture customization, the present invention provides a novel architecture-free technology for photovoltaic cell defect detection by expanding training data.
[0033] (4) The method proposed in the present invention may have wider applicability and potential application value in other fields, such as specific fields with limited data set sample size and high data acquisition cost, such as medical image analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 Flowchart of the semantic data enhancement method for diffusion-based photovoltaic cell defect detection.
[0035] Figure 2 Examples of four types of synthetic and real solar cell images. DETAILED DESCRIPTION
[0036] In view of the technical problems existing in the above background technology, the present invention proposes a semantic data enhancement method for photovoltaic cell defect detection based on diffusion DDIM (Denoising Diffusion Implicit Models). In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0037] In order to generate high-quality photovoltaic solar cell images to expand the deep learning network training data set, the present invention realizes more efficient and more accurate classification tasks. The conditional diffusion model is used to implement the training of images with different category labels on U-Net, and then the original real image is used as the input of the trained U-Net after the diffusion and denoising process, and finally the diffusion model sampling process is performed, so that the controllable generation of high-quality images can be achieved by specifying labels. The present invention mainly includes two steps: training the conditional diffusion model, using the denoised real image as input and generating the image through the denoising process. In the first step, the conditional diffusion model is trained using the real labeled image. Specifically, the diffusion process is the process of converting the real image into the noisy image by gradually adding Gaussian noise. Under the condition of the corresponding embedded label, the U-Net network is trained to gradually denoise the noisy image. In the second step, the trained U-Net model is used to generate high-quality photovoltaic cell images with different semantic labels. The synthetic image generated through the above steps and the real image together constitute an enhanced training data set for training deep classification models with different network architectures.
[0038] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0039] Step (1) Training the conditional diffusion model of photovoltaic cell images
[0040] Step (1.1), input image: the original real image is used as image input;
[0041] Step (1.2), the forward process, also known as the diffusion process: add Gaussian noise that follows the positive distribution to the original image. Specifically, based on the variance scheduling β1,...,β T Gradually inject Gaussian noise into the known data distribution q(x0) (x0 represents a clear image), this process can be fixed as a Markov chain:
[0042]
[0043] Here, T represents the predetermined total number of steps, usually set to 1000. t is the time step, which increases gradually from 1 to T. t Represents the image at time t. Similarly, x t-1 Represents the image at time t-1. represents the continuous multiplication from time t = 1 to time t = T, q(x t |x t-1 ) represents the existing x t-1 Under the condition x t The probability of q(x 1:T |x0) represents the final x obtained by continuous multiplication under the condition that x0 is known. T The probability of going from the initial state x0 to the final state x T The joint probability distribution of q(x t |x t-1 ) represents a given x t-1 After x t The conditional probability of N represents the normal distribution, x t represents the state at time step t, represents the mean, indicating the relationship between the current state and the previous state, β t I is the variance, which represents the noise intensity at time step t, and I is the identity matrix.
[0044] Step (1.3), get the noisy image x T :By combining the above two formulas, we can get the generated arbitrary image x t The derivation formula is as follows:
[0045]
[0046] in
[0047] Step (1.4), embedding conditional information: time step t and category label y∈{0,1,2,3} (i.e. four categories) are embedded into the U-Net model as conditional information. Technically, time step t is processed by Position Encoding, while category label y is input into a learnable Embedding layer. In this way, they can have the same vector dimension for element-by-element summation:
[0048] τ=Embedding(y)+Pos_Encoding(t) (4)
[0049] The Embedding(y) function refers to inputting the category label y into the learnable embedding layer, the Pos_Encoding(t) function can put the time step t into the position encoding for processing, and τ represents the mixed conditional information that can be merged into the U-Net network.
[0050] Step (1.5), reverse process: a U-Net network (i.e., a parameterized noise estimator, denoted as ε) is trained. θ ), gradually transform the noise image x T Denoising is a clear image x0. This process can be achieved by repeatedly applying the following equation from t = T to t = 1, where t is embedded according to step (1.4) to obtain τ.
[0051]
[0052] where x t represents the image generated at time step t, ε θ is the trained U-Net network model and parameterized noise estimator, which depends on the current state x t and time step τ, is the scaling factor, where
[0053] Step (1.6), calculate the loss function: The training goal of the conditional diffusion model is to calculate the mean square error loss between the minimum predicted conditional noise and the true noise, which can be expressed by the following formula:
[0054] L DM =||ε θ (x t ,τ)-ε|| 2 (6)
[0055] Where ε is the real noise, and the smaller the error between the predicted noise and the real noise, the better. In addition, in order to produce higher quality images, this work adopts a classifier-free bootstrap method, which utilizes both conditional and unconditional settings (y = φ) for model training.
[0056] Step (2) Photovoltaic cell image synthesis
[0057] Step (2.1), add noise to the real image: After training the conditional diffusion model of different photovoltaic cells, pure noise with random Gaussian distribution is usually used as the initial input image x T In this work, in order to generate more natural photovoltaic cell images, the initial input x T Instead, it is obtained by applying a forward diffusion process to a real reference image, that is, gradually filling the real photovoltaic cell image with normally distributed noise N(0,I). At the same time, the category label of the real image is used as conditional information to control the sampling process. Compared with pure noise input, this method allows the synthetic image to retain the structural information of the original real image.
[0058] Step (2.2), sampling process: The diffusion model predicts the conditional noise ε at each time step t through the trained U-Net θ (x t ,τ) and unconditional noise ε θ (x t ,t). Then, the conditional and unconditional prediction noises are linearly interpolated to form the combined noise εθ(x t ,τ), as shown below:
[0059] εθ(x t ,τ)=ε θ (x t ,t)+ω·[ε θ (x t ,τ)-ε θ (x t ,t)] (7)
[0060] The hyperparameter ω is set to a constant 3 according to experience, indicating the guidance strength of the conditional label y. Next, by T By reducing the noise, we can get the denoised image x t-1 , as shown below:
[0061]
[0062] The final denoised image x0, i.e. the synthesized image, can be obtained by repeated denoising process from t = T to t = 1. When different category labels are used as conditions, different categories of images can be synthesized, including normal single crystal, normal polycrystalline, defective single crystal and defective polycrystalline. Figure 2 Some results on synthetic images are shown.
[0063] The above embodiments are only used to illustrate the design concept and features of the present invention, and their purpose is to enable those skilled in the art to understand the contents of the present invention and implement them accordingly.
Claims
1. A diffusion-based semantic data enhancement method for photovoltaic cell defect detection, It is characterized in that The method comprises the steps of (1) training a conditional diffusion model of a photovoltaic cell image and (2) synthesizing the photovoltaic cell image.
2. According to claim 1, a diffusion-based semantic data enhancement method for photovoltaic cell defect detection, It is characterized in that The specific process of step (1) is as follows: Step (1.1), input image: the original real image is used as image input; Step (1.2), the forward process, also known as the diffusion process: add Gaussian noise that follows the forward distribution to the original image. Specifically, based on the variance scheduling β 1 ,...,β T Gradually inject Gaussian noise into the known data distribution q(x 0 )(x 0 represents a clear image), this process can be fixed as a Markov chain: Where T represents the predetermined total number of steps, t is the time step, and x t Represents the image at time t. Similarly, x t-1 represents the image at time t-1, represents the continuous multiplication from time t = 1 to time t = T, q(x t |x t-1 ) represents the existing x t-1 Under the condition x t The probability of q(x 1:T |x 0 ) represents the value obtained by continuous multiplication when x is known. 0 Finally, we get x T The probability of starting from the initial state x 0 To the final state x T The joint probability distribution of q(x t |x t-1 ) represents a given x t-1 After x t The conditional probability of , N represents the normal distribution, represents the mean, indicating the relationship between the current state and the previous state, β t I is the variance, which represents the noise intensity at time step t, and I is the identity matrix; Step (1.3), get the noisy image x T :By combining the above two formulas, we can get the generated arbitrary image x t The derivation formula is as follows: among them t =1-β t , Step (1.4), embedding conditional information: time step t and category label y∈{0,1,2,3} are embedded into the U-Net model as conditional information. Technically, time step t is processed by position encoding, while category label y is input into a learnable embedding layer. In this way, they have the same vector dimension for element-by-element summation: τ=Embedding(y)+Pos_Encoding(t) (4) The Embedding(y) function refers to inputting the category label y into the learnable embedding layer, the Pos_Encoding(t) function puts the time step t into the position encoding for processing, and τ represents the mixed conditional information that can be incorporated into the U-Net network; Step (1.5), reverse process: a U-Net network is trained, i.e., a parameterized noise estimator, denoted as ε θ , gradually transform the noise image x T Denoising to a clear image x 0 , this process can be achieved by repeatedly applying the following equation from t = T to t = 1, where t, information embedding is performed according to step (1.4) to obtain τ. where x t represents the image generated at time step t, ε θ is the trained U-Net network model and parameterized noise estimator, which depends on the current state x t and time step τ, is the scaling factor, where α t =1-β t , Step (1.6), calculate the loss function: The training goal of the conditional diffusion model is to calculate the mean square error loss between the minimum predicted conditional noise and the true noise, which can be expressed by the following formula: L DM =||e θ (x t ,t)-e|| 2 (6) Where ε is the real noise, and the smaller the error between the predicted noise and the real noise, the better. In addition, in order to produce higher quality images, a classifier-free bootstrap method is used, which uses both conditional and unconditional settings as y = φ empty set for model training.
3. The method for semantic data enhancement of photovoltaic cell defect detection based on diffusion according to claim 1, It is characterized in that The specific process of step (2) is as follows: Step (2.1), add noise to the real image: After training the conditional diffusion model of different photovoltaic cells, pure noise with random Gaussian distribution is usually used as the initial input image x T , in this work, in order to generate more natural photovoltaic cell images, the initial input x T Instead, it is obtained by applying a forward diffusion process to a real reference image, that is, gradually filling the real photovoltaic cell image with normal distribution noise N(0,I). At the same time, the category label of the real image is used as conditional information to control the sampling process. Compared with pure noise input, this method allows the synthetic image to retain the structural information of the original real image; Step (2.2), sampling process: The diffusion model predicts the conditional noise ε at each time step t through the trained U-Net θ (x t ,τ) and unconditional noise ε θ (x t ,t), then the conditional and unconditional prediction noises are linearly interpolated to form the combined noise εθ(x t ,τ), as shown below: e θ (x t ,t)=e θ (x t ,t)+ω·[ε θ (x t ,t)-e θ (x t ,t)] (7) The hyperparameter ω is set to a constant 3 according to experience, indicating the guidance strength of the conditional label y. Next, by T By reducing the noise, we can get the denoised image x t-1 , as shown below:
4. The method for semantic data enhancement of photovoltaic cell defect detection based on diffusion according to claim 1, It is characterized in that The T is set to 1000, and t increases gradually from 1 to T.
Citation Information
Cited By
Sonar image generation method and device based on diffusion model, equipment and medium
CN119784611A
Photovoltaic image data augmentation method and system based on defect attribute guidance
CN121861012A
