A tire defect detection method based on improved GANomaly model

By introducing the DDGANomaly network model, combined with the local discriminator and Wasserstein distance loss function, the problems of insufficient reconstruction capability and inaccurate detection of the GANomaly model are solved, and high-precision and efficient automation of tire X-ray image defect detection is achieved.

CN117036309BActive Publication Date: 2025-09-19SHENYANG LIGONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311038207.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-17
Publication Date
2025-09-19
Estimated Expiration
2043-08-17

AI Technical Summary

Technical Problem

The existing GANomaly model has insufficient reconstruction capability in tire X-ray image defect detection, and the wide variety of defects leads to inaccurate detection results, requiring a large amount of labeled data.

Method used

The DDGANomaly network model is adopted, and the local discriminator and Wasserstein distance loss function are introduced. Through the combination of autoencoder, reencoder, global discriminator and local discriminator, the image reconstruction ability and spatial level encoding ability are improved, and the abnormal threshold score is set for detection.

Benefits of technology

The accuracy of tire X-ray image defect detection has been improved, with the AUC reaching 90.6%, a 5.1% increase over the original GANomaly model, freeing up human resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117036309B_ABST
    Figure CN117036309B_ABST
Patent Text Reader

Abstract

This invention discloses a tire defect detection method based on an improved GANomaly model. The method comprises the following steps: establishing a model training sample dataset and a model test sample dataset; building a DDGANomaly network model based on the GANomaly model by adding a local discriminator and introducing a distance loss function; training the DDGANomaly network model to obtain an anomaly threshold score Φ; and inputting the test sample dataset into the test network model of the DDGANomaly network model to obtain a coding loss value A(a), thereby completing the detection. This invention addresses the problems of inaccurate detection results caused by the difficulty in obtaining tire X-ray defect images and the wide variety of tire defects, as well as the poor reconstruction capabilities of existing GANomaly network models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a tire X-ray image defect detection method, in particular to a tire defect detection method based on an improved GANomaly model. Background Art

[0002] According to statistics from the Ministry of Public Security, the number of motor vehicles in China reached 417 million in 2022, including 319 million cars. With the increase in the number of vehicles, the accident rate has also continued to rise. In addition to human factors such as driver fatigue and drunk driving, there are also many accidents caused by tire quality problems. The production of tires with quality problems not only endangers human life and safety but also wastes raw materials and manpower. The raw materials used to produce tires contain non-degradable components and are therefore not conducive to environmental development. Based on the above problems, how to effectively distinguish defective tires from qualified tires has become one of the key issues currently being concerned by researchers.

[0003] The emergence of convolutional networks has eliminated manual labor in tire defect detection, bringing the tire inspection industry towards intelligence. However, convolutional network models also have many problems. For example, convolutional networks are supervised anomaly detection models, which often require a large amount of labeled training data. Tire defects are numerous, and labeling data requires a lot of manpower.

[0004] With the development of deep learning and advancements in computing, unsupervised and semi-supervised learning have been increasingly applied by researchers to the field of anomaly detection. In recent years, GANomaly, as an unsupervised anomaly detection model, has been widely used in this field, particularly for anomaly detection in tire X-ray images. However, in practice, it has been found that the GANomaly network model has limited ability to reconstruct images. Summary of the Invention

[0005] Purpose of the invention:

[0006] The present invention proposes a tire defect detection method based on an improved GANomaly model, which aims to solve the problems of inaccurate detection results caused by the difficulty in obtaining tire X-ray defect images and the wide variety of tire defects, as well as the poor reconstruction ability of the existing GANomaly network model structure itself.

[0007] Technical solution:

[0008] In order to solve the above technical problems, the technical solutions of the present invention are as follows:

[0009] The present invention proposes a tire defect detection method based on the DDGANomaly network model, which comprises the following steps:

[0010] S1: Collect normal tire X-ray images, unify the image size, and establish a model training sample data set; and select the image to be tested, unify the image size, and establish a model test sample data set;

[0011] S2, based on the GANomaly model, adds a local discriminator to build a DDGANomaly network model and introduces the Wasserstein distance loss function;

