A defect data real-time generation segmentation model training method

By locating and cropping defective and non-defective images and enriching their features, real-time defect fusion images are generated, which solves the problems of data imbalance and noise interference in semantic segmentation models and improves the robustness and generalization ability of the models.

CN115937134BActive Publication Date: 2026-04-24BEIJING LUSTER LIGHTTECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING LUSTER LIGHTTECH
Filing Date
2022-12-05
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing semantic segmentation algorithms suffer from limited generalization ability due to limited labeled data, making them prone to over- and under-detection issues. Furthermore, they suffer from severe imbalance between target and background data, resulting in significant noise interference.

Method used

By acquiring defective and non-defective images, localization, cropping, and feature enrichment processing are performed to generate real-time defect fusion images. The defect database is then used to train a segmentation model, optimize network parameters, reduce noise interference, and improve the data imbalance problem.

Benefits of technology

It improves the robustness and generalization ability of the segmentation model, reduces data redundancy during model iteration, and enhances the real-time generation capability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115937134B_ABST
    Figure CN115937134B_ABST
Patent Text Reader

Abstract

The application provides a kind of defect data real-time generation segmentation model training method, the training method includes obtaining first defect image, first annotation image and obtaining non-defect image;Three are positioned cutting processing, selection fusion image, initial label annotation and feature rich processing are carried out respectively to obtain first target fusion image;Judge whether there is defect target in the first target fusion image;If there is, then the first target fusion image is carried out defect fusion generation processing to obtain real-time defect fusion image, real-time defect fusion image includes fusion area;Judge whether the size ratio of fusion area and real-time defect fusion image is greater than preset value;If yes, then according to real-time defect fusion image, segmentation model training is carried out and network parameter is updated and iteratively optimized.The application improves the data imbalance problem by the above method, weakens the interference of noise, optimizes the robustness of model, reduces the redundancy of data in model iteration process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image computer vision analysis and processing, and in particular to a method for training a segmentation model for real-time generation of defect data. Background Technology

[0002] Manufacturing is a fundamental sector of the national economy. With the development of science and technology, intelligent manufacturing has become a breakthrough and an inevitable path for transforming China from a manufacturing giant to a manufacturing powerhouse. Industrial robots, as irreplaceable equipment and tools in intelligent manufacturing, have become an important indicator of a country's manufacturing and technological level. Traditional manufacturing cannot function without manual labor, and even more so without human inspection and judgment. To achieve machine replacement of human labor, the key issue lies in realizing the intelligentization of robot vision, which is a crucial way to address rising manufacturing costs and environmental constraints. In intelligent manufacturing, using industrial robot vision technology to inspect industrial products will help identify process problems in production, promptly improve production processes, and enhance product quality.

[0003] Semantic segmentation is one of the most important topics in computer vision. It has also been one of the most important and popular research areas in computer vision in recent years, with related algorithms and technologies finding increasingly widespread applications in industry. Currently, semantic segmentation algorithms are widely used in industrial manufacturing, medical image processing, autonomous driving, smart cities, and other fields, significantly impacting industrial productivity.

[0004] Semantic segmentation typically employs a method of training a model to fit a labeled dataset, thereby obtaining a segmentation model to capture regions of interest. However, since the labeled image data is extremely limited, the segmentation model learns by fitting and learning on such limited data, resulting in limited generalization ability and a tendency to produce over- or under-detections. Summary of the Invention

[0005] This application provides a training method for a segmentation model that generates defect data in real time. This training method improves the imbalance between the real-time generated target and background data, reduces noise interference, and optimizes the robustness of the model.

[0006] The training method described in this application includes:

[0007] Acquire a first defect image and a first annotation image. The first defect image is an image with a defect. The location of the defect in the first defect image is the defect region. The first annotation image is an image outlined within the defect region.

[0008] Obtain a non-defect image, wherein the non-defect image is an image without defects;

[0009] The first defect image, the first labeled image, and the non-defect image are respectively subjected to positioning and cropping processing to obtain the first defect image block, the first labeled image block, and the non-defect image block;

[0010] Select the first defective image block or the non-defective image block as the fused image, and perform initial labeling processing on the fused image to obtain the first labeled fused image;

