Tire appearance flaw data generation method based on StyleGAN

Generate rich and diverse tire defect data through StyleGAN, which solves the problems of scarcity and insufficient diversity, and improves the training efficiency and accuracy of tire defect detection.

CN119131530AInactive Publication Date: 2024-12-13ZHONGTAI XINHE INTELLIGENT TECH CO LTD +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411595142.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2024-12-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The scarcity and diversity of tire defect data lead to insufficient training data in deep learning models in tire defect detection, affecting detection efficiency and accuracy.

Method used

The tire appearance defect data generation method based on StyleGAN is used to generate rich and diverse tire defect data through pre-processing, optimizing the StyleGAN model, establishing the mapping relationship between potential space and defect characteristics, and constructing defect image generation and diversity control.

Benefits of technology

It effectively expands the tire defect data set, provides richer and more diverse data support, and improves the training efficiency and accuracy of the tire defect detection algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131530A_ABST
    Figure CN119131530A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of tire image processing, and particularly relates to a tire appearance flaw data generation method based on StyleGAN. According to the method, the problems of scarcity and insufficient diversity of tire flaw data are solved, and richer and diverse data support is provided for training of a tire flaw detection algorithm. According to the method, by optimizing and customizing the StyleGAN model and combining the mapping relation between the potential space and the tire flaw features, diversity and controllability generation of the tire flaw image is achieved, and the tire flaw data set is effectively widened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of tire image processing, and specifically relates to a method for generating tire appearance defect data based on StyleGAN. Background Art

[0002] In the modern tire manufacturing industry, quality control is the core link to ensure product safety and market competitiveness. As an important part of the automobile manufacturing industry, the quality and safety of tires are directly related to the operating status of vehicles and the safety of passengers. With the rapid development of the automobile industry and the increasing requirements of consumers for tire quality, tire appearance defect detection has become a key link in ensuring tire quality. However, traditional tire defect detection mainly relies on manual visual inspection, which is not only inefficient, but also easily affected by human factors, making it difficult to ensure the accuracy and consistency of the test results.

[0003] In recent years, with the rapid development of computer vision and deep learning technologies, image-based tire defect detection methods have gradually emerged. This type of method realizes automatic analysis and defect detection of tire images by training deep learning models, greatly improving detection efficiency and accuracy. However, the training of deep learning models requires a large amount of labeled data, and tire defect data is often difficult to obtain in large quantities due to its particularity. On the one hand, there are many types of tire defects, including cracks, bubbles, wear, deformation, etc., and the shape and size of each defect are also different, which increases the difficulty and complexity of data annotation; on the other hand, the frequency of occurrence of tire defects in actual production is relatively low, and is often affected by multiple factors such as production environment and process conditions, resulting in very limited actual available defect data. Summary of the invention

[0004] This invention proposes a method for generating tire appearance defect data based on StyleGAN, aiming to solve the problem of scarce and insufficient diversity of tire defect data, and provide richer and more diverse data support for the training of tire defect detection algorithms. Its technical solution is: A method for generating tire appearance defect data based on StyleGAN comprises the following steps: S1. Preprocessing the tire appearance defect image to form an initial sample set of defect areas; S2. Input the initial sample set into the optimized StyleGAN model to train the optimized StyleGAN model; S3. Establishing a mapping relationship between the latent space and tire defect features; S4. Construct generation and diversity control of tire defect images; S5. Visualize the generated tire defect image.

[0005] Preferably, in step S1, defective areas are marked, defects of the tire are marked and managed according to defect classification, defective areas are accurately located and extracted, and the defective areas are centered and cropped to unify pixel sizes to form an initial sample set of defective areas.

[0006] Preferably, in step S2, the optimized StyleGAN model includes a tire appearance defect generation network structure, a generator structure, and a discriminator structure; wherein Tire appearance defect generation network structure: According to the characteristics of tire defect images, we gradually explore and adjust the number of network layers and depth of the generator and discriminator. We start with a shallower network and gradually increase the depth to effectively capture defect features. Generator structure: The generator network is responsible for generating images from random vectors in the latent space. In StyleGAN, the generator uses a multi-layer convolutional neural network, and each layer is injected with style information, which is implemented through the AdaIN layer, so that images with different styles can be generated. A self-attention mechanism module is introduced into the generator to generate an attention weight map by calculating the correlation between tire defect feature maps, which is then applied to the tire defect feature maps to enhance the representation of important features. Discriminator structure: The discriminator network is responsible for distinguishing between generated images and real images.