[0012] S3, the DDGANomaly network model in step S2 is trained using the training sample data set in step S1, the training weight of the model is retained, and the anomaly threshold score Φ is obtained;

[0013] S4, bring the training weights in step S3 into the trained DDGANomaly network model, and input the test sample data set in step S1 into the test network model of the DDGANomaly network model to obtain the coding loss value A(a). If the coding loss value A(a) exceeds the abnormal threshold score Φ, it is judged as abnormal sample data, otherwise it is judged as normal sample data, and the detection is completed.

[0014] Furthermore, the structure of the DDGANomaly network model includes an autoencoder, a reencoder, a global discriminator, and a local discriminator. The autoencoder is composed of an encoder and a decoder. The encoder, decoder, and reencoder are connected in sequence. The encoder and reencoder are both connected to the local discriminator. The decoder is connected to the global discriminator.

[0015] The encoder, decoder and re-encoder connected in sequence constitute the test network model of the DDGANomaly network model.

[0016] Furthermore, the training method of the DDGANomaly network model is as follows: the image x is input to the encoder and the global discriminator respectively, and the encoder is trained through its network structure G E (a) Output low-dimensional vector Z, i.e. Z = G E (x), the low-dimensional vector Z is input to the decoder and the local discriminator respectively, the decoder outputs the reconstructed image x', the reconstructed image x' is input to the re-encoder and the global discriminator respectively, and the re-encoder outputs the potential vector Z' of the reconstructed image x' through its network structure E(G(a)), that is, Z'=G E (x') = E(G(x)); the local discriminator reduces the difference between the low-dimensional vector Z and the latent vector Z' through the Wasserstein distance loss function; the global discriminator reduces the difference between the reconstructed image x' and the image x; and outputs the anomaly threshold score Φ;

[0017] The testing method of the DDGANomaly network model is as follows: the image is input into the encoder, decoder and re-encoder x times, and the encoding loss value A(a) is output.

[0018] Furthermore, the Wasserstein distance loss function includes the local generator loss function and the local discriminator loss function.

[0019] Local generator loss function:

[0020]

[0021] Local discriminator loss function:

[0022]

[0023] Among them, x~P data (x) represents data X randomly drawn from the distribution of real data, ω represents the value of a fixed constant, Z~P Z (Z) represents the noise ZD extracted from the Gaussian distributed random noise W (x) represents the actual output value of the discriminator.

[0024] Beneficial effects:

[0025] Considering that typical supervised learning network models require tire X-ray image defect annotation for model training, this invention takes an unsupervised learning approach and employs an improved GANomaly model. Starting from an existing GAN anomaly detection model, this invention utilizes the basic GANomaly model for improvement, resulting in a dual-discriminator DDGANomaly network model for tire X-ray image detection. A global discriminator is used to improve image reconstruction capabilities, while a local discriminator improves spatial encoding capabilities. Given the complex and diverse types of defects in tire X-ray images, an anomaly threshold score is set based on the image's spatial vectors. Defects exceeding this threshold are considered anomalies, resulting in high detection accuracy for complex defects. The proposed method was validated on both the MvTec dataset and a self-developed tire X-ray image dataset. The improved DDGANomaly model achieved an AUC of 90.6%, a 5.1% improvement over the original GANomaly model. This invention improves detection accuracy and further reduces labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 is a flow chart of the method of the present invention;

[0027] Figure 2 This is a radial tire X-ray image display;

[0028] Figure 3This is an example picture of mesh defects in MvTec;

[0029] Figure 4 It is a display diagram of the training and test data sets;

[0030] Figure 5 It is the DDGANomaly network structure;

[0031] Figure 6 This is a diagram showing the reconstruction effect of the training set on the DDGANomaly model;

[0032] Figure 7 It is a diagram showing the effect of the test set on the test model;

[0033] Figure 8 This is the AUC curve of the test model of the GANomaly model before improvement;

[0034] Figure 9 This is the AUC curve of the test model of the DDGANomaly model;