[0011] The first labeled fused image is subjected to feature enrichment processing to obtain the first target fused image;

[0012] Determine whether there is a defective target in the first target fused image;

[0013] If it does not exist, then the first target fusion image is subjected to defect fusion generation processing to obtain a real-time defect fusion image. The initial label of the real-time defect fusion image is a fusion label. The real-time defect fusion image includes a fusion region, which is the region of the first target fusion image that has been fused with other target fusion images after the defect fusion generation processing.

[0014] Determine whether the ratio of the size of the fusion region to the size of the real-time defect fusion image is greater than a preset value;

[0015] If so, the real-time defect fusion image is input into the network for segmentation model training, and the network parameters are updated and iterated under the supervision of the fusion label.

[0016] Preferably, the method further includes the following steps before obtaining the first defect image and the first annotation image:

[0017] Build a defect database;

[0018] Several defect images are obtained from the defect database, the defect images including defect regions;

[0019] For each defect image, the defect region is manually outlined to obtain several labeled images, and the defect images and the labeled images are in a one-to-one correspondence.

[0020] Input the defect image and the labeled image into the defect database;

[0021] The first defect image and the first labeled image are obtained from the defect database.

[0022] Preferably, the method for acquiring the non-defective image is random acquisition;

[0023] The steps of locating and cropping the first defect image, the first labeled image, and the non-defect image respectively include:

[0024] The first defect image, the first labeled image, and the non-defect image are respectively subjected to positioning and cropping processing at the same position.

[0025] Preferably, the step of performing initial labeling processing on the fused image to obtain the first labeled fused image includes:

[0026] Determine whether the fused image is the first defect image;

[0027] If so, the first labeled image is used as the initial label of the fused image;

[0028] If not, the initial label of the fused image is initialized to the background class.

[0029] Preferably, the step of performing feature enrichment processing on the first annotated fused image to obtain the first target fused image includes:

[0030] The first labeled fused image is subjected to illumination and color transformation processing to obtain a first rich image, and the initial label of the first rich image remains unchanged;

[0031] The first enriched image is randomly rotated to obtain a second enriched image, while the initial labels of the second enriched image remain unchanged.

[0032] The initial label of the second enriched image is transformed to obtain the first target fused image, and the initial label of the first target fused image is the first label.

[0033] Preferably, the step of determining whether to perform defect fusion generation processing on the first target fusion image to determine whether to determine whether to perform defect fusion generation processing on the first target fusion image includes:

[0034] Determine whether there is a defective target in the first target fused image;

[0035] If it does not exist, then perform defect fusion generation processing on the first target fused image;

[0036] If it exists, the fusion probability is calculated based on the fusion probability of the first target fused image;

[0037] Determine whether the fusion probability is greater than a probability threshold;

[0038] If not, the first target fused image is input into the network for segmentation model training, and the network parameters are updated and iteratively optimized under the supervision of the first label;

[0039] If so, then the first target fused image is subjected to defect fusion generation processing.

[0040] Preferably, the step of performing defect fusion generation processing on the first target fused image to obtain the real-time defect fused image includes:

[0041] Obtain the second defect image and the second labeled image from the defect database;

[0042] The second defect image and the second labeled image are preprocessed sequentially to obtain the second target fused image;

[0043] The first target fusion image and the second target fusion image are randomly fused to obtain a real-time defect fusion image.

[0044] Preferably, the initial label of the second target fused image is the second label;

[0045] The step of randomly fusing the first target fused image and the second target fused image includes:

[0046] The second target fusion image is randomly fused into the region of the first target fusion image that does not contain defective targets;

[0047] The second label is incorporated into the first label to obtain a real-time defect fusion image, wherein the real-time defect fusion image includes a fusion label.

[0048] Preferably, the preprocessing includes processing to change the defect distribution, processing to change the brightness, saturation and contrast, processing to perform affine transformation and processing to trim the image.

[0049] The step of sequentially preprocessing the second defect image and the second labeled image to obtain the second target fused image includes:

[0050] The defect distribution alteration process is applied to the second defect image and the second labeled image to obtain a first preprocessed image;

[0051] The first preprocessed image is subjected to the aforementioned brightness, saturation, and contrast alteration processes to obtain the second preprocessed image;

