A method and system for detecting surface defects of a solid oxide fuel cell
Patent Information
- Application Number
- CN202311367742.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-19
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-10-19
AI Technical Summary
[0004]由于在实际固体氧化物燃料电池片生产中很难事先收集到足够的缺陷样本,因此,采用基于有监督学习方法对电池片表面缺陷检测,训练样本中缺陷样本较少,正负样本不平衡,可能导致生成的模型不稳定或无效,检准确性不高,且容易导致过拟合,泛化能力低;并且,人工标注缺陷样本的成本高昂,特别是针对多种不同类型的缺陷,需要大量人力资源
[0028](1)本发明的固体氧化物燃料电池表面缺陷检测方法,通过构建缺陷恢复模型,鉴别器D和生成器G构成对抗网络,编码器E和生成器G构成对抗网络,采用生产线上检验合格的SOFC电池片图像作为正样本图像,由于鉴别器D和生成器G构成的对抗网络只接触到正样本图像,该对抗网络只能学习到电池片表面的正常特征;然后用训练好的生成器G对编码器E进行对抗训练,编码器E的输出维度为一维,训练好的生成器G基于编码器E输出的缺陷概率分布对缺陷进行恢复,得到高质量的不含缺陷的图像,用编码器生成的缺陷概率分布作为弱标签信息对生成器G进行指导,可以显著提高生成器生成修复缺陷图像的准确性;因此,在应用阶段,由于输入的图像为具有缺陷的SOFC电池片图像,编码器E输出对应的缺陷概率分布,生成器G基于这一缺陷概率分布对缺陷进行恢复,得到高质量的缺陷恢复后的图像,将缺陷恢复后的图像与原输入的具有缺陷的SOFC电池片图像进行对比,得到的残差图能够准确反映缺陷的位置信息,本发明的方法弥补了无监督网络缺少电池片表面缺陷信息的缺陷,能够提升缺陷检测的准确性。
Smart Images

