Nothing Special   »   [go: up one dir, main page]

CN117496299A - A method, device, terminal equipment and medium for augmenting defect image data - Google Patents

A method, device, terminal equipment and medium for augmenting defect image data Download PDF

Info

Publication number
CN117496299A
CN117496299A CN202311442141.4A CN202311442141A CN117496299A CN 117496299 A CN117496299 A CN 117496299A CN 202311442141 A CN202311442141 A CN 202311442141A CN 117496299 A CN117496299 A CN 117496299A
Authority
CN
China
Prior art keywords
defect image
image data
original
quality
surface defect
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311442141.4A
Other languages
Chinese (zh)
Inventor
王雅琳
周泽雄
谭栩杰
刘晨亮
袁君奇
潘雨晴
谢无非
陈燚涛
桂卫华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Central South University
Original Assignee
Central South University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Central South University filed Critical Central South University
Priority to CN202311442141.4A priority Critical patent/CN117496299A/en
Publication of CN117496299A publication Critical patent/CN117496299A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20076Probabilistic image processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Medical Informatics (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

The application is applicable to the technical field of image processing, and provides a method, a device, terminal equipment and a medium for amplifying defect image data, wherein original defect image training data are obtained; training a pre-constructed denoising diffusion probability model by using original defect image training data to obtain a trained denoising diffusion probability model, and inputting the original defect image training data into the trained denoising diffusion probability model to generate surface defect image data; evaluating high-quality image data from the surface defect image data, and constructing new surface defect image data according to the high-quality image data and the original defect image training data; progressively training a denoising diffusion probability model by utilizing new defect image numbers meeting preset quality requirements, and amplifying acquired target defect image data by utilizing the trained denoising diffusion probability model; the method and the device can improve the generation quality of the defect image.

Description

一种缺陷图像数据的增广方法、装置、终端设备及介质A method, device, terminal equipment and medium for augmenting defect image data

技术领域Technical field

本申请属于图像处理技术领域,尤其涉及一种缺陷图像数据的增广方法、装置、终端设备及介质。The present application belongs to the field of image processing technology, and in particular relates to a method, device, terminal equipment and medium for augmenting defect image data.

背景技术Background technique

在现代工业生产过程中,受原材料、热处理、运输等因素影响,钢材、钢板等工业产品表面会出现诸如划痕、斑块和轧屑等缺陷,为保证产品质量、节约生产资源,进行产品表面缺陷检测是保证产品质量的关键步骤。其中,表面缺陷检测技术是现代工业实现无人化、智能化检测的重要技术手段,但在实际生产过程中,缺陷数据的匮乏是制约表面缺陷检测技术发展的最大障碍。因而,在有限的缺陷数据样本下实现缺陷图像数据增广是表面缺陷智能检测技术发展的重要方向。In the modern industrial production process, affected by factors such as raw materials, heat treatment, and transportation, defects such as scratches, plaques, and mill scale will appear on the surface of steel, steel plates, and other industrial products. In order to ensure product quality and save production resources, product surface inspection Defect detection is a key step to ensure product quality. Among them, surface defect detection technology is an important technical means for realizing unmanned and intelligent detection in modern industry. However, in the actual production process, the lack of defect data is the biggest obstacle restricting the development of surface defect detection technology. Therefore, achieving defect image data augmentation with limited defect data samples is an important direction for the development of intelligent surface defect detection technology.

数据增广技术是扩充数据样本的一种重要方式。传统数据增广算法基于先验知识对原有的缺陷数据进行几何和色差的转换,这类方法简单有效,但在实际工业应用中可扩展性较差。随着深度学习技术的发展,众多研究者从有限的数据样本中学习缺陷数据的深度特征,并利用深度模型逼近缺陷数据特征的真实分布,然后通过在真实分布内采样,生成满足缺陷特征分布的缺陷数据。Data augmentation technology is an important way to expand data samples. Traditional data augmentation algorithms convert the original defect data into geometric and color differences based on prior knowledge. This method is simple and effective, but has poor scalability in actual industrial applications. With the development of deep learning technology, many researchers learn the deep features of defect data from limited data samples, and use deep models to approximate the true distribution of defect data features, and then generate models that satisfy the defect feature distribution by sampling within the real distribution. Defect data.

目前,在基于深度学习的数据增广技术中,应用最广泛的是生成对抗网络,但该网络主要的缺陷在于:在面对分布差异较大的小样本数据集问题,生成对抗网络所产生的样本存在质量极端的情况,例如缺陷特征不明显、数据结构性参数与原数据集差异较大的情况。此外,在面对分布差异较大的小样本数据集问题,生成对抗网络容易出现训练过程不稳定、模式崩溃的问题。At present, among the data augmentation technologies based on deep learning, the most widely used one is the generative adversarial network. However, the main flaw of this network is that when faced with the problem of small sample data sets with large distribution differences, the generated adversarial network generates There are extreme cases of sample quality, such as situations where the defect characteristics are not obvious, and the data structural parameters are greatly different from the original data set. In addition, when faced with the problem of small sample data sets with large distribution differences, generative adversarial networks are prone to instability in the training process and model collapse.

因此,亟需一种新的缺陷图像数据增广方法,来解决现有缺陷图像数据增广方法生成的新缺陷图像数据质量低的问题。Therefore, a new defect image data augmentation method is urgently needed to solve the problem of low quality of new defect image data generated by existing defect image data augmentation methods.

发明内容Contents of the invention

本申请提供了一种缺陷图像数据的增广方法、装置、终端设备及介质,可以解决现有缺陷图像数据增广方法生成的新缺陷图像数据质量低的问题。The present application provides a defect image data augmentation method, device, terminal equipment and medium, which can solve the problem of low quality of new defect image data generated by the existing defect image data augmentation method.

第一方面,本申请提供了一种缺陷图像数据的增广方法,包括:In the first aspect, this application provides a method for augmenting defect image data, including:

步骤1,获取原始缺陷图像训练数据;原始缺陷图像训练数据包括多个原始缺陷图像;Step 1: Obtain original defect image training data; the original defect image training data includes multiple original defect images;

步骤2,利用原始缺陷图像训练数据对预先构建的去噪扩散概率模型进行训练,得到训练后的去噪扩散概率模型,并将原始缺陷图像训练数据输入训练后的去噪扩散概率模型,生成表面缺陷图像数据;表面缺陷图像数据包括多个表面缺陷图像;Step 2: Use the original defect image training data to train the pre-built denoising diffusion probability model to obtain the trained denoising diffusion probability model, and input the original defect image training data into the trained denoising diffusion probability model to generate the surface Defect image data; surface defect image data includes multiple surface defect images;

步骤3,从表面缺陷图像数据中评估出高质量图像数据,并根据高质量图像数据和原始缺陷图像训练数据,构建新表面缺陷图像数据,判断新表面缺陷图像数据是否满足预设质量要求;高质量图像数据包括多个高质量图像;Step 3: Evaluate high-quality image data from the surface defect image data, construct new surface defect image data based on the high-quality image data and original defect image training data, and determine whether the new surface defect image data meets the preset quality requirements; High Quality image data includes multiple high-quality images;

步骤4,若新表面缺陷图像数据满足预设质量要求,则将步骤2中训练后的去噪扩散概率模型作为最终去噪扩散概率模型,利用最终去噪扩散概率模型,对采集的目标缺陷图像数据进行增广;否则,根据新表面缺陷图像数据和原始缺陷图像训练数据,构建中间原始缺陷图像训练数据,并将中间原始缺陷图像训练数据作为步骤2中的原始缺陷图像训练数据,返回执行步骤2。Step 4. If the new surface defect image data meets the preset quality requirements, use the denoising diffusion probability model trained in step 2 as the final denoising diffusion probability model, and use the final denoising diffusion probability model to analyze the collected target defect images. The data is augmented; otherwise, the intermediate original defect image training data is constructed based on the new surface defect image data and the original defect image training data, and the intermediate original defect image training data is used as the original defect image training data in step 2, and returns to the execution step 2.

可选的,从表面缺陷图像数据中评估出高质量图像数据,包括:Optionally, evaluate high-quality image data from surface defect image data, including:

构建基于LPIPS的深层特征评估器,并根据深层特征评估器计算每个表面缺陷图像的LPIPS评分;Construct a deep feature evaluator based on LPIPS, and calculate the LPIPS score of each surface defect image based on the deep feature evaluator;

计算每个表面缺陷图像的SSIM评分;Calculate the SSIM score for each surface defect image;

将LPIPS评分小于预设评分阈值且SSIM评分大于预设指标阈值的表面缺陷图像评估为高质量图像,得到高质量图像数据。Surface defect images with LPIPS scores less than the preset score threshold and SSIM scores greater than the preset index threshold are evaluated as high-quality images to obtain high-quality image data.

可选的,构建基于LPIPS的深层特征评估器,并根据深层特征评估器计算每个表面缺陷图像的LPIPS评分,包括:Optionally, build a deep feature evaluator based on LPIPS and calculate the LPIPS score of each surface defect image based on the deep feature evaluator, including:

步骤i,从表面缺陷图像数据中确定出低质量图像,得到低质量图像数据P1 low;低质量图像表示与原始缺陷图像之间的相似度低于预设相似度阈值的表面缺陷图像;Step i, determine the low-quality image from the surface defect image data to obtain low-quality image data P 1 low ; the low-quality image represents a surface defect image whose similarity to the original defect image is lower than the preset similarity threshold;

步骤ii,利用预先构建的初始AlexNet网络,分别提取原始缺陷图像训练数据的缺陷特征和低质量图像数据的缺陷特征;Step ii, use the pre-built initial AlexNet network to extract defect features of the original defect image training data and defect features of the low-quality image data respectively;

步骤iii,若原始缺陷图像训练数据的缺陷特征和低质量图像数据的缺陷特征之间的特征相似度小于预设特征相似度阈值,则微调初始AlexNet网络的参数,得到微调后的AlexNet网络,并将微调后的AlexNet网络作为步骤ii中的初始AlexNet网络,返回执行步骤ii;否则,执行步骤iv;Step iii, if the feature similarity between the defect features of the original defect image training data and the defect features of the low-quality image data is less than the preset feature similarity threshold, fine-tune the parameters of the initial AlexNet network to obtain the fine-tuned AlexNet network, and Use the fine-tuned AlexNet network as the initial AlexNet network in step ii, and return to step ii; otherwise, perform step iv;

步骤iv,利用微调后的AlexNet网络提取每个表面缺陷图像的图像特征,并根据图像特征计算表面缺陷图像的LPIPS评分。Step iv, use the fine-tuned AlexNet network to extract the image features of each surface defect image, and calculate the LPIPS score of the surface defect image based on the image features.

可选的,步骤3中判断新表面缺陷图像数据是否满足预设质量要求,包括:Optionally, in step 3, determine whether the new surface defect image data meets the preset quality requirements, including:

步骤a,若新表面缺陷图像数据与原始缺陷图像训练数据的LPIPS评分差值小于预设LPIPS评分差值阈值,且,新缺陷图像数据的SSIM评分差值大于预设SSIM评分差值阈值,则确定新缺陷图像数据满足预设质量要求;否则,执行步骤b;Step a, if the LPIPS score difference between the new surface defect image data and the original defect image training data is less than the preset LPIPS score difference threshold, and the SSIM score difference of the new defect image data is greater than the preset SSIM score difference threshold, then Determine that the new defect image data meets the preset quality requirements; otherwise, perform step b;

步骤b,若第v+1次构建的新缺陷图像数据的LPIPS评分与第v次构建的新缺陷图像数据的LPIPS评分之间的差值小于预设阈值,则确定第v+1次构建的新缺陷图像数据满足预设质量要求;否则,确定新缺陷图像数据不满足预设质量要求。Step b, if the difference between the LPIPS score of the new defect image data constructed for the v+1th time and the LPIPS score of the new defective image data constructed for the vth time is less than the preset threshold, then determine the LPIPS score of the new defect image data constructed for the v+1th time. The new defect image data meets the preset quality requirements; otherwise, it is determined that the new defect image data does not meet the preset quality requirements.

第二方面,本申请提供了一种缺陷图像数据的增广装置,包括:In the second aspect, this application provides an augmentation device for defect image data, including:

图像获取模块,用于获取原始缺陷图像训练数据;原始缺陷图像训练数据包括多个原始缺陷图像;The image acquisition module is used to obtain original defect image training data; the original defect image training data includes multiple original defect images;

表面缺陷图像生成模块,用于利用原始缺陷图像训练数据对预先构建的去噪扩散概率模型进行训练,得到训练后的去噪扩散概率模型,并将原始缺陷图像训练数据输入训练后的去噪扩散概率模型,生成表面缺陷图像数据;表面缺陷图像数据包括多个表面缺陷图像;The surface defect image generation module is used to train the pre-built denoising diffusion probability model using the original defect image training data to obtain the trained denoising diffusion probability model, and input the original defect image training data into the trained denoising diffusion probability model. Probabilistic model generates surface defect image data; surface defect image data includes multiple surface defect images;

高质量图像评估模块,用于从表面缺陷图像数据中评估出高质量图像数据,并根据高质量图像数据和原始缺陷图像训练数据,构建新表面缺陷图像数据,判断新表面缺陷图像数据是否满足预设质量要求;高质量图像数据包括多个高质量图像;The high-quality image evaluation module is used to evaluate high-quality image data from surface defect image data, construct new surface defect image data based on high-quality image data and original defect image training data, and determine whether the new surface defect image data meets the predicted requirements. Set quality requirements; high-quality image data includes multiple high-quality images;

模型增广模块,用于若新表面缺陷图像数据满足预设质量要求,则将表面缺陷图像生成模块中训练后的去噪扩散概率模型作为最终去噪扩散概率模型,利用最终去噪扩散概率模型,对采集的目标缺陷图像数据进行增广;否则,根据新表面缺陷图像数据和原始缺陷图像训练数据,构建中间原始缺陷图像训练数据,并将中间原始缺陷图像训练数据作为表面缺陷图像生成模块中的原始缺陷图像训练数据,返回执行表面缺陷图像生成模块。The model augmentation module is used to use the denoising diffusion probability model trained in the surface defect image generation module as the final denoising diffusion probability model if the new surface defect image data meets the preset quality requirements, and use the final denoising diffusion probability model , augment the collected target defect image data; otherwise, construct intermediate original defect image training data based on the new surface defect image data and original defect image training data, and use the intermediate original defect image training data as the surface defect image generation module The original defect image training data is returned to execute the surface defect image generation module.

第三方面,本申请提供了一种终端设备,包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,处理器执行计算机程序时实现上述的增广方法。In a third aspect, the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-mentioned augmented method is implemented.

第四方面,本申请提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现上述的增广方法。In a fourth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the above-mentioned augmentation method is implemented.

本申请的上述方案有如下的有益效果:The above solution of this application has the following beneficial effects:

本申请提供的缺陷图像数据的增广方法,通过将原始缺陷图像训练数据输入训练后的去噪扩散概率模型,生成表面缺陷图像数据,再从表面缺陷图像数据中评估出高质量图像数据,并根据高质量图像数据和原始缺陷图像训练数据,构建新表面缺陷图像数据,并利用新表面缺陷图像数据训练去噪扩散概率模型,丰富了去噪扩散概率模型训练数据的多样性,提高了去噪扩散概率模型训练数据的质量,提高了去噪扩散概率模型的准确性,从而有益于提高生成的新缺陷图像数据的质量。The augmentation method of defect image data provided by this application generates surface defect image data by inputting original defect image training data into the trained denoising diffusion probability model, and then evaluates high-quality image data from the surface defect image data, and Based on high-quality image data and original defect image training data, new surface defect image data is constructed, and the new surface defect image data is used to train the denoising diffusion probability model, which enriches the diversity of the denoising diffusion probability model training data and improves the denoising efficiency. The quality of the diffusion probability model training data improves the accuracy of the denoising diffusion probability model, which is beneficial to improving the quality of the new defect image data generated.

本申请的其它有益效果将在随后的具体实施方式部分予以详细说明。Other beneficial effects of the present application will be described in detail in the subsequent specific embodiments section.

附图说明Description of the drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the purpose of the present application. For some embodiments, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.

图1为本申请一实施例提供的缺陷图像数据的增广方法的流程图;Figure 1 is a flow chart of a method for augmenting defect image data provided by an embodiment of the present application;

图2为本申请一实施例中去噪扩散模型的结构示意图;Figure 2 is a schematic structural diagram of a denoising diffusion model in an embodiment of the present application;

图3为本申请一实施例中Lpips评分的计算流程示意图;Figure 3 is a schematic flow chart of the calculation process of Lpips score in an embodiment of the present application;

图4为本申请一实施例中SSIM评分的计算流程示意图;Figure 4 is a schematic flowchart of the calculation process of SSIM score in an embodiment of the present application;

图5为本申请一实施例提供的缺陷图像数据的增广装置的结构示意图;Figure 5 is a schematic structural diagram of an augmentation device for defect image data provided by an embodiment of the present application;

图6为本申请一实施例提供的终端设备的结构示意图。Figure 6 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.

具体实施方式Detailed ways

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures and technologies are provided to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It will be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and/or components but does not exclude one or more other The presence or addition of features, integers, steps, operations, elements, components and/or collections thereof.

还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It will also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "once" or "in response to determining" or "in response to detecting" depending on the context. ". Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, to mean "once determined" or "in response to a determination" or "once the [described condition or event] is detected ]" or "in response to detection of [the described condition or event]".