[0052] The second preprocessed image is subjected to the affine transformation process to obtain the third preprocessed image;

[0053] The cropping process is performed on the third preprocessed image to obtain the second target fused image.

[0054] Preferably, the step of determining whether the ratio of the size of the fused region to the size of the real-time defect fused image is less than a preset value further includes:

[0055] If not, perform defect fusion generation processing on the first target fused image again until the ratio of the size of the fused region to the size of the real-time defect fused image is greater than a preset value;

[0056] Output the real-time defect fusion image.

[0057] This application provides a method for training a segmentation model for real-time generation of defect data. The training method includes acquiring a first defect image and a first labeled image, wherein the first defect image is an image with defects, the defect location of the first defect image is a defect region, and the first labeled image is an image outlined within the defect region; acquiring a non-defect image, wherein the non-defect image is an image without defects; performing localization and cropping processing on the first defect image, the first labeled image, and the non-defect image respectively to obtain a first defect image block, a first labeled image block, and a non-defect image block; selecting the first defect image block or the first non-defect image block as a fusion image, and performing initial labeling processing on the fusion image to obtain a first labeled fusion image. The method involves: merging the first labeled fused image; performing feature enrichment processing on the first labeled fused image to obtain a first target fused image; determining whether a defective target exists in the first target fused image; if so, performing defect fusion generation processing on the first target fused image to obtain a real-time defect fused image, wherein the real-time defect fused image includes a fusion region, which is the region of the first target fused image fused with other target fused images after the defect fusion generation processing; determining whether the ratio of the size of the fusion region to the size of the real-time defect fused image is greater than a preset value; if so, outputting the real-time defect fused image and inputting it into a network for segmentation model training, and updating and iterating the network parameters under the supervision of real-time fusion labels. The training method described in this application trains the segmentation model using a small number of labeled images and a certain amount of easily obtainable non-defective samples. Data fusion generation improves the problem of imbalance between real-time generated target and background data, reduces noise interference, and optimizes the robustness of the model. By comprehensively utilizing the synergistic effect of defective and non-defective images, online data augmentation is performed, and the segmentation model is trained based on the real-time generated data, ensuring that the feature performance of each sample exhibits certain differences, reducing data redundancy during model iteration. Attached Figure Description

[0058] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0059] Figure 1 This is a flowchart illustrating the training method for a segmentation model that generates defect data in real time according to this application.

[0060] Figure 2 This is a flowchart illustrating the initial label annotation process in the segmentation model training method for real-time generation of defect data according to this application.

[0061] Figure 3 This is a flowchart illustrating the feature-rich processing in the segmentation model training method for real-time generation of defect data in this application.

[0062] Figure 4 This is a flowchart illustrating the defect fusion generation process in the segmentation model training method for real-time defect data generation according to this application.

[0063] Figure 5 This is a flowchart illustrating the preprocessing steps in the segmentation model training method for real-time generation of defect data according to this application.

[0064] Figure 6 This is a flowchart illustrating the random fusion processing in the segmentation model training method for real-time generation of defect data according to this application. Detailed Implementation

[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0066] Figure 1 This is a flowchart illustrating the training method for a segmentation model that generates defect data in real time, as described in this application.

[0067] refer to Figure 1 As can be seen, this embodiment provides a method for training a segmentation model for real-time generation of defect data, the training method including:

[0068] S100, acquire a first defect image and a first annotation image, wherein the first defect image is an image with a defect, the defect location of the first defect image is a defect region, and the first annotation image is an image outlined within the defect region.

[0069] Specifically, in this embodiment, before obtaining the first defect image and the first annotation image, a step of constructing a defect database is included. The first defect image and the first annotation image are both obtained from the defect database. The first defect image and the first annotation image are a pair of defect images. The first defect image is an image with a defect location, where the location of the defect in the first defect image is the defect region, and the first annotation image is an image of the defect region. It can also be understood that the first defect image is contained in the first annotation image.

[0070] The specific steps for obtaining the first defect image and the first annotation image are as follows: construct the defect database; then obtain several defect images from the defect database, each defect image including a defect region; manually delineate the boundary contour of the defect region on each defect image to obtain several annotation images; it should be noted that the defect images and the annotation images are in a one-to-one correspondence; input the defect images and the annotation images into the defect database; and then obtain the first defect image and the first annotation image from the defect database.

[0071] The training method also includes:

[0072] S200, Obtain a non-defect image, wherein the non-defect image is an image without defects.

[0073] Specifically, in this embodiment, the non-defect image is a normal image, that is, an image without defects; the non-defect image is not obtained from the defect database, but can be obtained from qualified products; and the data is augmented online through the synergistic effect of the first defect image and the non-defect image, so that the feature performance of each sample shows a certain difference, reducing the redundancy of data during model iteration, and training the segmentation model based on the real-time generated data.

[0074] The training method also includes:

[0075] S300, the first defect image, the first labeled image and the non-defect image are respectively positioned and cropped to obtain the first defect image block, the first labeled image block and the non-defect image block.

[0076] Specifically, in this embodiment, the first defect image, the first annotation image, and the non-defect image are all relatively large in size, resulting in a large amount of data processing. Therefore, considering this issue, the first defect image, the first annotation image, and the non-defect image are first subjected to positioning and cropping processing to reduce their size, resulting in the first defect image block, the first annotation image block, and the non-defect image block.

[0077] The specific steps of the positioning and cropping process are as follows: cropping is performed at random and corresponding positions in the first defect image and the first labeled image to obtain the first defect image block and the first labeled image block; after a certain degree of shaking is performed at the corresponding position on the non-defect image block, cropping is performed again to obtain the non-defect image block.

[0078] The training method also includes:

[0079] S400, select the first defective image block or the non-defective image block as the fused image, and perform initial labeling processing on the fused image to obtain the first labeled fused image.

[0080] Specifically, in this embodiment, the initial labels of the initial labels are different depending on the selected fused image. After the initial labeling process, the first defective image or the non-defective image is transformed into the first labeled fused image.

[0081] The training method also includes:

[0082] S500, the first labeled fused image is subjected to feature enrichment processing to obtain the first target fused image.

[0083] Specifically, in this embodiment, the first annotated fused image undergoes feature enrichment processing. The purpose of this feature enrichment processing is to give the first annotated fused image diverse characteristics. After the feature enrichment processing, the first annotated fused image is transformed into the first target fused image. After obtaining the first target fused image, defect fusion generation processing can be performed.

[0084] The training method also includes:

[0085] S600, determine whether there is a defective target in the first target fused image.

[0086] S700, if not, then perform defect fusion generation processing on the first target fusion image to obtain a real-time defect fusion image. The initial label of the real-time defect fusion image is a fusion label. The real-time defect fusion image includes a fusion region, which is the region of the first target fusion image that has been fused with other target fusion images after the defect fusion generation processing.

[0087] Specifically, in this embodiment, after the first target fused image undergoes the defect fusion generation process, the first image fused image is transformed into a real-time defect fused image, and the initial transition of the real-time defect fused image is also transformed into a real-time fusion label; wherein other target fused images are fused during the real-time defect fusion generation process, and the region fused with other target fused images is called the real-time fusion region.

[0088] The specific steps following the determination of whether there are defective targets in the first target fused image also include:

[0089] S1000, if it exists, then calculate the fusion probability based on the first target fusion image;

[0090] S1100, determine whether the fusion probability is greater than the probability threshold;

[0091] S1200, if not, the first target fused image is input into the network for segmentation model training, and the network parameters are updated and iteratively optimized under the supervision of the first label;

[0092] S700, if so, then perform defect fusion generation processing on the first target fused image.

[0093] As can be seen from the above, in this embodiment, the network parameters can be updated and iterated not only through the real-time defect fusion image, but also by inputting the real-time first target fusion image into the network to optimize the network parameters after the real-time first target fusion image meets the above conditions.

[0094] Real-time training methods also include:

[0095] S800, determine whether the ratio of the size of the fusion region to the size of the real-time defect fusion image is greater than a preset value.

[0096] S900, the real-time defect fusion image is input into the network for segmentation model training, and the network parameters are updated and iteratively optimized under the supervision of the fusion label.

