TW202449740A - Defect detection model training method, defect image classification method, device and electronic equipment - Google Patents
Defect detection model training method, defect image classification method, device and electronic equipment Download PDFInfo
- Publication number
- TW202449740A TW202449740A TW113105473A TW113105473A TW202449740A TW 202449740 A TW202449740 A TW 202449740A TW 113105473 A TW113105473 A TW 113105473A TW 113105473 A TW113105473 A TW 113105473A TW 202449740 A TW202449740 A TW 202449740A
- Authority
- TW
- Taiwan
- Prior art keywords
- defect
- image
- feature
- target
- model
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/001—Industrial image inspection using an image reference approach
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
- G06V10/443—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
- G06V10/449—Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters
- G06V10/451—Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters with interaction between the filter responses, e.g. cortical complex cells
- G06V10/454—Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing 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/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing 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/80—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
- G06V10/806—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30148—Semiconductor; IC; Wafer
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Multimedia (AREA)
- Medical Informatics (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biodiversity & Conservation Biology (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
Description
本發明要求於2023年02月17日提交中國專利局、申請號為202310184844.5、申請名稱“缺陷檢測模型的訓練方法、裝置及電子設備”的中國專利申請的優先權,其全部內容通過引用結合在本發明中。This invention claims priority to a Chinese patent application filed with the China Patent Office on February 17, 2023, with application number 202310184844.5 and application name “Training method, device and electronic device for defect detection model”, the entire contents of which are incorporated by reference in this invention.
本發明涉及影像識別領域,具體而言,涉及一種缺陷檢測模型的訓練方法、裝置及電子設備。The present invention relates to the field of image recognition, and more particularly to a method, device and electronic equipment for training a defect detection model.
相關技術中在利用無瑕疵的晶粒影像對待檢測晶粒影像進行缺陷識別和分類時,通常不會利用模板影像來輔助識別,通常採用的方法是直接融合待檢測晶粒影像和無瑕疵的晶粒影像,然後依據融合後的影像確定待檢測影像中的缺陷類別和缺陷位置。這種方式雖然利用了無瑕疵影像來實現對待檢測影像的缺陷識別和分類,但是融合影像以及對融合影像進行識別時計算量大,並且精度較低。In the related technology, when using the flawless grain image to identify and classify the defects of the grain image to be inspected, the template image is usually not used to assist in the identification. The method usually adopted is to directly fuse the grain image to be inspected and the flawless grain image, and then determine the defect type and defect location in the image to be inspected based on the fused image. Although this method uses the flawless image to realize the defect identification and classification of the image to be inspected, the amount of calculation is large when fusing the image and identifying the fused image, and the accuracy is relatively low.
針對上述的問題,目前尚未提出有效的解決方案。Currently, no effective solution has been proposed to the above problems.
本發明實施例提供了一種缺陷檢測模型的訓練方法、裝置及電子設備,以至少解決由於相關技術中在對晶粒影像進行缺陷識別和分類時直接融合無瑕疵影像和待檢測影像造成的計算量大且精度較低的技術問題。The embodiments of the present invention provide a defect detection model training method, apparatus and electronic equipment to at least solve the technical problems of large amount of calculation and low accuracy caused by directly fusing defect-free images and images to be detected when performing defect identification and classification on grain images in related technologies.
根據本發明實施例的一個方面,提供了一種缺陷檢測模型的訓練方法,包括:獲取訓練樣本集,以及與訓練樣本集中的每一組樣本對應的第一缺陷標籤訊息,其中,訓練樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第一缺陷標籤訊息包括缺陷影像中各處缺陷的第一類別訊息和第一位置訊息;確定目標損失函數,其中,目標損失函數包括缺陷類別損失函數和缺陷位置損失函數;採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型,其中,目標缺陷檢測模型用於確定待檢測缺陷影像中的缺陷位置訊息和缺陷類別訊息,待訓練模型用於提取缺陷影像的第一影像特徵和模板影像的第二影像特徵,並依據第一影像特徵和第二影像特徵輸出缺陷影像的第二標籤訊息,第二標籤訊息中包括待訓練模型確定的缺陷影像中各處缺陷的第二類別訊息和第二位置訊息。According to one aspect of an embodiment of the present invention, a method for training a defect detection model is provided, comprising: obtaining a training sample set and a first defect label message corresponding to each group of samples in the training sample set, wherein each group of samples in the training sample set includes a defect image and a template image corresponding to the defect image, and the first defect label message includes a first category message and a first position message of each defect in the defect image; determining a target loss function, wherein the target loss function includes a defect category loss function and a defect position loss function; adopting random gradient descent The method trains the model to be trained by using a training sample set, defect label information and a target loss function to obtain a target defect detection model, wherein the target defect detection model is used to determine the defect position information and defect category information in the defect image to be detected, the model to be trained is used to extract the first image feature of the defect image and the second image feature of the template image, and outputs the second label information of the defect image according to the first image feature and the second image feature, and the second label information includes the second category information and the second position information of the defects in each defect image determined by the model to be trained.
可選地,採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型的步驟包括:第一步,將缺陷影像和模板影像分別輸入到待訓練模型中,並獲取待訓練模型輸出的第二標籤訊息;第二步,將第一類別訊息和第二類別訊息輸入到缺陷類別損失函數中,得到第一損失函數值,以及將第一位置訊息和第二位置訊息輸入到缺陷位置損失函數中,得到第二損失函數值,並儲存第一損失函數值和第二損失函數值;第三步,採用隨機梯度下降法,通過第一損失函數值和第二損失函數值調整待訓練模型的模型參數;第四步,獲取儲存的全部第一損失函數值和第二損失函數值,在第一損失函數值和第二損失函數值符合預設條件的情況下,確定調整後的待訓練模型為目標缺陷檢測模型,否則跳轉到第一步,其中,預設條件包括連續預設數量個第一損失函數值和第二損失函數值的和均位於目標取值區間中。Optionally, the random gradient descent method is used to train the model to be trained through the training sample set, the defect label information and the target loss function, and the steps of obtaining the target defect detection model include: the first step, respectively inputting the defect image and the template image into the model to be trained, and obtaining the second label information output by the model to be trained; the second step, inputting the first category information and the second category information into the defect category loss function to obtain the first loss function value, and inputting the first position information and the second position information into the defect position loss function to obtain the second loss function value, and storing it. The first loss function value and the second loss function value are stored; in the third step, the model parameters of the model to be trained are adjusted by the first loss function value and the second loss function value using the stochastic gradient descent method; in the fourth step, all the stored first loss function values and the second loss function values are obtained, and when the first loss function value and the second loss function value meet the preset conditions, the adjusted model to be trained is determined to be the target defect detection model, otherwise jump to the first step, wherein the preset conditions include that the sum of a continuous preset number of first loss function values and the second loss function values are all in the target value interval.
可選地,將缺陷影像和模板影像分別輸入到待訓練模型中,並獲取待訓練模型輸出的第二標籤訊息的步驟包括:將缺陷影像和模板影像輸入到待訓練模型的主幹網路中,其中,主幹網路設置為提取缺陷影像和模板影像中的影像特徵,從而得到缺陷特徵影像和模板特徵影像;獲取待訓練模型依據缺陷特徵影像和模板特徵影像輸出的第二標籤訊息。Optionally, the step of inputting the defect image and the template image into the model to be trained respectively and obtaining the second label information output by the model to be trained includes: inputting the defect image and the template image into the backbone network of the model to be trained, wherein the backbone network is configured to extract image features from the defect image and the template image, thereby obtaining a defect feature image and a template feature image; and obtaining the second label information output by the model to be trained based on the defect feature image and the template feature image.
可選地,待訓練模型還包括特徵融合層和特徵金字塔層,其中,特徵融合層設置為依據缺陷特徵影像和模板特徵影像得到第一目標特徵影像,並將第一目標特徵影像輸入到特徵金字塔層中;特徵金字塔層設置為依據第一目標特徵影像輸出第二標籤訊息。Optionally, the model to be trained also includes a feature fusion layer and a feature pyramid layer, wherein the feature fusion layer is configured to obtain a first target feature image based on the defect feature image and the template feature image, and input the first target feature image into the feature pyramid layer; the feature pyramid layer is configured to output a second label information based on the first target feature image.
可選地,特徵融合層包括第一特徵融合層,其中,第一特徵融合層,設置為對缺陷特徵影像和模板特徵影像進行差分運算,得到差分特徵影像,其中,差分特徵影像中任意一個畫素點的畫素值等於任意一個畫素點對應的缺陷畫素點和模板畫素點的差值絕對值,缺陷畫素點為缺陷特徵影像中與任意一個畫素點對應的畫素點,模板畫素點為模板特徵影像中與任意一個畫素點對應的畫素點;對差分特徵影像和缺陷特徵影像進行通道拼接處理,得到第二目標特徵影像;通過目標卷積核對第二目標特徵影像進行卷積處理,得到第一目標特徵影像。Optionally, the feature fusion layer includes a first feature fusion layer, wherein the first feature fusion layer is configured to perform a differential operation on the defect feature image and the template feature image to obtain a differential feature image, wherein the pixel value of any pixel point in the differential feature image is equal to the absolute value of the difference between the defect pixel point and the template pixel point corresponding to any pixel point, the defect pixel point is the pixel point corresponding to any pixel point in the defect feature image, and the template pixel point is the pixel point corresponding to any pixel point in the template feature image; channel stitching processing is performed on the differential feature image and the defect feature image to obtain a second target feature image; and convolution processing is performed on the second target feature image through target convolution check to obtain the first target feature image.
可選地,特徵融合層包括第二特徵融合層,其中,第二特徵融合層,設置為通過目標卷積核分別對缺陷特徵影像和模板特徵影像進行卷積處理,並依據卷積處理後的缺陷特徵影像和模板特徵影像生成第一目標特徵影像,其中,第一目標特徵影像中任意一個畫素點的畫素值等於任意一個畫素點對應的缺陷畫素點和模板畫素點的畫素值之和。Optionally, the feature fusion layer includes a second feature fusion layer, wherein the second feature fusion layer is configured to perform convolution processing on the defect feature image and the template feature image respectively through a target convolution kernel, and generate a first target feature image based on the defect feature image and the template feature image after the convolution processing, wherein the pixel value of any pixel point in the first target feature image is equal to the sum of the pixel values of the defect pixel point and the template pixel point corresponding to the any pixel point.
可選地,確定調整後的待訓練模型為目標缺陷檢測模型的步驟包括:獲取驗證樣本集,以及與驗證樣本集中的每一組樣本對應的第三缺陷標籤訊息,其中,驗證樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第三缺陷標籤訊息包括缺陷影像中各處缺陷的第三類別訊息和第三位置訊息;在調整後的待訓練模型的數量為多個的情況下,通過驗證樣本集和第三缺陷標籤訊息確定多個調整後的待訓練模型中的每個調整後的待訓練模型的平均精度均值;確定平均精度均值最大的調整後的待訓練模型為目標缺陷檢測模型。Optionally, the step of determining that the adjusted model to be trained is the target defect detection model includes: obtaining a verification sample set and a third defect label information corresponding to each group of samples in the verification sample set, wherein each group of samples in the verification sample set includes a defect image and a template image corresponding to the defect image, and the third defect label information includes third category information and third position information of defects at various locations in the defect image; when there are multiple adjusted models to be trained, determining the average precision mean of each adjusted model to be trained in the multiple adjusted models to be trained through the verification sample set and the third defect label information; and determining the adjusted model to be trained with the largest average precision mean as the target defect detection model.
可選地,獲取訓練樣本集的步驟包括:獲取第一缺陷影像以及與第一缺陷影像對應的第一模板影像;對第一缺陷影像和第一模板影像採用相同的處理方式進行幾何變換處理,並將經過幾何變換處理的第一缺陷影像作為缺陷影像樣本,將經過結合變換處理的第一模板影像作為模板影像樣本,其中,處理方式包括以下至少之一:隨機裁剪,影像翻轉,影像拼接。Optionally, the step of obtaining a training sample set includes: obtaining a first defect image and a first template image corresponding to the first defect image; performing geometric transformation processing on the first defect image and the first template image using the same processing method, and using the first defect image after the geometric transformation processing as a defect image sample, and using the first template image after the combined transformation processing as a template image sample, wherein the processing method includes at least one of the following: random cropping, image flipping, and image stitching.
可選地,類別訊息包括缺陷的缺陷類別編號,位置訊息包括缺陷對應的缺陷框的位置訊息。Optionally, the category information includes a defect category number of the defect, and the location information includes location information of a defect box corresponding to the defect.
根據本發明實施例的另一方面,還提供了一種缺陷影像分類方法,包括:確定待檢測缺陷影像,以及與待檢測缺陷影像對應的模板影像;將待檢測缺陷影像和模板影像輸入到目標缺陷檢測模型中,獲取目標缺陷檢測模型輸出的缺陷位置訊息和缺陷類別訊息,其中,目標缺陷檢測模型用於提取待檢測缺陷影像的第三影像特徵和模板影像的第四影像特徵,並依據三影像特徵和第四影像特徵輸出缺陷位置訊息和缺陷類別訊息;依據缺陷位置訊息確定待檢測缺陷影像中距離待檢測缺陷影像的中心點最近的預設數量個目標缺陷;確定預設數量個目標缺陷中的每個目標缺陷的類別置信度,並確定類別置信度最大的目標缺陷的缺陷類別為待檢測缺陷影像的缺陷類別。According to another aspect of the embodiment of the present invention, a defect image classification method is also provided, including: determining a defect image to be detected, and a template image corresponding to the defect image to be detected; inputting the defect image to be detected and the template image into a target defect detection model to obtain defect location information and defect category information output by the target defect detection model, wherein the target defect detection model is used to extract a third image feature of the defect image to be detected and a fourth image feature of the template image, and output defect location information and defect category information based on the three image features and the fourth image feature; determining a preset number of target defects in the defect image to be detected that are closest to the center point of the defect image to be detected based on the defect location information; determining the category confidence of each target defect in the preset number of target defects, and determining the defect category of the target defect with the largest category confidence as the defect category of the defect image to be detected.
根據本發明實施例的另一方面,還提供了一種缺陷檢測模型的訓練裝置,包括:輸入模組,設置為獲取訓練樣本集,以及與訓練樣本集中的每一組樣本對應的第一缺陷標籤訊息,其中,訓練樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第一缺陷標籤訊息包括缺陷影像中各處缺陷的第一類別訊息和第一位置訊息;第一處理模組,設置為確定目標損失函數,其中,目標損失函數包括缺陷類別損失函數和缺陷位置損失函數;第二處理模組,設置為採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型,其中,目標缺陷檢測模型設置為確定待檢測缺陷影像中的缺陷位置訊息和缺陷類別訊息。According to another aspect of the embodiment of the present invention, a training device for a defect detection model is provided, comprising: an input module, configured to obtain a training sample set and a first defect label message corresponding to each set of samples in the training sample set, wherein each set of samples in the training sample set includes a defect image and a template image corresponding to the defect image, and the first defect label message includes a first category message and a first position message of each defect in the defect image; The first processing module is configured to determine a target loss function, wherein the target loss function includes a defect category loss function and a defect position loss function; the second processing module is configured to use a random gradient descent method to train a model to be trained using a training sample set, defect label information and a target loss function to obtain a target defect detection model, wherein the target defect detection model is configured to determine defect location information and defect category information in a defect image to be detected.
根據本發明實施例的另一方面,還提供了一種非易失性儲存媒體,非易失性儲存媒體中儲存有程式,其中,在程式運行時控制非易失性儲存媒體所在設備執行缺陷模型的訓練方法,或缺陷影像分類方法。According to another aspect of the embodiment of the present invention, a non-volatile storage medium is provided, in which a program is stored, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute a defect model training method or a defect image classification method.
根據本發明實施例的另一方面,還提供了一種電子設備,電子設備包括記憶體和處理器,處理器設置為運行儲存在記憶體中的程式,其中,程式運行時執行缺陷檢測模型的訓練方法,或缺陷影像分類方法。According to another aspect of an embodiment of the present invention, an electronic device is provided. The electronic device includes a memory and a processor. The processor is configured to run a program stored in the memory. When the program is running, a training method for a defect detection model or a defect image classification method is executed.
在本發明實施例中,採用獲取訓練樣本集,以及與訓練樣本集中的每一組樣本對應的第一缺陷標籤訊息,其中,訓練樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第一缺陷標籤訊息包括缺陷影像中各處缺陷的第一類別訊息和第一位置訊息;確定目標損失函數,其中,目標損失函數包括缺陷類別損失函數和缺陷位置損失函數;採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型,其中,目標缺陷檢測模型用於確定待檢測缺陷影像中的缺陷位置訊息和缺陷類別訊息,待訓練模型用於提取缺陷影像的第一影像特徵和模板影像的第二影像特徵,並依據第一影像特徵和第二影像特徵輸出缺陷影像的第二標籤訊息,第二標籤訊息中包括待訓練模型確定的缺陷影像中各處缺陷的第二類別訊息和第二位置訊息的方式,通過採用包含缺陷影像和模板影像的訓練樣本集以及缺陷標籤訊息訓練缺陷檢測模型,達到了獲得在缺陷識別過程中可利用模板影像的缺陷檢測模型的目的,從而實現了在對晶粒影像進行缺陷識別和分類的過程中可以利用模板影像來輔助分類識別的技術效果,進而解決了由於相關技術中在對晶粒影像進行缺陷識別和分類時沒有利用模板影像造成的識別和分類結果不佳技術問題。In the embodiment of the present invention, a training sample set and a first defect label information corresponding to each group of samples in the training sample set are obtained, wherein each group of samples in the training sample set includes a defect image and a template image corresponding to the defect image, and the first defect label information includes a first category information and a first position information of defects at various locations in the defect image; a target loss function is determined, wherein the target loss function includes a defect category loss function and a defect position loss function; a random gradient descent method is used to train a model to be trained through the training sample set, the defect label information and the target loss function to obtain a target defect detection model, wherein the target defect detection model is used to determine the defect location information and the defect category information in the defect image to be detected, and the model to be trained is used to extract the defect image. The method comprises the following steps: a first image feature and a second image feature of a template image, and outputting a second label information of the defect image based on the first image feature and the second image feature, wherein the second label information includes second category information and second position information of defects at various locations in the defect image to be determined by the training model. By adopting a training sample set including defect images and template images and defect label information to train a defect detection model, the purpose of obtaining a defect detection model that can utilize the template image in the defect recognition process is achieved, thereby achieving the technical effect of utilizing the template image to assist in classification recognition in the process of defect recognition and classification of grain images, thereby solving the technical problem of poor recognition and classification results caused by not utilizing the template image in the related technology when performing defect recognition and classification on grain images.
為了使所述技術領域具有通常知識者更好地理解本發明方案,下面將結合本發明實施例中的圖式,對本發明實施例中的技術方案進行清楚、完整地描述,顯然,所描述的實施例僅僅是本發明一部分的實施例,而不是全部的實施例。基於本發明中的實施例,所述技術領域具有通常知識者在沒有做出進步性勞動前提下所獲得的所有其他實施例,都應當屬於本發明保護的範圍。In order to enable a person with ordinary knowledge in the technical field to better understand the solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below in combination with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by a person with ordinary knowledge in the technical field without making progressive labor should belong to the scope of protection of the present invention.
需要說明的是,本發明的說明書和申請專利範圍及上述圖式中的術語“第一”、“第二”等是用於區別類似的對象,而不必用於描述特定的順序或先後次序。應該理解這樣使用的資料在適當情況下可以互換,以便這裡描述的本發明的實施例能夠以除了在這裡圖示或描述的那些以外的順序實施。此外,術語“包括”和“具有”以及他們的任何變形,意圖在於覆蓋不排他的包含,例如,包含了一系列步驟或單元的過程、方法、系統、產品或設備不必限於清楚地列出的那些步驟或單元,而是可包括沒有清楚地列出的或對於這些過程、方法、產品或設備固有的其它步驟或單元。It should be noted that the terms "first", "second", etc. in the specification and patent application of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or apparatus.
隨著半導體裝置技術的發展,用於製造半導體裝置的製程越來越多,其主要目的是在晶粒中製作電路及電子元件,如電晶體、電容和邏輯開關等等,例如,通過在晶粒表面進行氧化及化學氣相沉積,然後塗膜、曝光、顯影、蝕刻、離子植入、金屬濺鍍等步驟,並最終在晶粒上完成數層電路及元件加工與製作。然而,由於製造過程中的每個製程都有一定的複雜度,因此,每個製程流程對晶粒的處理都有可能會在不同層產生一些不符預期的結構,並且這些結構會造成晶片上電路無法正常工作,這種結構通常稱之為晶粒缺陷。With the development of semiconductor device technology, more and more processes are used to manufacture semiconductor devices. The main purpose is to make circuits and electronic components in the grain, such as transistors, capacitors and logic switches, etc. For example, by oxidation and chemical vapor deposition on the surface of the grain, followed by coating, exposure, development, etching, ion implantation, metal sputtering and other steps, and finally completing several layers of circuit and component processing and manufacturing on the grain. However, since each process in the manufacturing process has a certain degree of complexity, each process flow may produce some unexpected structures at different layers when treating the grain, and these structures will cause the circuit on the chip to not work properly. This structure is usually called a grain defect.
為了消除晶粒缺陷,晶片製造流程中會在眾多關鍵工序後都安排晶粒缺陷檢測的步驟,用於監控關鍵製程,確保其正確性。但由於晶片製造的製程流程極其複雜,晶粒缺陷類型繁多,所以目前沒有一個統一的分類方式。目前AOI(Automated Optical Inspection,自動光學檢測設備)通常使用傳統視覺即影像差分(目標晶粒和黃金晶粒)或閾值分割的檢測算法對晶粒上缺陷進行定位檢測。但是由於晶粒背景複雜,製程繁多,晶粒的樣式迥異,使用傳統視覺算法雖然能實現缺陷定位,但手動提取缺陷特徵進行分類幾乎是不可能完成的事情,往往在制定了一系列的規則(缺陷圖形及其缺陷形狀大小、缺陷位置區域的灰度值以及缺陷訊號強度等訊息)後篩選獲得的類別結果並不準確,存在很多的過檢和誤檢現象,所以大多時候,晶粒缺陷分類很大程度上依賴於原始的人工複檢的方式,而人工分類操作存在速度慢、一致性/可靠性差的缺點,且極易受到外界因素的干擾影響,這使得晶粒缺陷分類存在一定的技術瓶頸。In order to eliminate grain defects, the chip manufacturing process will arrange a grain defect detection step after many key processes to monitor the key processes and ensure their correctness. However, due to the extremely complex process of chip manufacturing and the wide variety of grain defects, there is currently no unified classification method. Currently, AOI (Automated Optical Inspection) usually uses traditional vision, i.e. image differential (target grain and gold grain) or threshold segmentation detection algorithms to locate defects on grains. However, due to the complex background of grains, the various processes, and the different styles of grains, although the use of traditional visual algorithms can achieve defect location, it is almost impossible to manually extract defect features for classification. Often, after formulating a series of rules (defect patterns and their defect shapes and sizes, grayscale values of defect location areas, and defect signal strength, etc.), the classification results obtained after screening are not accurate, and there are many over-inspections and mis-inspections. Therefore, most of the time, grain defect classification relies heavily on the original manual re-inspection method. Manual classification operations have the disadvantages of slow speed, poor consistency/reliability, and are easily affected by external factors, which makes grain defect classification have certain technical bottlenecks.
另外近些年來隨著深度學習算法及硬體設備的快速研究和發展,尤其是神經網路在目標分類、目標檢測、目標分割領域的迭代優化,使半導體領域的自動化缺陷檢測/分類越來越多得運用到深度學習算法技術,獲得越來越高的檢測/分類精度。In addition, with the rapid research and development of deep learning algorithms and hardware equipment in recent years, especially the iterative optimization of neural networks in the fields of target classification, target detection, and target segmentation, the automated defect detection/classification in the semiconductor field has increasingly used deep learning algorithm technology to achieve higher and higher detection/classification accuracy.
但是,相關技術中在進行缺陷識別和分類時依賴於特徵提取技術,而背景複雜的晶粒上的缺陷僅僅靠若干人工選擇的特徵進行識別,所得到的模型分類性能是有限的。卷積神經網路能自動學習提取適合分類的特徵,提高了檢測分類性能。但實際生產中晶粒背景複雜,紋路繁多,缺陷特徵不明顯,不同種類缺陷之間特徵類似不易區分,如何忽略掉無用的背景而準確得提取出感興趣的缺陷區域的特徵,是晶粒缺陷檢測分類問題的重難點。因此,存在無法高效準確地確定晶粒影像中的故障類型以及對故障進行分類的問題。為了解決該問題,本發明實施例中提供了相關的解決方案,以下詳細說明。However, related technologies rely on feature extraction technology for defect identification and classification, and defects on grains with complex backgrounds are only identified by a number of manually selected features, and the resulting model classification performance is limited. Convolutional neural networks can automatically learn to extract features suitable for classification, improving the detection and classification performance. However, in actual production, the grain background is complex, the textures are numerous, the defect features are not obvious, and the features of different types of defects are similar and difficult to distinguish. How to ignore the useless background and accurately extract the features of the defective area of interest is the key difficulty of grain defect detection and classification. Therefore, there is a problem of not being able to efficiently and accurately determine the fault type in the grain image and classify the fault. In order to solve this problem, the present invention provides a related solution in the embodiment, which is described in detail below.
根據本發明實施例,提供了一種缺陷檢測模型的訓練方法的方法實施例,需要說明的是,在圖式的流程圖示出的步驟可以在諸如一組電腦可執行指令的電腦系統中執行,並且,雖然在流程圖中示出了邏輯順序,但是在某些情況下,可以以不同於此處的順序執行所示出或描述的步驟。According to an embodiment of the present invention, a method embodiment of a defect detection model training method is provided. It should be noted that the steps shown in the flowchart in the figure can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
本發明實施例所提供的方法實施例可以在移動終端、電腦終端或者類似的運算裝置中執行。圖1示出了一種設置為實現缺陷檢測模型的訓練方法的電腦終端(或移動設備)的硬體結構方塊圖。如圖1所示,電腦終端10(或移動設備10)可以包括一個或多個(圖中採用102a、102b,……,102n來示出)處理器102(處理器102可以包括但不限於微處理器MCU或可編程邏輯裝置FPGA等的處理裝置)、用於儲存資料的記憶體104、以及用於通訊功能的傳輸模組106。除此以外,還可以包括:顯示器、輸入/輸出埠(I/O埠)、通用序列匯流排(USB)端口(可以作為BUS匯流排的端口中的一個端口被包括)、網路埠、電源和/或相機。所述技術領域具有通常知識者可以理解,圖1所示的結構僅為示意,其並不對上述電子裝置的結構造成限定。例如,電腦終端10還可包括比圖1中所示更多或者更少的組件,或者具有與圖1所示不同的配置。The method embodiment provided by the embodiment of the present invention can be executed in a mobile terminal, a computer terminal or a similar computing device. FIG1 shows a hardware structure block diagram of a computer terminal (or mobile device) configured to implement a training method for a defect detection model. As shown in FIG1 , a computer terminal 10 (or mobile device 10) may include one or more (shown in the figure as 102a, 102b, ..., 102n) processors 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input/output port (I/O port), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network port, a power supply and/or a camera. A person skilled in the art may understand that the structure shown in FIG. 1 is only for illustration and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a configuration different from that shown in FIG. 1.
應當注意到的是上述一個或多個處理器102和/或其他資料處理電路在本文中通常可以被稱為“資料處理電路”。該資料處理電路可以全部或部分的體現為軟體、硬體、韌體或其他任意組合。此外,資料處理電路可為單個獨立的處理模組,或全部或部分的結合到電腦終端10(或移動設備)中的其他元件中的任意一個內。如本發明實施例中所涉及到的,該資料處理電路作為一種處理器控制(例如與埠連接的可變電阻終端路徑的選擇)。It should be noted that the one or more processors 102 and/or other data processing circuits mentioned above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination. In addition, the data processing circuit may be a single independent processing module, or may be fully or partially integrated into any of the other components in the computer terminal 10 (or mobile device). As involved in the embodiments of the present invention, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to a port).
記憶體104可設置為儲存應用軟體的軟體程式以及模組,如本發明實施例中的缺陷檢測模型的訓練方法對應的程式指令/資料儲存裝置,處理器102通過運行儲存在記憶體104內的軟體程式以及模組,從而執行各種功能應用以及資料處理,即實現上述的應用程式的缺陷檢測模型的訓練方法。記憶體104可包括高速隨機記憶體,還可包括非易失性記憶體,如一個或者多個磁性儲存裝置、快閃記憶體、或者其他非易失性固態記憶體。在一些實例中,記憶體104可進一步包括相對於處理器102遠程設置的記憶體,這些遠程記憶體可以通過網路連接至電腦終端10。上述網路的實例包括但不限於網路、企業內部網路、區域網路、移動通訊網路及其組合。The memory 104 can be configured to store software programs and modules of application software, such as the program instruction/data storage device corresponding to the defect detection model training method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the defect detection model training method of the above-mentioned application program is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
傳輸模組106設置為經由一個網路接收或者發送資料。上述的網路具體實例可包括電腦終端10的通訊供應商提供的無線網路。在一個實例中,傳輸模組106包括一個網路介面控制器(Network Interface Controller,NIC),其可通過基站與其他網路設備相連從而可與網路進行通訊。在一個實例中,傳輸模組106可以為射頻(Radio Frequency,RF)模組,其設置為通過無線方式與網路進行通訊。The transmission module 106 is configured to receive or send data via a network. A specific example of the network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network interface controller (NIC), which can be connected to other network devices through a base station to communicate with the network. In one example, the transmission module 106 may be a radio frequency (RF) module, which is configured to communicate with the network wirelessly.
顯示器可以例如觸摸螢幕式的液晶顯示器(LCD),該液晶顯示器可使得使用者能夠與電腦終端10(或移動設備)的使用者界面進行交互。The display may be, for example, a touch screen liquid crystal display (LCD), which may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
在上述運行環境下,本發明實施例提供了一種缺陷檢測模型的訓練方法,如圖2所示,該方法包括如下步驟: 步驟S202,獲取訓練樣本集,以及與訓練樣本集中的每一組樣本對應的第一缺陷標籤訊息,其中,訓練樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第一缺陷標籤訊息包括缺陷影像中各處缺陷的第一類別訊息和第一位置訊息; 在步驟S202所提供的技術方案中,樣本影像中的缺陷影像和模板影像如圖3b所示。從圖3b中可以看出,模板影像和缺陷影像對應的是晶粒影像中的同一位置,區別僅在於模板影像中沒有缺陷或瑕疵。 In the above operating environment, the embodiment of the present invention provides a method for training a defect detection model, as shown in FIG2, the method includes the following steps: Step S202, obtaining a training sample set and a first defect label message corresponding to each set of samples in the training sample set, wherein each set of samples in the training sample set includes a defect image and a template image corresponding to the defect image, and the first defect label message includes a first category message and a first position message of defects in each location in the defect image; In the technical solution provided in step S202, the defect image and the template image in the sample image are shown in FIG3b. As can be seen from FIG3b, the template image and the defect image correspond to the same position in the grain image, and the only difference is that there is no defect or flaw in the template image.
作為一種可選地實施方式,可以通過確定缺陷影像在晶粒影像中的位置訊息後,依據該位置訊息從如圖3a所示的黃金晶粒影像中獲取對應的模板影像,其中,黃金晶粒影像指的是無任何缺陷或瑕疵的影像。黃金晶粒影像通產會儲存在AOI檢測設備中。As an optional implementation, after determining the position information of the defect image in the grain image, a corresponding template image can be obtained from the golden grain image shown in FIG. 3a according to the position information, wherein the golden grain image refers to an image without any defects or flaws. The golden grain image is usually stored in the AOI inspection equipment.
另外,步驟S202中所述的第一類別訊息包括缺陷的類別編號。具體地,可以提前確定晶粒影像中需要識別的缺陷類別和對應的類別編號,例如,假設需要識別的缺陷類別包括開口髒汙、線路髒汙、開口破損、線路蝕刻、膠面破損、顯影不良、線路橋接、壓邊等八種類別,對應的類別編號可以依次取{0,1,2,3,4,5,6,7}。In addition, the first category information described in step S202 includes the category number of the defect. Specifically, the defect categories and corresponding category numbers that need to be identified in the die image can be determined in advance. For example, assuming that the defect categories that need to be identified include eight categories, including opening dirt, line dirt, opening damage, line etching, plastic surface damage, poor development, line bridge, and edge pressing, the corresponding category numbers can be {0, 1, 2, 3, 4, 5, 6, 7} in sequence.
步驟S202中所述的第一位置訊息包括缺陷對應的缺陷框在影像中的坐標訊息。具體地,可以使用labelImg等工具對缺陷影像中的所有缺陷進行缺陷框標注,並且在標注的過程中,可以篩選掉無法進行分析標注的影像。The first position information in step S202 includes the coordinate information of the defect frame corresponding to the defect in the image. Specifically, tools such as labelImg can be used to mark all defects in the defect image with defect frames, and in the process of marking, images that cannot be analyzed and marked can be filtered out.
可選地,上述第一缺陷標籤訊息可以以標籤文件的形式保存。其中,標籤文件中的每一行會記錄缺陷影像中的一個缺陷的相關訊息,格式為:[x0, y0, x1, y1, 類別標號],其中x0表示缺陷框的左上角橫坐標,y0表示缺陷框左上角縱坐標,x1表示缺陷框右下角橫坐標,y1表示缺陷框右下角縱坐標。由於缺陷框的邊分別與缺陷影像的一條邊平行,因此僅需要缺陷框左上角和右下角的兩個坐標即可確定缺陷框的位置,進而確定缺陷的位置。需要說明的是,缺陷框的左上角和右下角的坐標是這兩個點在缺陷平面直角坐標系中的坐標,缺陷平面直角坐標系是在缺陷影像中建立的平面直角坐標系。Optionally, the first defect label information can be saved in the form of a label file. Each line in the label file records the relevant information of a defect in the defect image, and the format is: [x0, y0, x1, y1, category label], where x0 represents the horizontal coordinate of the upper left corner of the defect box, y0 represents the vertical coordinate of the upper left corner of the defect box, x1 represents the horizontal coordinate of the lower right corner of the defect box, and y1 represents the vertical coordinate of the lower right corner of the defect box. Since the sides of the defect box are parallel to one side of the defect image, only the two coordinates of the upper left corner and the lower right corner of the defect box are needed to determine the position of the defect box, and then determine the position of the defect. It should be noted that the coordinates of the upper left corner and the lower right corner of the defect box are the coordinates of these two points in the defect plane rectangular coordinate system, and the defect plane rectangular coordinate system is a plane rectangular coordinate system established in the defect image.
作為一種可選地實施方式,為了實現以有限的晶粒缺陷資料高效訓練缺陷檢測模型,還可以採用如圖4所示的訓練樣本集獲取方法來對訓練樣本集進行處理。如圖4所示,包括以下步驟: 步驟S402,獲取第一缺陷影像以及與第一缺陷影像對應的第一模板影像; 步驟S404,對第一缺陷影像和第一模板影像採用相同的處理方式進行幾何變換處理,並將經過幾何變換處理的第一缺陷影像作為缺陷影像樣本,將經過結合變換處理的第一模板影像作為模板影像樣本,其中,處理方式包括以下至少之一:隨機裁剪,影像翻轉,影像拼接。 As an optional implementation method, in order to realize efficient training of the defect detection model with limited grain defect data, the training sample set acquisition method shown in FIG4 can also be used to process the training sample set. As shown in FIG4, the following steps are included: Step S402, obtaining a first defect image and a first template image corresponding to the first defect image; Step S404, geometrically transforming the first defect image and the first template image using the same processing method, and using the first defect image after the geometric transformation as a defect image sample, and using the first template image after the combined transformation as a template image sample, wherein the processing method includes at least one of the following: random cropping, image flipping, and image splicing.
具體地,隨機裁剪的裁剪尺度範圍可以自行設定,例如可以設定為原圖尺寸的70%到130%,其中裁剪後得到的影像的空白部分畫素值可以設定為零。翻轉時可以按照預設概率對影像中的多行畫素或多列畫素進行水平或豎直翻轉。影像拼接則可以採用R-Stitch拼接等方式來對影像進行處理。Specifically, the cropping scale range of random cropping can be set by yourself, for example, it can be set to 70% to 130% of the original image size, and the pixel value of the blank part of the cropped image can be set to zero. When flipping, multiple rows or columns of pixels in the image can be flipped horizontally or vertically according to the preset probability. Image stitching can be processed by R-Stitch stitching and other methods.
這樣對樣本資料進行梳理後,間接增加了訓練過程的訓練批次,解決了類別分佈不均衡的問題,增加了樣本的多樣性,有效地防止了訓練過程中過擬合現象的發生,並且提高了模型對待檢測圖片尺寸大小的穩健性。After sorting out the sample data in this way, the training batches in the training process are indirectly increased, the problem of unbalanced category distribution is solved, the diversity of samples is increased, the occurrence of overfitting in the training process is effectively prevented, and the robustness of the model to the size of the images to be tested is improved.
步驟S204,確定目標損失函數,其中,目標損失函數包括缺陷類別損失函數和缺陷位置損失函數;在步驟S204所提供的技術方案中,缺陷類別損失函數可以為交叉熵損失函數,缺陷位置損失函數可以為平滑L1損失函數。In step S204, a target loss function is determined, wherein the target loss function includes a defect category loss function and a defect position loss function; in the technical solution provided in step S204, the defect category loss function may be a cross entropy loss function, and the defect position loss function may be a smoothed L1 loss function.
步驟S206,採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型,其中,目標缺陷檢測模型用於確定待檢測缺陷影像中的缺陷位置訊息和缺陷類別訊息,待訓練模型用於提取缺陷影像的第一影像特徵和模板影像的第二影像特徵,並依據第一影像特徵和第二影像特徵輸出缺陷影像的第二標籤訊息,第二標籤訊息中包括待訓練模型確定的缺陷影像中各處缺陷的第二類別訊息和第二位置訊息。Step S206, using the random gradient descent method, the model to be trained is trained through the training sample set, defect label information and target loss function to obtain the target defect detection model, wherein the target defect detection model is used to determine the defect position information and defect category information in the defect image to be detected, and the model to be trained is used to extract the first image feature of the defect image and the second image feature of the template image, and output the second label information of the defect image based on the first image feature and the second image feature, and the second label information includes the second category information and the second position information of the defects in each defect image determined by the model to be trained.
在步驟S206所提供的技術方案中,對目標缺陷檢測模型進行訓練的具體流程如圖5所示,包括以下步驟: 步驟S502,將缺陷影像和模板影像分別輸入到待訓練模型中,並獲取待訓練模型輸出的第二標籤訊息,其中,第二標籤訊息中包括待訓練模型確定的缺陷影像中各處缺陷的第二類別訊息和第二位置訊息; 步驟S504,將第一類別訊息和第二類別訊息輸入到缺陷類別損失函數中,得到第一損失函數值,以及將第一位置訊息和第二位置訊息輸入到缺陷位置損失函數中,得到第二損失函數值,並儲存第一損失函數值和第二損失函數值; 步驟S506,採用隨機梯度下降法,通過第一損失函數值和第二損失函數值調整待訓練模型的模型參數; 需要說明的是,可以加載官方的預訓練權重作為待訓練模型的初始模型參數。由於官方提供的預訓練權重是在包含了大量樣本影像的開源資料集ImageNet上訓練得到的,因此採用預訓練權重可以使待訓練模型更能學習到目標底層的特徵,極大程度緩解因訓練樣本集中的樣本數量過少導致的過擬合問題,並且可以加快模型收斂速度。 In the technical solution provided in step S206, the specific process of training the target defect detection model is shown in Figure 5, including the following steps: Step S502, respectively input the defect image and the template image into the model to be trained, and obtain the second label information output by the model to be trained, wherein the second label information includes the second category information and the second position information of each defect in the defect image determined by the model to be trained; Step S504, input the first category information and the second category information into the defect category loss function to obtain the first loss function value, and input the first position information and the second position information into the defect position loss function to obtain the second loss function value, and store the first loss function value and the second loss function value; Step S506, using the random gradient descent method, adjust the model parameters of the model to be trained through the first loss function value and the second loss function value; It should be noted that the official pre-trained weights can be loaded as the initial model parameters of the model to be trained. Since the official pre-trained weights are trained on the open source dataset ImageNet containing a large number of sample images, the use of pre-trained weights can enable the model to be trained to learn the characteristics of the target bottom layer better, greatly alleviate the overfitting problem caused by too few samples in the training sample set, and can speed up the model convergence speed.
步驟S508,獲取儲存的全部第一損失函數值和第二損失函數值,在第一損失函數值和第二損失函數值符合預設條件的情況下,確定調整後的待訓練模型為目標缺陷檢測模型,否則跳轉到步驟S502。In step S508, all the first loss function values and the second loss function values stored are obtained. If the first loss function value and the second loss function value meet the preset conditions, the adjusted model to be trained is determined to be the target defect detection model, otherwise jump to step S502.
上述預設條件可以是第一損失函數值和第二損失函數值均不再發生波動。例如,連續預設數量個第一損失函數值中任意兩個第一損失函數值之間的差值小於第一預設差值,並且連續預設數量個第二損失函數值中任意兩個第二損失函數值之間的差值小於第二預設差值。The preset condition may be that both the first loss function value and the second loss function value no longer fluctuate. For example, the difference between any two first loss function values in a preset number of consecutive first loss function values is less than a first preset difference, and the difference between any two second loss function values in a preset number of consecutive second loss function values is less than a second preset difference.
具體地,使用常見的交叉熵損失作為類別的損失計算函數,平滑L1損失作為真實坐標框的損失計算函數,並採用經典的隨機梯度下降法(SGD, Stochastic Gradient Descent)作為網路反向傳播的優化器。將訓練集批量匯入上述待訓練模型中,進行神經網路的前向傳播過程計算得到輸出(第二標籤訊息)後,同真實值(第一標籤訊息)對比計算出損失函數值,再通過反向傳播過程(梯度下降法)更新模型參數,一直反復迭代訓練直至損失函數值保持平穩不再顯著變化時停止訓練。Specifically, the common cross entropy loss is used as the loss calculation function for the category, the smooth L1 loss is used as the loss calculation function for the true coordinate frame, and the classic stochastic gradient descent (SGD) is used as the optimizer for network back propagation. The training set is batch-imported into the above-mentioned model to be trained, and the output (second label information) is calculated by the forward propagation process of the neural network. The loss function value is calculated by comparing it with the true value (first label information), and then the model parameters are updated through the back propagation process (gradient descent method). The training is repeated until the loss function value remains stable and no longer changes significantly.
在步驟S502所提供的技術方案中,擷取第二標籤訊息的具體方法如圖6所示,包括以下步驟: 步驟S602,將缺陷影像和模板影像輸入到待訓練模型的主幹網路中,其中,主幹網路設置為提取缺陷影像和模板影像中的影像特徵,從而得到缺陷特徵影像和模板特徵影像; 步驟S604,獲取待訓練模型依據缺陷特徵影像和模板特徵影像輸出的第二標籤訊息。 In the technical solution provided in step S502, the specific method for extracting the second label information is shown in Figure 6, including the following steps: Step S602, input the defect image and the template image into the backbone network of the model to be trained, wherein the backbone network is configured to extract image features from the defect image and the template image, thereby obtaining the defect feature image and the template feature image; Step S604, obtain the second label information output by the model to be trained based on the defect feature image and the template feature image.
可選地,本發明實施例中所提供的待訓練模型和相關技術中的模型相比,由於需要同時輸入缺陷影像和模板影像,因此會有兩個結構相同的主幹網路同時提取缺陷影像和模板影像的影像特徵。其中主幹網路的結構可以根據現有的硬體內存條件選擇合適的參數量和網路類型,如VGG系列、ResNet系列、RegNet系列、Efficient系列、MobileNet系列等。Optionally, the training model provided in the embodiment of the present invention is compared with the model in the related art, because the defect image and the template image need to be input simultaneously, so there will be two backbone networks with the same structure to extract the image features of the defect image and the template image simultaneously. The structure of the backbone network can select appropriate parameter quantities and network types according to the existing hardware memory conditions, such as VGG series, ResNet series, RegNet series, Efficient series, MobileNet series, etc.
本發明實施例中所提供的待訓練模型還包括特徵融合層和特徵金字塔層,其中,特徵融合層設置為依據缺陷特徵影像和模板特徵影像得到第一目標特徵影像,並將第一目標特徵影像輸入到特徵金字塔層中;特徵金字塔層設置為依據第一目標特徵影像輸出第二標籤訊息。The model to be trained provided in the embodiment of the present invention also includes a feature fusion layer and a feature pyramid layer, wherein the feature fusion layer is configured to obtain a first target feature image based on the defect feature image and the template feature image, and input the first target feature image into the feature pyramid layer; the feature pyramid layer is configured to output a second label message based on the first target feature image.
具體地,作為一種可選地實施方式,如圖7所示,上述特徵融合層包括第一特徵融合層。其中,第一特徵融合層,設置為對缺陷特徵影像和模板特徵影像進行差分運算,得到差分特徵影像,其中,差分特徵影像中任意一個畫素點的畫素值等於任意一個畫素點對應的缺陷畫素點和模板畫素點的差值絕對值,缺陷畫素點為缺陷特徵影像中與任意一個畫素點對應的畫素點,模板畫素點為模板特徵影像中與任意一個畫素點對應的畫素點;對差分特徵影像和缺陷特徵影像進行通道拼接處理,得到第二目標特徵影像;通過目標卷積核對第二目標特徵影像進行卷積處理,得到第一目標特徵影像。Specifically, as an optional implementation, as shown in FIG7 , the feature fusion layer includes a first feature fusion layer. The first feature fusion layer is configured to perform a differential operation on the defect feature image and the template feature image to obtain a differential feature image, wherein the pixel value of any pixel point in the differential feature image is equal to the absolute value of the difference between the defect pixel point and the template pixel point corresponding to any pixel point, the defect pixel point is the pixel point corresponding to any pixel point in the defect feature image, and the template pixel point is the pixel point corresponding to any pixel point in the template feature image; the differential feature image and the defect feature image are channel stitched to obtain a second target feature image; the second target feature image is convoluted by the target convolution check to obtain the first target feature image.
在一些實施例中,待訓練模型的結構也可以如圖8所示。從圖8中可以看出,上述特徵融合層包括第二特徵融合層,其中,第二特徵融合層,設置為通過目標卷積核分別對所述缺陷特徵影像和所述模板特徵影像進行卷積處理,並依據卷積處理後的所述缺陷特徵影像和所述模板特徵影像生成所述第一目標特徵影像,其中,所述第一目標特徵影像中任意一個畫素點的畫素值等於所述任意一個畫素點對應的缺陷畫素點和模板畫素點的畫素值之和。In some embodiments, the structure of the model to be trained may also be shown in FIG8. As can be seen from FIG8, the feature fusion layer includes a second feature fusion layer, wherein the second feature fusion layer is configured to perform convolution processing on the defect feature image and the template feature image respectively through a target convolution kernel, and generate the first target feature image according to the defect feature image and the template feature image after the convolution processing, wherein the pixel value of any pixel point in the first target feature image is equal to the sum of the pixel values of the defect pixel point and the template pixel point corresponding to the any pixel point.
圖7和圖8中所示的待訓練模型均可實現高效利用模板影像的訊息對缺陷影像中的缺陷或瑕疵進行定位,區別在於圖7中所示的模型是先得到缺陷影像和模板影像的差分圖,再對差分圖和缺陷影像進行通道拼接(也就是影像通道上的相加,相當於擴充為特徵圖原有通道數的兩倍),然後通過1×1的卷積核進行降通道處理後送入後續的特徵金字塔層。而圖8中所體用的方案是直接疊加缺陷影像和模板影像,然後送入後續的特徵金字塔層。The models to be trained shown in Figures 7 and 8 can both efficiently use the information of the template image to locate the defects or flaws in the defect image. The difference is that the model shown in Figure 7 first obtains the difference image between the defect image and the template image, then performs channel splicing on the difference image and the defect image (that is, the addition on the image channel, which is equivalent to expanding to twice the number of original channels of the feature map), and then performs channel reduction processing through a 1×1 convolution kernel and sends it to the subsequent feature pyramid layer. The solution embodied in Figure 8 is to directly superimpose the defect image and the template image, and then send it to the subsequent feature pyramid layer.
為了保證訓練效果,還可以同時對多個待訓練模型進行訓練,並在訓練完成後向每個模型中輸入驗證集,進行mAP(mean Average Precision,平均精度均值)的計算,並選取mAP最高的模型為最終得到的目標模型。具體流程如圖9所示,包括以下步驟:In order to ensure the training effect, multiple models to be trained can be trained at the same time, and after the training is completed, the validation set is input into each model to calculate the mAP (mean Average Precision), and the model with the highest mAP is selected as the final target model. The specific process is shown in Figure 9, which includes the following steps:
步驟S902,獲取驗證樣本集,以及與驗證樣本集中的每一組樣本對應的第三缺陷標籤訊息,其中,驗證樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第三缺陷標籤訊息包括缺陷影像中各處缺陷的第三類別訊息和第三位置訊息;需要說明的是,驗證樣本集可以採用與訓練樣本集相同的處理方法,對驗證樣本集中的影像進行幾何變換處理。In step S902, a verification sample set and a third defect label information corresponding to each group of samples in the verification sample set are obtained, wherein each group of samples in the verification sample set includes a defect image and a template image corresponding to the defect image, and the third defect label information includes third category information and third position information of defects at various locations in the defect image; it should be noted that the verification sample set can adopt the same processing method as the training sample set to perform geometric transformation processing on the images in the verification sample set.
步驟S904,在調整後的待訓練模型的數量為多個的情況下,通過驗證樣本集和第三缺陷標籤訊息確定多個調整後的待訓練模型中的每個調整後的待訓練模型的平均精度均值;步驟S906,確定平均精度均值最大的調整後的待訓練模型為目標缺陷檢測模型。Step S904, when there are multiple adjusted models to be trained, determine the average precision mean of each of the multiple adjusted models to be trained by using the verification sample set and the third defect label information; Step S906, determine the adjusted model to be trained with the largest average precision mean as the target defect detection model.
通過獲取訓練樣本集,以及與訓練樣本集中的每一組樣本對應的第一缺陷標籤訊息,其中,訓練樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第一缺陷標籤訊息包括缺陷影像中各處缺陷的第一類別訊息和第一位置訊息;確定目標損失函數,其中,目標損失函數包括缺陷類別損失函數和缺陷位置損失函數;採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型,其中,目標缺陷檢測模型設置為確定待檢測缺陷影像中的缺陷位置訊息和缺陷類別訊息,實現了基於模板圖特徵匹配的晶粒缺陷檢測及分類,充分得利用了前道檢測工序中獲得的晶粒背景訊息,將由無瑕疵黃金die中截取的模板圖與瑕疵圖一同作為網路模型的輸入端,對特徵提取之後的特徵圖進行了匹配融合,這種方法高效得使用到模板圖的訊息,避免了複雜背景電路板的干擾,且由於神經網路的平移不變性,有效地減少了模板圖和瑕疵圖輕微不對齊造成的影響,減輕了對資料預處理的依賴。與傳統的視覺檢測算法和單一輸入網路的神經網路模型相比,不但解決了傳統的視覺檢測算法在複雜背景的晶粒缺陷分類時過於依賴人工提取特徵的問題,也解決了單一輸入網路忽略AOI設備中特有的黃金晶粒訊息,無法合理利用已有的晶粒背景訊息進行瑕疵特徵提取的問題。By obtaining a training sample set and a first defect label information corresponding to each group of samples in the training sample set, wherein each group of samples in the training sample set includes a defect image and a template image corresponding to the defect image, and the first defect label information includes the first category information and the first position information of each defect in the defect image; determining a target loss function, wherein the target loss function includes a defect category loss function and a defect position loss function; using a random gradient descent method, the model to be trained is trained through the training sample set, the defect label information and the target loss function, and a target defect detection model is obtained, wherein the target defect detection model The model is set to determine the defect location information and defect category information in the defect image to be detected, and the grain defect detection and classification based on template image feature matching is realized. The grain background information obtained in the previous inspection process is fully utilized. The template image and the defect image captured from the defect-free golden die are used as the input of the network model, and the feature image after feature extraction is matched and fused. This method efficiently uses the information of the template image and avoids the interference of the complex background circuit board. In addition, due to the translation invariance of the neural network, the impact caused by slight misalignment of the template image and the defect image is effectively reduced, reducing the dependence on data preprocessing. Compared with traditional visual detection algorithms and neural network models with a single input network, this method not only solves the problem that traditional visual detection algorithms rely too much on manually extracted features when classifying grain defects in complex backgrounds, but also solves the problem that a single input network ignores the golden grain information unique to AOI equipment and cannot reasonably use the existing grain background information to extract defect features.
另外,雖然本發明實施例中提供的待檢測模型可以同時輸入缺陷影像和模板影像,但是由於兩個影像使用的主幹網路相同,因此模型的參數量幾乎沒有增加,保證了模型的推理速度。In addition, although the model to be detected provided in the embodiment of the present invention can simultaneously input the defect image and the template image, since the two images use the same backbone network, the number of model parameters is almost not increased, thereby ensuring the inference speed of the model.
並且本發明實施例中採用了預訓練權重微調及在線的隨機幾何變換、拼接等資料增強的方法,在不額外增加資料量(資料儲存空間)的同時,解決了類別分佈不均衡的問題,增加了樣本的多樣性,有效得防止了網路訓練過程中過擬合現象的發生且改善了模型對待檢測圖片尺寸大小的穩健性。In addition, the embodiments of the present invention adopt pre-training weight fine-tuning and online random geometric transformation, splicing and other data enhancement methods, which solve the problem of unbalanced category distribution without increasing the amount of data (data storage space), increase the diversity of samples, effectively prevent the occurrence of over-fitting during network training, and improve the robustness of the model to the size of the image to be detected.
而且本發明中的特徵匹配融合模型結構適用於任何神經網路的改造,包括分類、檢測、分割等,不限於晶粒缺陷檢測領域,並且適用於所有複雜背景場景下的瑕疵檢測領域,具有較強的通用性。Moreover, the feature matching fusion model structure of the present invention is applicable to the transformation of any neural network, including classification, detection, segmentation, etc., and is not limited to the field of grain defect detection, but is applicable to the field of defect detection in all complex background scenes, and has strong versatility.
本發明實施例提供了一種缺陷影像分類方法,圖10是缺陷影像分類方法的流程示意圖,如圖10所示,包括以下步驟: 步驟S1002,確定待檢測缺陷影像,以及與待檢測缺陷影像對應的模板影像; 步驟S1004,將待檢測缺陷影像和模板影像輸入到目標缺陷檢測模型中,獲取目標缺陷檢測模型輸出的缺陷位置訊息和缺陷類別訊息,其中,目標缺陷檢測模型用於提取待檢測缺陷影像的第三影像特徵和模板影像的第四影像特徵,並依據三影像特徵和第四影像特徵輸出缺陷位置訊息和缺陷類別訊息; 步驟S1006,依據缺陷位置訊息確定待檢測缺陷影像中距離待檢測缺陷影像的中心點最近的預設數量個目標缺陷; 步驟S1008,確定預設數量個目標缺陷中的每個目標缺陷的類別置信度,並確定類別置信度最大的目標缺陷的缺陷類別為待檢測缺陷影像的缺陷類別。 The embodiment of the present invention provides a defect image classification method. FIG10 is a flow chart of the defect image classification method. As shown in FIG10, the method includes the following steps: Step S1002, determining the defect image to be detected and the template image corresponding to the defect image to be detected; Step S1004, inputting the defect image to be detected and the template image into the target defect detection model, obtaining the defect location information and defect category information output by the target defect detection model, wherein the target defect detection model is used to extract the third image feature of the defect image to be detected and the fourth image feature of the template image, and outputting the defect location information and defect category information based on the third image feature and the fourth image feature; Step S1006, determining the preset number of target defects in the defect image to be detected that are closest to the center point of the defect image to be detected based on the defect location information; Step S1008, determine the category confidence of each target defect among the preset number of target defects, and determine the defect category of the target defect with the largest category confidence as the defect category of the defect image to be detected.
具體地,在得到缺陷影像中所有缺陷的位置與類別標籤,這時選擇距離影像中心點最近的topk(k可取任意值,如3)的檢測框中類別置信度最大的類別作為當前圖片的最終瑕疵類別。Specifically, after obtaining the positions and category labels of all defects in the defect image, the category with the largest category confidence in the topk (k can be any value, such as 3) detection box closest to the center point of the image is selected as the final defect category of the current image.
由於實際生產中獲得的瑕疵圖中可能存在多個不同種類不同位置的缺陷,所以採用簡單的分類網路往往不能夠得到準確的關注區域類別(單分類模型可能不會收斂,多分類模型無法確定類別位置),本發明實施例中設計了通過目標檢測模型先對瑕疵圖進行缺陷的定位分類檢測,再通過與關注區域的距離和類別置信度判定最終的類別,保證了模型的正常收斂的同時得到準確的類別標籤。Since the defect images obtained in actual production may contain multiple defects of different types and locations, a simple classification network often cannot obtain accurate categories of the area of interest (a single-classification model may not converge, and a multi-classification model cannot determine the category location). In the embodiment of the present invention, a target detection model is designed to first locate and classify the defects in the defect image, and then the final category is determined by the distance from the area of interest and the category confidence, thereby ensuring the normal convergence of the model and obtaining accurate category labels.
本發明實施例還提供了一種模型訓練及影像分類的實際應用流程。圖11是模型訓練及分類流程的流程示意圖。如圖11所示,首先在模型訓練過程中,在獲取了瑕疵圖後,AOI設備可以根據瑕疵圖在黃金Die(晶粒)影像中截取對應的模板圖,並生成缺陷影像的標籤文件。然後可以對缺陷影像和模板影像進行幾何變化、R-stitch拼接等處理。在處理完成後,將處理後的圖片按照一定的比例分為訓練集和驗證集。其中,訓練集用於對待訓練模型進行訓練,在訓練過程中,可以通過構建損失函數來確定訓練流程是否完成,並通過反向傳播法來更新模型參數。具體地,可以在損失函數的函數值保持平穩時確定訓練完成。在使用驗證集驗證訓練完成的模型時,可以將驗證集輸入到訓練完成的模型中,並計算各個模型對應的mAP,確定mAP最高的模型為最終得到的最佳模型。The embodiment of the present invention also provides a practical application process of model training and image classification. Figure 11 is a schematic diagram of the model training and classification process. As shown in Figure 11, first in the model training process, after obtaining the defect image, the AOI equipment can capture the corresponding template image in the gold Die (grain) image according to the defect image, and generate a label file for the defect image. Then the defect image and the template image can be processed by geometric changes, R-stitch splicing, etc. After the processing is completed, the processed images are divided into a training set and a verification set according to a certain ratio. Among them, the training set is used to train the model to be trained. During the training process, the loss function can be constructed to determine whether the training process is completed, and the model parameters can be updated by the back propagation method. Specifically, the training can be completed when the function value of the loss function remains stable. When using the validation set to validate the trained model, the validation set can be input into the trained model, and the mAP corresponding to each model can be calculated, and the model with the highest mAP can be determined as the best model obtained in the end.
在將最佳模型應用到影像分類的任務中時,首先AOI設備會根據待檢測影像從黃金Die影像中截取得到對應的模板影像,並將模板影像和待檢測影像輸入到最佳模型中。最佳模型會確定待檢測影像中的全部瑕疵的位置及種類,並根據距離待檢測影像中心最近的幾個瑕疵框的類別確定待檢測影像的類別,具體來說可以將這幾個瑕疵框中置信度最高的瑕疵框對應的缺陷類別作為待檢測影像的類別。When applying the best model to the task of image classification, the AOI device will first extract the corresponding template image from the golden die image according to the image to be inspected, and input the template image and the image to be inspected into the best model. The best model will determine the location and type of all defects in the image to be inspected, and determine the category of the image to be inspected based on the categories of the defect frames closest to the center of the image to be inspected. Specifically, the defect category corresponding to the defect frame with the highest confidence among these defect frames can be used as the category of the image to be inspected.
本發明實施例提供了一種缺陷檢測模型的訓練裝置,圖12是該裝置的結構示意圖。如圖12所示,該裝置包括:輸入模組120,設置為獲取訓練樣本集,以及與訓練樣本集中的每一組樣本對應的第一缺陷標籤訊息,其中,訓練樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第一缺陷標籤訊息包括缺陷影像中各處缺陷的第一類別訊息和第一位置訊息;第一處理模組122,設置為確定目標損失函數,其中,目標損失函數包括缺陷類別損失函數和缺陷位置損失函數;第二處理模組124,設置為採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型,其中,目標缺陷檢測模型設置為確定待檢測缺陷影像中的缺陷位置訊息和缺陷類別訊息,待訓練模型設置為提取缺陷影像的第一影像特徵和模板影像的第二影像特徵,並依據第一影像特徵和第二影像特徵輸出缺陷影像的第二標籤訊息,第二標籤訊息中包括待訓練模型確定的缺陷影像中各處缺陷的第二類別訊息和第二位置訊息。The embodiment of the present invention provides a training device for a defect detection model, and FIG12 is a schematic diagram of the structure of the device. As shown in FIG12, the device includes: an input module 120, which is configured to obtain a training sample set and a first defect label message corresponding to each group of samples in the training sample set, wherein each group of samples in the training sample set includes a defect image and a template image corresponding to the defect image, and the first defect label message includes a first category message and a first position message of each defect in the defect image; a first processing module 122, which is configured to determine a target loss function, wherein the target loss function includes a defect category loss function and a defect position loss function; a second processing module 124, which is configured to adopt The model to be trained is trained by the random gradient descent method through the training sample set, defect label information and target loss function to obtain the target defect detection model, wherein the target defect detection model is set to determine the defect position information and defect category information in the defect image to be detected, and the model to be trained is set to extract the first image feature of the defect image and the second image feature of the template image, and output the second label information of the defect image according to the first image feature and the second image feature, and the second label information includes the second category information and the second position information of the defects in each defect image determined by the model to be trained.
在本發明的一些實施例中,第二處理模組124採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型的步驟包括:第一步,將缺陷影像和模板影像分別輸入到待訓練模型中,並獲取待訓練模型輸出的第二標籤訊息,其中,第二標籤訊息中包括待訓練模型確定的缺陷影像中各處缺陷的第二類別訊息和第二位置訊息;第二步,將第一類別訊息和第二類別訊息輸入到缺陷類別損失函數中,得到第一損失函數值,以及將第一位置訊息和第二位置訊息輸入到缺陷位置損失函數中,得到第二損失函數值,並儲存第一損失函數值和第二損失函數值;第三步,採用隨機梯度下降法,通過第一損失函數值和第二損失函數值調整待訓練模型的模型參數;第四步,獲取儲存的全部第一損失函數值和第二損失函數值,在連續預設數量個第一損失函數值中任意兩個第一損失函數值之間的差值小於第一預設差值,並且連續預設數量個第二損失函數值中任意兩個第二損失函數值之間的差值小於第二預設差值的情況下,確定調整後的待訓練模型為目標缺陷檢測模型,否則跳轉到第一步。In some embodiments of the present invention, the second processing module 124 uses a random gradient descent method to train the model to be trained through a training sample set, a defect label message and a target loss function, and the steps of obtaining the target defect detection model include: a first step, inputting the defect image and the template image into the model to be trained respectively, and obtaining the second label message output by the model to be trained, wherein the second label message includes the second category information and the second position information of each defect in the defect image determined by the model to be trained; a second step, inputting the first category information and the second category information into the defect category loss function to obtain the first loss function value, and inputting the first position information and the second position information into In the defect position loss function, the second loss function value is obtained, and the first loss function value and the second loss function value are stored; in the third step, the random gradient descent method is used to adjust the model parameters of the model to be trained through the first loss function value and the second loss function value; in the fourth step, all the stored first loss function values and the second loss function values are obtained, and when the difference between any two first loss function values in a continuous preset number of first loss function values is less than the first preset difference, and the difference between any two second loss function values in a continuous preset number of second loss function values is less than the second preset difference, the adjusted model to be trained is determined to be the target defect detection model, otherwise jump to the first step.
在本發明的一些實施例中,第二處理模組124將缺陷影像和模板影像分別輸入到待訓練模型中,並獲取待訓練模型輸出的第二標籤訊息的步驟包括:將缺陷影像和模板影像輸入到待訓練模型的主幹網路中,其中,主幹網路設置為提取缺陷影像和模板影像中的影像特徵,從而得到缺陷特徵影像和模板特徵影像;獲取待訓練模型依據缺陷特徵影像和模板特徵影像輸出的第二標籤訊息。In some embodiments of the present invention, the second processing module 124 inputs the defect image and the template image into the model to be trained respectively, and the step of obtaining the second label information output by the model to be trained includes: inputting the defect image and the template image into the backbone network of the model to be trained, wherein the backbone network is configured to extract image features from the defect image and the template image, thereby obtaining a defect feature image and a template feature image; and obtaining the second label information output by the model to be trained based on the defect feature image and the template feature image.
在本發明的一些實施例中,待訓練模型還包括特徵融合層和特徵金字塔層,其中,特徵融合層設置為依據缺陷特徵影像和模板特徵影像得到第一目標特徵影像,並將第一目標特徵影像輸入到特徵金字塔層中;特徵金字塔層設置為依據第一目標特徵影像輸出第二標籤訊息。In some embodiments of the present invention, the model to be trained also includes a feature fusion layer and a feature pyramid layer, wherein the feature fusion layer is configured to obtain a first target feature image based on the defect feature image and the template feature image, and input the first target feature image into the feature pyramid layer; the feature pyramid layer is configured to output a second label information based on the first target feature image.
在本發明的一些實施例中,特徵融合層包括第一特徵融合層,其中,第一特徵融合層,設置為對缺陷特徵影像和模板特徵影像進行差分運算,得到差分特徵影像,其中,差分特徵影像中任意一個畫素點的畫素值等於任意一個畫素點對應的缺陷畫素點和模板畫素點的差值絕對值,缺陷畫素點為缺陷特徵影像中與任意一個畫素點對應的畫素點,模板畫素點為模板特徵影像中與任意一個畫素點對應的畫素點;對差分特徵影像和缺陷特徵影像進行通道拼接處理,得到第二目標特徵影像;通過目標卷積核對第二目標特徵影像進行卷積處理,得到第一目標特徵影像。In some embodiments of the present invention, the feature fusion layer includes a first feature fusion layer, wherein the first feature fusion layer is configured to perform a differential operation on the defect feature image and the template feature image to obtain a differential feature image, wherein the pixel value of any pixel point in the differential feature image is equal to the absolute value of the difference between the defect pixel point and the template pixel point corresponding to any pixel point, the defect pixel point is the pixel point corresponding to any pixel point in the defect feature image, and the template pixel point is the pixel point corresponding to any pixel point in the template feature image; channel stitching processing is performed on the differential feature image and the defect feature image to obtain a second target feature image; and convolution processing is performed on the second target feature image through target convolution check to obtain the first target feature image.
在本發明的一些實施例中,特徵融合層包括第二特徵融合層,其中,第二特徵融合層,設置為通過目標卷積核分別對缺陷特徵影像和模板特徵影像進行卷積處理,並依據卷積處理後的缺陷特徵影像和模板特徵影像生成第一目標特徵影像,其中,第一目標特徵影像中任意一個畫素點的畫素值等於任意一個畫素點對應的缺陷畫素點和模板畫素點的畫素值之和。In some embodiments of the present invention, the feature fusion layer includes a second feature fusion layer, wherein the second feature fusion layer is configured to perform convolution processing on the defect feature image and the template feature image respectively through a target convolution kernel, and generate a first target feature image based on the defect feature image and the template feature image after the convolution processing, wherein the pixel value of any pixel point in the first target feature image is equal to the sum of the pixel values of the defect pixel point and the template pixel point corresponding to the any pixel point.
在本發明的一些實施例中,第二處理模組124確定調整後的待訓練模型為目標缺陷檢測模型的步驟包括:獲取驗證樣本集,以及與驗證樣本集中的每一組樣本對應的第三缺陷標籤訊息,其中,驗證樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第三缺陷標籤訊息包括缺陷影像中各處缺陷的第三類別訊息和第三位置訊息;在調整後的待訓練模型的數量為多個的情況下,通過驗證樣本集和第三缺陷標籤訊息確定多個調整後的待訓練模型中的每個調整後的待訓練模型的平均精度均值;確定平均精度均值最大的調整後的待訓練模型為目標缺陷檢測模型。In some embodiments of the present invention, the step of the second processing module 124 determining that the adjusted model to be trained is the target defect detection model includes: obtaining a verification sample set and a third defect label message corresponding to each group of samples in the verification sample set, wherein each group of samples in the verification sample set includes a defect image and a template image corresponding to the defect image, and the third defect label message includes third category information and third position information of defects at various locations in the defect image; when there are multiple adjusted models to be trained, determining the average precision mean of each of the multiple adjusted models to be trained through the verification sample set and the third defect label message; and determining the adjusted model to be trained with the largest average precision mean as the target defect detection model.
在本發明的一些實施例中,輸入模組120獲取訓練樣本集的步驟包括:獲取第一缺陷影像以及與第一缺陷影像對應的第一模板影像;對第一缺陷影像和第一模板影像採用相同的處理方式進行幾何變換處理,並將經過幾何變換處理的第一缺陷影像作為缺陷影像樣本,將經過結合變換處理的第一模板影像作為模板影像樣本,其中,處理方式包括以下至少之一:隨機裁剪,影像翻轉,影像拼接。In some embodiments of the present invention, the step of the input module 120 obtaining a training sample set includes: obtaining a first defect image and a first template image corresponding to the first defect image; performing geometric transformation processing on the first defect image and the first template image using the same processing method, and using the first defect image after the geometric transformation processing as a defect image sample, and using the first template image after the combined transformation processing as a template image sample, wherein the processing method includes at least one of the following: random cropping, image flipping, and image stitching.
在本發明的一些實施例中,類別訊息包括缺陷的缺陷類別編號,位置訊息包括缺陷對應的缺陷框的位置訊息。In some embodiments of the present invention, the category information includes the defect category number of the defect, and the location information includes the location information of the defect box corresponding to the defect.
需要說明的是,上述缺陷檢測模型的訓練裝置中的各個模組可以是程式模組(例如是實現某種特定功能的程式指令集合),也可以是硬體模組,對於後者,其可以表現為以下形式,但不限於此:上述各個模組的表現形式均為一個處理器,或者,上述各個模組的功能通過一個處理器實現。It should be noted that each module in the above-mentioned defect detection model training device can be a program module (for example, a set of program instructions to implement a certain specific function) or a hardware module. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
本發明實施例還提供了一種非易失性儲存媒體。非易失性儲存媒體中儲存有程式,其中,在程式運行時控制非易失性儲存媒體所在設備執行如下缺陷檢測模型的訓練方法:獲取訓練樣本集,以及與訓練樣本集中的每一組樣本對應的第一缺陷標籤訊息,其中,訓練樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第一缺陷標籤訊息包括缺陷影像中各處缺陷的第一類別訊息和第一位置訊息;確定目標損失函數,其中,目標損失函數包括缺陷類別損失函數和缺陷位置損失函數;採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型,其中,目標缺陷檢測模型設置為確定待檢測缺陷影像中的缺陷位置訊息和缺陷類別訊息,待訓練模型設置為提取缺陷影像的第一影像特徵和模板影像的第二影像特徵,並依據第一影像特徵和第二影像特徵輸出缺陷影像的第二標籤訊息,第二標籤訊息中包括待訓練模型確定的缺陷影像中各處缺陷的第二類別訊息和第二位置訊息。The embodiment of the present invention also provides a non-volatile storage medium. The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the following defect detection model training method: obtain a training sample set and a first defect label message corresponding to each group of samples in the training sample set, wherein each group of samples in the training sample set includes a defect image and a template image corresponding to the defect image, and the first defect label message includes a first category message and a first position message of defects at various locations in the defect image; determine a target loss function, wherein the target loss function includes a defect category loss function and a defect position loss function ; The random gradient descent method is adopted to train the model to be trained through the training sample set, defect label information and target loss function to obtain the target defect detection model, wherein the target defect detection model is set to determine the defect position information and defect category information in the defect image to be detected, and the model to be trained is set to extract the first image feature of the defect image and the second image feature of the template image, and output the second label information of the defect image according to the first image feature and the second image feature, and the second label information includes the second category information and the second position information of the defects in each defect image determined by the model to be trained.
在本發明的一些實施例中,在程式運行時還可以控制非易失性儲存媒體所在設備執行如下缺陷影像分類方法:確定待檢測缺陷影像,以及與待檢測缺陷影像對應的模板影像;將待檢測缺陷影像和模板影像輸入到目標缺陷檢測模型中,獲取目標缺陷檢測模型輸出的缺陷位置訊息和缺陷類別訊息,其中,目標缺陷檢測模型設置為提取待檢測缺陷影像的第三影像特徵和模板影像的第四影像特徵,並依據三影像特徵和第四影像特徵輸出缺陷位置訊息和缺陷類別訊息;依據缺陷位置訊息確定待檢測缺陷影像中距離待檢測缺陷影像的中心點最近的預設數量個目標缺陷;確定預設數量個目標缺陷中的每個目標缺陷的類別置信度,並確定類別置信度最大的目標缺陷的缺陷類別為待檢測缺陷影像的缺陷類別。In some embodiments of the present invention, when the program is running, the device where the non-volatile storage medium is located can also be controlled to execute the following defect image classification method: determine the defect image to be detected and the template image corresponding to the defect image to be detected; input the defect image to be detected and the template image into the target defect detection model to obtain the defect location information and defect category information output by the target defect detection model, wherein the target defect detection model is set to extract the defect image to be detected. The third image feature and the fourth image feature of the template image are used, and defect location information and defect category information are output based on the third image feature and the fourth image feature; a preset number of target defects in the defect image to be detected that are closest to the center point of the defect image to be detected are determined based on the defect location information; a category confidence of each target defect in the preset number of target defects is determined, and the defect category of the target defect with the largest category confidence is determined as the defect category of the defect image to be detected.
本發明實施例還提供了一種電子設備,電子設備包括記憶體和處理器,處理器設置為運行儲存在記憶體中的程式,其中,程式運行時執行如下缺陷檢測模型的訓練方法:獲取訓練樣本集,以及與訓練樣本集中的每一組樣本對應的第一缺陷標籤訊息,其中,訓練樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第一缺陷標籤訊息包括缺陷影像中各處缺陷的第一類別訊息和第一位置訊息;確定目標損失函數,其中,目標損失函數包括缺陷類別損失函數和缺陷位置損失函數;採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型,其中,目標缺陷檢測模型設置為確定待檢測缺陷影像中的缺陷位置訊息和缺陷類別訊息,待訓練模型設置為提取缺陷影像的第一影像特徵和模板影像的第二影像特徵,並依據第一影像特徵和第二影像特徵輸出缺陷影像的第二標籤訊息,第二標籤訊息中包括待訓練模型確定的缺陷影像中各處缺陷的第二類別訊息和第二位置訊息。The embodiment of the present invention also provides an electronic device, which includes a memory and a processor, wherein the processor is configured to run a program stored in the memory, wherein the program executes the following defect detection model training method when it is run: obtaining a training sample set and a first defect label message corresponding to each group of samples in the training sample set, wherein each group of samples in the training sample set includes a defect image and a template image corresponding to the defect image, and the first defect label message includes a first category message and a first position message of defects at various locations in the defect image; determining a target loss function, wherein the target loss function includes a defect category loss function. The method adopts a random gradient descent method to train the model to be trained through the training sample set, the defect label information and the target loss function to obtain the target defect detection model, wherein the target defect detection model is set to determine the defect position information and the defect category information in the defect image to be detected, and the model to be trained is set to extract the first image feature of the defect image and the second image feature of the template image, and output the second label information of the defect image according to the first image feature and the second image feature, and the second label information includes the second category information and the second position information of the defects in each defect image determined by the model to be trained.
在本發明的一些實施例中,在程式運行時還可以執行如下缺陷影像分類方法:確定待檢測缺陷影像,以及與待檢測缺陷影像對應的模板影像;將待檢測缺陷影像和模板影像輸入到目標缺陷檢測模型中,獲取目標缺陷檢測模型輸出的缺陷位置訊息和缺陷類別訊息,其中,目標缺陷檢測模型設置為提取待檢測缺陷影像的第三影像特徵和模板影像的第四影像特徵,並依據三影像特徵和第四影像特徵輸出缺陷位置訊息和缺陷類別訊息;依據缺陷位置訊息確定待檢測缺陷影像中距離待檢測缺陷影像的中心點最近的預設數量個目標缺陷;確定預設數量個目標缺陷中的每個目標缺陷的類別置信度,並確定類別置信度最大的目標缺陷的缺陷類別為待檢測缺陷影像的缺陷類別。In some embodiments of the present invention, the following defect image classification method can also be executed when the program is running: determine a defect image to be detected and a template image corresponding to the defect image to be detected; input the defect image to be detected and the template image into a target defect detection model to obtain defect location information and defect category information output by the target defect detection model, wherein the target defect detection model is configured to extract a third image feature of the defect image to be detected and a fourth image feature of the template image, and output defect location information and defect category information based on the three image features and the fourth image feature; determine a preset number of target defects in the defect image to be detected that are closest to the center point of the defect image to be detected based on the defect location information; determine the category confidence of each target defect in the preset number of target defects, and determine the defect category of the target defect with the largest category confidence as the defect category of the defect image to be detected.
在本發明的上述實施例中,對各個實施例的描述都各有側重,某個實施例中沒有詳述的部分,可以參見其他實施例的相關描述。In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
在本發明所提供的幾個實施例中,應該理解到,所揭露的技術內容,可通過其它的方式實現。其中,以上所描述的裝置實施例僅僅是示意性的,例如所述單元的劃分,可以為一種邏輯功能劃分,實際實現時可以有另外的劃分方式,例如多個單元或組件可以結合或者可以整合到另一個系統,或一些特徵可以忽略,或不執行。另一點,所顯示或討論的相互之間的耦合或直接耦合或通訊連接可以是通過一些埠,單元或模組的間接耦合或通訊連接,可以是電性或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There can be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some ports, units or modules, which can be electrical 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, i.e., they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
另外,在本發明各個實施例中的各功能單元可以整合成在一個處理單元中,也可以是各個單元單獨物理存在,也可以兩個或兩個以上單元整合在一個單元中。上述整合的單元既可以採用硬體的形式實現,也可以採用軟體功能單元的形式實現。In addition, each functional unit in each embodiment of the present invention can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional unit.
所述整合的單元如果以軟體功能單元的形式實現並作為獨立的產品銷售或使用時,可以儲存在一個電腦可讀取儲存媒體中。基於這樣的理解,本發明的技術方案本質上或者說對相關技術做出貢獻的部分或者該技術方案的全部或部分可以以軟體產品的形式體現出來,該電腦軟體產品儲存在一個儲存媒體中,包括若干指令用以使得一台電腦設備(可為個人電腦、服務器或者網路設備等)執行本發明各個實施例所述方法的全部或部分步驟。而前述的儲存媒體包括:隨身碟、唯讀記憶體(ROM,Read-Only Memory)、隨機存取記憶體(RAM,Random Access Memory)、移動硬碟、磁碟或者光碟等各種可以儲存程式代碼的媒體。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage media include: flash drives, read-only memory (ROM), random access memory (RAM), removable hard drives, magnetic disks or optical disks, and other media that can store program code.
以上所述僅是本發明的較佳實施方式,應當指出,對於本技術領域的普通技術人員來說,在不脫離本發明原理的前提下,還可以做出若干改進和潤飾,這些改進和潤飾也應視為本發明的保護範圍。 [工業實用性] The above is only the best implementation of the present invention. It should be pointed out that ordinary technicians in this technical field can make some improvements and modifications without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention. [Industrial Applicability]
本發明實施例提供的缺陷檢測模型的訓練方法、裝置及電子設備,應用於影像識別領域。在本發明實施例中,通過獲取訓練樣本集,以及與訓練樣本集中的每一組樣本對應的第一缺陷標籤訊息,其中,訓練樣本集中的每一組樣本包括缺陷影像,以及與缺陷影像對應的模板影像,第一缺陷標籤訊息包括缺陷影像中各處缺陷的第一類別訊息和第一位置訊息;確定目標損失函數,其中,目標損失函數包括缺陷類別損失函數和缺陷位置損失函數;採用隨機梯度下降法,通過訓練樣本集,缺陷標籤訊息和目標損失函數對待訓練模型進行訓練,得到目標缺陷檢測模型,其中,目標缺陷檢測模型用於確定待檢測缺陷影像中的缺陷位置訊息和缺陷類別訊息,待訓練模型用於提取缺陷影像的第一影像特徵和模板影像的第二影像特徵,並依據第一影像特徵和第二影像特徵輸出缺陷影像的第二標籤訊息,第二標籤訊息中包括待訓練模型確定的缺陷影像中各處缺陷的第二類別訊息和第二位置訊息的方式,通過採用包含缺陷影像和模板影像的訓練樣本集以及缺陷標籤訊息訓練缺陷檢測模型,達到了獲得在缺陷識別過程中可利用模板影像的缺陷檢測模型的目的,從而實現了在對晶粒影像進行缺陷識別和分類的過程中可以利用模板影像來輔助分類識別的技術效果,進而解決了由於相關技術中在對晶粒影像進行缺陷識別和分類時沒有利用模板影像造成的識別和分類結果不佳技術問題。The defect detection model training method, device and electronic equipment provided by the embodiments of the present invention are applied in the field of image recognition. In the embodiment of the present invention, a training sample set and a first defect label information corresponding to each group of samples in the training sample set are obtained, wherein each group of samples in the training sample set includes a defect image and a template image corresponding to the defect image, and the first defect label information includes a first category information and a first position information of defects at various locations in the defect image; a target loss function is determined, wherein the target loss function includes a defect category loss function and a defect position loss function; a target defect detection model is obtained by training a model to be trained using the training sample set, the defect label information and the target loss function, wherein the target defect detection model is used to determine the defect location information and the defect category information in the defect image to be detected, and the model to be trained is used to extract the defect image. The method comprises the following steps: a first image feature and a second image feature of a template image, and outputting a second label information of the defect image based on the first image feature and the second image feature, wherein the second label information includes second category information and second position information of defects at various locations in the defect image to be determined by the training model. By adopting a training sample set including defect images and template images and defect label information to train a defect detection model, the purpose of obtaining a defect detection model that can utilize the template image in the defect recognition process is achieved, thereby achieving the technical effect of utilizing the template image to assist in classification recognition in the process of defect recognition and classification of grain images, thereby solving the technical problem of poor recognition and classification results caused by not utilizing the template image in the related technology when performing defect recognition and classification on grain images.
10:電腦終端 102:處理器 104:記憶體 106:傳輸模組 120:輸入模組 122:第一處理模組 124:第二處理模組 S202~S206、S402、S404、S502~S508、S602、S604、S902~S906、S1002~S1008:步驟 10: Computer terminal 102: Processor 104: Memory 106: Transmission module 120: Input module 122: First processing module 124: Second processing module S202~S206, S402, S404, S502~S508, S602, S604, S902~S906, S1002~S1008: Steps
此處所說明的圖式用來提供對本發明的進一步理解,構成本發明的一部分,本發明的示意性實施例及其說明用於解釋本發明,並不構成對本發明的不當限定。在圖式中: 圖1是根據本發明實施例的一種電腦終端的結構示意圖; 圖2是根據本發明實施例的一種缺陷檢測模型的訓練方法的流程示意圖; 圖3a是根據本發明實施例的一種黃金晶粒影像的示意圖; 圖3b是根據本發明實施例的一種缺陷影像和模板影像的示意圖; 圖4是根據本發明實施例的一種訓練樣本集獲取方法的流程示意圖; 圖5是根據本發明實施例的一種基於訓練樣本集和缺陷標籤訊息訓練缺陷檢測模型的訓練方法的流程示意圖; 圖6是根據本發明實施例的一種獲取第二標籤訊息的方法流程示意圖; 圖7是根據本發明實施例的一種缺陷檢測模型的模型結構示意圖; 圖8是根據本發明實施例的另一種缺陷檢測模型的模型結構示意圖; 圖9是根據本發明實施例的一種缺陷檢測模型的篩選方法的流程示意圖; 圖10是根據本發明實施例的一種缺陷影像分類方法的流程示意圖; 圖11是根據本發明實施例的一種模型訓練及分類流程的流程示意圖; 圖12是根據本發明實施例的一種缺陷模型的訓練裝置的結構示意圖。 The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation on the present invention. In the diagram: Figure 1 is a schematic diagram of the structure of a computer terminal according to an embodiment of the present invention; Figure 2 is a schematic diagram of the process of a training method for a defect detection model according to an embodiment of the present invention; Figure 3a is a schematic diagram of a gold grain image according to an embodiment of the present invention; Figure 3b is a schematic diagram of a defect image and a template image according to an embodiment of the present invention; Figure 4 is a schematic diagram of the process of a method for obtaining a training sample set according to an embodiment of the present invention; Figure 5 is a schematic diagram of the process of a training method for training a defect detection model based on a training sample set and defect label information according to an embodiment of the present invention; Figure 6 is a schematic diagram of the process of a method for obtaining a second label information according to an embodiment of the present invention; Figure 7 is a schematic diagram of the model structure of a defect detection model according to an embodiment of the present invention; Figure 8 is a schematic diagram of the model structure of another defect detection model according to an embodiment of the present invention; Figure 9 is a schematic diagram of the process of a screening method of a defect detection model according to an embodiment of the present invention; Figure 10 is a schematic diagram of the process of a defect image classification method according to an embodiment of the present invention; Figure 11 is a schematic diagram of the process of a model training and classification process according to an embodiment of the present invention; Figure 12 is a schematic diagram of the structure of a training device for a defect model according to an embodiment of the present invention.
S202~S206:步驟 S202~S206: Steps
Claims (13)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2023101848445 | 2023-02-17 | ||
CN202310184844.5A CN116188432A (en) | 2023-02-17 | 2023-02-17 | Training method and device of defect detection model and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
TW202449740A true TW202449740A (en) | 2024-12-16 |
Family
ID=86447369
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW113105473A TW202449740A (en) | 2023-02-17 | 2024-02-16 | Defect detection model training method, defect image classification method, device and electronic equipment |
Country Status (3)
Country | Link |
---|---|
CN (1) | CN116188432A (en) |
TW (1) | TW202449740A (en) |
WO (1) | WO2024169750A1 (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116188432A (en) * | 2023-02-17 | 2023-05-30 | 杭州长川科技股份有限公司 | Training method and device of defect detection model and electronic equipment |
CN116542980B (en) * | 2023-07-06 | 2023-11-03 | 宁德时代新能源科技股份有限公司 | Defect detection method, defect detection apparatus, defect detection program, storage medium, and defect detection program |
CN116824271B (en) * | 2023-08-02 | 2024-02-09 | 上海互觉科技有限公司 | SMT chip defect detection system and method based on tri-modal vector space alignment |
CN117830210A (en) * | 2023-11-10 | 2024-04-05 | 腾讯科技(深圳)有限公司 | Defect detection method, device, electronic equipment and storage medium |
CN119198565B (en) * | 2024-11-29 | 2025-02-25 | 南京冠石科技股份有限公司 | Polarizer appearance defect detection method and device |
CN119477902B (en) * | 2025-01-14 | 2025-04-22 | 湖南元智电集控科技有限公司 | A two-stage visual defect detection method for substation equipment based on open set classification |
CN119785054A (en) * | 2025-03-10 | 2025-04-08 | 南京大学 | Defect detection method, system and storage medium based on mixed expert model |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109859207B (en) * | 2019-03-06 | 2023-06-23 | 华南理工大学 | A defect detection method for high-density flexible substrates |
CN109934814B (en) * | 2019-03-15 | 2022-02-01 | 英业达科技有限公司 | Surface defect detection system and method thereof |
CN110349145B (en) * | 2019-07-09 | 2022-08-16 | 京东方科技集团股份有限公司 | Defect detection method, defect detection device, electronic equipment and storage medium |
CN113344857B (en) * | 2021-05-13 | 2022-05-03 | 深圳市华汉伟业科技有限公司 | Defect detection network training method, defect detection method and storage medium |
CN115393251A (en) * | 2021-05-25 | 2022-11-25 | 武汉Tcl集团工业研究院有限公司 | Defect detection method and device for printed circuit board, storage medium and electronic equipment |
CN116188432A (en) * | 2023-02-17 | 2023-05-30 | 杭州长川科技股份有限公司 | Training method and device of defect detection model and electronic equipment |
-
2023
- 2023-02-17 CN CN202310184844.5A patent/CN116188432A/en active Pending
-
2024
- 2024-02-05 WO PCT/CN2024/076135 patent/WO2024169750A1/en unknown
- 2024-02-16 TW TW113105473A patent/TW202449740A/en unknown
Also Published As
Publication number | Publication date |
---|---|
WO2024169750A1 (en) | 2024-08-22 |
CN116188432A (en) | 2023-05-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TW202449740A (en) | Defect detection model training method, defect image classification method, device and electronic equipment | |
CN109683360B (en) | Liquid crystal panel defect detection method and device | |
CN108562589B (en) | Method for detecting surface defects of magnetic circuit material | |
CN106875381B (en) | Mobile phone shell defect detection method based on deep learning | |
US20190197356A1 (en) | Data generation apparatus, data generation method, and data generation program | |
CN109308489B (en) | Method for detecting welding quality of element arc welding | |
CN109671058B (en) | Defect detection method and system for large-resolution image | |
CN113222913B (en) | Circuit board defect detection positioning method, device and storage medium | |
KR20190063839A (en) | Method and System for Machine Vision based Quality Inspection using Deep Learning in Manufacturing Process | |
JP2014178229A (en) | Teacher data creation method, image classification method and image classification device | |
CN112304952B (en) | Image recognition device, image recognition method and computer program product thereof | |
TW202113345A (en) | Image recognition apparatus, image recognition method, and computer program product thereof | |
US12094098B2 (en) | Defect management apparatus, method and non-transitory computer readable medium | |
CN115690670A (en) | Intelligent identification method and system for wafer defects | |
CN117355038B (en) | X-shaped hole processing method and system for circuit board soft board | |
CN117011216A (en) | Defect detection method and device, electronic equipment and storage medium | |
JP2009068946A (en) | Flaw sorting apparatus, flaw sorting method and program | |
CN117372339A (en) | PCB defect detection and identification method based on YOLO-SEE | |
CN114255212A (en) | A CNN-based FPC surface defect detection method and system | |
CN111598084B (en) | Defect segmentation network training method, device, equipment and readable storage medium | |
CN117635599A (en) | Defect detection model training and defect detection method, device, equipment and medium | |
CN116433651A (en) | A small sample panel defect detection method, system, equipment and storage medium | |
CN110751225A (en) | Image classification method, device and storage medium | |
CN119229106A (en) | A method and system for semantic segmentation of appearance defects of industrial products | |
CN118351059A (en) | Circuit board detection method, device, computer equipment and storage medium |