[0007] Preferably, in step S2, the composite loss function of the optimized StyleGAN model is designed as follows: G For the generator, D is the discriminator, x is a real image, z is a random noise vector, To generate images; Pixel-level loss: Use mean squared error to measure the difference between the generated image and the real image at the pixel level: ; in, R is the total number of pixels in the image, and are the values ​​of the i-th pixel in the real image and the generated image respectively; Feature-level loss: used to measure the difference between the generated image and the real image in the feature space, calculated by a pre-trained convolutional neural network: ; ϕ It is a feature mapping function of a certain layer of the pre-trained convolutional neural network. C, H, and W are the number of channels, height, and width of the feature map, respectively. The discriminator loss is calculated as follows: ; in, is the true image distribution, is a random noise distribution, is the interpolated distribution between the real image and the generated image, is the gradient penalty coefficient; The generator loss is calculated as follows: ; The composite loss function of the generator combines the above three loss functions to obtain a composite loss function: =α +β +γ ; Among them, α, β, and γ are weight coefficients used to balance the impact of different loss functions on model training.

[0008] Preferably, in step S3, the latent space mapping is established by setting a 512-dimensional random noise vector Z as input 1 , using a mapping network f containing 8 fully connected layers, the input noise vector Z 1 Mapped to a 512-dimensional latent space vector , the latent space vector There is a linear relationship between the properties of the generated image; in order to achieve different AdaIN layers using different Vector, will The dimension is expanded to 18×512, called W'.

[0009] Preferably, in step S3, tire defect feature editing includes latent coding vector solution, latent coding vector editing and feature editing evaluation; wherein: Latent coding vector solution: For a given real image, its latent coding vector is obtained by learning an encoder or directly optimizing the vector. The encoder-based solution method obtains the latent coding vector by performing forward propagation of the encoder neural network. Editing of latent coding vectors: After obtaining the latent coding vectors, the high-level semantic properties of the generated image are controlled by modifying their values; Feature Editing Evaluation: The latent encoding vector determines the features of the generated samples. If the generated samples corresponding to two points in the latent space are visually different, the interpolation path between these two points may generate samples with discontinuous or mutation features. Perceptual path length quantifies this smoothness and continuity by calculating the perceptual difference between adjacent samples on the interpolation path, calculated as: Assume that there are two latent encoding vectors z1 and z2 in the latent space, and the corresponding outputs of the generator as their inputs are G(z1) and G(z2). When z1 and z2 are interpolated, the output of the generator corresponding to the interpolation result may show features that do not exist in G(z1) and G(z2). In order to quantify the perceptual difference in this interpolation path, the calculation formula of PPL is usually defined as: lZ=E[1 / ϵ² * d(G(slerp(z1,z2;t)), G(slerp(z1,z2;t+ϵ)))], Among them: E represents expectation; ϵ is a small number used to subdivide the interpolation path into small segments; Slerp represents the spherical interpolation method, which is used to interpolate in the latent space; d represents the function for calculating the perceptual distance, which uses a pre-trained neural network to extract features and calculate the distance between feature vectors; t follows a (0,1) uniform distribution; The perceptual path length between two points in the latent space is obtained by calculating the sum of the perceptual differences of all small segments on the interpolation path.

[0010] Preferably, in step S4, the edited latent coding vector is input into the generator by randomly initializing the vector in the latent space, and the network structure of the generator is upsampled layer by layer and the style information is injected, so as to finally generate a defective image with desired properties.

[0011] Preferably, in step S4, the diversity generation control step is as follows: S41. Extracting feature vectors of tire defects in the generated image using a pre-trained neural network or manual annotation; S42. Normalizing the extracted feature vector; S43. quantize the normalized feature vector and map it into a finite number of feature buckets; S44. Calculate the distribution entropy of the quantized feature vector to quantify the diversity and variability of defects. The formula for the defect feature distribution entropy is: ; Where N is the number of feature buckets, It is i The ratio of the number of defect feature vectors in the feature bucket to the total number of defect feature vectors; if n i Indicates i The number of defect feature vectors in feature buckets, represents the total number of defect feature vectors, then The calculation formula is: ; S45. Adjust the parameters of the StyleGAN model or the distribution range of the latent vector according to the control strategy to achieve control over the diversity of the generated images.

[0012] Preferably, in step S5, the visualization is responsible for providing a user-friendly interface and tools, allowing the user to view and adjust the generated tire defect image in real time, specifically including the following functional characteristics: Interface design: Design an intuitive and easy-to-use user interface, including image display area, parameter adjustment area and generation control area; Real-time preview: When the user adjusts parameters or selects different defect features, the corresponding tire defect image is generated and displayed in real time; Parameter adjustment: Allows users to adjust the initial range, distribution type, and defect feature weight parameters of the latent vector through the interface to control the quality and diversity of the generated images; Save and Export: Provides save and export functions, allowing users to save the generated tire defect images locally or export them to other formats.

[0013] Compared with the prior art, the present invention has the following beneficial effects: The present invention solves the problem of scarce and insufficient diversity of tire defect data, and provides richer and more diverse data support for the training of tire defect detection algorithms. This method optimizes and customizes the StyleGAN model, combines the mapping relationship between the latent space and tire defect features, and realizes the diverse and controllable generation of tire defect images, effectively expanding the tire defect dataset. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 This is the flow chart of this application.

[0015] Figure 2 Schematic diagram of the StyleGAN training process.

[0016] Figure 3 Generate a frame map for the tire defect image.

[0017] Figure 4 Schematic diagram of the mapping network and synthesis network of the generator. DETAILED DESCRIPTION

[0018] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the examples of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] A method for generating tire appearance defect data based on StyleGAN comprises the following steps: S1. Image preprocessing and defect extraction: (1) Collect tire defect sample images from various channels (such as production sites, quality inspection departments, etc.).

[0020] (2) Crop the collected images, remove irrelevant background information, mark the defective areas, label and manage the tire defects according to defect classification, accurately locate and extract the defective areas, and perform center cropping on the defective areas, unify the pixel size, and other operations to improve the consistency of the sample data set.

[0021] (3) Cleaning and enhancement processing are performed to pre-process the tire appearance defect images collected by high-resolution cameras or sensors, including denoising and enhancement, to improve image quality.

[0022] (4) In order to simulate tire defect images under different lighting conditions, the brightness, contrast and color of the defect images are adjusted.

[0023] (5) The processed data is divided into a training set and a validation set, and the allocation is in a ratio of 4:1. When allocating the training set and the validation set, full consideration is given to the uniform distribution of various defect categories.

[0024] S2. StyleGAN tire defect generation network model customization and training: (1) StyleGAN tire defect generation network model customization: Network layers and depth: The original StyleGAN network may contain multiple convolutional layers, fully connected layers, etc. In order to better adapt to the characteristics of tire defect images, we increased the number of network layers, especially the number of convolutional layers in the feature extraction stage to capture the detailed features of tire defects more deeply. At the same time, in order to maintain the computational efficiency of the network and avoid overfitting, we adopted a convolution kernel size (for example, 3*3) and number that decreases layer by layer.

[0025] Introduction of attention mechanism: In the generator network of StyleGAN, a self-attention mechanism is introduced to enhance the model's ability to focus on key areas of tire defects. The attention mechanism module calculates the correlation between feature maps, generates an attention weight map, and then applies it to the feature map to enhance the representation of important features. The self-attention mechanism can capture long-distance dependencies and is very useful for generating images with complex structures and textures. The self-attention mechanism is introduced into the generator to improve the quality and detail of the generated images.

[0026] Composite loss function design: Based on the characteristics of tire defect images, composite loss functions are designed, including pixel-level loss (such as mean square error MSE), feature-level loss (such as perceptual loss Perceptual Loss) and adversarial loss (such as Wasserstein distance in WGAN-GP). Pixel-level loss is used to measure the difference between the generated image and the real image at the pixel level; feature-level loss extracts high-level features of the image through a pre-trained convolutional neural network and calculates the difference between these features; adversarial loss is used to maintain the diversity and authenticity of the generated images.

[0027] set up G For the generator, D is the discriminator, x is a real image, z is a random noise vector, x ^= G ( z ) is used to generate the image.

[0028] Pixel-level loss: The mean square error (MSE) is used to measure the difference between the generated image and the real image at the pixel level. The MSE loss helps capture the low-level features of the image, such as color, brightness, etc.

[0029] ; in, R is the total number of pixels in the image, and are the real image and the generated image. i The value of pixels.