[0097] Specifically, in this embodiment, the determination of whether the real-time defect fusion image can be output and input into the network is made by judging the proportion of the size of the fusion region in the real-time defect fusion image; when the ratio of the size of the fusion region to the size of the real-time defect fusion image is greater than the preset value, the real-time defect fusion image is input into the network and a segmentation model is trained. Finally, the network parameters are updated and iterated under the supervision of the real-time fusion label. Here, "under the supervision of the fusion label" can also be understood as the real-time defect fusion image being standardized by the real-time fusion label.

[0098] Figure 2 This is a flowchart illustrating the initial label annotation process in the segmentation model training method for real-time generation of defect data according to this application.

[0099] refer to Figure 2 It can be seen that, further, in some embodiments, the step of performing initial labeling processing on the fused image to obtain a first labeled fused image includes:

[0100] S401, determine whether the fused image is the first defective image block;

[0101] S402, if so, then the first labeled image block is used as the initial label of the fused image;

[0102] S403, if not, initialize the initial label of the fused image to the background class.

[0103] Specifically, in this embodiment, there are two options for selecting the fused image: the first option is to select the first defective image block as the fused image, and the second option is to select the non-defective image block as the fused image. When the first option is selected, the fused image needs to undergo initial labeling processing, specifically, the first labeled image is used as the initial label of the fused image to obtain the first labeled fused image. When the second option is selected, the fused image also needs to undergo initial labeling processing, specifically, the initial label of the fused image is initialized to the background class to obtain the first labeled fused image.

[0104] Figure 3 This is a flowchart illustrating the feature-rich processing in the segmentation model training method for real-time generation of defect data in this application.

[0105] refer to Figure 3 It can be seen that, further, in some embodiments, the step of performing feature enrichment processing on the first annotated fused image to obtain the first target fused image includes:

[0106] S501, the first labeled fused image is subjected to illumination and color transformation processing to obtain the first rich image.

[0107] Specifically, in this embodiment, after the illumination color transformation process, the first labeled fused image is transformed into the first rich image, which has the characteristics of presenting different illumination scenes.

[0108] The step of performing feature enrichment processing on the first annotated fused image to obtain the first target fused image further includes:

[0109] S502, the first enriched image is randomly rotated to obtain the second enriched image.

[0110] Specifically, in this embodiment, after the random rotation process, the first enriched image is transformed into the second enriched image. The second enriched image, while possessing the characteristics of presenting different lighting scenarios, also has the characteristic of richer local neighborhood features of the data.

[0111] The step of performing feature enrichment processing on the first annotated fused image to obtain the first target fused image further includes:

[0112] S503, the initial label of the second enriched image is transformed to obtain the first target fused image, and the initial label of the first target fused image is the first label.

[0113] Specifically, in this embodiment, after the initial label is transformed, the second enriched image is transformed into the first target fused image, and the initial label of the first target fused image is also transformed into the first label after the transformation process.

[0114] Figure 4 This is a flowchart illustrating the defect fusion generation process in the segmentation model training method for real-time defect data generation according to this application.

[0115] refer to Figure 4 It can be seen that, further, in some embodiments, the step of performing defect fusion generation processing on the first target fused image to obtain a real-time defect fused image includes:

[0116] S701, Obtain the second defect image and the second labeled image from the defect database.

[0117] S702, the second defect image and the second labeled image are preprocessed to obtain the second target fused image.

[0118] Specifically, in this embodiment, in order for the second defect image and the second labeled image to meet the conditions of the defect fusion generation process, the second defect image and the second labeled image need to be preprocessed. After preprocessing, the second defect image and the second labeled image are transformed into the second target fused image.

[0119] It should be noted that when the ratio of the size of the fusion region in the real-time defect fusion image to the size of the real-time defect fusion image is less than a preset value, it is necessary to re-process the real-time first target fusion image for defect fusion generation. Specifically, this involves re-obtaining the second defect image and the second labeled image from the defect database.

[0120] The step of performing defect fusion generation processing on the first target fused image to obtain a real-time defect fused image further includes:

[0121] S703, the first target fusion image and the second target fusion image are randomly fused to obtain the real-time defect fusion image.

[0122] Specifically, in this embodiment, after obtaining the second target fused image, the second fused image and the first fused image can be randomly fused to obtain the real-time defect fused image; it should be noted that the second target fused image also has an initial label, which is the second label.

[0123] Figure 5 This is a flowchart illustrating the preprocessing steps in the segmentation model training method for real-time generation of defect data according to this application.

[0124] refer to Figure 5 It is understood that, further, in some embodiments, the preprocessing includes processing to change the defect distribution, processing to change the brightness, saturation and contrast, processing of affine transformation and processing of cropping.

[0125] The step of sequentially preprocessing the second defect image and the second labeled image to obtain the second target fused image includes:

[0126] S7021, the second defect image and the second labeled image are subjected to the defect distribution change processing to obtain the first preprocessed image.

[0127] Specifically, in this embodiment, the defect distribution change processing enables the second defect image and the second annotation image to have the characteristic of representing defects from different angles and shapes. After the defect distribution processing, the second defect image and the second annotation image are transformed into the first preprocessed image.

[0128] Following the defect distribution alteration process, the following is also included:

[0129] S7022, the first preprocessed image is subjected to the brightness, saturation and contrast modification processing to obtain the second preprocessed image.

[0130] Specifically, in this embodiment, the first preprocessed image is made to have the characteristic of displaying color diversity by changing the brightness, saturation and contrast. After the change of brightness, saturation and contrast, the first preprocessed image is transformed into the second preprocessed image.

[0131] The steps following the brightness, saturation, and contrast adjustment process also include:

[0132] S7023, Perform the affine transformation on the second preprocessed image to obtain the third preprocessed image.

[0133] Specifically, in this embodiment, the affine transformation process gives the second preprocessed image the characteristic of diverse defect representation shapes. After the affine transformation process, the second preprocessed image is transformed into the third preprocessed image.

[0134] The affine transformation process is followed by:

[0135] S7024, the cropping process is performed on the third preprocessed image to obtain the second target fused image.

[0136] Specifically, in this embodiment, the cropping process enables the third preprocessed image to exhibit multi-scale and significantly defective characteristics, and the cropping process can also produce different defective representations. After the cropping process, the third preprocessed image is transformed into the second target fused image. Through the above four processing operations, compared with the conventional method of first transforming the entire image and then obtaining the defective region, it is more efficient and targeted, and can also avoid generating misleading information.

[0137] Figure 6 This is a flowchart illustrating the random fusion processing in the segmentation model training method for real-time generation of defect data according to this application.

[0138] refer to Figure 6 It can be seen that, further, in some embodiments, the step of randomly fusing the first target fused image and the second target fused image includes:

[0139] S7031, the second target fusion image is randomly fused into a region of the first target fusion image that does not contain a defective target;

[0140] S7032, the second label is incorporated into the first label to obtain a real-time defect fusion image, wherein the real-time defect fusion image includes a fusion label.

[0141] Specifically, in this embodiment, the region randomly fused into the first target fusion image by the second target fusion image is a region that does not contain defective targets, and the region fused into the first target fusion image by the second target fusion image is also referred to as the fusion region.

[0142] When the second fused image and the first fused image are randomly fused, the second label is also fused into the first label in the first target fused image, and the fused label is the fused label.

Claims

1. A method for training a segmentation model in real-time generation of defect data, characterized in that, The training method includes: Acquire a first defect image and a first annotation image. The first defect image is an image with a defect. The location of the defect in the first defect image is the defect region. The first annotation image is an image outlined within the defect region. Obtain a non-defect image, wherein the non-defect image is an image without defects; The first defect image, the first labeled image, and the non-defect image are respectively subjected to positioning and cropping processing to obtain the first defect image block, the first labeled image block, and the non-defect image block; Select the first defective image block or the non-defective image block as the fused image, and perform initial labeling processing on the fused image to obtain the first labeled fused image; The first labeled fused image is subjected to feature enrichment processing to obtain the first target fused image; Determine whether there is a defective target in the first target fused image; If it does not exist, then the first target fusion image is subjected to defect fusion generation processing to obtain a real-time defect fusion image. The initial label of the real-time defect fusion image is a fusion label. The real-time defect fusion image includes a fusion region, which is the region of the first target fusion image that has been fused with other target fusion images after the defect fusion generation processing. Determine whether the ratio of the size of the fusion region to the size of the real-time defect fusion image is greater than a preset value; If so, the real-time defect fusion image is input into the network for segmentation model training, and the network parameters are updated and iterated under the supervision of the fusion label. The step of determining whether there are defective targets in the first target fused image further includes: If it exists, the fusion probability is calculated based on the fusion probability of the first target fused image; Determine whether the fusion probability is greater than a probability threshold; If not, the first target fused image is input into the network for segmentation model training, and the network parameters are updated and iterated under the supervision of the first label; the initial label of the first target fused image is the first label; If so, then the first target fused image is subjected to defect fusion generation processing to obtain a real-time defect fused image; The step of determining whether the ratio of the size of the fusion region to the size of the real-time defect fusion image is greater than a preset value further includes: If not, perform defect fusion generation processing on the first target fused image again until the ratio of the size of the fused region to the size of the real-time defect fused image is greater than a preset value; Output the real-time defect fusion image.