[0035] Figure 10 Coding loss function curve;

[0036] Figure 11 Reconstruction error loss function curve graph;

[0037] Note in the figure:

[0038] 1. Encoder, 2. Decoder, 3. Re-encoder, 4. Local discriminator, 5. Global discriminator. DETAILED DESCRIPTION

[0039] The present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0040] The present invention is a tire defect detection method based on an improved GANomaly model (DDGANomaly), the specific steps are as follows: Figure 1 As shown:

[0041] S1, collect normal tire X-ray images, unify the image size, and establish a model training sample data set; and select images to be tested, which include images containing bubbles and impurities and normal images, unify the image size, and establish a model test sample data set;

[0042] The best-used tire on the market is the radial tire. This paper takes the X-ray image of the radial tire as an example. The X-ray image of the radial tire has the steel ring, carcass, crown, etc. Figure 2As shown in the figure, after comparing different locations of the radial X-ray image, the radial tire sidewall X-ray image with a relatively simple background image was ultimately selected. However, the collected radial tire X-ray images are typically of high resolution. Directly inputting them into the network model for training may result in slow training and feature loss. For testing, where image size is less critical, the image resolution can be appropriately increased. The training and test sample data are processed uniformly.

[0043] Normal tire X-ray images are collected through X-rays. Normal tire X-ray images are normal X-ray images of defect-free radial tires. They are unified into 128*128 resolution to form a training sample data set. Tire X-ray images with defects (impurities and bubbles) and normal tire X-ray images are collected as a test sample data set. Specifically, the test sample data set includes normal tire X-ray images, tire X-ray images with impurities, and tire X-ray images with bubbles.

[0044] S2, based on the GANomaly model, adds local discriminator 4 to build the DDGANomaly network model and introduces the Wasserstein distance loss function;

[0045] GANomaly is an improved model based on GAN. It primarily employs an encoder-decoder-encoder structure, mapping the input image into a low-dimensional vector through the first encoder. The decoder then reconstructs the low-dimensional vector into an image, and finally, the second encoder generates the latent vector of the reconstructed image. Through model training, the difference between the low-dimensional vector and the latent vector is further narrowed, thereby learning and obtaining the data distribution of the input image. The discriminator uses the larger distance metric obtained from this learned data distribution to infer outliers in this distribution.

[0046] This invention builds upon the existing GANomaly model by introducing a dual-adversarial mechanism, whereby the two discriminators have distinct functions. The local discriminator 4 brings the low-dimensional vector Z generated by the autoencoder 1 of the input image x closer to the latent vector Z' generated by recompressing the reconstructed image. The global discriminator 5 further reduces the reconstruction error between the real image x and the reconstructed image x'. This dual-adversarial mechanism reduces reconstruction error, lowers the anomaly threshold score, and effectively improves the accuracy of the model's anomaly detection.

[0047] (1) Build the DDGANomaly model;

[0048] like Figure 5As shown in the figure, the DDGANomaly model is an improved model based on the GANomaly network model, namely the dual discriminator GANomaly (DDGANomaly) model structure. The DDGANomaly network model structure consists of four parts: an autoencoder, a reencoder 3, a global discriminator 5, and a local discriminator 4. The autoencoder is composed of an encoder 1 and a decoder 2. The encoder 1, decoder 2, and reencoder 3 are connected in sequence. Encoder 1 and reencoder 3 are both connected to the local discriminator 4; decoder 2 is connected to the global discriminator 5. The encoder 1, decoder 2, and reencoder 3 connected in sequence constitute the test network model of the DDGANomaly network model.

[0049] The training method of the DDGANomaly network model is:

[0050] The image x is input to the encoder 1 and the global discriminator 5 respectively. The encoder 1 passes through its network structure G E (a) Output low-dimensional vector Z, i.e. Z = G E (x), the low-dimensional vector Z is input to the decoder 2 and the local discriminator 4 respectively, the decoder 2 outputs the reconstructed image x', the reconstructed image x' is input to the re-encoder 3 and the global discriminator 5 respectively, the re-encoder 3 outputs the potential vector Z' of the reconstructed image x' through its network structure E(G(a)), that is, Z'=G E (x') = E(G(x)); Encoder 1 and Decoder 2 form an autoencoder. This serves as the network's generator. The re-encoder 3 has the same network structure as Encoder 1. The global discriminator network D in the global discriminator 5 primarily distinguishes whether the input image is from image x or the reconstructed image x', and performs adversarial training until the reconstructed image x' is as close to image x as possible. The local discriminator, structurally composed of a decoder and an encoder, inputs the low-dimensional vector Z and the latent vector Z' into the local discriminator, where it undergoes adversarial training until the low-dimensional vector Z and the latent vector Z' are as close as possible.

[0051] The testing method of the DDGANomaly network model is:

[0052] The network model consisting of encoder 1, decoder 2, and re-encoder 3 serves as the test network for the DDGANomay network model. The test sample dataset is sequentially fed into encoder 1, decoder 2, and re-encoder 3. Since normal images are used during training, when an abnormal image is fed, the entire structure attempts to reconstruct the image x as normal. This increases the gap between the low-dimensional vector Z generated by encoder 1 and the latent vector Z' generated by re-encoder 3. If the gap exceeds a certain anomaly threshold score Φ, the image is considered abnormal.

[0053] The autoencoder composed of encoder 1 and decoder 2 is used to reconstruct the input image x'. The reconstructed image x' is as close to the input image x as possible. This part uses the reconstruction error loss, which continuously reduces the difference between the reconstructed image x' and the original image x through the function to the reconstruction error loss function L con Basically remain unchanged, the reconstruction error loss function L con As shown in formula (1).

[0054] L con =||x-x'||1 (1)

[0055] The re-encoder 3 is used to generate the potential vector Z' of the reconstructed image x', and the low-dimensional vector Z generated by the encoder 1 in the autoencoder is subjected to MSELoss loss, L enc Represents the difference between the low-dimensional vector Z of the input image and the potential vector Z' of the reconstructed image. Through this function, the difference between the potential vector Z' and the low-dimensional vector Z is continuously reduced to the encoding loss function L enc Basically remain unchanged, the encoding loss function L enc As shown in formula (2).

[0056] L enc =||Z-Z'||2 (2)

[0057] The addition of the global discriminator 5 further constrains the reconstruction of the image. The autoencoder and re-encoder 3 as a whole serve as a global generator, forming a GAN model with the global discriminator 5, and adopting the original cross entropy loss function. The loss function is shown in formula (3).

[0058]

[0059] Z is random noise that follows a Gaussian distribution; G represents the generator; D represents the discriminator; P data (x) represents the probability distribution of real data; P z (z) represents the probability distribution of random noise; x~P data (x) represents data X, Z~P randomly drawn from the distribution of real data Z (Z) represents noise Z extracted from Gaussian distributed random noise, and D(x) and G(z) both represent the vectors output by the discriminator and generator after receiving the input in the brackets.

[0060] In order to further optimize the global discriminator 5, feature matching loss is added. Feature matching loss L adv As shown in Formula 4. By calculating the feature matching loss L between the input image x and the reconstructed image x' feature representation adv, making x and x' closer, making the reconstructed image x' generated by the global generator more realistic, and further optimizing the discriminator. The objective optimization function of the global generator is shown in Formula 5.

[0061] L adv =||f(x)-f(G(x))||2 (4)

[0062] L=w adv L adv +w enc L enc +w con L con (5)

[0063] Among them, f(x) represents the output of the real image x in a certain intermediate layer of the global discriminator, G(x) represents the reconstructed image x', and f(G(x)) represents the output of the reconstructed image x' in a certain intermediate layer of the global discriminator. adv 、w enc 、w con is the weighting parameter.

[0064] (2) After adding the local discriminator, the loss function of the local discriminator 4 is replaced with the Wasserstein distance loss function. The loss function is shown in formulas (6) and (7);

