Image defect detection model construction method, image defect detection method and device

By optimizing the sensitivity field and utilizing the DualGAN model, the problem of poor image reconstruction accuracy in planar array capacitive imaging technology is solved, and higher accuracy image defect detection and reconstruction are achieved.

CN118038200BActive Publication Date: 2025-04-15HARBIN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410009375.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-03
Publication Date
2025-04-15
Estimated Expiration
2044-01-03

AI Technical Summary

Technical Problem

Planar array capacitive imaging technology has problems with poor accuracy during image reconstruction, especially under the influence of noise, which leads to uncertainty in the inverse problem.

Method used

Image reconstruction and defect detection are performed using the DualGAN model by acquiring lossy capacitance data and real defect images of multiple known defective materials, optimize the sensitivity field for more accurate dielectric constant distribution.

Benefits of technology

It improves the accuracy of image defect detection, realizes more accurate image reconstruction and defect detection, reduces the workload of data annotation, and enhances the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118038200B_ABST
    Figure CN118038200B_ABST
Patent Text Reader

Abstract

The invention provides an image defect detection model construction method, an image defect detection method and a device, which relate to the field of electrical capacitance tomography technology. The construction method includes: obtaining lossy capacitance data of multiple known defective materials and corresponding real defect image sets, and obtaining corresponding sensitivity fields according to each set of lossy capacitance data; optimizing each sensitivity field, and obtaining corresponding dielectric constant distribution through the optimized sensitivity field and the corresponding lossy capacitance data; reconstructing images according to each dielectric constant distribution to obtain an initial reconstructed image set; training and optimizing the original DualGAN model according to the initial reconstructed image set and the real defect image set to obtain an image defect detection model, which is used to obtain defect images corresponding to the material to be tested. The present invention improves the accuracy of PECT image defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electrical capacitance tomography, and in particular to an image defect detection model construction method, an image defect detection method and a device. Background Art

[0002] Planar Electrical Capacitance Tomography (PECT) is a new type of multiphase flow visualization detection technology. Its principle is the same as that of capacitance tomography, which uses the edge effect of capacitors. When external excitation is applied to the surface of an object, the change in the dielectric constant distribution in the steady-state electric field will lead to a change in the electric field distribution, thereby causing a change in the capacitance value measured by the array sensor. Through the image reconstruction algorithm, the change in the measured capacitance value is used to reconstruct the dielectric constant distribution of the measurement area and obtain a dielectric constant distribution image. However, the inverse problem of planar array capacitance imaging, that is, the inverse problem of planar array capacitance imaging, is an uncertain problem, in which the error in the original data caused by noise leads to a significant deviation between the approximate solution and the actual solution, resulting in poor accuracy of the reconstructed image.

[0003] Nowadays, machine learning and deep learning have been used to solve image reconstruction problems. For example, CNN is used to realize intelligent recognition of defects from one-dimensional signals, thereby improving the recognition accuracy of heat exchange tube defects. However, in the process of image reconstruction using existing technical means, it is usually necessary to process a large amount of data and perform complex calculations, which leads to a large amount of computational complexity for image reconstruction, resulting in low detection efficiency. In addition, when running machine learning and deep learning, due to the limitation of the data set, the reconstructed image still has errors. Summary of the invention

[0004] The problem solved by the invention is how to improve the accuracy of PECT image defect detection.

[0005] In order to solve the above problems, the present invention provides a method for constructing an image defect detection model, comprising the following steps:

[0006] Acquire lossy capacitance data of a plurality of known defective materials and corresponding real defect image sets, and obtain a corresponding sensitivity field according to each set of the lossy capacitance data;

[0007] Optimizing each of the sensitivity fields, and obtaining a corresponding dielectric constant distribution through the optimized sensitivity fields and the corresponding lossy capacitance data;

[0008] Reconstructing images according to the dielectric constant distributions to obtain an initial reconstructed image set;

[0009] The original DualGAN model is trained and optimized according to the initial reconstructed image set and the real defect image set to obtain an image defect detection model, and the image defect detection model is used to obtain defect images corresponding to the material to be tested.

[0010] Optionally, the construction process of the original DualGAN model includes:

[0011] Obtaining a DualGAN base model, wherein the DualGAN base model includes a generator;

[0012] The original DualGAN model is obtained by adding an attention mechanism module after the fusion module of each layer of the network in the generator;

[0013] Among them, the attention mechanism module is based on the Bahdanau attention module.

[0014] Optionally, the training and optimizing the original DualGAN model according to the initial reconstructed image set and the real defect image set to obtain an image defect detection model includes:

[0015] respectively performing expansion processing on the initial reconstructed image set and the real defect image set to obtain a target reconstructed image set and a target real image set;

[0016] The original defect detection model is trained and tuned according to the target reconstructed data set and the target real image set to obtain a temporary defect detection model and a temporary data set, wherein the temporary data set is the output of the original defect detection model, and the temporary data set includes a temporary reconstructed image set and a temporary real image set;

[0017] The temporary defect detection model is trained and optimized according to the temporary reconstructed image set and the temporary real image set to obtain the image defect detection model.

[0018] Optionally, the optimizing each sensitivity field and obtaining a corresponding dielectric constant distribution through the corresponding lossy capacitance data and the optimized sensitivity field includes:

[0019] Optimizing the sensitivity field based on an improved particle swarm algorithm to obtain the optimized sensitivity field;

[0020] The corresponding dielectric constant distribution is obtained according to the lossy capacitance data and the optimized sensitivity field.

[0021] Optionally, obtaining the corresponding dielectric constant distribution according to the lossy capacitance data and the optimized sensitivity field includes:

[0022] Acquire lossless capacitance data, and obtain variable capacitance data according to the lossless capacitance data and the lossy capacitance data;

[0023] The corresponding dielectric constant distribution is obtained according to the variable capacitance data and the optimized sensitivity field.

[0024] Optionally, optimizing the sensitivity field based on an improved particle swarm algorithm to obtain the optimized sensitivity field includes:

[0025] Obtaining an optimal particle position according to the improved particle swarm algorithm, and obtaining a weight matrix according to the optimal particle position and a diagonal matrix of the sensitivity field;

[0026] The sensitivity field is updated according to the weight matrix to obtain a temporary sensitivity field, and a normalization operation is performed on the temporary sensitivity field to obtain the optimized sensitivity field.

[0027] Optionally, the improved particle swarm algorithm includes:

[0028] Obtaining an initial particle group, and obtaining comfort data of each particle according to the initial particle group;

[0029] Update the speed and position of each particle according to the comfort data until the preset comfort function is minimized;

[0030] Acquire an optimal comfort level, and obtain a corresponding target position of the particle according to the optimal comfort level;

[0031] Taking the target position as the number of the initial particle group, obtaining the target particle group;

[0032] A corresponding target comfort level is obtained according to the target particle group, and the optimal particle position is obtained according to the target comfort level.

[0033] The advantages of the image defect detection model construction method described in the present invention over the prior art are:

[0034] First, by obtaining the lossy capacitance data and corresponding real defect images of multiple known defective materials, this process not only provides capacitance data, but also provides real defect images, providing actual data support for subsequent model training and optimization; each sensitivity field is optimized, and the dielectric constant distribution is obtained according to the optimized sensitivity field and the corresponding lossy capacitance data, that is, by analyzing and optimizing the sensitivity field, a more accurate dielectric constant distribution can be obtained, which makes the reconstruction of defect images relatively accurate. Image reconstruction based on the dielectric constant distribution and generating the initial reconstructed image set are helpful to establish the corresponding training data, provide prior information, and provide the basis and direction for model training. By training the DualGAN model, the image defect detection model is optimized and obtained. The model can achieve more accurate image reconstruction and more sensitive detection of defects, achieving better defect marking effect. Since the DualGAN model is a variant of the Generative Adversarial Network (GAN), it does not require paired data for training, which means that it is easier to use large-scale and incomplete data sets to train the model, thereby reducing the workload of data annotation, so realistic defect images can be generated more effectively.

[0035] Therefore, the present invention improves the training effect of the image defect model by comprehensively utilizing lossy capacitance data, sensitivity field and real defect image set, effectively realizing the integration of capacitance imaging technology and image recognition technology; and by utilizing the advanced DualGAN model, the defect image reconstruction and detection have higher accuracy and robustness. This method is more flexible and efficient than the traditional defect detection method based on rules or feature extraction.

[0036] In order to solve the above technical problems, the present invention also provides an image defect detection model construction device, comprising:

[0037] An acquisition unit, used to acquire lossy capacitance data of a plurality of known defective materials and corresponding real defect image sets, and obtain a corresponding sensitivity field according to each set of lossy capacitance data;

[0038] A processing unit, configured to optimize each of the sensitivity fields and obtain a corresponding dielectric constant distribution through the optimized sensitivity fields and the corresponding lossy capacitance data;

[0039] The processing unit is also used to perform image reconstruction according to each of the dielectric constant distributions to obtain an initial reconstructed image set; train and optimize the original DualGAN model according to the initial reconstructed image set and the real defect image set to obtain an image defect detection model, and the image defect detection model is used to obtain a defect image corresponding to the material to be tested.

[0040] The advantages of the image defect detection model construction device described in the present invention and the image defect detection model construction method described in the present invention are the same as those of the prior art, which will not be repeated here.

[0041] In order to solve the above technical problems, the present invention also provides an image defect detection method, comprising:

[0042] Obtain lossy capacitance data and corresponding sensitivity field corresponding to the material to be tested;

[0043] Optimizing each of the sensitivity fields, and obtaining a corresponding dielectric constant distribution through the corresponding lossy capacitance data and the optimized sensitivity field;

[0044] Performing image reconstruction according to the dielectric constant distribution to obtain an initial image to be measured, and acquiring a matching target image according to a preset storage library;

[0045] The target defect image is obtained by inputting the initial image to be tested and the target image into the image defect detection model constructed by the image defect detection model construction method.

[0046] The image defect detection method described in the present invention and the image defect detection model construction method described in the present invention have the same advantages over the prior art, which will not be repeated here.

[0047] In order to solve the above technical problems, the present invention also provides an image defect detection device, comprising:

[0048] An acquisition module is used to obtain lossy capacitance data and a corresponding sensitivity field corresponding to the material to be tested;

[0049] A processing module, used for optimizing each of the sensitivity fields, and obtaining a corresponding dielectric constant distribution through the corresponding lossy capacitance data and the optimized sensitivity field;

[0050] The processing module is also used to reconstruct an image according to the dielectric constant distribution to obtain an initial image to be tested, and to obtain a matching target image according to a preset repository; and to input the initial image to be tested and the target image into an image defect detection model constructed by the image defect detection model construction method to obtain a target defect image.

[0051] The advantages of the image defect detection device described in the present invention and the image defect detection model construction method described in the present invention are the same as those of the prior art, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A schematic diagram of a process for constructing an image defect detection model in an embodiment of the present invention;

[0053] Figure 2Schematic diagram of the training process of the original DualGAN model in an embodiment of the present invention;

[0054] Figure 3 A network diagram of a generator in an embodiment of the present invention;

[0055] Figure 4 Schematic diagram of an attention mechanism module in an embodiment of the present invention;