另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of this application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference in this specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Therefore, the phrases "in one embodiment", "in some embodiments", "in other embodiments", "in other embodiments", etc. appearing in different places in this specification are not necessarily References are made to the same embodiment, but rather to "one or more but not all embodiments" unless specifically stated otherwise. The terms "including," "includes," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

针对现有缺陷图像数据增广方法生成的新缺陷图像数据质量低的问题,本申请提供了一种缺陷图像数据的增广方法、装置、终端设备及介质,其中,该方法通过将原始缺陷图像训练数据输入训练后的去噪扩散概率模型,生成表面缺陷图像数据,再从表面缺陷图像数据中评估出高质量图像数据,并根据高质量图像数据和原始缺陷图像训练数据,构建新表面缺陷图像数据,并利用新表面缺陷图像数据训练去噪扩散概率模型,丰富了去噪扩散概率模型训练数据的多样性,提高了去噪扩散概率模型训练数据的质量,提高了去噪扩散概率模型的准确性,从而有益于提高生成的新缺陷图像数据的质量。In order to solve the problem of low quality of new defect image data generated by the existing defect image data augmentation method, this application provides a defect image data augmentation method, device, terminal equipment and medium, wherein the method uses the original defect image to The training data is input into the trained denoising diffusion probability model to generate surface defect image data, and then high-quality image data is evaluated from the surface defect image data, and a new surface defect image is constructed based on the high-quality image data and original defect image training data. data, and use the new surface defect image data to train the denoising diffusion probability model, which enriches the diversity of the denoising diffusion probability model training data, improves the quality of the denoising diffusion probability model training data, and improves the accuracy of the denoising diffusion probability model. properties, thereby benefiting to improve the quality of the new defect image data generated.