Figure CN117611519B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of fuel cells, and more specifically, relates to a method and system for detecting surface defects in solid oxide fuel cells. Background Technology
[0002] Solid oxide fuel cells (SOFCs) are widely used in the energy sector due to their high efficiency, environmental friendliness, and reliability, becoming a key technology for energy transition and sustainable development. However, surface defects are inevitably generated during the manufacturing process of SOFC cells, which may affect cell performance and lifespan.
[0003] Currently, traditional methods for detecting surface defects in solar cells mainly rely on manual visual observation, which is highly subjective and time-consuming. Although machine vision systems can replace human eyes for inspection, many problems and challenges remain in practical applications, especially when it is necessary to manually design experience-based traditional image features to distinguish between defects and non-defects. In recent years, deep learning technology has made significant progress in image feature extraction.
[0004] Because it is difficult to collect enough defect samples in the actual production of solid oxide fuel cell sheets, supervised learning-based methods for surface defect detection suffer from limited training samples, an imbalance between positive and negative samples, and potentially unstable or invalid models with low accuracy, overfitting, and poor generalization. Furthermore, manually labeling defect samples is costly, especially for various defect types, requiring significant human resources. While unsupervised methods effectively compensate for the shortcomings of supervised methods, they rely solely on positive sample data for training, lacking guidance from surface defect information during training. Therefore, they cannot guarantee good detection results for every type of defect sample. Summary of the Invention
[0005] In view of the shortcomings of existing technologies and the need for improvement, this invention provides a method and system for detecting surface defects in solid oxide fuel cells, with the aim of improving detection accuracy.
[0006] To achieve the above objectives, according to a first aspect of the present invention, a method for detecting surface defects in a solid oxide fuel cell is provided, comprising:
[0007] Training phase:
[0008] A defect recovery model is trained using a training set, wherein the training samples in the training set are images of solid oxide fuel cells that have passed inspection on the production line; the defect recovery model includes: a discriminator D, a generator G, and an encoder E; wherein the discriminator D and the generator G constitute an adversarial network, the encoder E and the generator G constitute an adversarial network, and the output dimension of the encoder E is one-dimensional.
[0009] The adversarial network consisting of discriminator D and generator G is trained using training samples.
[0010] The training samples are input into encoder E for defect feature extraction, and encoder E outputs a probability distribution map of the defect features; the probability distribution map of the defect features is input into the trained generator G for defect recovery to obtain the defect-recovered image; when the feature loss between the defect-recovered image output by generator G and the input training samples converges, the training of encoder E is completed.
[0011] Application phase: The defective solid oxide fuel cell image is input into the trained encoder E, and the generator G outputs the image after defect recovery; the image after defect recovery is subtracted from the input defective solid oxide fuel cell image to obtain a residual map; the residual map is used to locate defects on the cell surface.
[0012] Furthermore, the application phase also includes:
[0013] The residual image is fused with the probability distribution map of the defect features to obtain a fused image, which is then used to locate surface defects on the battery cell. The probability distribution map of the defect features is the output of the image of the defective solid oxide fuel cell input to the trained encoder E.
[0014] Furthermore, it also includes: performing binary segmentation on the fused image.
[0015] Furthermore, during the training phase, the probability distribution map of the defect features output by the encoder E is also used as the input to constrain the discriminator D.
[0016] Furthermore, during the training phase, when training samples are used to train the adversarial network consisting of the discriminator D and the generator G, training is completed when the feature loss between the image output by the generator G and the input training samples converges.
[0017] Furthermore, the generator G includes an input layer, a fully connected layer, and an output layer connected in sequence;
[0018] The input layer is used to input a noise vector;
[0019] The fully connected layer is used to extract features and transform the dimensions of the input noise vector;
[0020] The output layer is used to output noisy images.
[0021] Furthermore, the output layer has a dimension of one or three dimensions.
[0022] Furthermore, before the training samples are input into the defect recovery model, the method further includes: performing block segmentation, Gaussian filtering for noise reduction, and normalization on the training samples.
[0023] According to a second aspect of the present invention, a surface defect detection system for a solid oxide fuel cell is provided, comprising a computer-readable storage medium and a processor;
[0024] The computer-readable storage medium is used to store executable instructions;
[0025] The processor is configured to read executable instructions stored in the computer-readable storage medium and execute the method described in any of the first aspects.
[0026] According to a third aspect of the invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the first aspects.
[0027] In summary, the above-described technical solutions conceived in this invention can achieve the following beneficial effects:
[0028] (1) The solid oxide fuel cell surface defect detection method of the present invention constructs a defect recovery model. The discriminator D and generator G form an adversarial network, and the encoder E and generator G also form an adversarial network. Images of SOFC cells that have passed inspection on the production line are used as positive sample images. Since the adversarial network composed of discriminator D and generator G only encounters positive sample images, it can only learn the normal features of the cell surface. Then, the trained generator G is used to perform adversarial training on the encoder E. The output dimension of encoder E is one-dimensional. The trained generator G recovers the defects based on the defect probability distribution output by encoder E, obtaining a high-quality, defect-free image. The image is then encoded... The defect probability distribution generated by the encoder serves as weak label information to guide the generator G, which can significantly improve the accuracy of the generator in generating repaired defect images. Therefore, in the application stage, since the input image is an image of a defective SOFC cell, the encoder E outputs the corresponding defect probability distribution. The generator G restores the defect based on this defect probability distribution, obtaining a high-quality image after defect restoration. The image after defect restoration is compared with the original input image of the defective SOFC cell, and the resulting residual map can accurately reflect the location information of the defect. The method of this invention makes up for the lack of surface defect information of unsupervised networks and can improve the accuracy of defect detection.
[0029] (2) The method of the present invention only requires normal battery cell images as training data, avoiding a large number of defective samples and the tedious process of manual annotation, reducing costs and the subjectivity of manual detection, and improving detection efficiency.
[0030] (3) The method of this invention performs phased training during the training process. First, the adversarial network consisting of the generator G and the discriminator D is trained first, allowing it to focus on generating and discriminating samples without being disturbed by the encoder E. With the generator G fixed, the encoder E can focus on learning how to generate appropriate label information to improve the overall model performance. Second, by training the generator G and the discriminator D first, and then training the encoder E, convergence can be achieved more easily, reducing training complexity and instability. In addition, the learning rate of each stage can be better controlled, thereby improving the stability of the entire training process. Third, before the encoder E is trained, the generator G and the discriminator D have already had some reasonable parameter initialization, which helps the encoder E to learn to generate appropriate label information more easily.
[0031] (4) Further, in the application stage, the residual map and the probability distribution map of the defect features output by the encoder E are fused to obtain the fused image. The fused image shows a uniform gray level in the defect-free area, while showing obvious gray level differences in the defective area. The probability distribution map of the defect features is used to guide the defect position in the residual map, combining the information at the pixel level with the information at the feature level to further improve the accuracy of defect localization.
[0032] (5) Further, the fused image is subjected to binary segmentation to achieve pixel-level defect localization, thereby further improving the accuracy of defect localization.
[0033] (6) Furthermore, during the training phase, the probability distribution map of the defect features output by encoder E is also used as the input to constrain discriminator D, enabling discriminator D to consider the distribution information of the defect features generated by both the sample image and encoder E. This helps to improve discriminator D's consistency judgment between the real image and the generated image, thereby more accurately evaluating whether the generated image contains defects. Moreover, by introducing the probability distribution of defect features into discriminator D, generator G can generate defect-free images more specifically, which helps to improve the quality of the generated image. This is because generator G can better understand which parts may contain defects and repair them in a targeted manner, further improving the realism and accuracy of the generated image. At the same time, since discriminator D evaluates the generated image based on the probability distribution of the entire defect feature, even if the position and intensity of the defect feature in the image change, the model can still perform accurate detection and repair, which can increase the robustness of the model. Attached Figure Description
[0034] Figure 1 This is a structural diagram of the defect recovery model of the present invention.
[0035] Figure 2 This is a schematic diagram of the solid oxide fuel cell surface defect detection method of the present invention. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0037] like Figure 1 and Figure 2 As shown, the solid oxide fuel cell surface defect detection method of the present invention includes a training phase and an application phase.
[0038] Training phase:
[0039] The defect recovery model is trained using a training set, which consists of images of SOFC cells that have passed inspection on the production line. The defect recovery model includes a discriminator D, a generator G, and an encoder E. The discriminator D and the generator G form an adversarial network, and the encoder E and the generator G form an adversarial network. The output layer of the encoder E has a one-dimensional dimension.
[0040] The adversarial network consisting of discriminator D and generator G is trained using training samples. Training is completed when the feature loss between the image output by generator G and the input training samples converges.
[0041] The encoder E is adversarially trained using a pre-trained generator G: training samples are input into encoder E to extract defect features, and encoder E outputs a probability distribution map of defect features; the probability distribution map of defect features is input into the pre-trained generator G to recover defects, and the recovered image is obtained; when the feature loss between the recovered image output by generator G and the input training samples converges, the training of encoder E is completed.
[0042] Application phase: The image of the defective solid oxide fuel cell cell is input into the trained encoder E to obtain the probability distribution map of the defect features; the probability distribution map of the defect features is input into the trained generator G to obtain the image after defect recovery; the image after defect recovery is subtracted from the input image of the defective solid oxide fuel cell cell to obtain the residual map; the residual map is used to locate the surface defects of the cell.
[0043] Specifically, during the training phase, the training set consists of a series of qualified SOFC cell images collected from the production line that have undergone rigorous quality inspection. This facilitates the discriminator D and generator G in learning the normal characteristics of the cells during adversarial training. In this embodiment, both the training and test set cell surface images are 256×256 pixels in size. Before inputting the defect recovery model, the method further includes segmenting the training sample images and the images of defective solid oxide fuel cell cells into blocks. In this embodiment, the image block size is 32×32 pixels, and each image block undergoes Gaussian filtering for noise reduction and normalization.
[0044] The defect recovery model of this invention is a novel deep convolutional adversarial network model, comprising: a discriminator D, a generator G, and an encoder E. Specifically, the discriminator D, the generator G, and the encoder E are all deep convolutional networks.
[0045] The generator G comprises an input layer, a fully connected layer, and an output layer connected in sequence. The input layer takes a noise vector as input. The fully connected layer is used for feature extraction and dimensionality transformation of the input noise vector. The output layer outputs a noisy image, i.e., a pseudo-image that approximates the real sample. Batch normalization (BN) is performed on all layers except the output layer of generator G, and rectified linear units (ReLU) are used for activation. In this embodiment, the input layer is a 64-dimensional Gaussian noise vector z, the fully connected layer is 1024-dimensional, and further reshaped to a 2×2×256 dimension; the output layer is set to a dimension of 32×32×1. In this embodiment, the depth of the output layer is 1, outputting a grayscale image; in other embodiments, the depth of the output layer can also be 3 to output an RGB color image.
[0046] Encoder E and discriminator D are constructed by inversely reversing generator G, forming adversarial networks with generator G. The output layer of encoder E is one-dimensional and is used to extract the probability distribution map of defect features from the input image; each pixel value in the probability distribution map represents the probability that a defect may exist at that location.
[0047] Specifically, during adversarial training of the adversarial network consisting of the discriminator D and the generator G, Gaussian noise z is input into the generator G to generate a noise feature map x. ′ Noise feature map x ′ The image generated by the discriminator G is input along with the training sample x into the discriminator D for adversarial training. Training of both the discriminator D and the generator G is complete when the image generated by the discriminator D closely approximates the input training sample x. In this embodiment of the invention, the adversarial training of the adversarial network composed of the discriminator D and the generator G is divided into two stages. In the first stage, a small learning rate is selected for the discriminator D for initial training. In the second stage, the generator G is trained. However, in both stages, the network parameters of both the discriminator D and the generator G are adjusted inversely using loss mechanisms.
[0048] During the training of encoder E, the network parameters of generator G are fixed, and the network parameters of encoder E are adjusted only by the corresponding loss.
[0049] Preferably, during the training phase, the probability distribution map E(x) of the defect features output by encoder E is also used as input to constrain the discriminator D. This allows discriminator D to simultaneously consider the distribution information of the defect features generated by the sample image x and encoder E, which helps improve discriminator D's consistency judgment between the real image and the generated image, thereby more accurately assessing whether the generated image contains defects. Furthermore, by incorporating the probability distribution of defect features into discriminator D, generator G can more effectively generate defect-free images, improving the quality of the generated images. This is because generator G can better understand the defect distribution through the defect feature distribution information output by encoder E and repair it accordingly, further enhancing the realism and accuracy of the images generated by generator G. Simultaneously, since discriminator D evaluates the generated image based on the probability distribution of the entire defect feature set, even if the position and intensity of the defect features in the image change, the model can still accurately detect and repair them, increasing the model's robustness.
[0050] In summary, using E(x) as input to the discriminator D helps improve the quality, robustness, and consistency of the generated images, enabling the model to cope more effectively with different types of defects and variations. This contributes to more accurate defect detection and repair.
[0051] In this embodiment of the invention, the objective function min is used to train the adversarial network composed of discriminator D and generator G. G min D L GAN (G,D) is:
[0052]
[0053] Where, x ′ =G(z) is the noise feature map generated by the generator G, and x is the input training sample (i.e., Figure 1 (The real image patch in the image), z represents Gaussian noise, y represents the additional constraints of the discriminator D, and in this embodiment of the invention, it is the probability distribution map E(x) of the defect features output by the encoder E; p data (x) represents the data distribution of the generator, p z (x ′ ) represents the noise distribution.
[0054] When using generator G to perform adversarial training on encoder E, the objective function is:
[0055]
[0056] Where n represents the number of image blocks input in the same batch, x i For the image patch corresponding to training sample x, E(x) iG(E(x)) is the probability distribution diagram of the defect features output by encoder E; i )) represents the image after defect recovery output by generator G.
[0057] During the training phase, the adversarial network consisting of discriminator D and generator G only encounters positive sample image patches and Gaussian noise data, so it cannot learn the features of surface defects on the battery cell. However, during the testing phase, the input image is a defective solid oxide fuel cell cell image. At this time, encoder E outputs the corresponding defect probability distribution. Generator G recovers the defects based on this defect probability distribution to obtain a high-quality defect-free image (i.e., the recovered image). The high-quality defect-free image is compared with the input defective solid oxide fuel cell cell image, and the resulting residual map can accurately reflect the location information of the defects.
[0058] Preferably, during the application phase, the residual image is fused with the probability distribution map of defect features output by encoder E to obtain a fused image. The fused image exhibits a uniform grayscale level in defect-free areas, while showing significant grayscale differences in defective areas. The probability distribution map of defect features is then used to guide the defect location in the residual image, combining pixel-level and feature-level information to further improve the accuracy of defect localization.
[0059] As a further optimization, the fused image is subjected to binary segmentation to achieve pixel-level defect localization, thus providing important support for subsequent detection and maintenance work.
[0060] The solid oxide fuel cell surface defect detection method of this invention constructs a defect recovery model. A discriminator D and a generator G form an adversarial network, as do the encoder E and the generator G. Images of SOFC cells that have passed inspection on the production line are used as positive sample images. This allows the discriminator D and generator G to learn the normal features of the cells during adversarial training. Since the adversarial network formed by the discriminator D and generator G only encounters positive sample image blocks and Gaussian noise data, it cannot learn the features of surface defects. Then, the trained generator G is used to adversarially train the encoder E. The encoder E has a one-dimensional output dimension. The trained generator G recovers the defects based on the defect probability distribution output by the encoder E, obtaining high-quality defect recovery models. For images containing defects (i.e., the restored images), the defect probability distribution generated by the encoder is used as weak label information to guide the generator G, which can significantly improve the accuracy of the generator in generating repaired defect images. In the application stage, since the input image is an image of a defective solid oxide fuel cell sheet, the encoder E will output the corresponding defect probability distribution. The generator G restores the defects based on this defect probability distribution to obtain a high-quality restored image. The restored image is compared with the original input image of the defective solid oxide fuel cell sheet, and the resulting residual map can accurately reflect the location information of the defects. The method of this invention makes up for the lack of surface defect information of unsupervised networks and can improve the accuracy of defect detection.
[0061] The method of the present invention generates repaired defect images with high accuracy, and the model can better handle samples containing defects during the testing phase, thereby improving the accuracy of defect localization.
[0062] The method of the present invention only requires normal battery cell images as training data, avoiding the tedious process of a large number of defective samples and manual annotation, reducing costs and the subjectivity of manual inspection, and improving inspection efficiency.
[0063] The method of this invention employs phased training during the training process. Firstly, it allows the model to focus on different learning tasks, thereby better optimizing the parameters of each part. Training the adversarial network consisting of the generator G and discriminator D first allows it to concentrate on generating and discriminating samples without interference from the encoder E. With the generator G fixed, the encoder E can focus on learning how to generate appropriate label information, improving overall model performance. Secondly, by training the generator G and discriminator D first, and then training the encoder E, convergence is easier to achieve, reducing training complexity and instability. Furthermore, the learning rate at each stage can be better controlled, thus improving the stability of the entire training process. Thirdly, before training the encoder E, the generator G and discriminator D already have some reasonable parameter initialization, which helps the encoder E learn to generate appropriate label information more easily.
[0064] The present invention also provides a surface defect detection system for solid oxide fuel cells, including a computer-readable storage medium and a processor;
[0065] Computer-readable storage media are used to store executable instructions;
[0066] The processor is used to read executable instructions stored in a computer-readable storage medium and execute the solid oxide fuel cell surface defect detection method in the above embodiments.
[0067] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the solid oxide fuel cell surface defect detection method as described in the above embodiments.
[0068] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting surface defects in a solid oxide fuel cell, characterized in that, include: Training phase: The defect recovery model is trained using a training set, wherein the training samples in the training set are images of solid oxide fuel cells that have passed inspection on the production line. The defect recovery model includes: discriminator D, generator G, and encoder E; wherein, discriminator D and generator G constitute an adversarial network, encoder E and generator G constitute an adversarial network, and the output dimension of encoder E is one-dimensional. The adversarial network consisting of discriminator D and generator G is trained using training samples to obtain a well-trained generator G. Training samples are input into encoder E for defect feature extraction, and encoder E outputs a probability distribution map of defect features. The probability distribution map of defect features output by encoder E also serves as the input to constrain the discriminator D. The probability distribution map of defect features is input into the trained generator G for defect recovery, resulting in a defect-recovered image. When the feature loss between the defect-recovered image output by generator G and the input training samples converges, the training of encoder E is complete. During the training of encoder E, the network parameters of generator G are fixed, and the network parameters of encoder E are adjusted only by the corresponding loss. Application phase: The defective solid oxide fuel cell image is input into the trained encoder E to obtain the probability distribution map of the defective features corresponding to the defective solid oxide fuel cell image; the probability distribution map of the defective features is input into the trained generator G, and the generator G outputs the image after defect recovery; the image after defect recovery is subtracted from the input image of the defective solid oxide fuel cell to obtain a residual map; the residual map and the probability distribution map of the defective features are fused to obtain a fused image, and the fused image is used to locate defects on the surface of the battery cell.
2. The method according to claim 1, characterized in that, Also includes: The fused image is then subjected to binary segmentation.
3. The method according to claim 1 or 2, characterized in that, During the training phase, when the adversarial network consisting of the discriminator D and the generator G is trained using training samples, the training is completed when the feature loss between the image output by the generator G and the input training samples converges.
4. The method according to claim 3, characterized in that, The generator G includes an input layer, a fully connected layer, and an output layer connected in sequence. The input layer is used to input a noise vector; The fully connected layer is used to extract features and transform the dimensions of the input noise vector; The output layer is used to output noisy images.
5. The method according to claim 4, characterized in that, The output layer can be one-dimensional or three-dimensional.
6. The method according to claim 1, characterized in that, Before the training samples are input into the defect recovery model, the method further includes: performing block segmentation, Gaussian filtering for noise reduction, and normalization on the training samples.
7. A surface defect detection system for solid oxide fuel cells, characterized in that, Includes computer-readable storage media and processors; The computer-readable storage medium is used to store executable instructions; The processor is configured to read executable instructions stored in the computer-readable storage medium and execute the method according to any one of claims 1-6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Surface defect detection method based on positive case training
CN108961217A
Character image restoration method based on generative adversarial network
CN116630183A