Tire defect detection method based on improved auto-encoder structure
By introducing NAM attention mechanism, flow alignment module and PatchGAN network in tire defect detection, the shortcomings of the autoencoder in feature extraction and discrimination are solved, and the accuracy and accuracy of tire defect detection are significantly improved.
Patent Information
- Application Number
- CN202411306034.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-07
AI Technical Summary
In the existing tire defect detection method, the autoencoder loses information due to downsampling operations during feature extraction, and introduces position errors during upsampling, resulting in the reconstruction image not being realistic enough. The discriminator only focuses on the overall effect and cannot effectively distinguish local areas. Details affect the defect detection effect.
Adopting an improved autoencoder structure, the NAM attention mechanism and flow alignment module are introduced, combined with the PatchGAN network, the feature extraction, reconstruction and discrimination capabilities are enhanced, and the accuracy of tire defect detection is improved through the AFPGAN model.
It effectively reduces information loss during feature extraction, enhances reconstruction performance and discrimination ability, improves the accuracy and accuracy of tire defect detection, and significantly improves the detection ability of local defects.
Smart Images

Figure CN119273639A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of energy utilization technology, and in particular to a tire defect detection method based on an improved autoencoder structure. Background Art
[0002] In today's automotive industry, radial tires have become the mainstream tire type, and are popular among consumers for their excellent handling performance and ride comfort. However, radial tires may have a variety of defects during the production process, such as bubbles, cracks, impurities, etc. If these defects are not discovered and handled in time, they may cause serious safety problems during use.
[0003] With the development of deep learning, unsupervised methods have shown significant advantages in the field of anomaly detection. They do not need to rely on a large number of labeled defective tire images for training like supervised methods, nor do they need to rely on predefined defect types. Instead, they can identify and define defects based on the intrinsic structure and distribution of the data. These advantages make unsupervised learning methods widely applicable in practical application scenarios. Generative adversarial network (GAN), as a key unsupervised learning technology, has been widely used in the field of anomaly detection. Its core idea is to use the difference between the generated reconstructed data and the original input data to determine whether there is a defect. AnoGAN pioneered the use of GAN for anomaly detection and applied GAN for the first time. The AnoGAN algorithm has two stages. First, a standard GAN network is trained using normal data, and in the second step, the test sample is mapped to the latent space through an iterative method to obtain the corresponding latent code. Using this latent code, the trained GAN can then reconstruct the corresponding sample, and the difference measure between the input sample and the reconstructed sample is regarded as the criterion for anomaly scoring.
[0004] At present, the generator in the generative adversarial network mainly adopts the model architecture based on the auto encoder. In the process of feature extraction, the downsampling operation of the encoder in the auto encoder will cause some important information to be lost, and the upsampling process will introduce position errors, resulting in the inability to accurately align feature maps at different levels in the spatial dimension, which in turn causes the reconstructed image to be unrealistic. The original discriminator only focuses on the overall effect of the image, but cannot judge the quality of local details well. This will cause some local defects to be undetectable, affecting the defect detection effect.
[0005] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention
[0006] In view of the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a tire defect detection method based on an improved autoencoder structure, aiming to solve the problem that the discriminator in the prior art only focuses on the overall effect of the image but cannot well judge the quality of local details, resulting in some local defects cannot be discovered, affecting the defect detection effect.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] In a first aspect, a tire defect detection method based on an improved autoencoder structure comprises:
[0009] S1. Collect normal tire X-ray images, unify the image size, and establish a model training sample data set; select the image to be tested, unify the image size, and establish a model test sample data set; in the training stage, the encoder in the autoencoder is responsible for downsampling operations, extracting high-order features of the image, and mapping them into latent space vectors; then the decoder performs upsampling operations to reconstruct the latent space vector into an image; then, the second encoder is used to obtain the latent vector of the reconstructed image; through model training, the difference between the low-dimensional vector and the latent vector is further reduced, so as to learn and capture the data distribution of the input image; the role of the discriminator in this model is to improve the authenticity of the image generated by the model during the training process;
[0010] S2. Based on the GANomaly model, the NAM attention mechanism is introduced after each convolutional layer of the encoder part, the stream alignment module is integrated into the decoder part, and the local discriminator Patchgan replaces the original global discriminator;
[0011] S3: The AFPGAN network model in step S2 is trained using the training sample data set in step S1, retaining the training weights of the model and deriving the abnormal threshold score.
[0012] S4, bring the training weights in step S3 into the trained AFPGAN network model, and input the test sample data set in step S1 into the test network model of the AFPGAN network model. In the test phase, a trained autoencoder-encoder structure model is used. This model only uses normal images during the training process, so when the model encounters abnormal images, the model will try to reconstruct the input image into a normal image. This reconstruction process causes the difference between the low-dimensional feature representation generated by the encoder in the autoencoder and the potential representation generated by the second encoder to increase. When this difference exceeds the set anomaly detection threshold, the image will be identified as abnormal and the detection is completed.
[0013] Furthermore, the NAM attention mechanism is introduced after each convolutional layer of the encoder part based on the GANomaly model, including:
[0014] NAM adopts the module integration method of CBAM. The model consists of attention channels and spatial attention mechanisms. In the design framework of the channel attention submodule, the scaling factor defined by Batch Normalization is integrated. This factor can reflect the degree of channel change. Its specific expression is shown in formula (1), emphasizing the most important channels:
[0015]
[0016] In this formula, μ β As the mean of the mini-batch B, σ β As its standard deviation, γ and β are trainable affine transformation parameters, which are used to adjust the scale and offset respectively, where ε is a very small number to avoid zero division errors;
[0017] As shown in formula (2), the channel attention module defines the output feature M C Use the scaling factor γ to adjust each channel, where F1 is the input feature map and the specific weight W y See formula (3); the concept of weight in formula (3) is introduced; when evaluating the importance of pixels, the scaling factor of BN is applied to the spatial dimension, and this process is defined as pixel normalization; formula (4) details the spatial attention module and its output M S F2 is the input feature map, λ is the scaling factor, and the weights are shown in formula (5).
[0018] M C =sigmoid(W γ (BN(F1)))(2)
[0019]
[0020] M S =sigmoid(W λ (BN S (F2)))(4)
[0021]
[0022] Further, the step of integrating the stream alignment module into the decoder part includes:
[0023] In the decoder part, a stream alignment module is introduced to generate new feature maps from the low-resolution feature maps and high-resolution feature maps in the decoder through the stream alignment module, and then these feature maps are fused;
[0024] Given two feature maps of different resolutions and Using the flow alignment module, we transform F L The resolution is adjusted to the same level as F by upsampling. L-1 Same; Next, adjust the F L Feature Map and F L-1 The feature maps are merged and further processed by a convolution layer with two convolution kernels of size 3×3; a semantic flow field can be generated. The output of the flow alignment module is the predicted value of the semantic flow field; its mathematical process is shown in formula (6):
[0025] Δ L-1 =conv L (cat(F L ,F L-1 ))(6)
[0026] Where cat(·) represents the Concat concatenation operation, and convl(·) is a 3×3 convolutional layer;
[0027] Spatial grid Ω in semantic flow field L-1 Any point P in L-1 , can be mapped to the corresponding upsampling position P through a simple addition operation L ; Apply formula (7) to halve the data to correct the resolution difference between the feature map and the flow field; then, with the help of the differential bilinear sampling strategy mentioned in the spatial transformer network STN, sample the four surrounding points of PL and merge them through linear interpolation to accurately calculate the final semantic flow field mapping; the mathematical process is shown in formula (8);
[0028]
[0029] Where N (PL) Indicates F L Middle twist point P L Neighborhood, ω P Represents the bilinear kernel weights for the distance estimate through the warped grid.
[0030] Furthermore, replacing the original global discriminator with the local discriminator Patchgan includes:
[0031] The PatchGAN network is introduced to replace the original global discriminator; it can capture the local texture details in the image more finely and improve the ability to discriminate generated images; the PatchGAN model maps the input to an N×N matrix, where each element in the matrix represents a specific image block; by calculating the average value of each receptive field, the possibility that the final image is a real image can be obtained.
[0032] The technical solution adopted by the present invention has the following beneficial effects:
[0033] The AFPGAN model proposed in this application is based on the GANormaly model. On this basis, the NAM attention mechanism is introduced in the encoder part to enhance the model's feature extraction capability. The stream alignment module FAM is introduced in the decoder part to enhance the model's reconstruction capability. PatchGan is used to replace the original global discriminator to enhance the discriminator's identification ability. After the model is built, the model is trained and tested using a laboratory-made dataset. Through a series of related experiments, the effectiveness of AFPGAN in improving the accuracy of tire defect detection is verified. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is the channel attention module;
[0035] Figure 2 is the spatial attention module;
[0036] Figure 3 Align module for streams;
[0037] Figure 4 For the distortion process;
[0038] Figure 5 It is the PatchGAN network structure;
[0039] Figure 6 It is the AFPGAN network model;
[0040] Figure 7 It is a tire X-ray defect-free image;
[0041] Figure 8 It is the tire X-ray defect image;
[0042] Fig. 9 This is a comparison chart of ROC curves;
[0043] Fig.10 To reconstruct the loss function curve graph;
[0044] Fig.11 It is the coding loss function curve. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0046] It should be noted that when a component is referred to as being "fixed to" or "disposed on" another component, it can be directly on the other component or indirectly on the other component. When a component is referred to as being "connected to" another component, it can be directly connected to the other component or indirectly connected to the other component.
[0047] It should also be noted that the same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the drawings, it is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limitations on this patent. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0048] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0049] 1.1 NAM Attention Mechanism
[0050] The encoder uses downsampling in the feature extraction process to reduce the size of the feature map, thereby extracting higher-level and more abstract features while reducing the amount of calculation and the number of parameters. However, information loss may occur in this process. This will cause some important information to be missing in the model feature extraction process, thus affecting the performance of the model. This application reduces the impact of the above problems on the model by introducing an attention mechanism.
[0051] In recent years, attention mechanisms have attracted widespread attention in the field of deep learning because they can help neural networks focus on the most critical information while suppressing minor details. Although many early studies have demonstrated the effectiveness of capturing salient features through attention mechanisms, the potential role of weight allocation in suppressing insignificant channels has been ignored. Therefore, the NAM attention mechanism selected in this application cleverly incorporates the scaling factor of batch normalization into its weight calculation process in order to optimize the performance of the channel attention submodule. Through this design, NAM can assign more weights to those channels with more importance, so that the network can be more focused on refining and strengthening key features. In addition, compared with traditional attention mechanisms such as SE, BAM and CBAM, a major advantage of NAM is that it abandons the fully connected layers and convolutional layers that occupy a lot of computing resources.
[0052] NAM adopts the module integration method of CBAM. The model consists of an attention channel (Channel AttetionModule) and a spatial attention mechanism (Spirit Attetion Module). For these two sub-modules, an innovative design concept is proposed so that they can be flexibly deployed after the convolutional block of the network. Within the design framework of the channel attention sub-module, the scaling factor defined by Batch Normalization is integrated. This factor can reflect the degree of channel change. Its specific expression is shown in formula (1), emphasizing the most important channels.
[0053]
[0054] In this formula, μ β As the mean of the mini-batch B, σ β As its standard deviation, γ and β are used as trainable affine transformation parameters for adjusting the scale and offset respectively. Among them, ε is a very small number used to avoid division by zero errors.
[0055] like Figure 1 The channel attention module shown in the corresponding formula (2) defines the output feature M C Use the scaling factor γ to adjust each channel, where F1 is the input feature map and the specific weight W Y See formula (3). The concept of weight in formula (3) is introduced. When evaluating the importance of pixels, the scaling factor of BN is applied to the spatial dimension. This process is defined as pixel normalization. Figure 2 and formula (4) detail the spatial attention module and its output M S F2 is the input feature map, λ is the scaling factor, and the weights are shown in formula (5).
[0056] M C =sigmoid(Wγ (BN(F1)))(2)
[0057]
[0058] M S =sigmoid(W λ (BN S (F2)))(4)
[0059]
[0060] In summary, the introduction of the NAM attention mechanism in the encoder part not only enhances the model's feature extraction capability and efficiently extracts useful information, but also reduces over-learning on irrelevant features and reduces the risk of overfitting.
[0061] 1.2 Stream Alignment Module
[0062] During the feature extraction process, downsampling will cause the position information in the feature map to be lost, and multiple adjacent pixels will be mapped to the same larger pixel position. When upsampling, the lost position information cannot be accurately restored, which may cause spatial mismatch in the feature map.
[0063] Therefore, this application introduces a stream alignment module in the decoder part, generates new feature maps through the stream alignment module for the low-resolution feature maps and high-resolution feature maps in the decoder, and then fuses these feature maps. In this way, each feature point on the low-resolution feature map can be accurately mapped to the corresponding position on the high-resolution feature map, thereby solving the alignment problem between feature maps of different levels. This method can ensure accurate alignment of information while making full use of features between different levels, and can effectively improve the reconstruction performance of the model.
[0064] Given two feature maps of different resolutions and Using the flow alignment module, we transform F L The resolution is adjusted to the same level as F by upsampling. L-1 Next, adjust the F L Feature Map and F L-1 The feature maps are merged and further processed by a convolution layer with two convolution kernels of size 3×3. A semantic flow field can be generated. The output of the flow alignment module is the predicted value of the semantic flow field. The mathematical process is shown in formula (6):
[0065] Δ L-1 =conv L (cat(F L ,FL-1 ))(6)
[0066] Where cat(·) represents the Concat concatenation operation, and convl(·) is a 3×3 convolutional layer. The stream alignment module is as follows Figure 3 shown.
[0067] Spatial grid Ω in semantic flow field L-1 Any point P in L-1 , can be mapped to the corresponding upsampling position P through a simple addition operation L By observing Figure 4 , it can be seen that the feature map and the flow field show different resolutions. Therefore, the method described in formula (7) is used to halve it to correct this difference. Then, with the help of the differential bilinear sampling strategy mentioned in the spatial transformer network STN, for P L The four surrounding points (i.e., upper left, upper right, lower left, and lower right) of are sampled and merged through linear interpolation in order to accurately calculate the final semantic flow field mapping. The mathematical process is shown in formula (8).
[0068]
[0069] in Indicates F L Middle twist point P L Neighborhood, ω P represents the bilinear kernel weights of the distance estimate through the warped grid. This process is somewhat similar to the deformable kernel operation of the Deformable Convolutional Network (DCN). Despite the similarities, this method differs from the DCN in several aspects. First, FAM integrates high-level and low-level features by predicting the offset field so that the two can be aligned in position. DCN, on the other hand, adjusts the position of the kernel according to the predicted position offset to adaptively adjust the size of its receptive field. Second, the flow alignment module aims to accurately align features at different levels, while the core function of DCN is more inclined to identify and focus on the salient parts of the target object, which can be regarded as an attention mechanism.
[0070] 1.3 PatchGAN Network
[0071] The function of the discriminator is to identify the difference between the image reconstructed by the generator and the real image, and determine whether the image is forged. The traditional global discriminator network outputs a single scalar value that reflects the possibility of the input image being considered a real image, and uses this to evaluate the authenticity of the entire image. However, this method has shortcomings: the single scalar value it outputs is a global evaluation of the entire image, and cannot reflect the characteristics of each local area in detail.
[0072] In order to solve this problem, the PatchGAN network is introduced to replace the original global discriminator. It can capture the local texture details in the image more finely and improve the ability to discriminate generated images. The PatchGAN model maps the input to an N×N matrix, where each element in the matrix represents a specific image block. By calculating the average value of each receptive field, the possibility that the final image is a real image can be obtained. This can give the discriminator a more fine-grained discrimination ability, and can better capture the local differences between the generated image and the real image, thereby improving the accuracy of defect detection; the PatchGAN network structure diagram is shown in the figure. Figure 5 shown.
[0073] 1.4 Overall network framework
[0074] The model architecture of AFPGAN is detailed in Figure 6 , this application proposes an innovative strategy of embedding NAM and technologically advanced FAM into the encoder and decoder respectively. The introduction of NAM in the encoder significantly improves the performance of the model in feature extraction, while FAM in the decoder improves the problem of misalignment of features at different levels of the decoder in upsampling tasks. In addition, the use of PatchGAN to replace the previous discriminator further optimizes the image generation quality of the model, which also indirectly improves the performance of the model in defect diagnosis tasks.
[0075] During the training phase, the encoder in the autoencoder is responsible for downsampling operations, extracting high-order features of the image and mapping them into latent space vectors. The decoder then performs upsampling operations to reconstruct the latent space vectors into images. Next, a second encoder is used to obtain the latent vector of the reconstructed image. Through model training, the difference between the low-dimensional vector and the latent vector is further reduced, thereby learning and capturing the data distribution of the input image. The role of the discriminator in this model is to improve the authenticity of the images generated by the model during the training process.
[0076] During the testing phase, a model with a trained autoencoder-encoder structure was used. This model was trained using only normal images, so when the model encounters an abnormal image, it attempts to reconstruct the input image into a normal image. This reconstruction process results in an increase in the difference between the low-dimensional feature representation generated by the encoder in the autoencoder and the latent representation generated by the second encoder. When this difference exceeds the set anomaly detection threshold, the image is identified as an anomaly.
[0077] 1.5 Loss Function
[0078] 1.5.1 Generator Loss Function
[0079] The loss function of the generator includes three, namely, adversarial loss L adv , reconstruction error loss Lcon and the coding loss L enc .
[0080] The specific formula is as follows:
[0081] 1. Fighting Losses
[0082] The original intention of the adversarial loss is to make the samples generated by the generator deceive the discriminator, even if the generated samples are as close to the real samples as possible. The calculation process of the adversarial loss has been explained in formula (9). Where D(x) is the output of the discriminator on the real data sample x, D(G(x)) is the output of the discriminator on the generated data sample G(x), and ||·||2 represents the L2 norm.
[0083] L adv =||D(x)-D(G(x)||2 (9)
[0084] 2. Reconstruction Loss
[0085] By calculating the L1 distance between the input image and the reconstructed image, the reconstructed image is made as close to the input image as possible. The reconstruction loss function is shown in formula (10). In the formula, x represents the data of the original input image, G(x) represents the data of the reconstructed image, and ||·||1 represents the L1 norm.
[0086] L con =E x~px ||xG(x)||1 (10)
[0087] 3. Coding loss
[0088] The above two loss functions can make the reconstructed image as realistic as possible. The coding loss is introduced to minimize the distance between the coding feature z of the input image and the coding feature z′ of the reconstructed image. The coding loss function is shown in formula (11). ||·||2 represents the L2 norm.
[0089] L enc =||ZZ′||2(11)
[0090] 4. The total loss function of the generator: where ω adv ,ω con ,ω enc are the weight parameters corresponding to the three loss functions.
[0091] L=ω adv L adv +ω con L con +ω enc L enc (12)
[0092] 1.5.2 Discriminator Loss Function
[0093] PatchGAN divides the input image into N non-overlapping sub-blocks, and then independently distinguishes the authenticity of each sub-block. The corresponding loss function is given in formula (13). Where D represents the discriminator, E represents the encoder, G represents the generator, and x is the real data sample.
[0094] L dis =E x~px [log(D(x))]+E x~px [1-log(D(G(x)))] (13)
[0095] 2. Experiment
[0096] 2.1 Experimental Dataset
[0097] (1) Training Dataset
[0098] In order for the model to learn enough features, this application uses 8340 tire X-ray defect-free images at different positions as the training data set. Figure 7 shown.
[0099] (2) Test Dataset
[0100] The test data set consists of defect-free images and defective images. There are 1900 defect-free images and 1900 defective images. The specific types and quantities are shown in Table 1 and Figure 8 shown.
[0101] Table 1Defect type and quantity
[0102]
[0103]
[0104] 2.2 Experimental platform configuration
[0105] The development platform configuration of this experiment is Python 3.9 and Pytorch 1.12.1, deep convolutional neural network development tools. The computer hardware configuration is Intel (R) Xeon (R) Platinum 8260C, NVIDIA GeForce RTX3090 GPU, 86G memory. The programming environment is Ubuntu 20.04 operating system.
[0106] 2.3 Experimental related parameters
[0107] The specific parameters of the AFPGAN model are shown in Table 2.
[0108] Table 2 Parameter settings
[0109]
[0110] 2.4 Experimental Results Analysis
[0111] In this experiment, the receiver operating characteristic (ROC) curve was used to evaluate the model performance. The ROC curve is a tool for evaluating binary classification systems. It is used to visualize and compare the relationship between the true positive rate (TPR) and the false positive rate (FPR) of the classifier under different threshold settings, so as to reflect the overall performance of the classifier. In order to further quantify the performance of the model, the area under the curve (AUC) is calculated. The ROC comparison of the basic model GANomaly and the improved model AFPGAN is shown in Figure 2. Fig. 9 shown.
[0112] The correlation and comparison of the reconstruction loss function and encoding loss function of the basic model GANomaly and the improved model AFPGAN have been shown in Fig.10 and Fig.11 in Fig.10 From the results shown, we can see that the reconstruction loss curve of the GANomaly model has gradually stabilized during the training process, and the final convergence value is 0.0589. Under the same training conditions, the reconstruction loss function curve of the improved model AFPGAN shows a faster convergence trend, and the final convergence value is only 0.0194. In contrast, the reconstruction loss of AFPGAN has been reduced by 0.0395, which shows that AFPGAN has been significantly improved in reconstruction ability. Fig.11 It can be seen from the training process that the encoding loss function curve of GANomaly gradually converges to 0.0396. The improved model AFPGAN finally converges to 0.0023. In contrast, the encoding loss of AFPGAN is reduced by 0.0373. This result shows that AFPGAN not only reduces the key information loss of the model in the downsampling process during feature extraction, but also improves the distinction between abnormal data and normal data. This improves the anomaly detection ability of the model.
[0113] 2.5 Comparative Experiment
[0114] In order to fully demonstrate the superiority of the AFPGAN model compared to other models, the same dataset was used to train and test GANomaly, F-AnoGAN, AnoGAN, and Skip-GANomaly. The specific results are shown in Table 3.
[0115] Table 3 Comparison of experimental results of different models
[0116]
[0117]
[0118] AUC is a statistical indicator used to measure the performance of a classifier. Its value is between 0 and 1. The higher the value, the stronger the model's ability to distinguish, that is, it can better distinguish different categories (such as normal and abnormal). AFPGAN scored 0.964 on this indicator, significantly higher than the scores of GANomaly, AnoGAN, and F-AnoGAN, which means that AFPGAN has a higher anomaly detection ability. The AP value measures the average value of the model under the precision-recall curve at all different thresholds, and is also an evaluation indicator ranging from 0 to 1. On this indicator, AFPGAN scored 0.958, far exceeding the other three models, indicating that it can not only efficiently identify anomalies, but also maintain a high precision and recall when doing this task.
[0119] 2.6 Ablation Experiment
[0120] In order to verify the effectiveness of the NAM attention mechanism, stream alignment module and PatchGAN introduced on the basic model proposed in this application, a series of ablation experiments are conducted. All experiments follow the same parameter settings mentioned previously to ensure the consistency and accuracy of the experiments. The experimental results are shown in Table 4.
[0121] Table 4. Results of ablation experiment
[0122]
[0123] As shown in the ablation experiment data, each introduced module has a significant improvement in AUC and AP values. These data not only highlight the value of each module, but also show that they can complement each other when used in combination, providing a more comprehensive performance improvement.
[0124] 3. Conclusion
[0125] The AFPGAN model proposed in this application is based on the GANormaly model. On this basis, the NAM attention mechanism is introduced in the encoder part to enhance the model's feature extraction capability. The stream alignment module FAM is introduced in the decoder part to enhance the model's reconstruction capability. PatchGan is used to replace the original global discriminator to enhance the discriminator's identification ability. After the model is built, the model is trained and tested using a laboratory-made dataset. Through a series of related experiments, the effectiveness of AFPGAN in improving the accuracy of tire defect detection is verified.
[0126] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the schemes disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the claims.
Claims
1. A tire defect detection method based on an improved autoencoder structure, characterized in that: include: S1. Collect normal tire X-ray images, unify the image size, and establish a model training sample data set; select the image to be tested, unify the image size, and establish a model test sample data set; in the training stage, the encoder in the autoencoder is responsible for downsampling operations, extracting high-order features of the image, and mapping them into latent space vectors; then the decoder performs upsampling operations to reconstruct the latent space vector into an image; then, the second encoder is used to obtain the latent vector of the reconstructed image; through model training, the difference between the low-dimensional vector and the latent vector is further reduced, so as to learn and capture the data distribution of the input image; the role of the discriminator in this model is to improve the authenticity of the image generated by the model during the training process; S2. Based on the GANomaly model, the NAM attention mechanism is introduced after each convolutional layer of the encoder part, the stream alignment module is integrated into the decoder part, and the local discriminator Patchgan replaces the original global discriminator; S3, in step S2, the AFPGAN network model is trained using the training sample data set of step S1, the training weight of the model is retained, and the abnormal threshold score φ is obtained; S4. Bring the training weights in step S3 into the trained AFPGAN network model, and input the test sample data set in step S1 into the test network model of the AFPGAN network model. In the test phase, a trained autoencoder-encoder structure model is used; this model only uses normal images during the training process, so when the model encounters abnormal images, the model will try to reconstruct the input image into a normal image; this reconstruction process causes the difference between the low-dimensional feature representation generated by the encoder in the autoencoder and the potential representation generated by the second encoder to increase; when this difference exceeds the set anomaly detection threshold, the image will be identified as abnormal and the detection is completed.
2. The tire defect detection method based on the improved autoencoder structure according to claim 1, characterized in that: The NAM attention mechanism introduced after each convolutional layer of the encoder part based on the GANomaly model includes: NAM adopts the module integration method of CBAM. The model consists of attention channels and spatial attention mechanisms. In the design framework of the channel attention submodule, the scaling factor defined by Batch Normalization is integrated. This factor can reflect the degree of channel change. Its specific expression is shown in formula (1), emphasizing the most important channels: In this formula, μ β As the mean of the mini-batch B, σ β As its standard deviation, γ and β are used as trainable affine transformation parameters, which are used to adjust the scale and offset respectively. Among them, ε is a very small number to avoid zero division errors; As shown in formula (2), the channel attention module defines the output feature M C Use the scaling factor γ to adjust each channel, where F1 is the input feature map and the specific weight W y See formula (3); the concept of weight in formula (3) is introduced; when evaluating the importance of pixels, the scaling factor of BN is applied to the spatial dimension, and this process is defined as pixel normalization; formula (4) details the spatial attention module and its output M S ; Where F2 is the input feature map, λ is the scaling factor, and the weight is as shown in formula (5): M S =sigmoid(W λ (BN S (F2)))(4) 3. The tire defect detection method based on the improved autoencoder structure according to claim 1, characterized in that: The integration of the stream alignment module into the decoder part includes: In the decoder part, a stream alignment module is introduced to generate new feature maps from the low-resolution feature maps and high-resolution feature maps in the decoder through the stream alignment module, and then these feature maps are fused; Given two feature maps of different resolutions and Using the flow alignment module, we transform F L The resolution is adjusted to the same level as F by upsampling. L-1 Same; Next, adjust the F L Feature Map and F L-1 The feature maps are merged and further processed by a convolution layer containing two convolution kernels of size 3×3; a semantic flow field can be generated. The output of the flow alignment module is the predicted value of the semantic flow field; its mathematical process is shown in formula (6): Δ L-1 =conv L (cat(F L ,F L-1 ))(6) Where cat(·) represents the Concat concatenation operation, and convl(·) is a 3×3 convolutional layer; Spatial grid Ω in semantic flow field L-1 Any point P in L-1 , can be mapped to the corresponding upsampling position P through a simple addition operation L ; Apply formula (7) to halve the resolution and correct the resolution difference between the feature map and the flow field; then, with the help of the differential bilinear sampling strategy mentioned in the spatial transformer network STN, for P L The four surrounding points of are sampled and merged through linear interpolation to accurately calculate the final semantic flow field mapping; the mathematical process is shown in formula (8); in Indicates F L Middle twist point P L Neighborhood, ω P Represents the bilinear kernel weights for the distance estimate through the warped grid.
4. The tire defect detection method based on the improved autoencoder structure according to claim 1, characterized in that: The method of replacing the original global discriminator with the local discriminator Patchgan includes: The PatchGAN network is introduced to replace the original global discriminator; it can capture the local texture details in the image more finely and improve the ability to discriminate generated images; the PatchGAN model maps the input to an N×N matrix, where each element in the matrix represents a specific image block; by calculating the average value of each receptive field, the possibility that the final image is a real image can be obtained.
Citation Information
Cited By
Tire defect detection method based on anomaly detection and conditional generative adversarial network
CN120088199A