如图1所示,本申请提供的缺陷图像数据的增广方法包括以下步骤:As shown in Figure 1, the augmentation method of defect image data provided by this application includes the following steps:

步骤1,获取原始缺陷图像训练数据。Step 1: Obtain original defect image training data.

上述原始缺陷图像训练数据包括多个原始缺陷图像。The above original defect image training data includes a plurality of original defect images.

示例性的,在本申请的一实施例中,为了生成准确有效的工业表面缺陷图像数据,可通过开源数据集基于对比度、亮度和锐度的NEU-CLS(一个开源数据集)获取原始缺陷图像数据,该原始缺陷图像数据不仅包括原始缺陷图像,还包括每个图像所属缺陷的类别(如表面划痕缺陷,表面斑块缺陷以及表面轧屑缺陷)、尺寸参数、灰度均值以及灰度标准差。Illustratively, in an embodiment of the present application, in order to generate accurate and effective industrial surface defect image data, the original defect image can be obtained through the open source data set NEU-CLS (an open source data set) based on contrast, brightness and sharpness. Data, the original defect image data not only includes the original defect image, but also includes the category of the defect to which each image belongs (such as surface scratch defects, surface patch defects and surface scale defects), size parameters, grayscale mean value and grayscale standard Difference.

步骤2,利用原始缺陷图像训练数据对预先构建的去噪扩散概率模型进行训练,得到训练后的去噪扩散概率模型,并将原始缺陷图像训练数据输入训练后的去噪扩散概率模型,生成表面缺陷图像数据。Step 2: Use the original defect image training data to train the pre-built denoising diffusion probability model to obtain the trained denoising diffusion probability model, and input the original defect image training data into the trained denoising diffusion probability model to generate the surface Defect image data.

上述表面缺陷图像数据包括多个重建缺陷图像。The above-mentioned surface defect image data includes a plurality of reconstructed defect images.

应理解,去噪扩散概率模型(Probabilistic Denoising Diffusion Model)是一种基于概率的图像去噪方法,其通过迭代地应用一系列随机变换来逐步降低图像中的噪声水平,达到提升图像质量的效果。在本申请的实施例中,去噪扩散概率模型的模型结构如图2所示。It should be understood that the Probabilistic Denoising Diffusion Model is a probability-based image denoising method that gradually reduces the noise level in the image by iteratively applying a series of random transformations to achieve the effect of improving image quality. In the embodiment of the present application, the model structure of the denoising diffusion probability model is shown in Figure 2.

下面对步骤2中将原始缺陷图像训练数据输入训练后的去噪扩散概率模型,生成表面缺陷图像数据的过程进行示例性说明,具体如下:The following is an exemplary explanation of the process of inputting the original defect image training data into the trained denoising diffusion probability model to generate surface defect image data in step 2, as follows:

随机生成与原始缺陷图像的尺寸参数相同并且服从均值为0,方差为1的正态分布噪声矩阵其中,n表示噪声矩阵的序号,n=1,2,...,N,N表示噪声矩阵的总数。Randomly generate a normally distributed noise matrix with the same size parameters as the original defect image and a mean of 0 and a variance of 1. Among them, n represents the serial number of the noise matrix, n=1, 2,...,N, and N represents the total number of noise matrices.

分别针对每个噪声矩阵,通过计算公式For each noise matrix respectively, calculate the formula

βt=1-αt,n=1,…,N,t=1,…,Tβ t =1-α t , n = 1, ..., N, t = 1, ..., T

得到在第t-1时间步的第n个表面缺陷图像其中,/>表示第t时间步的第n个表面缺陷图像的预测噪声,βt表示超参数,αt表示超参数。Obtain the nth surface defect image at the t-1th time step Among them,/> represents the prediction noise of the nth surface defect image at the tth time step, β t represents the hyperparameter, and α t represents the hyperparameter.

步骤3从表面缺陷图像数据中评估出高质量图像数据,并根据高质量图像数据和原始缺陷图像训练数据,构建新表面缺陷图像数据,判断新表面缺陷图像数据是否满足预设质量要求。Step 3: Evaluate high-quality image data from the surface defect image data, construct new surface defect image data based on the high-quality image data and original defect image training data, and determine whether the new surface defect image data meets the preset quality requirements.