[0065] The purpose of the local discriminator 4 is mainly to reduce the difference between the low-dimensional vector Z generated by the encoder 1 in the autoencoder of the input image x and the latent vector Z' of the reconstructed image x' generated by the reencoder 3.

[0066] The activation function is removed from the last layer of the local discriminator, and the Wasserstein distance loss function is used. The local discriminator output is required to be the actual output value. The final discriminator layer in a basic GAN model typically uses a sigmoid activation function. To obtain the actual output value of the local discriminator, the sigmoid activation function is removed. Furthermore, a momentum-based optimization algorithm is used. The Adam optimization algorithm used in RMSProp may cause training instability, so the RMSProp optimization algorithm is used. The parameter range is then controlled, and after each update of the discriminator parameters are mapped within a fixed constant w. Finally, the loss function is replaced with the Wasserstein distance loss function. The actual difference between the real image and the generator image is input to the local discriminator, replacing the BCELoss loss with the actual difference between the two outputs. For local discriminator optimization, the larger the difference, the better. For local generator optimization, the local generator expects the local discriminator to produce the largest actual output value for the generated image, which is used to update and optimize the local generator.

[0067] The Wasserstein distance loss function includes the local generator (re-encoder 3) loss function mGin and the local discriminator 4 loss function L(D):

[0068] Local generator (re-encoder 3) loss function:

[0069]

[0070] Local Discriminator (4) loss function:

[0071]

[0072] Among them, x~P data (x) represents data X randomly drawn from the distribution of real data, ω represents the value of a fixed constant, Z~P Z (Z) represents the noise ZD extracted from the Gaussian distributed random noise W (x) represents the actual output value of the discriminator.

[0073] The target loss function of the local discriminator and the local generator uses the Wasserstein distance loss function to avoid problems such as mode collapse.

[0074] After adding local discriminator 4, the training method of global discriminator 5 and local discriminator 4 of the model is improved, and the global discriminator 5 is trained first and the local discriminator 4 is trained later.

[0075] The optimization goal of the DDGANomaly network model in this invention is to solve the problem of the discriminator and the generator confronting each other. The difference from the basic GANomaly model is that there are two confrontation processes in DDGANomaly:

[0076] (1) The global generator composed of the autoencoder composed of the encoder 1 and the decoder 2 and the reencoder 3 competes with the global discriminator 5 to minimize the difference between the input real image and the reconstructed image.

[0077] (2) The local discriminator 4 competes with the generator composed of the re-encoder 3 to make the difference between the low-dimensional vector generated by the encoder 1 in the autoencoder and the latent vector generated by the re-encoder 3 as small as possible.

[0078] S3: The DDGANomaly network model in step S2 is trained using the training sample data set in step S1 until the global discriminator 5 cannot recognize the image x and the reconstructed image x'; the local discriminator 4 cannot recognize the low-dimensional vector Z and the latent vector Z'. The training weights of the model are retained, and the anomaly threshold score Φ is obtained.

[0079] The re-encoder 3 and the local discriminator 4 form a local GAN ​​network, with the re-encoder 3 serving as a local generator. The encoding loss is further reduced, and the anomaly threshold score Φ is lowered. The encoding loss value A(a) is obtained by formula (8). The encoding loss value A(a) output by the DDGANomaly network model training is recorded as the anomaly threshold score Φ.

[0080] A(a)=||G E (a)-E(G(a))||1 (8)

[0081] Where a represents the input real image x, G(a) is the reconstructed image x'. E (a) The output value of the real image x after encoder 1, E(G(a)) represents the output value of the reconstructed image x' after re-encoder 3.

[0082] The global discriminator 5 is trained to be unable to recognize the image x and the reconstructed image x'; the local discriminator 4 is unable to recognize the low-dimensional vector Z and the potential vector Z', that is, the reconstruction error loss function L con And the encoding loss function L enc After training, the global discriminator 5 cannot distinguish whether the input is the reconstructed image x' generated by the global generator or the real image x, and the local discriminator cannot distinguish whether the input is the low-dimensional vector Z generated by the encoder 1 in the autoencoder or the latent vector Z' generated by the reconstructed image after the reencoder.

