A semantic segmentation-oriented adversarial label inversion and virtual image generation method

CN123016113APending Publication Date: 2026-10-30SUYIDE TECHNOLOGY (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611166750.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]本发明目的在于提供一种面向语义分割的对抗式标签反演与虚拟图像生成方法,以解决工业缺陷检测场景下,因真实标注样本数量稀缺、缺陷种类覆盖不全导致语义分割模型检测精度低、泛化能力差的技术问题

Benefits of technology

[0031]本发明通过构建语义分割模型与条件生成对抗模型的协同训练框架,学习从语义标签到真实图像的映射关系,进而以人工创建的多样化语义标签驱动生成大量虚拟图像样本,能够在有限真实标注数据的基础上显著扩充训练样本规模,突破了工业场景中低概率偶发缺陷、隐性缺陷难以采集的样本数量瓶颈,为语义分割模型的训练提供充足的数据支撑。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123016113A_ABST
    Figure CN123016113A_ABST
Patent Text Reader

Abstract

The application discloses a kind of semantic segmentation-oriented adversarial label inversion and virtual image generation method, the collaborative training framework of constructing semantic segmentation model and conditional generation adversarial model is trained to generate model with paired defect real image and semantic label, so that it learns from label to real image mapping relationship;By creating a semantic label candidate set containing multiple defect morphologies, generate model is driven to mass-produce virtual defect images;Then, the virtual sample is checked by reverse segmentation using the semantic segmentation model, and the effective sample that meets the standard of semantic consistency is selected to build an expanded training set, which is finally used for semantic segmentation model training.The application efficiently expands the number of training samples and the coverage of defect types, generates samples with accurate semantics and real-world scenarios, significantly improves the detection accuracy and generalization ability of the semantic segmentation model, and is suitable for various industrial defect detection scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of industrial defect detection and computer vision, and in particular relates to an adversarial label inversion and virtual image generation method for semantic segmentation. Background Technology

[0002] Industrial defect detection is a crucial step in ensuring the quality of industrial products, and it is widely used in the quality control of various industrial products such as mechanical parts, electronic components, and sheet metal surfaces. In recent years, with the rapid development of deep learning technology, semantic segmentation-based industrial defect detection methods have gradually become the mainstream technical approach. Among them, Transformer-based semantic segmentation models, represented by SegFormer, have made significant progress in defect detection tasks due to their powerful feature extraction capabilities.

[0003] However, training deep learning-based semantic segmentation models heavily relies on large-scale, high-quality pixel-level labeled data. In real-world industrial scenarios, many defects in industrial production are low-probability, sporadic events, and some latent defects are difficult to obtain through conventional collection methods. This results in an extremely limited number of real defect samples available for model training, failing to meet the training requirements of deep neural networks and becoming a key bottleneck restricting model performance improvement. Industrial defects are diverse in form and complex in distribution. Existing collected samples often cannot cover all defect forms, sizes, and spatial distribution types, forming a typical long-tail defect problem—common defect samples are plentiful, while rare defect samples are extremely scarce, leading to a severe deficiency in the model's ability to detect uncommon defect types.

[0004] To alleviate the problem of insufficient labeled data, the industry has proposed various solutions. Traditional data augmentation methods, such as random rotation, translation, scaling, and color dithering, can only perform simple geometric or color transformations on existing samples. They cannot generate training samples with entirely new semantic layouts or new types of defects, and essentially do not increase the semantic diversity of the data, making it difficult to fundamentally solve the problem of sample scarcity. Sample generation methods based on generative adversarial networks, such as conditional generative adversarial networks represented by pix2pix, can achieve translation from semantic label maps to real images, and theoretically can be used to generate virtual training samples. However, training the pix2pix model itself also requires a large number of paired label maps and real image data, and when pix2pix is ​​used alone, it lacks precise guidance for semantic segmentation. The generated virtual samples have low consistency with actual industrial defect scenarios in terms of defect semantics and texture details, and the accuracy of defect region annotation in the generated images is insufficient, making it difficult to directly use them for training semantic segmentation models. When using semantic segmentation algorithms such as SegFormer alone, their model performance is highly dependent on the scale and diversity of the training data. When the number of samples is limited and the types of defects are incomplete, the model is prone to overfitting, has weak generalization ability, and its detection accuracy for defect types that have not appeared in the training set drops significantly, making it unable to overcome the limitations of sample data. Summary of the Invention