LPIPS(Learned Perceptual Image Patch Similarity)评分是一种用于评估图像质量和视觉感知差异的指标。其取值通常在0到1之间,LPIPS评分越小,表示图像之间越相似,而较大的LPIPS评分表示图像之间差异更大。LPIPS (Learned Perceptual Image Patch Similarity) score is an indicator used to evaluate image quality and visual perception differences. Its value usually ranges from 0 to 1. The smaller the LPIPS score, the more similar the images are. The larger the LPIPS score, the greater the difference between the images.

SSIM(Structural Similarity Index)指标是一种用于评估图像质量的指标。它基于图像的亮度、对比度和结构等方面来计算图像之间的相似度,并考虑了人类视觉系统的感知特性。SSIM指标越高,两幅图像之间的相似度就越高。SSIM (Structural Similarity Index) indicator is an indicator used to evaluate image quality. It calculates the similarity between images based on aspects such as image brightness, contrast, and structure, and takes into account the perceptual characteristics of the human visual system. The higher the SSIM index, the higher the similarity between the two images.

值得一提的是,本申请通过计算重建缺陷图像的LPIPS评分和SSIM指标,筛选LPIPS评分高且SSIM指标好的高质量图像参与去噪扩散概率模型的生成,减小了低质量图像带来的负面影响,有助于提高去噪扩散概率模型的准确性,从而提高去噪扩散概率模型生成的新缺陷图像数据的质量。It is worth mentioning that this application calculates the LPIPS score and SSIM index of the reconstructed defect image, and selects high-quality images with high LPIPS score and good SSIM index to participate in the generation of denoising diffusion probability model, which reduces the problems caused by low-quality images. Negative impact, it helps to improve the accuracy of the denoising diffusion probability model, thereby improving the quality of new defect image data generated by the denoising diffusion probability model.

上述根据高质量图像和原始缺陷图像训练数据,构建新缺陷图像数据的过程为:将所有高质量图像和原始缺陷图像训练数据进行合并,形成一个新的图像集,该图像集包括所有的原始缺陷图像和高质量图像。此举能够丰富生成样本的多样性,有利于提高新缺陷图像数据的质量。The above-mentioned process of constructing new defect image data based on high-quality images and original defect image training data is: merging all high-quality images and original defect image training data to form a new image set, which includes all original defects. images and high quality images. This can enrich the diversity of generated samples and help improve the quality of new defect image data.

步骤4,若新表面缺陷图像数据满足预设质量要求,则将步骤2中训练后的去噪扩散概率模型作为最终去噪扩散概率模型,利用最终去噪扩散概率模型,对采集的目标缺陷图像数据进行增广;否则,根据新表面缺陷图像数据和原始缺陷图像训练数据,构建中间原始缺陷图像训练数据,并将中间原始缺陷图像训练数据作为步骤2中的原始缺陷图像训练数据,返回执行步骤2。Step 4. If the new surface defect image data meets the preset quality requirements, use the denoising diffusion probability model trained in step 2 as the final denoising diffusion probability model, and use the final denoising diffusion probability model to analyze the collected target defect images. The data is augmented; otherwise, the intermediate original defect image training data is constructed based on the new surface defect image data and the original defect image training data, and the intermediate original defect image training data is used as the original defect image training data in step 2, and returns to the execution step 2.

下面对步骤3中从表面缺陷图像数据中评估出高质量图像数据过程进行示例性说明。The following is an exemplary explanation of the process of evaluating high-quality image data from surface defect image data in step 3.

具体包括步骤A~C:Specifically including steps A ~ C:

步骤A,构建基于LPIPS的深层特征评估器,并根据深层特征评估器计算每个表面缺陷图像的LPIPS评分。Step A, build a deep feature evaluator based on LPIPS, and calculate the LPIPS score of each surface defect image based on the deep feature evaluator.

具体的,步骤i,从表面缺陷图像数据中确定出低质量图像,得到低质量图像数据P1 low;低质量图像表示与原始缺陷图像之间的相似度低于预设相似度阈值的表面缺陷图像;Specifically, step i determines the low-quality image from the surface defect image data to obtain low-quality image data P 1 low ; the low-quality image represents surface defects whose similarity to the original defect image is lower than the preset similarity threshold image;

步骤ii,利用预先构建的初始AlexNet网络,分别提取原始缺陷图像训练数据的缺陷特征和低质量图像数据的缺陷特征;Step ii, use the pre-built initial AlexNet network to extract defect features of the original defect image training data and defect features of the low-quality image data respectively;

步骤iii,若原始缺陷图像训练数据的缺陷特征和低质量图像数据的缺陷特征之间的特征相似度小于预设特征相似度阈值,则微调初始AlexNet网络的参数,得到微调后的AlexNet网络,并将微调后的AlexNet网络作为步骤ii中的初始AlexNet网络,返回执行步骤ii;否则,执行步骤iv;Step iii, if the feature similarity between the defect features of the original defect image training data and the defect features of the low-quality image data is less than the preset feature similarity threshold, fine-tune the parameters of the initial AlexNet network to obtain the fine-tuned AlexNet network, and Use the fine-tuned AlexNet network as the initial AlexNet network in step ii, and return to step ii; otherwise, perform step iv;

步骤iv,利用微调后的AlexNet网络提取每个表面缺陷图像的图像特征,并根据图像特征计算表面缺陷图像的LPIPS评分。Step iv, use the fine-tuned AlexNet network to extract the image features of each surface defect image, and calculate the LPIPS score of the surface defect image based on the image features.

具体的,通过计算公式Specifically, through the calculation formula

得到第q层特征向量的残差其中/>表示第n个重建缺陷图像/>的第q层特征向量,/>表示第k个原始缺陷图像/>的第q层特征向量,|·|表示取绝对值,q=1,2,...,5。Get the residual of the qth layer feature vector Among them/> Represents the nth reconstructed defective image/> The qth layer feature vector of ,/> Represents the k-th original defect image/> The qth layer feature vector of , |·| means taking the absolute value, q=1, 2,...,5.

通过计算公式By calculation formula

得到第n个重建缺陷图像与第k个原始缺陷图像/>的LPIPS评分。Get the nth reconstructed defect image With the kth original defect image/> LPIPS score.

其中,w表示特征降维器,特征降维器用于将高维特征转换成低维特征。Among them, w represents the feature dimensionality reducer, which is used to convert high-dimensional features into low-dimensional features.

通过计算公式By calculation formula

得到第n个重建缺陷图像的LPIPS评分/> Get the nth reconstructed defect image LPIPS score/>

该过程具体如图3所示。The process is specifically shown in Figure 3.

步骤B,计算每个表面缺陷图像的SSIM评分。Step B, calculate the SSIM score of each surface defect image.

具体的,通过计算公式Specifically, through the calculation formula

得到第n个重建缺陷图像的灰度均值/>其中,H,W表示第n个重建缺陷图像的像素尺寸,/>表示第n个重建缺陷图像/>的像素(i,j),i=1,2,...,H,j=1,2,...,W;Get the nth reconstructed defect image Grayscale mean/> Among them, H and W represent the nth reconstructed defect image pixel size,/> Represents the nth reconstructed defective image/> Pixels (i, j), i=1, 2,..., H, j=1, 2,..., W;

通过计算公式By calculation formula

得到第n个重建缺陷图像的灰度标准差/> Get the nth reconstructed defect image Grayscale standard deviation/>

通过计算公式By calculation formula

得到第n个重建缺陷图像与第k个原始缺陷图像/>的协方差矩阵/> Get the nth reconstructed defect image With the kth original defect image/> The covariance matrix />

通过计算公式By calculation formula

