IP Library Granted Patent US 12,639,804
Granted Patent B2
US 12,639,804 · App. 18/433,673 · Granted May 26, 2026

Generating minority class defect detection data from visual inspection dataset using self-supervised defect generator

Inventors: Yinan He (Singapore, SG); Xinyan Chen (Singapore, SG); Rajesh Vellore Arumugam (Singapore, SG); Anantharaman Ravi (Singapore, SG)
Assignee: SAP SE
G06T7/001G06T2207/20081G06T2210/12
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,639,804
App. No.
18/433,673
Granted
May 26, 2026
Kind
B2
Abstract

Methods, systems, and computer-readable storage media for a defect detection system that generates synthetic defect data that is representative of real-world defects in products. The synthetic defect data is included in training data for training a defect detection model. The defect detection model is deployed to a production environment to detect defects in products.

Claims (40)

1 . A computer-implemented method for detecting defects in products, the method being executed by one or more processors and comprising:

generating a first set of context images from a set of positive images, each positive image representing one or more defects occurring in products, each context image in the first set of context images comprising at least one cropped area cropping out a defect represented in a respective positive image;

training a defect generation model using the set of context images, the defect generation model being trained to inpaint synthetic defects within cropped areas;

generating a second set of context images from a set of negative images, each negative image representing a product absent any defect, each context image in the second set of context images comprising at least one cropped area cropping representing a target defect location;

providing a set of synthetic defect data by processing the second set of context images through the defect generation model, for each context image in the second set of context images, the defect generation model inpainting a synthetic defect in the at least one cropped area to provide a synthetic defect image;

training a defect detection model using training data that comprises at least a portion of the set of synthetic defect data; and

executing defect detection of products by processing images of the products through the defect detection model.

2 . The method of claim 1 , wherein the context images in the first set of context images are generated based on a text embedding that is representative of text that indicates a target defect class.

3 . The method of claim 1 , wherein the defect generation model is trained based on a text embedding that is representative of text that indicates a target defect class.

4 . The method of claim 1 , wherein generating a second set of context images from a set of negative images comprises, for each negative image providing at least one bounding box indicating a location within the negative image that a defect is to be inpainted and cropping an area of the bounding box to provide the at least one cropped area.

5 . The method of claim 1 , wherein providing a set of synthetic defect data by processing the second set of context images through the defect generation model comprises providing a text embedding that is representative of text that indicates a target defect class to the defect generation model, the defect generation model inpainting a synthetic defect corresponding to the target defect class in each of the at least one cropped areas of the context images of the second set of context images.

6 . The method of claim 1 , wherein the set of synthetic defect data comprises synthetic defect images representative of multiple defect classes.

7 . The method of claim 1 , wherein the training data further comprises at least a portion of the set of negative images.

8 . A non-transitory computer-readable storage medium coupled to one or more processors and having instructions stored thereon which, when executed by the one or more processors, cause the one or more processors to perform operations for detecting defects in products, the operations comprising:

generating a first set of context images from a set of positive images, each positive image representing one or more defects occurring in products, each context image in the first set of context images comprising at least one cropped area cropping out a defect represented in a respective positive image;

training a defect generation model using the set of context images, the defect generation model being trained to inpaint synthetic defects within cropped areas;

generating a second set of context images from a set of negative images, each negative image representing a product absent any defect, each context image in the second set of context images comprising at least one cropped area cropping representing a target defect location;

providing a set of synthetic defect data by processing the second set of context images through the defect generation model, for each context image in the second set of context images, the defect generation model inpainting a synthetic defect in the at least one cropped area to provide a synthetic defect image;

training a defect detection model using training data that comprises at least a portion of the set of synthetic defect data; and

executing defect detection of products by processing images of the products through the defect detection model.

9 . The non-transitory computer-readable storage medium of claim 8 , wherein the context images in the first set of context images are generated based on a text embedding that is representative of text that indicates a target defect class.

10 . The non-transitory computer-readable storage medium of claim 8 , wherein the defect generation model is trained based on a text embedding that is representative of text that indicates a target defect class.

11 . The non-transitory computer-readable storage medium of claim 8 , wherein generating a second set of context images from a set of negative images comprises, for each negative image providing at least one bounding box indicating a location within the negative image that a defect is to be inpainted and cropping an area of the bounding box to provide the at least one cropped area.

12 . The non-transitory computer-readable storage medium of claim 8 , wherein providing a set of synthetic defect data by processing the second set of context images through the defect generation model comprises providing a text embedding that is representative of text that indicates a target defect class to the defect generation model, the defect generation model inpainting a synthetic defect corresponding to the target defect class in each of the at least one cropped areas of the context images of the second set of context images.

13 . The non-transitory computer-readable storage medium of claim 8 , wherein the set of synthetic defect data comprises synthetic defect images representative of multiple defect classes.

14 . The non-transitory computer-readable storage medium of claim 8 , wherein the training data further comprises at least a portion of the set of negative images.

15 . A system, comprising:

a computing device; and

a computer-readable storage device coupled to the computing device and having instructions stored thereon which, when executed by the computing device, cause the computing device to perform operations for detecting defects in products, the operations comprising:

generating a first set of context images from a set of positive images, each positive image representing one or more defects occurring in products, each context image in the first set of context images comprising at least one cropped area cropping out a defect represented in a respective positive image;

training a defect generation model using the set of context images, the defect generation model being trained to inpaint synthetic defects within cropped areas;

generating a second set of context images from a set of negative images, each negative image representing a product absent any defect, each context image in the second set of context images comprising at least one cropped area cropping representing a target defect location;

providing a set of synthetic defect data by processing the second set of context images through the defect generation model, for each context image in the second set of context images, the defect generation model inpainting a synthetic defect in the at least one cropped area to provide a synthetic defect image;

training a defect detection model using training data that comprises at least a portion of the set of synthetic defect data; and

executing defect detection of products by processing images of the products through the defect detection model.

16 . The system of claim 15 , wherein the context images in the first set of context images are generated based on a text embedding that is representative of text that indicates a target defect class.

17 . The system of claim 15 , wherein the defect generation model is trained based on a text embedding that is representative of text that indicates a target defect class.

18 . The system of claim 15 , wherein generating a second set of context images from a set of negative images comprises, for each negative image providing at least one bounding box indicating a location within the negative image that a defect is to be inpainted and cropping an area of the bounding box to provide the at least one cropped area.

19 . The system of claim 15 , wherein providing a set of synthetic defect data by processing the second set of context images through the defect generation model comprises providing a text embedding that is representative of text that indicates a target defect class to the defect generation model, the defect generation model inpainting a synthetic defect corresponding to the target defect class in each of the at least one cropped areas of the context images of the second set of context images.

20 . The system of claim 15 , wherein the set of synthetic defect data comprises synthetic defect images representative of multiple defect classes.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 6, 2024
From: HE, YINAN; CHEN, XINYAN; ARUMUGAM, RAJESH VELLORE; RAVI, ANANTHARAMAN
To: SAP SE
Reel/Frame 066390/0798 →
Continuity (1)
Related Publication 20250252554A1 · Aug 7, 2025
References Cited (36)
US 12518352B2 · Ramesh et al. · 2026 [cited by applicant]
US 20200364842A1 · Chaton · 2020 [cited by applicant]
US 20240020954A1 · Kelkar et al. · 2024 [cited by applicant]
US 20240062362A1 · Wang · 2024 [cited by examiner]
US 20240273374A1 · Lee · 2024 [cited by examiner]
US 20250119624A1 · Oh · 2025 [cited by examiner]
US 20250297566A1 · Rouet-Leduc · 2025 [cited by examiner]
CN 114764765 · 2022 [cited by applicant]
CN 116468725 · 2023 [cited by applicant]
CN 116703874 · 2023 [cited by applicant]
CN 116993976 · 2023 [cited by applicant]
EP 4123506 · 2023 [cited by applicant]
WO WO2022119870 · 2022 [cited by applicant]
WO WO2022161974 · 2022 [cited by applicant]
Defect Image Sample Generation With GAN for Improving Defect Recognition , by Niu et al., IEEE Transactions On Automation Science and Engineering, vol. 17, No. 3, Jul. 2020; pp. 1611-1622 (Year: 2020). [cited by examiner]
Brown et al., “Language models are few-shot learners” Advances in neural information processing systems 33, 2020, 25 pages. [cited by applicant]
Ho et al., “Denoising diffusion probabilistic models” Advances in neural information processing systems, 33, 2020, 12 pages. [cited by applicant]
Pathak et al., “Context encoders: Feature learning by inpainting” In Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, 2536-2544. [cited by applicant]
Reimers et al., “Sentence-bert: Sentence embeddings using siamese bert-networks” CoRR, Submitted on Aug. 2019, arXiv:1908.10084v1, 11 pages. [cited by applicant]
Extended European Search Report in European Appln. No. 25152989.7, mailed on Jul. 1, 2025, 6 pages. [cited by applicant]
Extended European Search Report in European Appln. No. 25155829.2, mailed on May 23, 2025, 9 pages. [cited by applicant]
Huang et al., “Image difference captioning with instance-level fine-grained feature representation.” IEEE transactions on multimedia 24, Apr. 2021, 2004-2017. [cited by applicant]
U.S. Appl. No. 18/582,802, filed Feb. 21, 2024, Chen et al. [cited by applicant]
U.S. Appl. No. 18/969,362, filed Dec. 5, 2024, Mishra et al. [cited by applicant]
Chen et al., “A zero-/few-shot anomaly classification and segmentation method for CVPR 2023 VAND workshop challenge tracks 1 &2. 1st Place on Zero-shot AD and 4th Place on Few-shot AD 2305” CoRR, Submitted on May 27, 20… [cited by applicant]
Chen et al., “See-through-text grouping for referring image segmentation.” Paper, Presented at Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, South Korea, Oct. 27, 2019-Nov. 2, 2019, 745… [cited by applicant]
Deng et al., “PTMNet: Pixel-Text Matching Network for Zero-Shot Anomaly Detection,” Paper, Presented at 2023 9th International Conference on Big Data and Information Analytics (BigDIA), Haikou, China, Dec. 15-17, 2023, … [cited by applicant]
Jeong et al., “Winclip: Zero-/few-shot anomaly classification and segmentation.” Paper, Presented at Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, Vancouver, BC, Canada, Jun. 17-24, … [cited by applicant]
Li et al., “Referring image segmentation via recurrent refinement networks.” Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, Jun. 18-23, 2018, 5745-5753. [cited by applicant]
Liu et al., “Referring image segmentation using text supervision.” Paper, Presented at Proceedings of the IEEE/CVF international conference on computer vision, Paris, France, Oct. 1-6, 2023, 22124-22134. [cited by applicant]
Shan et al., “Human-machine hybrid strategy for defect semantic segmentation with limited data.” IEEE Transactions on Instrumentation and Measurement 73, Dec. 2023, 1-15. [cited by applicant]
Tao et al., “Deep learning for unsupervised anomaly localization in industrial images: A survey.” IEEE Transactions on Instrumentation and Measurement 71, Aug. 2022, 1-21. [cited by applicant]
Wang, “Learning to detect and segment for open vocabulary object detection.” Paper, Presented at Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, Jun. 17-24, 2023… [cited by applicant]
Yu et al., “Zero-shot Referring Image Segmentation with Global-Local Context Features,” Paper, Presented at 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, Jun. 18-22, … [cited by applicant]
Zhang et al., “Combined anomaly aware weakly supervised lightweight model for surface defect inspection.” IEEE Transactions on Industrial Informatics 20.4, Jan. 2024, 6652-6663. [cited by applicant]
Zhang et al., “Gpt-4v-ad: Exploring grounding potential of vqa-oriented gpt-4v for zero-shot anomaly detection.” CoRR, Submitted on Apr. 16, 2024, arXiv:2311.02612v2, 9 pages. [cited by applicant]