2. The method for training a segmentation model for real-time generation of defect data according to claim 1, characterized in that, Prior to the steps of acquiring the first defect image and the first annotation image, the method further includes: Build a defect database; Several defect images are obtained from the defect database, the defect images including defect regions; For each defect image, the defect region is manually outlined to obtain several labeled images, and the defect images and the labeled images are in a one-to-one correspondence. Input the defect image and the labeled image into the defect database; The first defect image and the first labeled image are obtained from the defect database.

3. The method for training a segmentation model for real-time generation of defect data according to claim 1, characterized in that, The method for obtaining non-defective images is random acquisition; The steps of locating and cropping the first defect image, the first labeled image, and the non-defect image respectively include: The first defect image, the first labeled image, and the non-defect image are respectively subjected to positioning and cropping processing at the same position.

4. The method for training a segmentation model for real-time generation of defect data according to claim 1, characterized in that, The step of performing initial labeling processing on the fused image to obtain the first labeled fused image includes: Determine whether the fused image is the first defect image; If so, the first labeled image is used as the initial label of the fused image; If not, the initial label of the fused image is initialized to the background class.

5. The method for training a segmentation model for real-time generation of defect data according to claim 1, characterized in that, The step of performing feature enrichment processing on the first annotated fused image to obtain the first target fused image includes: The first labeled and fused image is subjected to illumination and color transformation processing to obtain the first rich image; The first enriched image is randomly rotated to obtain the second enriched image; The initial labels of the second enriched image are transformed to obtain the first target fused image.

6. The method for training a segmentation model for real-time generation of defect data according to claim 2, characterized in that, The step of performing defect fusion generation processing on the first target fused image to obtain a real-time defect fused image includes: Obtain the second defect image and the second labeled image from the defect database; The second defect image and the second labeled image are preprocessed to obtain the second target fused image; The real-time defect fusion image is obtained by randomly fusing the first target fusion image and the second target fusion image.

7. The method for training a segmentation model for real-time generation of defect data according to claim 6, characterized in that, The initial label of the second target fused image is the second label; The step of randomly fusing the first target fused image and the second target fused image includes: The second target fusion image is randomly fused into the region of the first target fusion image that does not contain defective targets; The second label is incorporated into the first label to obtain a real-time defect fusion image, wherein the real-time defect fusion image includes a fusion label.

8. The method for training a segmentation model for real-time generation of defect data according to claim 6, characterized in that, The preprocessing includes processing to change the defect distribution, processing to change the brightness, saturation and contrast, processing to perform affine transformation and processing to cut the material. The steps of preprocessing the second defect image and the second labeled image sequentially to obtain the second target fused image include: The defect distribution alteration process is applied to the second defect image and the second labeled image to obtain a first preprocessed image; The first preprocessed image is subjected to the aforementioned brightness, saturation, and contrast alteration processes to obtain the second preprocessed image; The second preprocessed image is subjected to the affine transformation process to obtain the third preprocessed image; The cropping process is performed on the third preprocessed image to obtain the second target fused image.

Citation Information

Patent Citations

  • Panel defect detection method and device based on image fusion and equipment terminal

    CN110599453A

  • Data enhancement method and device, data enhancement equipment and storage medium

    CN112884691A