得到第n个重建缺陷图像与第k个原始缺陷图像/>的亮度相似度;其中,C1表示一非零常数,用于保证分母不为0;Get the nth reconstructed defect image With the kth original defect image/> brightness similarity; where, C 1 represents a non-zero constant, used to ensure that the denominator is not 0;

通过计算公式By calculation formula

得到第n个重建缺陷图像与第k个原始缺陷图像/>的对比度相似度/>其中,C2表示一非零常数,用于保证分母不为0;Get the nth reconstructed defect image With the kth original defect image/> Contrast similarity/> Among them, C2 represents a non-zero constant, used to ensure that the denominator is not 0;

通过计算公式By calculation formula

得到第n个重建缺陷图像与第k个原始缺陷图像/>的结构相似度/>其中,C3表示一非零常数,用于保证分母不为0;Get the nth reconstructed defect image With the kth original defect image/> Structural similarity/> Among them, C 3 represents a non-zero constant, used to ensure that the denominator is not 0;

通过计算公式By calculation formula

得到第n个重建缺陷图像与第k个原始缺陷图像/>的SSIM相似度/>其中,α,β,γ均为平衡参数;Get the nth reconstructed defect image With the kth original defect image/> SSIM similarity/> Among them, α, β, and γ are all equilibrium parameters;

通过计算公式By calculation formula

得到第n个重建缺陷图像的SSIM指标/> Get the nth reconstructed defect image SSIM indicator/>

该过程具体如图4所示。The process is specifically shown in Figure 4.

步骤C,将LPIPS评分小于预设评分阈值且SSIM评分大于预设指标阈值的表面缺陷图像评估为高质量图像,得到高质量图像数据。Step C: Evaluate surface defect images whose LPIPS score is less than the preset score threshold and whose SSIM score is greater than the preset index threshold as high-quality images to obtain high-quality image data.

下面对步骤3中判断新表面缺陷图像数据是否满足预设质量要求的过程进行示例性说明,具体如步骤a~b所示。The following is an exemplary description of the process of determining whether the new surface defect image data meets the preset quality requirements in step 3, as shown in steps a to b.

步骤a,若新表面缺陷图像数据与原始缺陷图像训练数据的LPIPS评分差值小于预设LPIPS评分差值阈值,且,新缺陷图像数据的SSIM评分差值大于预设SSIM评分差值阈值,则确定新缺陷图像数据满足预设质量要求;否则,执行步骤b;Step a, if the LPIPS score difference between the new surface defect image data and the original defect image training data is less than the preset LPIPS score difference threshold, and the SSIM score difference of the new defect image data is greater than the preset SSIM score difference threshold, then Determine that the new defect image data meets the preset quality requirements; otherwise, perform step b;

步骤b,若第v+1次构建的新缺陷图像数据的LPIPS评分与第v次构建的新缺陷图像数据的LPIPS评分之间的差值小于预设阈值,则确定第v+1次构建的新缺陷图像数据满足预设质量要求;否则,确定新缺陷图像数据不满足预设质量要求。Step b, if the difference between the LPIPS score of the new defect image data constructed for the v+1th time and the LPIPS score of the new defective image data constructed for the vth time is less than the preset threshold, then determine the LPIPS score of the new defect image data constructed for the v+1th time. The new defect image data meets the preset quality requirements; otherwise, it is determined that the new defect image data does not meet the preset quality requirements.

下面对利用最终去噪扩散概率模型,对采集的目标缺陷图像数据进行增广的过程进行示例性说明,具体如下:The following is an exemplary explanation of the process of augmenting the collected target defect image data using the final denoising diffusion probability model, as follows:

将采集的目标缺陷图像数据输入最终去噪扩散概率模型,通过最终去噪扩散概率模型进行去噪,生成目标缺陷图像数据对应的新缺陷图像数据,在本申请的一实施例中,在开源数据集NEU-CLS上对比了本申请提供的缺陷图像数据的增广方法与目前其他常用缺陷图像数据增广方法的生成效果,如下表所示:The collected target defect image data is input into the final denoising diffusion probability model, and denoising is performed through the final denoising diffusion probability model to generate new defect image data corresponding to the target defect image data. In an embodiment of the present application, in the open source data The generation effects of the defect image data augmentation method provided by this application and other commonly used defect image data augmentation methods are compared on NEU-CLS, as shown in the following table:

表中的数值表示生成的各类缺陷图像的弗雷歇特-因塞普逊距离(FID,FréchetInception Distance),是一种用于评估生成对抗网络生成图像质量的指标,表征生成图像和原始图像的相似度,数值越小意味着越相似。可见,随着本申请提供的缺陷图像数据的增广方法执行次数的增加,各类缺陷图像的FID值逐渐减小,说明生成的新缺陷图像更接近原始缺陷图像,这正是缺陷图像增广所追求的目的,生成的新缺陷图像和原始缺陷图像越小,意味着生成的新缺陷图像的质量越高,越有利于提高产品表面缺陷检测的准确性。因此,本申请提供的缺陷图像数据的增广方法能够有效缓解缺陷数据的匮乏对于表面缺陷检测技术的影响,并且,本申请提供的缺陷图像数据的增广方法生成的新缺陷图像质量更优于其他现有技术。The values in the table represent the Fréchet-Inception Distance (FID) of various types of defect images generated. It is an indicator used to evaluate the quality of images generated by generative adversarial networks and characterizes the generated images and the original images. The smaller the value, the more similar it is. It can be seen that as the number of executions of the defect image data augmentation method provided by this application increases, the FID values of various types of defect images gradually decrease, indicating that the generated new defect images are closer to the original defect images. This is exactly what defect image augmentation means. The purpose pursued is that the smaller the generated new defect image and the original defect image are, the higher the quality of the generated new defect image is, which is more conducive to improving the accuracy of product surface defect detection. Therefore, the augmentation method of defect image data provided by this application can effectively alleviate the impact of the lack of defect data on surface defect detection technology, and the quality of the new defect image generated by the augmentation method of defect image data provided by this application is better than Other existing technologies.

下面对本申请步骤2中利用原始缺陷图像训练数据对预先构建的去噪扩散概率模型进行微调的过程进行示例性说明。具体包括步骤i~iv:The following is an exemplary explanation of the process of fine-tuning the pre-constructed denoising diffusion probability model using the original defect image training data in Step 2 of this application. Specifically, it includes steps i~iv:

步骤i,通过计算公式Step i, by calculating the formula

得到第k个原始缺陷图像在第t时间步的扩散图像/> Get the kth original defect image Diffusion image at time step t/>

其中,k=1,2,...,K,K表示原始缺陷图像的总数量,αt表示在第t时间步的扩散系数,ε表示服从于均值为0方差为1正态分布的随机噪声矩阵,t=1,2,...,T,T表示预先设置的扩散过程的总时间步数。Among them, k = 1, 2, ..., K, K represents the total number of original defect images, α t represents the diffusion coefficient at the t time step, and ε represents a random distribution subject to a normal distribution with a mean of 0 and a variance of 1. Noise matrix, t = 1, 2, ..., T, T represents the total time steps of the preset diffusion process.

步骤ii,利用第t时间步对应的噪声预测网络εθ(t)对进行预测,得到/>第t时间步的预测噪声/> Step ii, use the noise prediction network ε θ (t) corresponding to the t-th time step to Make a prediction and get/> Prediction noise at time step t/>

步骤iii,通过计算公式得到训练损失值L。Step iii, by calculating the formula Get the training loss value L.

其中,||·||表示L2范式。Among them, ||·|| represents L2 normal form.

步骤iv,若训练损失值小于预设损失阈值,则将各时间步对应的噪声预测网络的权值参数作为最终权值参数,得到训练后的去噪扩散概率模型;否则,根据训练损失值进行随机梯度下降运算,反向传播更新各时间步对应的噪声预测器网络的权值参数,并返回执行步骤i。Step iv, if the training loss value is less than the preset loss threshold, use the weight parameters of the noise prediction network corresponding to each time step as the final weight parameters to obtain the trained denoising diffusion probability model; otherwise, proceed based on the training loss value Stochastic gradient descent operation, backpropagation updates the weight parameters of the noise predictor network corresponding to each time step, and returns to execution step i.