[0005] The purpose of this invention is to provide an adversarial label inversion and virtual image generation method for semantic segmentation, in order to solve the technical problems of low detection accuracy and poor generalization ability of semantic segmentation models in industrial defect detection scenarios due to the scarcity of real labeled samples and incomplete coverage of defect types.

[0006] To achieve the above objectives, the specific technical solution of the adversarial label inversion and virtual image generation method for semantic segmentation of the present invention is as follows:

[0007] An adversarial label inversion and virtual image generation method for semantic segmentation includes the following steps:

[0008] S1. Collect real images of defects and their corresponding semantic segmentation label images, normalize the image size, label different defect types, and divide them into training set and validation set according to a preset ratio.

[0009] S2. Construct a collaborative training framework for a semantic segmentation model and a conditional generative adversarial model. Use the semantic segmentation label map as the input condition of the conditional generative adversarial model and the real image corresponding to the semantic segmentation label map as the output target of the conditional generative adversarial model. Train the conditional generative adversarial model to learn the mapping relationship from semantic labels to real images.

[0010] S3. Create a semantic label candidate set, which contains various types of defect region annotations;

[0011] S4. Input the semantic label candidate set into the conditional generative adversarial model to generate corresponding virtual image samples;

[0012] S5. Use the semantic segmentation model to perform reverse semantic segmentation verification on the generated virtual image samples, filter out the valid virtual samples whose semantic consistency meets the preset threshold, and construct the expanded training dataset.

[0013] S6. Use the expanded training dataset for training the semantic segmentation model.

[0014] As a further improvement of the present invention, the training of the conditional generative adversarial model in S2 adopts a multi-loss fusion function, which includes adversarial loss, pixel loss and semantic segmentation loss, and the three are weighted and summed according to preset weights as the total training objective.

[0015] As a further improvement of the present invention, the semantic segmentation loss is the cross-entropy loss, which is obtained by the semantic segmentation model through forward reasoning on the generated image, and is used to constrain the semantic consistency between the generated image and the real image.

[0016] As a further improvement of the present invention, the semantic segmentation model is the SegFormer model, and its SegFormerHead component includes a channel attention module and a spatial attention module; the channel attention module adaptively learns the importance weights of each feature channel through global pooling, and the spatial attention module generates a spatial weight map to guide the model to focus on potential defect regions.

[0017] As a further improvement of the present invention, the SegFormerHead component also includes an edge enhancement module, which adopts a structure combining edge convolutional layers and residual connections.

[0018] As a further improvement of the present invention, the semantic tag candidate set in S3 includes defect type tags of defect size, defect shape, and defect location;

[0019] The defect morphology includes dot-like, linear, block-like, and irregular shapes; the defect location includes the surface, edge, and interior.

[0020] As a further improvement of the present invention, the reverse semantic segmentation verification in S5 includes the following steps: inputting the generated virtual image into the semantic segmentation model to obtain the predicted semantic label map, calculating the intersection-union ratio (IU) between the predicted semantic label map and the input original semantic label map, and retaining virtual samples whose IU meets a preset threshold as valid samples.

[0021] As a further improvement of the present invention, the conditional generative adversarial model is a pix2pix model, whose generator is a U-Net structure and discriminator is a convolutional neural network structure.

[0022] As a further improvement of the present invention, during the training process of the conditional generative adversarial model described in S2, the model performance is verified on the validation set every preset number of iterations, and training stops when the similarity between the generated image and the real image reaches the convergence condition.

[0023] An adversarial label inversion and virtual image generation system for semantic segmentation, employing the aforementioned adversarial label inversion and virtual image generation method for semantic segmentation, includes:

[0024] The data preprocessing module is used to collect real images of industrial defects and their corresponding semantic segmentation label maps, and to perform size normalization and dataset partitioning.

[0025] The collaborative training module is used to build a collaborative training framework for the semantic segmentation model and the conditional generative adversarial model, and to train the conditional generative adversarial model to learn the mapping relationship from semantic labels to real images.

[0026] The tag generation module is used to create a set of semantic tag candidates containing annotations of various defect regions with different morphologies;

[0027] The image generation module is used to input the semantic label candidate set into the conditional generative adversarial model and generate corresponding virtual image samples.

[0028] The sample selection module is used to perform reverse semantic segmentation verification on virtual image samples using a semantic segmentation model, select valid virtual samples, and build an expanded training dataset.

[0029] The model training module is used to train the semantic segmentation model using the expanded training dataset.

[0030] Beneficial effects:

[0031] This invention constructs a collaborative training framework for a semantic segmentation model and a conditional generative adversarial model to learn the mapping relationship from semantic labels to real images. Then, it drives the generation of a large number of virtual image samples with artificially created diverse semantic labels. This can significantly expand the scale of training samples based on limited real labeled data, breaking through the bottleneck of sample quantity that is difficult to collect for low-probability sporadic defects and latent defects in industrial scenarios, and providing sufficient data support for the training of semantic segmentation models.

[0032] By creating a semantic label candidate set containing annotations of various defect regions with different morphologies, it is possible to flexibly generate defect samples of various morphologies and distributions. In particular, it can generate rare defect types not covered in existing datasets, greatly expanding the coverage of defect types and effectively solving the long-tail defect problem commonly found in industrial defect detection, enabling the model to learn more comprehensive defect features.

[0033] A collaborative training framework combining semantic segmentation and conditional generative adversarial models is adopted. Real semantic labels and corresponding real images are used as paired training data. This allows the conditional generative adversarial model to be constrained by semantic information while learning image generation. This overcomes the lack of semantic guidance when using a generative model alone, and ensures that the generated virtual samples are highly consistent with the actual industrial scenario in terms of defect semantic layout, thus possessing usability.

[0034] A reverse semantic segmentation verification step is implemented, using a semantic segmentation model to perform reverse segmentation verification on the generated virtual images. Valid samples whose semantic consistency meets a preset threshold are then included in the training set. This quality control mechanism ensures the accuracy of the annotations and the semantic validity of the virtual samples in the augmented dataset from the source, preventing low-quality generated samples from interfering with model training and ensuring the actual gain of the data augmentation.

[0035] The selected high-quality virtual samples, together with the original real samples, constitute the expanded training dataset. The increase in the number of samples and the richness of defect types enable the semantic segmentation model to learn more diverse defect features, effectively alleviate the overfitting problem under small sample conditions, significantly improve the defect detection accuracy of the model, and enhance the model's generalization ability to unseen defect types. The overall detection performance is better than the model trained using only the original samples.

[0036] By generating virtual samples to replace the collection and labeling of some real defect samples, there is no need to invest a lot of manpower and resources to collect scarce defect samples, nor is there a need to manually label the generated virtual samples. This can significantly reduce the data acquisition cost and manpower cost of training industrial defect detection models, shorten the data preparation cycle, and has significant economic benefits and engineering practical value. Attached Figure Description

[0037] Figure 1 This is a schematic diagram of an adversarial label inversion and virtual image generation method for semantic segmentation according to the present invention;

[0038] Figure 2 This is a schematic diagram of the training data samples;

[0039] Figure 3 A schematic diagram for generating virtual images. Detailed Implementation

[0040] To better understand the purpose, structure, and function of this invention, a more detailed description is provided of an adversarial label inversion and virtual image generation method for semantic segmentation.

[0041] Implementation example:

[0042] like Figure 1 This paper presents an adversarial label inversion and virtual image generation method for semantic segmentation, comprising six steps: data preprocessing, collaborative model training, diversified label creation, virtual image generation, sample screening and verification, and model training optimization. In this embodiment, the semantic segmentation model uses the SegFormer model, and the conditional generative adversarial model uses the pix2pix model. The pix2pix model is trained using a small number of paired real industrial defect images and semantic labels, enabling it to master the mapping ability from semantic labels to real defect images. Then, by manually creating diversified semantic labels, the pix2pix model is driven to generate high-quality virtual defect samples in batches. After SegFormer reverse verification and screening, the effective virtual samples are added to the training set, ultimately improving the accuracy and generalization ability of the SegFormer defect detection model.

[0043] Step 1: Data preprocessing. Collect real images of industrial defects and their corresponding semantic segmentation label maps to construct the initial training dataset.

[0044] Collect images of surface defects in industrial products, including but not limited to grayscale or color defect images of mechanical parts, electronic components, and metal sheets in industrial scenarios; perform pixel-level semantic annotation on each real image to generate a corresponding semantic segmentation label map (mask), with different colors used to distinguish different defect types; normalize the size of all real images and corresponding label maps to uniformly adjust them to the same resolution; randomly divide the processed dataset into a training set and a validation set according to a preset ratio, with the training set used for model training and the validation set used for performance evaluation and convergence judgment during the training process.

[0045] like Figure 2 The training data sample diagram shown has a real industrial defect image on the left and a corresponding semantic label image on the right. Different colored areas represent different types of defects, and the two correspond one-to-one to form a pair of training samples.

[0046] Step 2: Construct a collaborative training framework and train a conditional generative adversarial model. Construct a collaborative training framework for the SegFormer semantic segmentation model and the pix2pix conditional generative adversarial model, and train the pix2pix model to learn the mapping relationship from semantic labels to real images.

[0047] In the pix2pix model structure, the generator adopts a U-Net encoder-decoder architecture. The encoder extracts image features through progressive downsampling via multiple convolutional layers, while the decoder gradually restores image resolution through upsampling. Skip connections are set between corresponding layers of the encoder and decoder to preserve detailed information. The discriminator uses a convolutional neural network structure to determine whether the input image is a real image or a generated image. The semantic segmentation label map is used as the input condition for the pix2pix generator, and the corresponding real defect image is used as the output target of the generator. The generator receives the label map and outputs the generated image, while the discriminator receives a pair of inputs—the label map and the real image, or the label map and the generated image—and outputs the authenticity judgment result.

[0048] Training employs a multi-loss fusion function as the overall training objective. The total loss = adversarial loss + pixel loss + semantic segmentation loss, which are weighted and summed according to preset weights. In this embodiment, the loss function = 0.4 × adversarial loss + 0.3 × L1 loss + 0.3 × SegFormer semantic segmentation loss, where:

[0049] The adversarial loss is calculated from the discriminator output and is used to drive the generated image to visually approximate the real image. The pixel loss adopts L1 loss, which calculates the pixel-level difference between the generated image and the real image to ensure pixel detail similarity. The semantic segmentation loss adopts cross-entropy loss, which is obtained by the SegFormer model performing forward inference on the generated image to obtain the predicted segmentation result, and then calculating the cross-entropy with the input semantic label to constrain the semantic consistency between the generated image and the real image, ensuring that the generated defective region corresponds accurately to the input label semantically.

[0050] The training set data is input into the collaborative framework for iterative training. Every preset number of iterations, the model performance is validated on the validation set to evaluate the similarity between the generated image and the real image. When the similarity between the generated image and the real image reaches the preset convergence condition, training is stopped, and the trained pix2pix model is obtained.

[0051] Step 3: Create a semantic label candidate set. Based on the existing defect type features, create a diverse set of semantic label candidates.

[0052] Semantic tags are manually created or expanded from multiple dimensions to form a rich tag candidate set, covering dimensions including: defect size (including defect annotations of different scales, covering small, medium, and large sizes); defect morphology (including various geometric shapes such as point defects, line defects, block defects, and irregular defects); and defect location (including defect annotations located in different distribution areas such as product surface areas, edge areas, and internal areas). This coverage of rare defect locations supplements existing training data with tags for rare defect types that are not covered or have very few samples, specifically addressing the long-tail defect problem. Through this multi-dimensional combination, a large number of tag maps with different semantic layouts are generated, providing diverse input conditions for subsequent virtual sample generation.

[0053] Step 4: Generate virtual image samples. Input the semantic label candidate set created in Step 3 into the trained pix2pix model to generate corresponding virtual defect image samples.

[0054] Each label image in the semantic label candidate set is used as input and fed into the pix2pix generator trained in step two. The generator outputs a virtual defect image corresponding to the semantic meaning of the input label. Since the pix2pix model has learned the mapping rules from labels to real images, the generated virtual image is highly consistent with the real industrial scene in terms of texture, lighting, and defect morphology.

[0055] like Figure 3 The diagram showing the virtual image generation process illustrates the generation effect from label input to virtual image output. The left side shows the input semantic label image (different colors represent different defect types), and the right side shows the corresponding virtual defect image generated by the pix2pix model.

[0056] Step 5: Reverse semantic segmentation verification and sample selection. The SegFormer semantic segmentation model is used to perform reverse semantic segmentation verification on the generated virtual image samples. Valid virtual samples whose semantic consistency meets the preset threshold are selected to construct the expanded training dataset.

[0057] Each generated virtual image is input into the SegFormer semantic segmentation model for forward inference to obtain a predicted semantic label map for the virtual image. The intersection-over-union (IoU) ratio between the predicted semantic label map and the original input label map used to generate the virtual image is calculated. The IoU measures the degree of overlap of defective regions in the two label maps. A preset semantic consistency threshold is set. In this embodiment, virtual samples with an IoU ≥ 90% are considered valid and retained, while samples with an IoU below 90% are considered low-quality and discarded. All the selected valid virtual samples are combined with their corresponding semantic labels and merged with the original real training data to form the expanded training dataset. This selection mechanism ensures that all virtual samples entering the training set have accurate semantic annotations, avoiding interference from low-quality generated samples in subsequent model training.

[0058] Step 6: Expand the dataset to train the semantic segmentation model. Use the expanded training dataset constructed in Step 5 to train the SegFormer semantic segmentation model.

[0059] An expanded training dataset (containing original real samples and filtered virtual samples) is input into the SegFormer model for training. In this embodiment, the SegFormerHead component of the SegFormer model has been specifically optimized, including: a channel attention module, which adaptively learns the importance weights of each feature channel through global pooling operations, enhancing the response of channels related to defect features and suppressing noise from irrelevant channels; a spatial attention module, which generates a spatial weight map to guide the model to focus its attention on potential defect regions, effectively suppressing noise interference from complex industrial backgrounds; and an edge enhancement module, which adopts a structure combining edge convolutional layers and residual connections to strengthen the feature representation of defect boundaries, improving the localization accuracy and detection sensitivity for small-sized defects. After training, a semantic segmentation defect detection model with higher detection accuracy and stronger generalization ability is obtained.

[0060] An adversarial label inversion and virtual image generation system for semantic segmentation, implemented using the aforementioned method, includes the following functional modules: a data preprocessing module, used to collect real images of industrial defects and their corresponding semantic segmentation label maps, perform size normalization processing, and divide them into training and validation sets according to a preset ratio; a co-training module, which incorporates the SegFormer semantic segmentation model and the pix2pix conditional generative adversarial model, used to construct a co-training framework for the two, and uses a multi-loss fusion function to train the pix2pix model to learn the mapping relationship from semantic labels to real images; and a label generation module, used to generate labels from defect size, defect shape, and defect location. The system creates diverse semantic label candidate sets from multiple dimensions, including various types of defect region annotations; the image generation module inputs the semantic label candidate sets into the trained pix2pix model to generate corresponding virtual defect image samples; the sample selection module, with a built-in SegFormer semantic segmentation model, performs reverse semantic segmentation verification on the virtual image samples, selects valid virtual samples that meet the semantic consistency standard through intersection-union ratio calculation, and constructs an expanded training dataset; the model training module inputs the expanded training dataset into the optimized SegFormer model for training, resulting in a high-precision, highly generalized defect detection model.

[0061] The method of this invention requires only a small number of real-labeled samples to train the generative model. By manually designing diverse labels to drive the generation of a large number of virtual defect samples, the training data scale can be expanded several times, completely breaking through the bottleneck of low-probability defects being difficult to collect. The multi-dimensional label generation strategy covers multiple dimensions such as size, shape, and location, and can specifically supplement rare and long-tail defect types, significantly enriching the defect type coverage and effectively improving the model's ability to detect rare defects. The multi-loss fusion training mechanism takes into account visual realism (adversarial loss), pixel similarity (L1 loss), and semantic consistency (segmentation loss). The generated virtual images not only have realistic industrial textures but also ensure accurate semantic correspondence of defects, with a fitting degree far superior to single-generative models. The reverse semantic segmentation verification stage uses the intersection-union ratio as a hard indicator to screen samples, retaining only virtual images that meet the semantic consistency standard, eliminating low-quality generated samples from the source from interfering with training, and ensuring the safety and usability of the expanded data. By combining dual attention and edge enhancement in SegFormer optimization, the model's sensitivity to small defects and boundary localization capabilities are enhanced. With training on an expanded dataset, both the model's mIoU and generalization ability are significantly improved, with particularly outstanding performance in detecting unseen defect types. Virtual samples replace a large amount of real-world data collection and manual annotation, significantly reducing data acquisition costs and shortening the model training cycle. This allows for rapid adaptation to various industrial quality inspection scenarios, including machinery, electronics, and sheet metal processing.

[0062] It is understood that the present invention has been described through some embodiments, and those skilled in the art will recognize that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, under the teachings of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of the present invention.

Claims