[0030] Perceptual Loss: It is used to measure the difference between the generated image and the real image in the feature space. It is calculated by a pre-trained convolutional neural network (such as the VGG network) and can capture high-level features of the image, such as texture and structure.

[0031] ; in, It is a feature mapping function of a certain layer of a pre-trained convolutional neural network (such as VGG16), where C, H, and W are the number of channels, height, and width of the feature map, respectively.

[0032] Adversarial loss (WGAN-GP Loss): Using the Wasserstein distance in Wasserstein GAN with Gradient Penalty (WGAN-GP) to measure the difference between the distribution of generated images and real images helps to make the distribution of generated images closer to the distribution of real images, thereby improving the quality of generated images.

[0033] Discriminator loss: ; in, P r is the true image distribution, P z is a random noise distribution, is the interpolation distribution between the real image and the generated image, and λ is the gradient penalty coefficient.

[0034] Generator loss: ; The composite loss function combines the above three loss functions to obtain a composite loss function: =α +β +γ ; Among them, α, β, and γ are weight coefficients used to balance the impact of different loss functions on model training. Note that only the composite loss function of the generator is included here, and the loss function of the discriminator is still L D .

[0035] (2) Model training and optimization: Training strategy: Adopt a strategy of gradually increasing the difficulty of training, first use a simple data set for pre-training, and then gradually introduce more complex data. During the training process, use techniques such as learning rate decay and gradient clipping to stabilize the training process.

[0036] Model evaluation and adjustment: During the training process, the performance of the model is regularly evaluated, including the quality and diversity of the generated images and the generalization ability of the model on unseen data. Based on the evaluation results, the model structure, loss function and training strategy are adjusted and optimized.

[0037] Model saving and loading: In order to facilitate subsequent model deployment and algorithm optimization, a model saving and loading interface is designed. The trained model parameters can be saved to a file, and the model can be loaded for inference or continued training when needed.

[0038] S3. Latent space mapping and feature editing module: (1) Latent Space Mapping: Set the input to be a 512-dimensional random noise vector Z 1 , using a mapping network f containing 8 fully connected layers, the input noise vector Z 1 Mapped to a 512-dimensional latent space vector The purpose of the mapping network f is to get rid of the influence of the input vector on the distribution of the input data set, so that the latent space vector The distribution is consistent with the training set, and a more uniform attribute distribution is obtained.

[0039] Latent space vector There is a better linear relationship between the properties of the generated image, which is conducive to controlling the properties of the generated image. Vector, will The dimension is expanded to 18×512, called W'.

[0040] (2) Feature editing: Latent coding vector solution: For a given real image, its latent coding vector can be obtained by learning an encoder or directly optimizing the vector. The encoder-based solution method can quickly obtain the latent coding vector by executing the forward propagation of the encoder neural network, but there may be problems with exceeding the training data set. The optimization-based solution method directly optimizes the corresponding latent coding vector for each image, which has higher accuracy but slow optimization speed.

[0041] Editing the latent coding vector, after obtaining the latent coding vector, the high-level semantic properties of the generated image can be controlled by modifying its value. There is a better linear relationship between the properties of the generated image, so it can be directly Edit to control image properties. The values ​​of certain dimensions in the generated image can be used to modify the defect type, tire pattern and other characteristics.

[0042] Feature editing evaluation can measure the effect of feature editing through evaluation methods such as perceptual path length and linear separability. Among them, perceptual path length evaluates the average distance between endpoints in the latent space, which can reflect the smoothness and continuity of the editing. Linear separability evaluates the separability of different attributes in the latent space, which can guide how to perform feature editing more effectively.

[0043] a. Perceptual Path Length (PPL), the latent encoding vector determines the characteristics of the generated samples. If the generated samples corresponding to two points in the latent space are visually different, the interpolation path between these two points may generate samples with discontinuous or abrupt features. Perceptual path length quantifies this smoothness and continuity by calculating the perceptual difference between adjacent samples on the interpolation path. The calculation formula is: Assume that there are two latent encoding vectors z1 and z2 in the latent space, and their corresponding outputs as the input of the generator are G(z1) and G(z2). When z1 and z2 are interpolated, the output of the generator corresponding to the interpolation result may show features that do not exist in G(z1) and G(z2). In order to quantify the perceptual difference in this interpolation path, the calculation formula of PPL is usually defined as: lZ=E[1 / ϵ² * d(G(slerp(z1,z2;t)), G(slerp(z1,z2;t+ϵ)))]; in: E stands for expectation; ϵ is a small number used to subdivide the interpolation path into small segments; Slerp represents the spherical interpolation method, which is used to interpolate in the latent space; d represents the function for calculating the perceptual distance, which usually uses a pre-trained neural network (such as the VGG network) to extract features and calculate the distance between feature vectors; t follows a (0,1) uniform distribution.