由上述各步骤可见,本申请提供的缺陷图像数据的增广方法,通过将原始缺陷图像训练数据输入训练后的去噪扩散概率模型,生成表面缺陷图像数据,再从表面缺陷图像数据中评估出高质量图像数据,并根据高质量图像数据和原始缺陷图像训练数据,构建新表面缺陷图像数据,并利用新表面缺陷图像数据训练去噪扩散概率模型,丰富了去噪扩散概率模型训练数据的多样性,提高了去噪扩散概率模型训练数据的质量,提高了去噪扩散概率模型的准确性,从而有益于提高生成的新缺陷图像数据的质量。It can be seen from the above steps that the augmentation method of defect image data provided by this application generates surface defect image data by inputting the original defect image training data into the trained denoising diffusion probability model, and then evaluates the surface defect image data from the surface defect image data. High-quality image data, and based on the high-quality image data and original defect image training data, new surface defect image data is constructed, and the new surface defect image data is used to train the denoising diffusion probability model, which enriches the diversity of denoising diffusion probability model training data. It improves the quality of the denoising diffusion probability model training data and improves the accuracy of the denoising diffusion probability model, which is beneficial to improving the quality of the new defect image data generated.

下面对本申请提供的缺陷图像数据的增广装置进行示例性说明。The following is an exemplary description of the augmentation device for defect image data provided by this application.

如图5所示,该缺陷图像数据的增广装置500包括以下模块:As shown in Figure 5, the defect image data augmentation device 500 includes the following modules:

图像获取模块501,用于获取原始缺陷图像训练数据;原始缺陷图像训练数据包括多个原始缺陷图像;The image acquisition module 501 is used to acquire original defect image training data; the original defect image training data includes multiple original defect images;

表面缺陷图像生成模块502,用于利用原始缺陷图像训练数据对预先构建的去噪扩散概率模型进行训练,得到训练后的去噪扩散概率模型,并将原始缺陷图像训练数据输入训练后的去噪扩散概率模型,生成表面缺陷图像数据;表面缺陷图像数据包括多个表面缺陷图像;The surface defect image generation module 502 is used to train the pre-constructed denoising diffusion probability model using the original defect image training data, obtain the trained denoising diffusion probability model, and input the original defect image training data into the trained denoising diffusion probability model. The diffusion probability model generates surface defect image data; the surface defect image data includes multiple surface defect images;

高质量图像评估模块503,用于从表面缺陷图像数据中评估出高质量图像数据,并根据高质量图像数据和原始缺陷图像训练数据,构建新表面缺陷图像数据,判断新表面缺陷图像数据是否满足预设质量要求;高质量图像数据包括多个高质量图像;The high-quality image evaluation module 503 is used to evaluate high-quality image data from the surface defect image data, construct new surface defect image data based on the high-quality image data and original defect image training data, and determine whether the new surface defect image data meets Preset quality requirements; high-quality image data includes multiple high-quality images;

模型增广模块504,用于若新表面缺陷图像数据满足预设质量要求,则将表面缺陷图像生成模块中训练后的去噪扩散概率模型作为最终去噪扩散概率模型,利用最终去噪扩散概率模型,对采集的目标缺陷图像数据进行增广;否则,根据新表面缺陷图像数据和原始缺陷图像训练数据,构建中间原始缺陷图像训练数据,并将中间原始缺陷图像训练数据作为表面缺陷图像生成模块中的原始缺陷图像训练数据,返回执行表面缺陷图像生成模块。The model augmentation module 504 is used to use the denoising diffusion probability model after training in the surface defect image generation module as the final denoising diffusion probability model if the new surface defect image data meets the preset quality requirements, and use the final denoising diffusion probability model to augment the collected target defect image data; otherwise, construct intermediate original defect image training data based on the new surface defect image data and original defect image training data, and use the intermediate original defect image training data as the surface defect image generation module The original defect image training data in is returned to execute the surface defect image generation module.

需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction, execution process, etc. between the above-mentioned devices/units are based on the same concept as the method embodiments of the present application. For details of their specific functions and technical effects, please refer to the method embodiments section. No further details will be given.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional units and modules is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs. Module completion means dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be hardware-based. It can also be implemented in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the present application. For the specific working processes of the units and modules in the above system, please refer to the corresponding processes in the foregoing method embodiments, and will not be described again here.

下面对本申请提供的终端设备进行示例性说明。The following is an exemplary description of the terminal equipment provided by this application.

如图6所示,本申请的实施例提供了一种终端设备,如图6所示,该实施例的终端设备D10包括:至少一个处理器D100(图6中仅示出一个处理器)、存储器D101以及存储在所述存储器D101中并可在所述至少一个处理器D100上运行的计算机程序D102,所述处理器D100执行所述计算机程序D102时实现上述任意各个方法实施例中的步骤。As shown in Figure 6, an embodiment of the present application provides a terminal device. As shown in Figure 6, the terminal device D10 of this embodiment includes: at least one processor D100 (only one processor is shown in Figure 6), Memory D101 and a computer program D102 stored in the memory D101 and executable on the at least one processor D100. When the processor D100 executes the computer program D102, the steps in any of the above method embodiments are implemented.

具体的,所述处理器D100执行所述计算机程序D102时,通过获取原始缺陷图像训练数据,利用原始缺陷图像训练数据对预先构建的去噪扩散概率模型进行训练,得到训练后的去噪扩散概率模型,并将原始缺陷图像训练数据输入训练后的去噪扩散概率模型,生成表面缺陷图像数据,将满足预设质量要求的去噪扩散概率模型作为最终去噪扩散概率模型,利用最终去噪扩散概率模型,对采集的目标缺陷图像数据进行增广。其中,通过将原始缺陷图像训练数据输入训练后的去噪扩散概率模型,生成表面缺陷图像数据,再从表面缺陷图像数据中评估出高质量图像数据,并根据高质量图像数据和原始缺陷图像训练数据,构建新表面缺陷图像数据,并利用新表面缺陷图像数据训练去噪扩散概率模型,丰富了去噪扩散概率模型训练数据的多样性,提高了去噪扩散概率模型训练数据的质量,提高了去噪扩散概率模型的准确性,从而有益于提高生成的新缺陷图像数据的质量。Specifically, when the processor D100 executes the computer program D102, it obtains the original defect image training data and uses the original defect image training data to train the pre-constructed denoising diffusion probability model to obtain the trained denoising diffusion probability. model, and input the original defect image training data into the trained denoising diffusion probability model to generate surface defect image data. The denoising diffusion probability model that meets the preset quality requirements is used as the final denoising diffusion probability model, and the final denoising diffusion is used Probabilistic model is used to augment the collected target defect image data. Among them, the original defect image training data is input into the trained denoising diffusion probability model to generate surface defect image data, and then the high-quality image data is evaluated from the surface defect image data and trained based on the high-quality image data and the original defect image. data, construct new surface defect image data, and use the new surface defect image data to train the denoising diffusion probability model, which enriches the diversity of the denoising diffusion probability model training data, improves the quality of the denoising diffusion probability model training data, and improves The accuracy of the denoised diffusion probability model is thereby beneficial to improve the quality of the new defect image data generated.