1. A method for adversarial label inversion and virtual image generation oriented towards semantic segmentation, characterized in that, Includes the following steps: S1. Collect real images of defects and their corresponding semantic segmentation label images, normalize the image size, label different defect types, and divide them into training set and validation set according to a preset ratio. S2. Construct a collaborative training framework for a semantic segmentation model and a conditional generative adversarial model. Use the semantic segmentation label map as the input condition of the conditional generative adversarial model and the real image corresponding to the semantic segmentation label map as the output target of the conditional generative adversarial model. Train the conditional generative adversarial model to learn the mapping relationship from semantic labels to real images. S3. Create a semantic label candidate set, which contains various types of defect region annotations; S4. Input the semantic label candidate set into the conditional generative adversarial model to generate corresponding virtual image samples; S5. Use the semantic segmentation model to perform reverse semantic segmentation verification on the generated virtual image samples, filter out the valid virtual samples whose semantic consistency meets the preset threshold, and construct the expanded training dataset. S6. Use the expanded training dataset for training the semantic segmentation model.

2. The adversarial label inversion and virtual image generation method for semantic segmentation according to claim 1, characterized in that, The training of the conditional generative adversarial model described in S2 uses a multi-loss fusion function, which includes adversarial loss, pixel loss, and semantic segmentation loss. The three are weighted and summed according to preset weights as the overall training objective.

3. The adversarial label inversion and virtual image generation method for semantic segmentation according to claim 2, characterized in that, The semantic segmentation loss is the cross-entropy loss, which is obtained by the semantic segmentation model through forward reasoning on the generated image and is used to constrain the semantic consistency between the generated image and the real image.

4. The adversarial label inversion and virtual image generation method for semantic segmentation according to claim 1, characterized in that, The semantic segmentation model is the SegFormer model, whose SegFormerHead component includes a channel attention module and a spatial attention module. The channel attention module adaptively learns the importance weights of each feature channel through global pooling, and the spatial attention module generates a spatial weight map to guide the model to focus on potential defect regions.

5. The adversarial label inversion and virtual image generation method for semantic segmentation according to claim 4, characterized in that, The SegFormerHead component also includes an edge enhancement module, which adopts a structure that combines edge convolutional layers with residual connections.

6. The adversarial label inversion and virtual image generation method for semantic segmentation according to claim 1, characterized in that, The semantic tag candidate set described in S3 includes defect type tags for defect size, defect shape, and defect location; The defect morphology includes dot-like, linear, block-like, and irregular shapes; the defect location includes the surface, edge, and interior.

7. The adversarial label inversion and virtual image generation method for semantic segmentation according to claim 1, characterized in that, The reverse semantic segmentation verification described in S5 includes the following steps: inputting the generated virtual image into the semantic segmentation model to obtain the predicted semantic label map, calculating the intersection-union ratio (IU) between the predicted semantic label map and the input original semantic label map, and retaining virtual samples whose IU meets a preset threshold as valid samples.

8. The adversarial label inversion and virtual image generation method for semantic segmentation according to claim 1, characterized in that, The conditional generative adversarial model is a pix2pix model, with a U-Net generator and a convolutional neural network discriminator.

9. The adversarial label inversion and virtual image generation method for semantic segmentation according to claim 1, characterized in that, During the training process of the conditional generative adversarial model described in S2, the model performance is verified on the validation set every preset number of iterations, and training stops when the similarity between the generated image and the real image reaches the convergence condition.

10. An adversarial label inversion and virtual image generation system for semantic segmentation, characterized in that, The method for adversarial label inversion and virtual image generation oriented towards semantic segmentation as described in any one of claims 1-9 includes: The data preprocessing module is used to collect real images of industrial defects and their corresponding semantic segmentation label maps, and to perform size normalization and dataset partitioning. The collaborative training module is used to build a collaborative training framework for the semantic segmentation model and the conditional generative adversarial model, and to train the conditional generative adversarial model to learn the mapping relationship from semantic labels to real images. The tag generation module is used to create a set of semantic tag candidates containing annotations of various defect regions with different morphologies; The image generation module is used to input the semantic label candidate set into the conditional generative adversarial model and generate corresponding virtual image samples. The sample selection module is used to perform reverse semantic segmentation verification on virtual image samples using a semantic segmentation model, select valid virtual samples, and build an expanded training dataset. The model training module is used to train the semantic segmentation model using the expanded training dataset.