[0056] Figure 5 A schematic diagram of improving the operation of a particle swarm algorithm in an embodiment of the present invention;

[0057] Figure 6 Schematic diagram for comparing various defect image generation methods in the embodiments of the present invention;

[0058] Figure 7 Schematic diagram of the process of the image defect detection method in an embodiment of the present invention;

[0059] Figure 8 1 is a diagram showing the internal structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0060] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0061] like Figure 1 As shown, in one embodiment, a method for building an image defect detection model is provided, comprising the following steps:

[0062] Step S1, acquiring lossy capacitance data of a plurality of known defective materials and corresponding real defect image sets, and obtaining a corresponding sensitivity field according to each set of the lossy capacitance data.

[0063] Specifically, lossy capacitance data is capacitance data obtained by detecting materials with defect positions and sizes through PECT sensors, and relative lossless capacitance data is capacitance data obtained by placing lossless materials on PECT sensors for detection; the corresponding sensitivity field can be obtained through each set of lossy capacitance data corresponding to each material; among them, PECT (Planar Electrical Capacitance Tomography) planar capacitance tomography technology, a new type of multiphase flow visualization detection technology, has the same principle as capacitance tomography technology, both of which use the edge effect of capacitance. The PECT sensor includes a copper capacitor plate, a radial shielding plate and an outer shielding cover, the shielding plate and the outer shielding plate are grounded, and the capacitor plate is mounted on an insulating substrate.

[0064] In the simulation system, a finite element simulation model can be established for the PECT sensor to perform detection simulation on typical defects of carbon fiber reinforced polymer (CFRP), which may include hole defects, crack defects, and delamination defects. Take the detection of hole defects as an example.

[0065] During the simulation, the dielectric constants of the defect area and the outer air area are set to 1, and the dielectric constant of the composite material is set to 3.6. The change in the dielectric constant causes the detection signal to change. The edge effect of the capacitor is used to apply voltage to the excitation electrode in turn and measure the inter-electrode capacitance between the excitation electrode and the receiving electrode, while ensuring that the other electrodes remain grounded, so that the dielectric constant distribution of the defective sample is different from that of the defect-free sample. By simulating the composite material, the lossy capacitance data can be obtained by solving the positive problem of PECT, and the corresponding sensitivity field can be obtained based on the lossy capacitance data.

[0066] Step S2, optimizing each of the sensitivity fields, and obtaining a corresponding dielectric constant distribution through the optimized sensitivity fields and the corresponding lossy capacitance data.

[0067] Specifically, the sensitivity field is optimized by using appropriate optimization algorithms or techniques. The goal of the optimization may be to maximize or minimize certain metrics to achieve an optimal sensitivity field. Using known lossy capacitance data, the optimized sensitivity field can be correlated with capacitance imaging techniques to determine the dielectric constant in the material. Using the optimized sensitivity field and lossy capacitance data, the dielectric constant is reconstructed or estimated using appropriate inversion methods and numerical techniques. This may include the use of inverse problem solving methods, such as imaging algorithms, inversion algorithms, or inverse modeling techniques.

[0068] Step S3, performing image reconstruction according to each of the dielectric constant distributions to obtain an initial reconstructed image set.

[0069] Specifically, prepare the dielectric constant distribution data required for image reconstruction. These data usually include known dielectric constant distribution information, which may be the dielectric constant value at a specific location or area. According to the characteristics of the data and application requirements, select an appropriate image reconstruction algorithm. Common image reconstruction algorithms include back projection algorithm, gradient descent algorithm, least squares method, model-based imaging algorithm, etc. Using the selected image reconstruction algorithm, combined with the dielectric constant distribution data, the image of the target area is reconstructed. According to the algorithm and data used, the dielectric constant distribution is mapped to the image space to obtain an initial set of reconstructed images. In practical applications, further optimization and improvement may be required to obtain more accurate and reliable image reconstruction results.

[0070] Step S4, training and optimizing the original DualGAN model according to the initial reconstructed image set and the real defect image set to obtain an image defect detection model, wherein the image defect detection model is used to obtain a defect image corresponding to the material to be tested.

[0071] Specifically, the DualGAN model process is trained and optimized through the initial reconstructed image set and the real defect image set, which will be used as the input data for model training. The DualGAN model is trained using the prepared image data. DualGAN is a variant of the Generative Adversarial Network (GAN) that can simultaneously generate real samples and corresponding defect samples. Through adversarial training, the DualGAN model can generate defect images with high fidelity.

[0072] During the training process, the model is optimized and adjusted, including selecting appropriate loss functions, network structures, and hyperparameters, to obtain better model performance and image generation effects.

[0073] The trained DualGAN model can generate defect images corresponding to the material to be tested. These images can be used as labels for material defect detection tasks or as input data for subsequent defect detection models. By using the trained image defect detection model, defect detection is performed on the material to be tested. The image defect detection model can identify defect areas in the image and generate defect images based on comparative analysis. These defect images can help with material quality assessment, defect analysis, and quality control.

[0074] The above training process can be applied to many fields, such as industrial quality inspection, medical image analysis, etc. In practical applications, appropriate adjustments and improvements may be required according to different task requirements.

[0075] In this embodiment, first, by obtaining the lossy capacitance data and corresponding real defect images of multiple known defective materials, the process not only provides capacitance data, but also provides real defect images, providing actual data support for subsequent model training and optimization; each sensitivity field is optimized, and the dielectric constant distribution is obtained according to the optimized sensitivity field and the corresponding lossy capacitance data, that is, by analyzing and optimizing the sensitivity field, a more accurate dielectric constant distribution can be obtained, which makes the reconstruction of defect images relatively accurate. Image reconstruction is performed according to the dielectric constant distribution to generate an initial reconstructed image set, which helps to establish corresponding training data, provides prior information, and provides a basis and direction for model training. By training the DualGAN model, the image defect detection model is optimized and obtained. The model can achieve more accurate image reconstruction and more sensitive detection of defects, achieving better defect marking effects. Since the DualGAN model is a variant of a generative adversarial network (GAN), it does not require paired data for training, which means that it is easier to use large-scale and incomplete data sets to train the model, thereby reducing the workload of data annotation, so that realistic defect images can be generated more effectively.

[0076] Therefore, this embodiment improves the training effect of the image defect model by comprehensively utilizing lossy capacitance data, sensitivity field and real defect image set, effectively realizing the integration of capacitance imaging technology and image recognition technology; and by utilizing the advanced DualGAN model, the defect image reconstruction and detection have higher accuracy and robustness. This method is more flexible and efficient than the traditional defect detection method based on rules or feature extraction.

[0077] In some embodiments, the construction process of the original DualGAN model includes:

[0078] Obtaining a DualGAN base model, wherein the DualGAN base model includes a generator;

[0079] The original DualGAN model is obtained by adding an attention mechanism module after the fusion module of each layer of the network in the generator;

[0080] Among them, the attention mechanism module is based on the Bahdanau attention module.

[0081] Specifically, the DualGAN basic model includes a generator and a discriminator. The generator is responsible for generating fake data from noise data, while the discriminator is responsible for distinguishing real images from generated images. In the DualGAN basic model, each layer of the generator network will add an attention mechanism module through a fusion module, which will enhance the original DualGAN model, and the attention mechanism module is based on the Bahdanau attention module.

[0082] Among them, the Bahdanau attention module is an attention model widely used in sequence-to-sequence learning. It is used to align different parts of the source sequence to different positions of the target sequence. In this model, the attention mechanism is used to decide which input sequence corresponds to each moment of the output sequence during the translation process in order to translate more efficiently.

[0083] Applying the Bahdanau attention module to the fusion module of each layer of the generator network can help the generator better focus on and learn the important parts of the input data, thereby improving the effect of the generator in generating realistic images. This mechanism can help the generator better understand and learn different parts of the input data during training and generate more realistic images.

[0084] In some embodiments, in step S4, the training and optimization of the original DualGAN model according to the initial reconstructed image set and the real defect image set to obtain an image defect detection model includes:

[0085] Step S41, respectively expanding the initial reconstructed image set and the real defect image set to obtain a target reconstructed image set and a target real image set;

[0086] Step S42, training and tuning the original defect detection model according to the target reconstructed data set and the target real image set to obtain a temporary defect detection model and a temporary data set, wherein the temporary data set is the output of the original defect detection model, and the temporary data set includes a temporary reconstructed image set and a temporary real image set;

[0087] Step S43: training and optimizing the temporary defect detection model according to the temporary reconstructed image set and the temporary real image set to obtain the image defect detection model.

[0088] Specifically, Figure 2As shown in the figure, the initial reconstructed image set and the real defect image set are expanded, that is, the initial reconstructed image set and the real defect image are expanded by rotating, cropping, scaling and flipping. In the process of model training, it is easy to cause overfitting due to the small amount of data in the training set, so expanding the image set can avoid this phenomenon. During the two training processes of the model, the initial data set of each training can be expanded accordingly (that is, in the second training, the temporary reconstructed image set and the temporary real image set are expanded to obtain the first temporary reconstructed image set and the first temporary real image set, and the temporary defect detection model is trained by the first temporary reconstructed image set and the first temporary real image set) to improve the diversity and quantity of the data set, so as to make the final image defect detection model more accurate and more robust. That is, by expanding the data set and repeatedly training and tuning the model, the performance and stability of the image defect detection model can be improved. Expanding the data set helps to improve the adaptability of the model to different scenes and situations, and repeated model tuning helps to improve the accuracy and generalization ability of the model. The image defect detection model obtained in this way will have higher reliability and practicality.

[0089] In some preferred embodiments, the DualGAN basic model includes generator A, generator B and a discriminator, and all use the same network structure. The generator uses a fully convolutional UNet network, in which the encoding layer and the decoding layer use a jump connection method to improve the efficiency of information transmission; the discriminator can use a PatchGAN network, which consists of multiple convolutional layers and activation functions (LRelu) to distinguish the difference between the converted image and the real image. In each convolution operation of the UNet network, padding>0 is set, and the input image is padded with 0 values ​​to keep the size of the convolved image fixed. The network structure diagram of the generator is shown in the figure. Figure 3As shown in the figure, conv3*3 is a 3*3 convolution module, Attention block is an attention mechanism module, Skip Connection is a skip connection, up conv2*2 is a 2*2 upsampling module (upsampling convolution layer), sigmoid (S-shaped growth curve) is used as the activation function, Dropout is used in the fully connected layer to prevent the model from overfitting, and the structure of the generator consists of eight upsampling convolution layers and eight downsampling convolution layers. Each network layer is activated with LReLU after convolution, and the step size is set to 2. In each downsampling, the number of feature channels is doubled. Conversely, in the upsampling process, the number of feature channels is halved. After the eighth layer of upsampling is completed, the spliced ​​feature map is placed in the first layer of downsampling, and the splicing and fusion are completed in sequence to complete the training of the generator. The training process can use the focal loss function to reduce the reconstruction error between the output image and the input image. The focal loss function (a loss function based on binary cross entropy) can reduce the weight of samples that are easy to classify in training, so that the model can focus more on distinguishing samples that are difficult to train. The standard calculation formula for focal loss is:

[0090]

[0091] Wherein, p=1 represents the reconstructed image (such as the temporary reconstructed image set and the target reconstructed image set), p=0 represents the real defect image, Represents the output after the activation function, the balance factor α t Correcting the impact of positive and negative samples on the total loss reflects the difficulty of classification, the modulation factor In The larger the value, the higher the target confidence and the easier it is to classify the sample; The smaller the value, the opposite is true.

[0092] As the number of network layers increases, the less original information is retained in the obtained sentence vector, and the higher the abstract level of the sentence meaning. The features of the encoding layer include unique edge spatial features, and the features of the decoding layer include high-level abstract spatial features. Both sides focus on features at different levels and lose the spatial focus of the other layer, so directly connecting the encoding and decoding features cannot effectively select spatial information. Therefore, a Bahdanau attention module is added after the full convolution concatenation layer of each layer of Unet, and the feature map with the weight coefficient adjusted by the attention mechanism is input into the feature fusion network on the right side of Unet to generate a new weight feature map. The Bahdanau attention module is as follows: Figure 4As shown in the Bahdanau attention module, the intermediate semantic vector c is generated at different times of the decoder, and the weight α of the decoder at time t on all hidden layer states of the encoder is tj and the hidden layer state h of the encoder at the jth moment j The weighted summation is used to obtain the intermediate semantic vector c at time t, as shown in formula (2):

[0093]

[0094] The hidden state s of the decoder at time t tj , used to calculate the attention weight, as shown in formula (3):

[0095] s t =f(y t-1 ,s t-1 ,c t ); (3)

[0096] Among them, y t is the output vector with the highest probability, and calculates the influence of the information of the input sequence at time j on the decoding of the output sequence at time t. tj , as shown in formula (4):

[0097] ε tj =a(s t-1 ,h j ); (4)

[0098] Among them, a is the output probability learned by the network training parameters.

[0099] Automatically select some hidden layer information in the encoder according to the degree of influence, and use the softmax function to calculate the attention weight value α of the features of all hidden layer states of the encoder tj , as shown in formula (5):

[0100]

[0101] Based on the attention weight values ​​of the features of the hidden layer state, all weights are updated using adaptive moment estimation (Adam), thereby adjusting the weights twice, reducing the conversion error, and keeping the learning rate unchanged. Calculate the attention weight α tj The gradient g of the first-order moment estimate x t Adjust the direction of change of the parameter, as shown in formula (6). Second-order moment estimate s t Adjust the change rate of the parameters, as shown in formula (7):

[0102] xt ←β 1 x t-1 +(1-β 1 ) t ; (6);

[0103] s t ←β 2 s t-1 +(1-β 2 ) t 2 (7);

[0104] Among them, β 1 , β 2 is the exponential decay rate, set it to β 1 =0.9,β 2 =0.999 The network parameters are adjusted by calculating different adaptive learning rates. The first-order moment estimate and the second-order moment estimate are corrected to unbiased parameters, as shown in formula (8) and formula (9):

[0105]

[0106]

[0107] The attention weight is updated according to the first moment estimate and the second moment estimate after deviation correction, as shown in formula (10):

[0108]

[0109] Among them, θ is the attention weight, η is the step size of the algorithm, and ε is a very small parameter. Multiply this vector with the weight map of the input feature of the module to generate the final attention feature S tj , as shown in formula (11):

[0110]

[0111] Among them, C ij It is the concatenated feature map.

[0112] The corrected attention feature map is convolved with the concatenated feature map after feature extraction, and finally the feature map of each part is convolved to obtain a complete reconstructed image. The reconstructed image and the real image are identified in the discriminator, and the calculation is iterated many times until the image generated by the generator is highly consistent with the real image and the reconstruction error is minimized. The conversion image of the best Landweber reconstructed image is obtained as the final reconstructed image of ECT.

[0113] In some embodiments, in step S2, optimizing each sensitivity field and obtaining a corresponding dielectric constant distribution through the corresponding lossy capacitance data and the optimized sensitivity field includes:

[0114] Step S21, optimizing the sensitivity field based on an improved particle swarm algorithm to obtain the optimized sensitivity field;

[0115] Step S22, obtaining the corresponding dielectric constant distribution according to the lossy capacitance data and the optimized sensitivity field

[0116] In some embodiments, in step S22, obtaining the corresponding dielectric constant distribution according to the lossy capacitance data and the optimized sensitivity field includes:

[0117] Step S221, acquiring lossless capacitance data, and obtaining variable capacitance data according to the lossless capacitance data and the lossy capacitance data;

[0118] Step S222: obtaining a corresponding dielectric constant distribution according to the variable capacitance data and the optimized sensitivity field.

[0119] Specifically, the variable capacitance data (variable capacitance data C) is obtained according to the lossless capacitance data and the lossy capacitance data, that is, the lossless capacitance data is subtracted from the lossy capacitance data and then divided by the lossless capacitance data. In the simulation process, for example, the Landweber algorithm is used in Matlab to solve the PECT inverse problem, that is, the dielectric constant distribution G in the test area is obtained by using the variable capacitance value C and the corresponding optimized sensitivity field S through formula (12), and formula (12) is:

[0120]

[0121] The solution is corrected in the negative gradient direction of the data residual to optimize the minimum value of the target functional, thereby completing the reconstruction and obtaining the dielectric constant distribution G. The gradient formula of the data residual is shown in formula (13):

[0122]

[0123] The corresponding iterative formula is shown in formula (14):

[0124] G (k+1) =G (k) +αST(C-SG (k) ); (14)

[0125] Among them, α is a positive iteration factor, S T is the transposed matrix of S; SG is the product of the sensitivity field and the dielectric constant distribution, and k is the number of iterations.

[0126] Specifically, since the dielectric constant distribution is calculated based on multiple iterations during the image reconstruction process, the amount of calculation is too large, the time complexity is high, and the convergence speed is slow. Therefore, during the simulation process, when the Landweber algorithm is used in Matlab to solve the PECT inverse problem, the parfor-loop (using the parfor function for parallel calculations) can be called instead of the for-loop (for loop) to accelerate the calculation. It is necessary to write and start the Matlab client (client) of the parallel program and the Matlab worker (work unit) that runs the code in parallel. Among them, the client refers to the Matlab segment that writes and starts the parallel code, and the worker refers to the Matlab end that runs the code in parallel. When using the parfor parallel for loop, the client assigns 500 loop tasks to multiple workers, which run simultaneously in a loop. All workers return results after running, and the results are integrated. The original time complexity of the loop iteration is O(N 2 ), after parallel processing, the time complexity is reduced to O(N), which reduces the amount of calculation and improves the calculation efficiency.

[0127] In some embodiments, in step S21, optimizing the sensitivity field based on the improved particle swarm algorithm to obtain the optimized sensitivity field includes:

[0128] Step S211, obtaining an optimal particle position according to the improved particle swarm algorithm, and obtaining a weight matrix according to the optimal particle position and a diagonal matrix of the sensitivity field;

[0129] Step S212: updating the sensitivity field according to the weight matrix to obtain a temporary sensitivity field, and performing a normalization operation on the temporary sensitivity field to obtain the optimized sensitivity field.

[0130] In some embodiments, Figure 5 As shown, the improved particle swarm algorithm includes:

[0131] Obtaining an initial particle group, and obtaining comfort data of each particle according to the initial particle group;

[0132] Update the speed and position of each particle according to the comfort data until the preset comfort function is minimized;

[0133] Acquire an optimal comfort level, and obtain a corresponding target position of the particle according to the optimal comfort level;

[0134] Taking the target position as the number of the initial particle group, obtaining the target particle group;

[0135] A corresponding target comfort level is obtained according to the target particle group, and the optimal particle position is obtained according to the target comfort level.

[0136] In some embodiments, an improved particle swarm algorithm is used, that is, a particle swarm algorithm with adaptive particle number and L2 norm normalization to optimize the sensitivity field. In the particle swarm algorithm with adaptive particle number, the particle swarm is first initialized, and the comfort score (comfort data) of each particle is calculated. The particle position change is used to update the particle velocity, and finally the optimal particle position is obtained. The position and velocity of the i-th particle are respectively recorded as x i , v i , the particle velocity update formula is shown in (15):

[0137]

[0138] Among them, w is the weight, v is the speed, c 1 , c 2 is the learning factor, r 1 , r 2 is a random number uniformly generated in the range [0,1]. is the individual extreme value, is the group extreme value. According to the particle velocity, the particle position update can be calculated, as shown in formula (16):

[0139]

[0140] The condition number is selected as the fitness function. The larger the condition number, the larger the input error. The second cycle calculates the position of the next particle and finds the minimum condition number by evaluating the fitness cod of each particle. The fitness calculation formula is shown in (17).

[0141]

[0142] Among them, T is the condition number, s is the target matrix, M t is the learning factor.

[0143] By continuously adjusting the position of the particles to minimize the fitness function, the best fitness is found and the particle position with the best fitness is returned. The particle position (target position) is used as the optimal particle number N for the second optimization of the sensitivity field using the particle swarm algorithm, and the particle swarm algorithm is called again to update the sensitivity field parameters. Finally, the L2 norm is used to normalize the numerical range in the sensitivity field. After L2 norm normalization, the Euclidean distance and corresponding cosine similarity of a set of vectors can be equivalent, and the optimized sensitivity field is obtained.

[0144] In some specific embodiments, the specific implementation methods of experimental verification of the image defect detection model construction method are as follows:

[0145] Taking hole defect detection as an example, five hole defects of the same material are detected using different methods, and the final defect image is obtained as follows: Figure 6 As shown. And select the accuracy evaluation criteria, you can choose the correlation coefficient (CC) (as shown in formula (18)) image relative error (RE) (as shown in formula (19)), by comparing the defect images generated by the improved DualGAN with those generated by the classic algorithm, as shown in Table 1, the accuracy table of defect images obtained by different methods.

[0146]

[0147]

[0148] Table 1 Accuracy of defect images obtained by different methods

[0149]

[0150]

[0151] pass Figure 6 In (b) and (c), we can see that image reconstruction (defective image) and Figure 6 (a) Compared with the model image (real defect image), the errors are relatively large and the correlation coefficients in the table are relatively low. Figure 6 (d) is the original DualGAN model based on the Landweber reconstruction image. It can be seen that the effect of eliminating artifacts and deepening the contour is enhanced, and the linear correlation with the model image (real defect image) is high. The relative error is greatly reduced. It can be seen from the results in the table that the subjective and objective evaluations are higher than the classic reconstruction algorithm, but there are still errors for small hole defects; Figure 6 (e) is the image reconstruction method of the present invention. Compared with the original DualGAN, the image reconstructed by the method of the present invention has clearer edges and fewer artifacts, better retains the structure of the real defect image, and subjectively accurately reconstructs the contour and position of the defect feature position. The improved DualGAN reconstruction method makes the various indicators of the PECT image more accurate than the classical method. This shows that the use of neural networks and attention mechanisms is conducive to the detection of complex hole structures, improves the reconstruction accuracy, and achieves good and reliable results.

[0152] The image defect detection model construction method described in this embodiment first obtains the lossy capacitance data and corresponding real defect images of multiple known defective materials. This process not only provides capacitance data, but also provides real defect images, providing actual data support for subsequent model training and optimization; optimize each sensitivity field, and obtain the dielectric constant distribution according to the optimized sensitivity field and the corresponding lossy capacitance data, that is, by analyzing and optimizing the sensitivity field, a more accurate dielectric constant distribution can be obtained, which makes the reconstruction of defective images relatively accurate. Image reconstruction is performed according to the dielectric constant distribution to generate an initial reconstructed image set, which helps to establish corresponding training data, provides prior information, and provides a basis and direction for model training. By training the DualGAN model, the image defect detection model is optimized and obtained. The model can achieve more accurate image reconstruction and more sensitive detection of defects, and achieve better defect marking effect. Since the DualGAN model is a variant of a generative adversarial network (GAN), it does not require paired data for training, which means that it is easier to use large-scale and incomplete data sets to train the model, thereby reducing the workload of data annotation, so that realistic defect images can be generated more effectively.

[0153] Therefore, this embodiment improves the training effect of the image defect model by comprehensively utilizing lossy capacitance data, sensitivity field and real defect image set, effectively realizing the integration of capacitance imaging technology and image recognition technology; and by utilizing the advanced DualGAN model, the defect image reconstruction and detection have higher accuracy and robustness. This method is more flexible and efficient than the traditional defect detection method based on rules or feature extraction.

[0154] Another embodiment of the present invention provides an image defect detection model construction device, comprising:

[0155] An acquisition unit, used to acquire lossy capacitance data of a plurality of known defective materials and corresponding real defect image sets, and obtain a corresponding sensitivity field according to each set of lossy capacitance data;

[0156] A processing unit, configured to optimize each of the sensitivity fields and obtain a corresponding dielectric constant distribution through the optimized sensitivity fields and the corresponding lossy capacitance data;

[0157] The processing unit is also used to perform image reconstruction according to each of the dielectric constant distributions to obtain an initial reconstructed image set; train and optimize the original DualGAN model according to the initial reconstructed image set and the real defect image set to obtain an image defect detection model, and the image defect detection model is used to obtain a defect image corresponding to the material to be tested.

[0158] like Figure 7As shown, another embodiment of the present invention provides an image defect detection method, comprising:

[0159] Obtain lossy capacitance data and corresponding sensitivity field corresponding to the material to be tested;

[0160] Optimizing each of the sensitivity fields, and obtaining a corresponding dielectric constant distribution through the corresponding lossy capacitance data and the optimized sensitivity field;

[0161] Performing image reconstruction according to the dielectric constant distribution to obtain an initial image to be measured, and acquiring a matching target image according to a preset storage library;

[0162] The target defect image is obtained by inputting the image defect detection model constructed by the image defect detection model construction method according to the initial image to be tested and the target image.

[0163] Specifically, the preset repository is a repository of existing defect image data. By matching the initial image to be tested (the preliminary reconstructed image corresponding to the material to be tested) with the data in the preset repository, the image with the closest similarity to the initial image to be tested is selected as the target image, and the two images are input into the image defect detection model. After processing by the model, the corresponding target defect image can be obtained.

[0164] In this embodiment, the dielectric constant distribution is obtained by using lossy capacitance data and the corresponding sensitivity field, and image reconstruction is realized through the distribution, and then the initial image to be tested and the target image are input into the image defect detection model to obtain the target defect image. The capacitance imaging technology and the image defect detection method are fully combined. The data obtained by the capacitance imaging technology, combined with the image defect detection model, enables the obtained image to more intuitively show the defect condition of the material to be tested, which is conducive to a comprehensive and accurate understanding of the defect condition of the object. By inputting the initial image to be tested and the target image into the image defect detection model, a more intuitive and accurate target defect image can be obtained. This helps to discover and identify defects more quickly and accurately, thereby providing strong support for subsequent processing and repair. Therefore, in this embodiment, the lossy capacitance data, sensitivity field, image reconstruction and image defect detection are combined, which helps to more comprehensively obtain the defect information of the material to be tested, and provide the necessary basis and reference for subsequent analysis and repair.

[0165] Another embodiment of the present invention provides an image defect detection device, comprising:

[0166] An acquisition module is used to obtain lossy capacitance data and a corresponding sensitivity field corresponding to the material to be tested;

[0167] A processing module, used for optimizing each of the sensitivity fields, and obtaining a corresponding dielectric constant distribution through the corresponding lossy capacitance data and the optimized sensitivity field;

[0168] The processing module is also used to reconstruct an image according to the dielectric constant distribution to obtain an initial image to be tested, and obtain a matching target image according to a preset repository; and input the initial image to be tested and the target image into an image defect detection model constructed by the image defect detection model construction method to obtain a target defect image.

[0169] Another embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned image defect detection method when executing the computer program.

[0170] It should be noted that the device may be a computer device such as a server or a mobile terminal.

[0171] Figure 8 The internal structure diagram of a computer device in one embodiment is shown. The computer device includes a processor, a memory, a network interface, an input device and a display screen connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement an image defect detection method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement a satellite signal quality prediction method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse.

[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned image defect detection method are implemented.

[0173] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0174] It should be noted that, in this article, terms such as "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0175] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

[0176] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the protection scope of the present invention.

Claims

1. A method for constructing an image defect detection model, characterized in that: include: Acquire lossy capacitance data of a plurality of known defective materials and corresponding real defect image sets, and obtain a corresponding sensitivity field according to each set of the lossy capacitance data; Optimizing each of the sensitivity fields and obtaining a corresponding dielectric constant distribution through the optimized sensitivity fields and the corresponding lossy capacitance data, including: Optimizing the sensitivity field based on an improved particle swarm algorithm to obtain the optimized sensitivity field; Obtaining the corresponding dielectric constant distribution according to the lossy capacitance data and the optimized sensitivity field; Reconstructing images according to the dielectric constant distributions to obtain an initial reconstructed image set; The original DualGAN model is trained and optimized according to the initial reconstructed image set and the real defect image set to obtain an image defect detection model, including: respectively performing expansion processing on the initial reconstructed image set and the real defect image set to obtain a target reconstructed image set and a target real image set; The original DualGAN model is trained and tuned according to the target reconstructed image set and the target real image set to obtain a temporary defect detection model and a temporary data set, wherein the temporary data set is the output of the original DualGAN model, and the temporary data set includes a temporary reconstructed image set and a temporary real image set; The temporary defect detection model is trained and tuned according to the temporary reconstructed image set and the temporary real image set to obtain the image defect detection model; the image defect detection model is used to obtain the defect image corresponding to the material to be tested; The construction process of the original DualGAN model includes: Obtaining a DualGAN base model, wherein the DualGAN base model includes a generator; The original DualGAN model is obtained by adding an attention mechanism module after the fusion module of each layer of the network in the generator; Among them, the attention mechanism module is based on the Bahdanau attention module.

2. The image defect detection model construction method according to claim 1, characterized in that: The obtaining the corresponding dielectric constant distribution according to the lossy capacitance data and the optimized sensitivity field includes: Acquire lossless capacitance data, and obtain variable capacitance data according to the lossless capacitance data and the lossy capacitance data; The corresponding dielectric constant distribution is obtained according to the variable capacitance data and the optimized sensitivity field.

3. The image defect detection model construction method according to claim 1, characterized in that: The step of optimizing the sensitivity field based on the improved particle swarm algorithm to obtain the optimized sensitivity field includes: Obtaining an optimal particle position according to the improved particle swarm algorithm, and obtaining a weight matrix according to the optimal particle position and a diagonal matrix of the sensitivity field; The sensitivity field is updated according to the weight matrix to obtain a temporary sensitivity field, and a normalization operation is performed on the temporary sensitivity field to obtain the optimized sensitivity field.

4. The method for constructing an image defect detection model according to claim 3, characterized in that: The improved particle swarm algorithm comprises: Obtaining an initial particle group, and obtaining comfort data of each particle according to the initial particle group; Update the speed and position of each particle according to the comfort data until the preset comfort function is minimized; Acquire an optimal comfort level, and obtain a corresponding target position of the particle according to the optimal comfort level; Taking the target position as the number of the initial particle group, obtaining the target particle group; A corresponding target comfort level is obtained according to the target particle group, and the optimal particle position is obtained according to the target comfort level.

5. An image defect detection model building device, characterized in that: include: An acquisition unit, used to acquire lossy capacitance data of a plurality of known defective materials and corresponding real defect image sets, and obtain a corresponding sensitivity field according to each set of lossy capacitance data; A processing unit, configured to optimize each of the sensitivity fields and obtain a corresponding dielectric constant distribution through the optimized sensitivity field and the corresponding lossy capacitance data, including: optimizing the sensitivity field based on an improved particle swarm algorithm to obtain the optimized sensitivity field; obtaining the corresponding dielectric constant distribution according to the lossy capacitance data and the optimized sensitivity field; The processing unit is also used to perform image reconstruction according to each of the dielectric constant distributions to obtain an initial reconstructed image set; train and optimize the original DualGAN model according to the initial reconstructed image set and the real defect image set to obtain an image defect detection model, including: respectively expanding the initial reconstructed image set and the real defect image set to obtain a target reconstructed image set and a target real image set; training and tuning the original DualGAN model according to the target reconstructed image set and the target real image set to obtain a temporary defect detection model and a temporary data set, wherein the temporary data set is the output of the original DualGAN model, and the temporary data set is the output of the original DualGAN model. The data set includes a temporary reconstructed image set and a temporary real image set; the temporary defect detection model is trained and tuned according to the temporary reconstructed image set and the temporary real image set to obtain the image defect detection model; the image defect detection model is used to obtain the defect image corresponding to the material to be tested; wherein, the construction process of the original DualGAN model includes: obtaining the DualGAN basic model, and the DualGAN basic model includes a generator; by adding an attention mechanism module to the fusion module of each layer of the network in the generator, the original DualGAN model is obtained; wherein, the attention mechanism module is based on the Bahdanau attention module.

6. An image defect detection method, characterized in that: include: Obtain lossy capacitance data and corresponding sensitivity field corresponding to the material to be tested; Optimizing each of the sensitivity fields, and obtaining a corresponding dielectric constant distribution through the corresponding lossy capacitance data and the optimized sensitivity field; Performing image reconstruction according to the dielectric constant distribution to obtain an initial image to be measured, and acquiring a matching target image according to a preset storage library; The initial image to be tested and the target image are input into the image defect detection model constructed by the image defect detection model construction method according to any one of claims 1 to 4 to obtain a target defect image.

7. An image defect detection device, characterized in that: include: An acquisition module, used to acquire lossy capacitance data and a corresponding sensitivity field corresponding to the material to be tested; A processing module, used for optimizing each of the sensitivity fields, and obtaining a corresponding dielectric constant distribution through the corresponding lossy capacitance data and the optimized sensitivity field; The processing module is also used to perform image reconstruction according to the dielectric constant distribution to obtain an initial image to be tested, and to obtain a matching target image according to a preset repository; and to input the initial image to be tested and the target image into an image defect detection model constructed by the image defect detection model construction method according to any one of claims 1 to 4 to obtain a target defect image.