所称处理器D100可以是中央处理单元(CPU,Central Processing Unit),该处理器D100还可以是其他通用处理器、数字信号处理器(DSP,Digital Signal Processor)、专用集成电路(ASIC,Application Specific Integrated Circuit)、现成可编程门阵列(FPGA,Field-Programmable Gate Array)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor D100 may be a central processing unit (CPU). The processor D100 may also be other general-purpose processors, digital signal processors (DSP), or application specific integrated circuits (ASICs). Integrated Circuit), off-the-shelf programmable gate array (FPGA, Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

所述存储器D101在一些实施例中可以是所述终端设备D10的内部存储单元,例如终端设备D10的硬盘或内存。所述存储器D101在另一些实施例中也可以是所述终端设备D10的外部存储设备,例如所述终端设备D10上配备的插接式硬盘,智能存储卡(SMC,SmartMedia Card),安全数字(SD,Secure Digital)卡,闪存卡(Flash Card)等。进一步地,所述存储器D101还可以既包括所述终端设备D10的内部存储单元也包括外部存储设备。所述存储器D101用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器D101还可以用于暂时地存储已经输出或者将要输出的数据。In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may also be an external storage device of the terminal device D10, such as a plug-in hard disk, a smart memory card (SMC, SmartMedia Card), or a secure digital (SMC) device equipped on the terminal device D10. SD (Secure Digital) card, Flash Card, etc. Further, the memory D101 may also include both an internal storage unit of the terminal device D10 and an external storage device. The memory D101 is used to store operating systems, application programs, boot loaders (Boot Loaders), data and other programs, such as program codes of the computer programs. The memory D101 can also be used to temporarily store data that has been output or will be output.

本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps in each of the above method embodiments can be implemented.

本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行时实现可实现上述各个方法实施例中的步骤。Embodiments of the present application provide a computer program product. When the computer program product is run on a terminal device, the steps in each of the above method embodiments can be implemented when the terminal device executes it.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到缺陷图像数据的增广装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, this application can implement all or part of the processes in the above embodiment methods by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. The computer program When executed by a processor, the steps of each of the above method embodiments may be implemented. Wherein, the computer program includes computer program code, which may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code to an augmentation device/terminal device of defective image data, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory) , random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals and software distribution media. For example, U disk, mobile hard disk, magnetic disk or CD, etc. In some jurisdictions, subject to legislation and patent practice, computer-readable media may not be electrical carrier signals and telecommunications signals.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, each embodiment is described with its own emphasis. For parts that are not detailed or documented in a certain embodiment, please refer to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.

在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed devices/network devices and methods can be implemented in other ways. For example, the apparatus/network equipment embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components can be combined or can be integrated into another system, or some features can be omitted, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or units, which may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

以上所述是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above is the preferred embodiment of the present application. It should be pointed out that for those of ordinary skill in the art, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications can also be made. should be regarded as the scope of protection of this application.

Claims (7)

1.一种缺陷图像数据的增广方法,其特征在于,包括:1. An augmentation method for defect image data, characterized by including: 步骤1,获取原始缺陷图像训练数据;所述原始缺陷图像训练数据包括多个原始缺陷图像;Step 1: Obtain original defect image training data; the original defect image training data includes multiple original defect images; 步骤2,利用所述原始缺陷图像训练数据对预先构建的去噪扩散概率模型进行训练,得到训练后的去噪扩散概率模型,并将所述原始缺陷图像训练数据输入所述训练后的去噪扩散概率模型,生成表面缺陷图像数据;所述表面缺陷图像数据包括多个表面缺陷图像;Step 2: Use the original defect image training data to train the pre-constructed denoising diffusion probability model to obtain the trained denoising diffusion probability model, and input the original defect image training data into the trained denoising probability model. A diffusion probability model generates surface defect image data; the surface defect image data includes multiple surface defect images; 步骤3,从所述表面缺陷图像数据中评估出高质量图像数据,并根据所述高质量图像数据和所述原始缺陷图像训练数据,构建新表面缺陷图像数据,判断所述新表面缺陷图像数据是否满足预设质量要求;所述高质量图像数据包括多个高质量图像;Step 3: Evaluate high-quality image data from the surface defect image data, construct new surface defect image data based on the high-quality image data and the original defect image training data, and judge the new surface defect image data Whether it meets the preset quality requirements; the high-quality image data includes multiple high-quality images; 步骤4,若所述新表面缺陷图像数据满足预设质量要求,则将所述步骤2中所述训练后的去噪扩散概率模型作为最终去噪扩散概率模型,利用所述最终去噪扩散概率模型,对采集的目标缺陷图像数据进行增广;否则,根据所述新表面缺陷图像数据和所述原始缺陷图像训练数据,构建中间原始缺陷图像训练数据,并将所述中间原始缺陷图像训练数据作为所述步骤2中的原始缺陷图像训练数据,返回执行步骤2。Step 4: If the new surface defect image data meets the preset quality requirements, use the denoising diffusion probability model after training in step 2 as the final denoising diffusion probability model, and use the final denoising diffusion probability model model to augment the collected target defect image data; otherwise, construct intermediate original defect image training data based on the new surface defect image data and the original defect image training data, and use the intermediate original defect image training data to As the original defect image training data in step 2, return to step 2. 2.根据权利要求1所述的增广方法,其特征在于,所述从所述表面缺陷图像数据中评估出高质量图像数据,包括:2. The augmentation method according to claim 1, characterized in that estimating high-quality image data from the surface defect image data includes: 构建基于LPIPS的深层特征评估器,并根据所述深层特征评估器计算每个所述表面缺陷图像的LPIPS评分;Constructing a deep feature evaluator based on LPIPS, and calculating a LPIPS score for each of the surface defect images based on the deep feature evaluator; 计算每个所述表面缺陷图像的SSIM评分;Calculate the SSIM score for each of the surface defect images; 将所述LPIPS评分小于预设评分阈值且所述SSIM评分大于预设指标阈值的表面缺陷图像评估为高质量图像,得到所述高质量图像数据。Surface defect images whose LPIPS score is less than a preset score threshold and whose SSIM score is greater than a preset index threshold are evaluated as high-quality images to obtain the high-quality image data. 3.根据权利要求2所述的增广方法,其特征在于,所述构建基于LPIPS的深层特征评估器,并根据所述深层特征评估器计算每个所述表面缺陷图像的LPIPS评分,包括:3. The augmentation method according to claim 2, characterized in that said constructing a deep feature evaluator based on LPIPS and calculating the LPIPS score of each of the surface defect images according to the deep feature evaluator includes: 步骤i,从所述表面缺陷图像数据中确定出低质量图像,得到低质量图像数据P1 low;所述低质量图像表示与所述原始缺陷图像之间的相似度低于预设相似度阈值的表面缺陷图像;Step i, determine a low-quality image from the surface defect image data to obtain low-quality image data P 1 low ; the similarity between the low-quality image and the original defect image is lower than a preset similarity threshold images of surface defects; 步骤ii,利用预先构建的初始AlexNet网络,分别提取所述原始缺陷图像训练数据的缺陷特征和所述低质量图像数据的缺陷特征;Step ii: Use the pre-constructed initial AlexNet network to respectively extract the defect features of the original defect image training data and the defect features of the low-quality image data; 步骤iii,若所述原始缺陷图像训练数据的缺陷特征和所述低质量图像数据的缺陷特征之间的特征相似度小于预设特征相似度阈值,则微调所述初始AlexNet网络的参数,得到微调后的AlexNet网络,并将所述微调后的AlexNet网络作为所述步骤ii中的初始AlexNet网络,返回执行步骤ii;否则,执行步骤iv;Step iii, if the feature similarity between the defect features of the original defect image training data and the defect features of the low-quality image data is less than the preset feature similarity threshold, fine-tune the parameters of the initial AlexNet network to obtain fine-tuning The final AlexNet network, and use the fine-tuned AlexNet network as the initial AlexNet network in step ii, return to step ii; otherwise, perform step iv; 步骤iv,利用所述微调后的AlexNet网络提取每个所述表面缺陷图像的图像特征,并根据所述图像特征计算所述表面缺陷图像的LPIPS评分。Step iv: Use the fine-tuned AlexNet network to extract image features of each surface defect image, and calculate the LPIPS score of the surface defect image based on the image features. 4.根据权利要求3所述的增广方法,其特征在于,所述步骤3中判断所述新表面缺陷图像数据是否满足预设质量要求,包括:4. The augmentation method according to claim 3, wherein determining whether the new surface defect image data meets preset quality requirements in step 3 includes: 步骤a,若所述新表面缺陷图像数据与所述原始缺陷图像训练数据的LPIPS评分差值小于预设LPIPS评分差值阈值,且,所述新缺陷图像数据的SSIM评分差值大于预设SSIM评分差值阈值,则确定所述新缺陷图像数据满足预设质量要求;否则,执行步骤b;Step a, if the LPIPS score difference between the new surface defect image data and the original defect image training data is less than the preset LPIPS score difference threshold, and the SSIM score difference of the new defect image data is greater than the preset SSIM If the score difference threshold is reached, it is determined that the new defect image data meets the preset quality requirements; otherwise, step b is performed; 步骤b,若第v+1次构建的新缺陷图像数据的LPIPS评分与第v次构建的新缺陷图像数据的LPIPS评分之间的差值小于预设阈值,则确定第v+1次构建的新缺陷图像数据满足预设质量要求;否则,确定所述新缺陷图像数据不满足预设质量要求。Step b, if the difference between the LPIPS score of the new defect image data constructed for the v+1th time and the LPIPS score of the new defective image data constructed for the vth time is less than the preset threshold, then determine the LPIPS score of the new defect image data constructed for the v+1th time. The new defect image data meets the preset quality requirements; otherwise, it is determined that the new defect image data does not meet the preset quality requirements. 5.一种缺陷图像数据的增广装置,其特征在于,包括:5. An augmentation device for defect image data, characterized in that it includes: 图像获取模块,用于获取原始缺陷图像训练数据;所述原始缺陷图像训练数据包括多个原始缺陷图像;An image acquisition module, used to acquire original defect image training data; the original defect image training data includes multiple original defect images; 表面缺陷图像生成模块,用于利用所述原始缺陷图像训练数据对预先构建的去噪扩散概率模型进行训练,得到训练后的去噪扩散概率模型,并将所述原始缺陷图像训练数据输入所述训练后的去噪扩散概率模型,生成表面缺陷图像数据;所述表面缺陷图像数据包括多个表面缺陷图像;A surface defect image generation module is used to train a pre-constructed denoising diffusion probability model using the original defect image training data, obtain a trained denoising diffusion probability model, and input the original defect image training data into the The trained denoising diffusion probability model generates surface defect image data; the surface defect image data includes multiple surface defect images; 高质量图像评估模块,用于从所述表面缺陷图像数据中评估出高质量图像数据,并根据所述高质量图像数据和所述原始缺陷图像训练数据,构建新表面缺陷图像数据,判断所述新表面缺陷图像数据是否满足预设质量要求;所述高质量图像数据包括多个高质量图像;A high-quality image evaluation module, used to evaluate high-quality image data from the surface defect image data, and construct new surface defect image data based on the high-quality image data and the original defect image training data, and determine the Whether the new surface defect image data meets the preset quality requirements; the high-quality image data includes multiple high-quality images; 模型增广模块,用于若所述新表面缺陷图像数据满足预设质量要求,则将所述表面缺陷图像生成模块中所述训练后的去噪扩散概率模型作为最终去噪扩散概率模型,利用所述最终去噪扩散概率模型,对采集的目标缺陷图像数据进行增广;否则,根据所述新表面缺陷图像数据和所述原始缺陷图像训练数据,构建中间原始缺陷图像训练数据,并将所述中间原始缺陷图像训练数据作为所述表面缺陷图像生成模块中的原始缺陷图像训练数据,返回执行表面缺陷图像生成模块。A model augmentation module, configured to use the trained denoising diffusion probability model in the surface defect image generation module as the final denoising diffusion probability model if the new surface defect image data meets the preset quality requirements, using The final denoising diffusion probability model augments the collected target defect image data; otherwise, the intermediate original defect image training data is constructed based on the new surface defect image data and the original defect image training data, and the obtained The intermediate original defect image training data is used as the original defect image training data in the surface defect image generation module, and is returned to execute the surface defect image generation module. 6.一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至4任一项所述的增广方法。6. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, the processor implements the claims as claimed in The augmentation method described in any one of 1 to 4. 7.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至4任一项所述的增广方法。7. A computer-readable storage medium, the computer-readable storage medium stores a computer program, characterized in that when the computer program is executed by a processor, the augmentation as claimed in any one of claims 1 to 4 is achieved. method.
CN202311442141.4A 2023-11-01 2023-11-01 A method, device, terminal equipment and medium for augmenting defect image data Pending CN117496299A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311442141.4A CN117496299A (en) 2023-11-01 2023-11-01 A method, device, terminal equipment and medium for augmenting defect image data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311442141.4A CN117496299A (en) 2023-11-01 2023-11-01 A method, device, terminal equipment and medium for augmenting defect image data