[0044] By calculating the sum of the perceptual differences of all small segments on the interpolation path, the perceptual path length between two points in the latent space can be obtained.

[0045] b. Linear Separability: In the latent space, if samples of different attributes can be clearly separated by a hyperplane, these attributes are said to be linearly separable. The higher the linear separability, the more regular the sample distribution in the latent space, making it easier to perform operations such as feature editing and classification. The evaluation method is as follows: Linear separability is usually evaluated by the classification effect of linear classifiers such as support vector machines (SVM) on the latent space. The specific steps are as follows: Extract samples with different attributes from the latent space as training sets and test sets; Use a linear classifier (such as SVM) to train the training set; Use the trained classifier to classify the test set and calculate the classification accuracy; The higher the classification accuracy, the easier it is for samples with different attributes in the latent space to be linearly separable.

[0046] Notice: Linear separability evaluation does not directly give a specific calculation formula, but is indirectly evaluated through the classification effect of the classifier; In practical applications, it may be necessary to combine other evaluation methods (such as perceptual path length) to comprehensively measure the characteristics of the latent space.

[0047] S4. Defective Image Generation and Diversity Control (1) Defective image generation: Load the trained StyleGAN model parameters, randomly initialize the vectors in the latent space, input the edited latent coding vector into the generator, upsample layer by layer through the generator's network structure and inject style information, and finally generate an image with the desired attributes.

[0048] (2) Diversity generation control: Diversity metric: Design a diversity metric to evaluate the diversity of generated images. This can be achieved by calculating the defect feature distribution entropy. Defect feature distribution entropy evaluates diversity by calculating the distribution entropy of tire defect feature vectors in the generated images. First, we extract the feature vectors of tire defects in the generated images, which can include attributes such as shape, size, location, color, etc. Then, we calculate the distribution entropy of these feature vectors in the feature space to quantify the diversity and variability of defects.

[0049] a. Defect feature extraction: Use pre-trained neural networks (such as object detection networks or segmentation networks) or manual annotation to extract feature vectors of tire defects in the generated images. These feature vectors should be able to reflect the key attributes of the defects.

[0050] b. Feature normalization: The extracted feature vectors are normalized to ensure that they are compared at the same scale.

[0051] c. Feature quantization: quantize the normalized feature vector and map it into a finite number of feature bins. The purpose of quantization is to simplify the calculation of feature distribution and reduce the impact of noise.

[0052] d. Calculate the distribution entropy and the distribution entropy of the quantized feature vector to quantify the diversity and variability of defects. The formula for the defect feature distribution entropy is: ; Where N is the number of feature buckets, pi is the ratio of the number of defect feature vectors in the i-th feature bucket to the total number of defect feature vectors. Specifically, if ni represents the number of defect feature vectors in the i-th feature bucket, N total represents the total number of defect feature vectors, then ; Control strategy design: Design corresponding control strategies based on the diversity measurement results. For example, when it is found that the diversity of generated images is insufficient, the randomness of the latent vectors can be increased, noise can be introduced, or style mixing techniques can be used to increase diversity.

[0053] Parameter adjustment: Adjust the parameters of the StyleGAN model or the distribution range of the latent vector according to the control strategy to achieve control over the diversity of generated images.

[0054] S5. Visualization tool for parameter adjustment: The visualization tool submodule is responsible for providing a user-friendly interface and tools that allow users to view and adjust the generated tire defect images in real time. It includes the following features: Interface design: Design an intuitive and easy-to-use user interface, including image display area, parameter adjustment area, and generation control area.

[0055] Real-time preview: When the user adjusts parameters or selects different defect features, the corresponding tire defect image is generated and displayed in real time.

[0056] Parameter adjustment: Allows users to adjust parameters such as the initial range of the latent vector, distribution type, defect feature weight, etc. through the interface to control the quality and diversity of the generated images.

[0057] Save and Export: Provides save and export functions, allowing users to save the generated tire defect images locally or export them to other formats.

[0058] S6. Data augmentation and algorithm optimization: Data augmentation: The generated tire defect images are input as training data into the tire defect detection algorithm. At the same time, the generated images are transformed using data augmentation techniques (such as rotation, scaling, translation, etc.) to further enrich the dataset. Random noise, such as Gaussian noise, is added to the images to simulate noise interference in real scenes and improve the algorithm's noise resistance. Accurate labels are added to the generated images, including information such as defect type, location, size, etc., for use in training the algorithm.

[0059] Algorithm optimization: Use the augmented dataset to train and optimize the tire defect detection algorithm. Input the augmented dataset into the model for iterative training. During the training process, the IoU loss function is used to measure the difference between the model's prediction results and the true labels, and the model parameters are updated through the back-propagation algorithm.

[0060] Algorithm evaluation: Choose appropriate evaluation indicators, such as accuracy, recall, F1 score, mean average precision (mAP), etc., to measure the performance of the algorithm. Extract a part of the augmented dataset as the test set, ensuring that the test set has a similar distribution but does not intersect with the training set. Input the test set into the algorithm, obtain the prediction results of the algorithm, and calculate the performance score of the algorithm based on the evaluation indicators. By performing algorithm evaluation on the generated tire defect images, the performance and advantages of the algorithm can be measured more accurately. The evaluation results can be used as a basis for algorithm optimization and improvement.

[0061] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one 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 rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating tire appearance defect data based on StyleGAN, characterized in that: The following steps are involved: S1. Preprocessing the tire appearance defect image to form an initial sample set of defect areas; S2. Input the initial sample set into the optimized StyleGAN model to train the optimized StyleGAN model; S3. Establishing a mapping relationship between the latent space and tire defect features; S4. Construct generation and diversity control of tire defect images; S5. Visualize the generated tire defect image.

2. The tire appearance defect data generation method based on StyleGAN according to claim 1, characterized in that: In step S1, the defective area is marked, the defects of the tire are marked and managed according to the defect classification, the defective area is accurately located and extracted, and the defective area is centered and cropped to unify the pixel size to form an initial sample set of the defective area.

3. The tire appearance defect data generation method based on StyleGAN according to claim 1, characterized in that: In step S2, the optimized StyleGAN model includes a tire appearance defect generation network structure, a generator structure, and a discriminator structure; wherein Tire appearance defect generation network structure: According to the characteristics of tire defect images, we gradually explore and adjust the number of network layers and depth of the generator and discriminator. We start with a shallower network and gradually increase the depth to effectively capture defect features. Generator structure: The generator network is responsible for generating images from random vectors in the latent space. In StyleGAN, the generator uses a multi-layer convolutional neural network, and each layer is injected with style information, which is implemented through the AdaIN layer, so that images with different styles can be generated. A self-attention mechanism module is introduced into the generator to generate an attention weight map by calculating the correlation between tire defect feature maps, which is then applied to the tire defect feature map to enhance the representation of important features. Discriminator structure: The discriminator network is responsible for distinguishing between generated images and real images.

4. The tire appearance defect data generation method based on StyleGAN according to claim 1, characterized in that: In step S2, the composite loss function of the optimized StyleGAN model is designed as follows: G For the generator, D is the discriminator, x is a real image, z is a random noise vector, To generate images; Pixel-level loss: Use mean squared error to measure the difference between the generated image and the real image at the pixel level: ; in, R is the total number of pixels in the image, and are the values ​​of the i-th pixel in the real image and the generated image respectively; Feature-level loss: used to measure the difference between the generated image and the real image in the feature space, calculated by a pre-trained convolutional neural network: ; ϕ It is a feature mapping function of a certain layer of the pre-trained convolutional neural network. C, H, and W are the number of channels, height, and width of the feature map, respectively. The discriminator loss is calculated as follows: ; in, is the true image distribution, is a random noise distribution, is the interpolated distribution between the real image and the generated image, is the gradient penalty coefficient; The generator loss is calculated as follows: ; The composite loss function of the generator combines the above three loss functions to obtain a composite loss function: =a +b +g ? Among them, α, β, and γ are weight coefficients used to balance the impact of different loss functions on model training.

5. The tire appearance defect data generation method based on StyleGAN according to claim 1, characterized in that: In step S3, the latent space mapping is established: a 512-dimensional random noise vector Z is set as the input 1 , using a mapping network f containing 8 fully connected layers, the input noise vector Z 1 Mapped to a 512-dimensional latent space vector , the latent space vector There is a linear relationship between the properties of the generated image; in order to achieve different AdaIN layers using different Vector, will The dimension is expanded to 18×512, called W'.

6. The tire appearance defect data generation method based on StyleGAN according to claim 1, characterized in that: In step S3, tire defect feature editing includes latent coding vector solution, latent coding vector editing and feature editing evaluation; wherein: Latent coding vector solution: For a given real image, its latent coding vector is obtained by learning an encoder or directly optimizing the vector. The encoder-based solution method obtains the latent coding vector by performing forward propagation of the encoder neural network. Editing of latent coding vectors: After obtaining the latent coding vectors, the high-level semantic properties of the generated image are controlled by modifying their values; Feature Editing Evaluation: The latent encoding vector determines the features of the generated samples. If the generated samples corresponding to two points in the latent space are visually different, the interpolation path between these two points may generate samples with discontinuous or mutation features. Perceptual path length quantifies this smoothness and continuity by calculating the perceptual difference between adjacent samples on the interpolation path, calculated as: Assume that there are two latent encoding vectors z1 and z2 in the latent space, and the corresponding outputs of the generator as their inputs are G(z1) and G(z2); interpolating z1 and z2, the output of the generator corresponding to the interpolation result may show features that do not exist in G(z1) and G(z2); in order to quantify the perceptual difference in this interpolation path, the formula is: lZ=E[1 / ϵ² * d(G(slerp(z1,z2;t)), G(slerp(z1,z2;t+ϵ)))]; in: E stands for expectation; ϵ is a small number used to subdivide the interpolation path into small segments; Slerp represents the spherical interpolation method, which is used to interpolate in the latent space; d represents the function for calculating the perceptual distance, which uses a pre-trained neural network to extract features and calculate the distance between feature vectors; t follows a (0,1) uniform distribution; The perceptual path length between two points in the latent space is obtained by calculating the sum of the perceptual differences of all small segments on the interpolation path.

7. The tire appearance defect data generation method based on StyleGAN according to claim 1, characterized in that: In step S4, the edited latent coding vector is input into the generator by randomly initializing the vector in the latent space, and the network structure of the generator is upsampled layer by layer and the style information is injected, and finally a defect image with the desired attributes is generated.

8. The tire appearance defect data generation method based on StyleGAN according to claim 1, characterized in that: In step S4, the diversity generation control steps are as follows: S41. Extracting feature vectors of tire defects in the generated image using a pre-trained neural network or manual annotation; S42. Normalizing the extracted feature vector; S43. quantize the normalized feature vector and map it into a finite number of feature buckets; S44. Calculate the distribution entropy of the quantized feature vector to quantify the diversity and variability of defects. The formula for the defect feature distribution entropy is: ; Where N is the number of feature buckets, It is i The ratio of the number of defect feature vectors in the feature bucket to the total number of defect feature vectors; if n i Indicates i The number of defect feature vectors in feature buckets, represents the total number of defect feature vectors, then: ; S45. Adjust the parameters of the StyleGAN model or the distribution range of the latent vector according to the control strategy to achieve control over the diversity of the generated images.

9. The tire appearance defect data generation method based on StyleGAN according to claim 1, characterized in that: In step S5, visualization is responsible for providing a user-friendly interface and tools, allowing the user to view and adjust the generated tire defect image in real time, including the following functional features: Interface design: Design an intuitive and easy-to-use user interface, including image display area, parameter adjustment area and generation control area; Real-time preview: When the user adjusts parameters or selects different defect features, the corresponding tire defect image is generated and displayed in real time; Parameter adjustment: Allows users to adjust the initial range, distribution type, and defect feature weight parameters of the latent vector through the interface to control the quality and diversity of the generated images; Save and Export: Provides save and export functions, allowing users to save the generated tire defect images locally or export them to other formats.

Citation Information

Patent Citations

  • Metal surface flaw detection method based on generative adversarial network

    CN113610794A

  • Intelligent identification method for tire surface flaws under small sample

    CN113901947A

  • Method for generating surface defect image of electric power safety tool

    CN116071352A

  • ACGAN sewing thread image generation method based on multi-class attention mechanism

    CN117237469A

  • Transformer fault image sample generation method and system based on StyleGAN

    CN117853847A