[0083] S4, bring the training weights in step S3 into the trained DDGANomaly network model, and input the test sample data set in step S1 into the test network model of the DDGANomaly network model to obtain the coding loss value A(a). If the coding loss value A(a) exceeds the abnormal threshold score Φ, it is judged as abnormal sample data, otherwise it is judged as normal sample data, and the detection is completed.

[0084] During the testing phase, the trained test network model consisting of encoder 1, decoder 2, and re-encoder 3 is used to test the sample data to be tested. During the training phase of the model, all normal sample data is selected. Therefore, the trained model has a strong reconstruction ability for normal sample data, but a poor reconstruction ability for abnormal sample data. The sample data to be tested is input into the test structure, and the encoding loss value A(a) is compared with the trained anomaly threshold score Φ. As shown in formula (6), if the encoding loss value A(a) exceeds the anomaly threshold score Φ, it is judged as an abnormal sample data; otherwise, it is judged as normal sample data.

[0085] Example 1 Dataset and related parameter settings

[0086] This embodiment prepares two datasets, namely the MvTec dataset and a self-made tire X-ray image dataset.

[0087] (1) MvTec dataset

[0088] The MvTec dataset contains 15 different types of defects, of which 3629 images are used for training and verification, 1725 images are used for testing, and only normal images are used for training. The test set contains 73 different defects, such as surface defects, structural defects, or defects due to the lack of certain components of the object. The size of all images is between 700x700 and 1024x1024, and the grid, zipper, and screw images are grayscale single-channel images. The dataset provides pixel-level annotation areas for all defect areas, covering a total of nearly 1900 annotation areas. For example, take a partial picture of the grid Figure 3 shown.

[0089] (2) Self-made tire X-ray image dataset

[0090] 1) Training Dataset

[0091] The training dataset consists of 13,200 X-ray images of tires without defects. Specifically, radial tire X-ray images were selected, and after comparing X-ray images of different positions of the tire, the X-ray images of the radial sidewall with relatively simple structure and background were selected, such as Figure 4 As shown in a).

[0092] 2) Test Dataset

[0093] like Figure 4 As shown in (b), normal tire X-ray images are collected by X-ray. Normal tire X-ray images are normal, defect-free radial tire X-ray images. These images are unified into 128*128 resolution to form a training sample dataset and numbered. A total of 13,200 normal radial tire X-ray images are obtained. Tire X-ray images containing defects (impurities and bubbles) are collected and unified into 1024*1024 resolution. Together with the normal tire X-ray images, they form a test sample dataset. In this embodiment, the test set includes normal tire X-ray images, tire X-ray images containing impurities, and tire X-ray images containing bubbles, each with 500 images, for a total of 1,500 images. To more intuitively demonstrate the comparative effect of the detection, the defects in the tire X-ray images are annotated using Labelme software. This is used for comparison of the detection situation during testing and does not participate in the training and testing of the network model.

[0094] (3) Parameter setting and preservation of model training weights

[0095] Considering the computer capacity and video memory, the training batch size of this network is 132, the learning rate lr is 0.0001, b1 is 0.5, b2 is 0.999, the latent variable dimension Z is 100, and the number of epochs is 100. The pre-trained weights of the model are retained after 100 epochs. The trained images are as follows: Figure 6 As shown in the figure, we selected the global generator from the improved GANomaly model to build an encoder-decoder-encoder test network model. We also set the following training parameters: batch size = 1, learning rate lr = 0.0001, iteration number epoch = 1, b1 = 0.5, b2 = 0.999, and latent variable dimension Z = 100. The data used was the same as that used for training. We then input the prepared tire X-ray defect image to complete the detection.

[0096] (4) Experimental platform configuration:

[0097] The computer hardware configuration is Intelr-i5, Nvidia GTX1050GP U, and 12G memory. The programming environment uses the Windows operating system, Python 3.6, and PyTorch deep neural network development tools.

[0098] Example 2 Model Performance Evaluation

[0099] The reconstruction effect of the test image is shown in the figure Figure 7 As shown. Looking at the reconstruction effect of the image alone may lead to subjective judgment problems. To address this, the evaluation method of the model performance in this experiment adopts the Receiver Operating Characteristic (ROC) curve, that is, the ROC curve is introduced. The horizontal axis of the ROC curve represents the negative positive rate, which indicates the proportion of abnormal data that are actually all abnormal data that are incorrectly judged as normal. The vertical axis represents the positive positive rate, which indicates the proportion of normal data that are actually all normal data that are correctly judged as normal. The closer the ROC curve is to the upper left corner of the coordinate axis, the better the detection effect. The area enclosed by the ROC curve and the horizontal axis represents the AUC value. The larger the value, the better the detection effect. A single ROC curve lacks singularity in verifying the experimental results. Using AUC can better verify the experimental results.

[0100] The ROC curve and AUC values ​​of the original GANomaly model and the improved GANomaly model are as follows: Figure 8 and Figure 9 As shown in Figures 8 and 9, the improved GANomaly model has an anomaly detection accuracy of 90.6%, which is 5.1% higher than the detection accuracy of the original GANomaly.

[0101] Example 3: Validity comparison based on the MvTec dataset

[0102] In order to demonstrate the effectiveness of the proposed method on the MvTec dataset, an advanced unsupervised anomaly detection model is selected for comparative experiments. The experimental results are shown in Table 1.

[0103] Table 1 Comparison of AUC experimental results of MvTec dataset

[0104]

[0105] As shown in Table 1, DDGANomaly achieves a mean AUC of 0.71 for 15 different defect types in the MvTec dataset, an improvement of 0.049 over the mean AUC of the original GANomaly model. The mean AUCs of the other three anomaly detection models—Autocoder, AnoGAN, and f-AnoGAN—are 0.150, 0.190, and 0.111 higher, respectively. Experiments demonstrate the effectiveness of this approach. Comparing the AUCs of different models for the same defect type, the Autoencoder model's AUCs for capsule, carpet, leather, and metal nut are slightly higher than those of the improved model. The AUCs of the AnoGAN model for leather and tile, the f-AnoGAN model for leather, tile, and wood, and the GANomaly model for leather and screw are also slightly higher than those of the improved DDGANomaly model. However, the AUCs for all other defect types for these different models are lower than those of the improved DDGANomaly model. Experimental results show that the improved model DDGANomaly has strong universality for anomaly detection.

[0106] Example 4: Comparison test based on tire X-ray image dataset

[0107] 1) Training loss

[0108] The encoding loss function and reconstruction error loss function of the original GANomaly model and the improved model DDGANomaly are respectively as follows: Figure 10 and Figure 11 shown.

[0109] Depend on Figure 10 From the encoder loss function curve, we can see that the convergence value of the encoding loss of the GANomaly model is 0.0245, and the convergence value of the DDGANomaly model is 0.0234. The encoder loss has dropped by 0.0011, which reduces the abnormal threshold score. Figure 11From the reconstruction error loss function curve of the training, we can see that the convergence value of the reconstruction error loss of GANomaly is 0.0366, and the convergence value of DDGANomaly is 0.0354. The reconstruction error loss has decreased by 0.0012, which enhances the reconstruction ability of the model.

[0110] 2) Test results

[0111] The recognition results of various defects of the proposed method on the self-made tire X-ray image dataset are shown in Table 2.

[0112] Table 2 Comparison of tire X-ray image AUC value experimental results

[0113]

[0114] Table 2 shows that, under the same experimental conditions, the DDGANomaly model achieved an AUC of 0.906, a 0.051 improvement over the original GANomaly model, demonstrating a significant improvement in accuracy. The AUC values ​​of the Autoencoder model increased by 0.309, the AnoGAN model by 0.196, and the f-AnoGAN model by 0.302. Experiments demonstrate that the improved DDGANomaly model effectively improves defect detection accuracy.

[0115] 3) Ablation experimental study

[0116] To verify the effectiveness of adding a local discriminator and introducing the Wasserstein distance loss function to the GANomaly model proposed in this paper, an ablation experiment was conducted to evaluate the impact of different modules on the performance of the proposed model under the same experimental conditions. The ablation experiment selected GANomaly as the baseline model and was conducted on the processed tire X-ray image dataset. The relevant experimental parameters were consistent with those mentioned above. The experimental results are shown in Table 3.

[0117] Table 3 Ablation experiment data

[0118]

[0119] Table 3 shows the ablation experiment data. The background of tire X-ray images is complex. Adding a local discriminator improves the model's reconstruction capability and significantly increases detection accuracy by 4%. Furthermore, introducing the Wasserstein distance loss function increases detection accuracy by 1.1%, a slight improvement. This demonstrates the effectiveness of these improvements.

[0120] The DDGANomaly model proposed in this paper adds a local discriminator to the original GANomaly model, forming a dual-discriminator mechanism. This effectively addresses the model's poor image reconstruction capabilities due to the presence of the autoencoder and the excessively high anomaly threshold score in the original GANomaly model. Experimental verification demonstrates that the improved DDGANomaly model can improve anomaly detection accuracy.

Claims

1. A tire defect detection method based on the DDGANomaly network model, characterized by: The steps are: S1: Collect normal tire X-ray images, unify the image size, and establish a model training sample data set; and select the image to be tested, unify the image size, and establish a model test sample data set; S2, based on the GANomaly model, adds a local discriminator (4) to build a DDGANomaly network model and introduces the Wasserstein distance loss function; S3, the DDGANomaly network model in step S2 is trained using the training sample data set in step S1, the training weight of the model is retained, and the anomaly threshold score Φ is obtained; S4: Bring the training weights in step S3 into the trained DDGANomaly network model, and input the test sample data set in step S1 into the test network model of the DDGANomaly network model to obtain the coding loss value A(a). If the coding loss value A(a) exceeds the abnormality threshold score Φ, it is judged as abnormal sample data; otherwise, it is judged as normal sample data, and the detection is completed; The structure of the DDGANomaly network model includes an autoencoder, a re-encoder (3), a global discriminator (5) and a local discriminator (4). The autoencoder is composed of an encoder (1) and a decoder (2). The encoder (1), the decoder (2) and the re-encoder (3) are connected in sequence. The encoder (1) and the re-encoder (3) are both connected to the local discriminator (4). The decoder (2) is connected to the global discriminator (5). The encoder (1), decoder (2) and re-encoder (3) connected in sequence constitute the test network model of the DDGANomaly network model.

2. The tire defect detection method based on the DDGANomaly network model according to claim 1, characterized in that: The training method of the DDGANomaly network model is as follows: the image x is input to the encoder (1) and the global discriminator (5) respectively, and the encoder (1) is trained through its network structure G E (a) Output low-dimensional vector Z, i.e. Z = G E (x), the low-dimensional vector Z is input to the decoder (2) and the local discriminator (4), the decoder (2) outputs the reconstructed image x', the reconstructed image x' is input to the re-encoder (3) and the global discriminator (5), the re-encoder (3) outputs the potential vector Z' of the reconstructed image x' through its network structure E(G(a)), that is, Z'=G E (x') = E(G(x)); the local discriminator (4) reduces the difference between the low-dimensional vector Z and the latent vector Z' through the Wasserstein distance loss function; the global discriminator (5) reduces the difference between the reconstructed image x' and the image x; and outputs an anomaly threshold score Φ; The testing method of the DDGANomaly network model is as follows: the image is input x times into the encoder (1), decoder (2) and re-encoder (3), and the encoding loss value A(a) is output.

3. The tire defect detection method based on the DDGANomaly network model according to claim 2, characterized in that: The Wasserstein distance loss function includes the local generator loss function and the local discriminator (4) loss function, Local generator loss function: Local Discriminator (4) loss function: Among them, x~P data (x) represents data X randomly drawn from the distribution of real data, ω represents the value of a fixed constant, Z~P Z (Z) represents the noise ZD extracted from the Gaussian distributed random noise W (x) represents the actual output value of the discriminator.