Publications (1)

Publication Number Publication Date
CN117496299A true CN117496299A (en) 2024-02-02

Family

ID=89675670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311442141.4A Pending CN117496299A (en) 2023-11-01 2023-11-01 A method, device, terminal equipment and medium for augmenting defect image data

Country Status (1)

Country Link
CN (1) CN117496299A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118657719A (en) * 2024-05-30 2024-09-17 常州工学院 A method for generating concrete crack images based on denoising diffusion probability model
CN118887117A (en) * 2024-09-27 2024-11-01 北京智眸科技发展有限公司 A method and system for industrial image data enhancement and defect generation based on diffusion model

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118657719A (en) * 2024-05-30 2024-09-17 常州工学院 A method for generating concrete crack images based on denoising diffusion probability model
CN118887117A (en) * 2024-09-27 2024-11-01 北京智眸科技发展有限公司 A method and system for industrial image data enhancement and defect generation based on diffusion model

Similar Documents

Publication Publication Date Title
CN108960245B (en) Tire mold character detection and recognition method, device, equipment and storage medium
WO2018108129A1 (en) Method and apparatus for use in identifying object type, and electronic device
CN117496299A (en) A method, device, terminal equipment and medium for augmenting defect image data
WO2020186887A1 (en) Target detection method, device and apparatus for continuous small sample images
CN107273458B (en) Depth model training method and device, and image retrieval method and device
CN107944020A (en) Facial image lookup method and device, computer installation and storage medium
CN111709909A (en) General printing defect detection method based on deep learning and model thereof
CN111488985A (en) Deep neural network model compression training method, device, equipment, medium
CN108710907B (en) Handwritten data classification method, model training method, device, equipment and medium
CN111881803B (en) An animal face recognition method based on improved YOLOv3
TWI803243B (en) Method for expanding images, computer device and storage medium
CN111223128A (en) Target tracking method, device, device and storage medium
CN110111365B (en) Training method and device based on deep learning and target tracking method and device
CN109492610B (en) Pedestrian re-identification method and device and readable storage medium
WO2019100348A1 (en) Image retrieval method and device, and image library generation method and device
CN111314704A (en) Image-level JND threshold prediction method, apparatus, device and storage medium
CN111488927B (en) Classification threshold determination method, device, electronic equipment and storage medium
Popescu et al. Efficient fractal method for texture classification
CN112270404A (en) Detection structure and method for bulge defect of fastener product based on ResNet64 network
CN105279517A (en) Weak tag social image recognition method based on semi-supervision relation theme model
CN111985487A (en) Remote sensing image target extraction method, electronic equipment and storage medium
CN116704208B (en) Local interpretable method based on characteristic relation
CN110111307B (en) Immune system feedback simulation system and method for immune teaching
CN115797709B (en) Image classification method, device, equipment and computer readable storage medium
CN116109627A (en) Defect detection method, device and medium based on migration learning and small sample learning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination