System for generating virtual defect image and method thereof
The system addresses the issue of visible boundaries in virtual defect images by segmenting and transforming defects in pixel units, applying image blending and correction, improving AI model learning.
Patent Information
- Application Number
- JP2025084430
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-27
- Filing Date
- 2025-05-20
- Publication Date
- 2025-12-10
AI Technical Summary
Conventional methods for generating virtual defect images result in visible boundaries of cropped defective images, reducing the learning ability of AI models.
A system and method that segments defects in pixel units, applies transformation methods, and synthesizes them into normal images using image blending and correction techniques to reduce boundary prominence.
Reduces the prominence of cropped defect image borders and enables synthesis of larger defects, enhancing the learning capability of AI models.
Smart Images

Figure 2025179817000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a virtual defect image generation system and method, and more particularly to a virtual defect image generation system and method that segments defects from an image containing the defects, combines the defects with a normal image, and generates a virtual defect image using image blending. [Background technology]
[0002] Detecting defects in manufactured products is an important task in the manufacturing industry. In particular, there is active research into technologies that can detect various defects by generating virtual defect images and training artificial intelligence models.
[0003] However, conventional technology for generating virtual defect images involves cropping a portion of a defective image and combining it with a normal image, which has the limitation that the boundaries of the cropped defective image become visible, reducing the learning ability of the AI model.
[0004] Therefore, there is a current need for a technique to generate more natural virtual defect images. The background art of the present invention is described in Korean Patent Publication No. 10-2024-0044757 (published on April 5, 2024). Summary of the Invention [Problem to be solved by the invention]
[0005] According to the present invention, there is provided a virtual defect image generating system and method for segmenting defects from an image containing the defects, combining the defects with a normal image, and generating a virtual defect image using image blending. [Means for solving the problem]
[0006] According to an embodiment of the present invention to solve this technical problem, a virtual defect image generation system may include an input unit to which a normal image or a defect image including at least one defect is input, an extraction unit to separate and extract defects from the input defect image, a pre-processing unit to convert the extracted defects by applying a predetermined conversion method to the defects, and a synthesis unit to synthesize and correct the defects converted into the normal image.
[0007] The synthesis unit can identify the type of defect for the extracted defect and synthesize the extracted defect at a point within a preset area where the defect of that type can occur according to the type of defect.
[0008] The pre-processing unit can match an identifier to the defect according to the location where the extracted defect occurs.
[0009] The identifier may include a type of defect and a preset area in which the type of defect may occur.
[0010] The synthesis unit can copy and synthesize the defect converted into the input normal image, and select pixels on the boundary of the defect as correction targets.
[0011] The synthesis unit may calculate a gradient of the defect from the normal image into which the defect has been synthesized, calculate a gradient of the normal image, and extract a boundary line of the defect.
[0012] The synthesis unit may extract magnitudes in the x and y directions from the calculated gradient of the defect and the gradient of the normal image, respectively, and calculate a gradient using the larger value of the extracted magnitudes in the x and y directions.
[0013] The synthesis unit may calculate a function between the normal image and the defect using a differential equation for the gradient calculated using the extracted boundary line and the larger value of the magnitude in the x and y directions, and may correct the boundary line by multiplying the normal image by the calculated function.
[0014] In another embodiment of the present invention, a virtual defect image generating method may include a step in which an input unit inputs a normal image or a defect image including at least one defect; a step in which an extraction unit separates and extracts defects from the input defect image; a step in which a pre-processing unit applies a predetermined conversion method to the extracted defects to convert the defects; and a step in which a synthesis unit synthesizes and corrects the defects converted into the normal image. [Effects of the Invention]
[0015] According to the present invention, it is possible to reduce the prominence of the borders of the cropped defect images that occurs when the cropped defect images are combined in the conventional method.
[0016] Furthermore, defects of a relatively large size can be synthesized by extracting the defects themselves and converting the extracted defects by various methods. [Brief explanation of the drawings]
[0017] [Figure 1] 1 is a block diagram of a virtual defect imaging system according to one embodiment of the present invention;
[0018] [Figure 2] 4 is a flowchart of a method for generating a virtual defect image according to another embodiment of the present invention.
[0019] [Figure 3] 10 is an exemplary diagram showing an example of extracting defects and generating a virtual image according to another embodiment of the present invention; FIG.
[0020] [Figure 4] FIG. 10 is an exemplary diagram showing an example of extracting a defect according to another embodiment of the present invention.
[0021] [Figure 5] FIG. 10 is an exemplary diagram showing an example of modifying an extracted defect according to another embodiment of the present invention.
[0022] [Figure 6] FIG. 10 is an exemplary diagram showing an example of correction according to another embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0023] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In this process, the thickness of lines and the size of components shown in the drawings may be exaggerated for clarity and convenience.
[0024] In addition, the terms used below are defined in consideration of the functions of the present invention, and may vary depending on the intentions or practices of users or operators. Therefore, the definitions of such terms should be based on the contents of this specification as a whole.
[0025] FIG. 1 is a block diagram of a virtual defect imaging system according to one embodiment of the present invention.
[0026] As shown in FIG. 1, the virtual defect image generation system 100 can include an input section 110 , an extraction section 120 , a preprocessing section 130 , and a synthesis section 140 .
[0027] First, the input unit 110 can input a normal image or a defective image containing at least one defect.
[0028] Specifically, the input unit 110 may receive a normal image or a defective image including at least one defect from a user using a database (not shown), a server (not shown), an imaging device (not shown), or the like.
[0029] Next, the extraction unit 120 can segment and extract defects from the input defect image.
[0030] Specifically, the extracting unit 120 can separate and extract defects from the input defect image in units of pixels according to a signal input by a user.
[0031] At this time, the extraction unit 120 does not crop and extract the defect, but separates and extracts it in pixel units, so that only the defect area can be easily synthesized.
[0032] Next, the pre-processing unit 130 can apply a preset transformation method (e.g., rotation, shift, reduction, expansion, etc.) to the extracted defect to transform the defect.
[0033] Specifically, the pre-processing unit 130 may match the extracted defect with an identifier according to the location where the extracted defect occurs, and may apply a preset transformation method (e.g., rotation, translation, reduction, enlargement, etc.) to the extracted transformation. In this case, the identifier may include the type of defect and at least one region where the preset type of defect may occur.
[0034] That is, the pre-processing unit 130 can rotate, shrink, move, or enlarge the extracted defect to change the state of the defect.
[0035] The combiner 140 can then combine and correct the defects converted into a normal image.
[0036] Specifically, the synthesis unit 140 may identify the type of defect for the extracted defect and synthesize the extracted defect at a point within a preset area where the defect of the type may occur, depending on the defect type. In this case, the identification of the defect type may be performed using a pre-trained discrimination model, which is a model trained to output the type of defect when an image including the defect is input using the type of defect and an image including the defect of the type as training data.
[0037] The synthesis unit 140 can also copy and synthesize the converted defect into the input normal image, and select pixels around the boundary line as correction targets.
[0038] Furthermore, the composition unit 140 may apply a predetermined correction method (eg, image blending, Poisson's equation, etc.) to the pixels selected as correction targets to perform correction.
[0039] The virtual defect image generating system will be described in more detail below with reference to FIGS.
[0040] FIG. 2 is a flowchart of a method for generating a virtual defect image according to another embodiment of the present invention, and FIG. 3 is an exemplary diagram showing an example of extracting a defect and generating a virtual image according to another embodiment of the present invention.
[0041] As shown in FIGS. 2 and 3, the input unit 110 can input a normal image or a defective image containing at least one defect (S210).
[0042] Specifically, the input unit 110 may receive a normal image or a defective image including at least one defect from a user using a database (not shown), a server (not shown), an imaging device (not shown), or the like.
[0043] Next, the extracting unit 120 can separate and extract defects from the input failure image (S220).
[0044] Specifically, the extracting unit 120 can separate and extract defects from the input defect image in pixel units according to a signal input by a user.
[0045] FIG. 4 is an exemplary diagram showing an example of extracting a defect according to another embodiment of the present invention.
[0046] As shown in FIG. 4, the extracting unit 120 can separate and extract defects displayed in white in units of pixels according to a signal input by a user.
[0047] At this time, the extraction unit 120 can extract the defect in the same form as the defect form (marked in yellow).
[0048] Next, the pre-processing unit 130 can transform the extracted defect by applying a preset transformation method (for example, rotation, translation, reduction, enlargement, etc.) to the defect (S230).
[0049] Specifically, the pre-processing unit 130 may match the extracted defect with an identifier according to the location where the extracted defect occurs, and may apply a preset transformation method (e.g., rotation, translation, reduction, enlargement, etc.) to the extracted transformation. In this case, the identifier may include the type of defect and at least one region where the preset type of defect may occur.
[0050] Furthermore, the preprocessing unit 130 can transform the detected defect using at least one of rotation, translation, reduction, and enlargement in response to a selection signal input by the user.
[0051] FIG. 5 is an exemplary diagram showing an example of modifying an extracted defect according to another embodiment of the present invention.
[0052] As shown in FIG. 5, the pre-processing unit 130 can apply a preset transformation method (e.g., rotation, translation, shrinking, enlarging, etc.) to the extracted defect to transform the defect at least once.
[0053] According to one embodiment of the present invention, the pre-processing unit 130 can rotate and zoom the extracted defects to transform the defects.
[0054] That is, the preprocessing unit 130 can rotate, shrink, move, or enlarge the extracted defect to change the state of the defect.
[0055] Next, the synthesis unit 140 can synthesize and correct the defects converted into a normal image (S240).
[0056] Specifically, the synthesis unit 140 may identify the type of defect for the extracted defect and synthesize the extracted defect from a normal image to a point within a preset area where the defect of the type may occur, depending on the type of defect. In this case, the identification of the defect type may be performed using a pre-trained discrimination model, which is a model trained to output the type of defect when an image including the defect is input using the type of defect and an image including the defect of the type as training data.
[0057] The synthesis unit 140 can also identify the type of the defect after conversion and synthesize the defect at a position corresponding to the type of defect identified from the normal image.
[0058] Furthermore, the synthesis unit 140 can copy and synthesize the converted defect onto the input normal image, and select pixels around the boundary line as correction targets.
[0059] The synthesis unit 140 can correct the selected correction target by applying a predetermined correction method (for example, image blending, Poisson's equation, etc.).
[0060] According to an embodiment of the present invention, the composition unit 140 may perform correction by applying an image blending method to the pixels selected as correction targets.
[0061] According to an embodiment of the present invention, the synthesizing unit 140 may perform correction by applying the Poisson equation to the pixel selected as the correction target.
[0062] FIG. 6 is an exemplary diagram showing an example of correction according to another embodiment of the present invention.
[0063] As shown in FIG. 6, the synthesis unit 140 can calculate the gradient of the defect from the normal image into which the defect has been synthesized, calculate the gradient of the normal image, and extract the boundary line of the defect from the normal image into which the defect has been synthesized.
[0064] In addition, the synthesis unit 140 can extract the magnitudes of the gradient of the defect and the gradient of the normal image in the x and y directions from the normal image into which the calculated defect is synthesized, and calculate the gradient using the larger value of the extracted magnitudes in the x and y directions.
[0065] According to one embodiment of the present invention, the magnitudes of the x and y directions of the gradient of the defect (e.g., (-1, 2)) and the gradient of the normal image (e.g., (5, 1)) are extracted from the normal image into which the defect has been synthesized, and the gradient (e.g., (5, 2)) can be calculated using the larger value of the extracted magnitudes in the x and y directions.
[0066] In addition, the composition unit 140 may calculate a function between the defect and the normal image into which the defect has been composed using a differential equation for the extracted boundary line and the calculated gradient. Here, the method of calculating the gradient during the image composition and calculating the function between the two images is the same as the conventionally disclosed method, and therefore a detailed description thereof will be omitted.
[0067] The combining unit 140 can correct the boundary line of the defect by multiplying the normal image into which the defect has been combined by the calculated function.
[0068] According to the above-described embodiment of the present invention, it is possible to mitigate the border prominence of the cropped defect image that occurs when conventionally combining cropped defect images.
[0069] Furthermore, according to the embodiment of the present invention, defects of a relatively large size can be synthesized by extracting the defects themselves and transforming the extracted defects in various ways.
[0070] Specifically, existing virtual defect generation methods crop a relatively small defect and combine it with a normal image. The size of the box containing the defect is relatively small, and the border (edge) of the box does not stand out in the normal image. However, as the size of the defect increases, the size of the box also increases, and the border becomes more prominent, making the defect more likely to be exposed. Since defects are identified not by their shape but by the border of the cropped box, this does not have a positive effect on image learning.
[0071] However, according to an embodiment of the present invention, it is possible to synthesize a relatively large defect by adjusting the pixel values similar to those of a normal image while maintaining the gradient (or rate of change of pixel values) of the defect extracted using the Poisson equation, setting a boundary where the extracted defect and the normal image meet, and adjusting the boundary portion of the extracted defect similar to the pixel values of the boundary portion of the normal image.
[0072] That is, according to an embodiment of the present invention, the synthesis unit 140 can set boundary conditions so that the boundary portion of the defect to be synthesized into the normal image is similar to the normal image, and adjust the pixel values of the boundary portion to satisfy the set boundary conditions.
[0073] Although the present invention has been described with reference to the embodiments shown in the drawings, these are merely examples, and those skilled in the art will recognize that various modifications and equivalent embodiments are possible. Therefore, the true technical scope of the present invention should be determined by the technical spirit of the following claims. [Explanation of symbols]
[0074] 100: Virtual defect image generation system
[0075] 110: Input section
[0076] 120: Extraction part
[0077] 130: Preprocessing section
[0078] 140: Synthesis section
Claims
1. an input section to which a normal image or a faulty image containing at least one defect is input; an extraction unit that separates and extracts defects from the input failure image; a pre-processing unit that applies a preset conversion method to the extracted defects to convert the defects; a synthesis unit that synthesizes and corrects the defects converted into the normal image.
2. The synthesis unit 2. The virtual defect image generation system of claim 1, further comprising: identifying a defect type for an extracted defect; and synthesizing the extracted defect at a point within a predetermined area where a defect of that type can occur according to the defect type.
3. The pre-treatment unit The virtual defect imaging system of claim 1 , wherein the identifier is matched to the defect according to the location of the extracted defect.
4. The identifier is 4. The virtual defect imaging system of claim 3, comprising a type of defect and a preset area where the defect of that type can occur.
5. The synthesis unit 2. The virtual defect image generating system according to claim 1, wherein the defect converted into the input normal image is copied and synthesized, and pixels on the boundary of the defect are selected as correction targets.
6. The synthesis unit The virtual defect image generation system according to claim 1 , further comprising: calculating a gradient of the defect from a normal image into which the defect has been synthesized; calculating a gradient of the normal image; and extracting a boundary line of the defect.
7. The synthesis unit 7. The virtual defect image generating system of claim 6, wherein the magnitudes in the x and y directions are extracted from the calculated gradient of the defect and the gradient of the normal image, and the gradient is calculated using the larger value of the extracted magnitudes in the x and y directions.
8. The synthesis unit 8. The virtual defect image generating system of claim 7, further comprising: a differential equation for the gradient calculated using the extracted boundary line and the larger value of the magnitude in the x and y directions; a function between the normal image and the defect is calculated; and the boundary line is corrected by multiplying the normal image by the calculated function.
9. An input unit receives a normal image or a defective image including at least one defect; an extracting unit separating and extracting defects from the input failure image; a pre-processing unit applying a preset conversion method to the extracted defect to convert the defect; a synthesis unit synthesizing and correcting the defect converted into the normal image.
10. The correcting step includes:
10. The virtual defect image generating method of claim 9, further comprising identifying a defect type for the extracted defect, and synthesizing the extracted defect at a point within a predetermined area where the defect type can occur according to the defect type.
11. The extracting step includes: The virtual defect image generating method of claim 9, further comprising matching an identifier to the defect according to the location of the extracted defect.
12. The identifier is The method for generating a virtual defect image according to claim 11 , further comprising: a type of defect and a predetermined area where the defect of the type can occur.
13. The correcting step includes:
10. The virtual defect image generating method according to claim 9, further comprising the steps of: copying and combining the defect converted into the input normal image; and selecting pixels on the boundary line of the defect as the correction target.
14. The correcting step includes:
14. The virtual defect image generating method according to claim 9, further comprising the steps of: calculating a gradient of the defect from a normal image into which the defect has been synthesized; calculating a gradient of the normal image; and extracting a boundary line of the defect.
15. The correcting step includes: The method for generating a virtual defect image according to claim 14, further comprising extracting magnitudes in the x and y directions from the calculated gradient of the defect and the gradient of the normal image, and calculating the gradient using the larger value of the extracted magnitudes in the x and y directions.
16. The correcting step includes:
16. The method for generating a virtual defect image according to claim 15, further comprising: calculating a function between the normal image and the defect using a differential equation for the gradient calculated using the extracted boundary line and the larger value of the magnitude in the x and y directions; and correcting the boundary line by multiplying the normal image by the calculated function.