TWI791970B - Defect detection method and defect detection device - Google Patents

Defect detection method and defect detection device Download PDF

Info

Publication number
TWI791970B
TWI791970B TW109111696A TW109111696A TWI791970B TW I791970 B TWI791970 B TW I791970B TW 109111696 A TW109111696 A TW 109111696A TW 109111696 A TW109111696 A TW 109111696A TW I791970 B TWI791970 B TW I791970B
Authority
TW
Taiwan
Prior art keywords
image
reconstruction
model
defect
reconstructed
Prior art date
Application number
TW109111696A
Other languages
Chinese (zh)
Other versions
TW202139132A (en
Inventor
莊承翰
Original Assignee
台達電子工業股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 台達電子工業股份有限公司 filed Critical 台達電子工業股份有限公司
Priority to TW109111696A priority Critical patent/TWI791970B/en
Publication of TW202139132A publication Critical patent/TW202139132A/en
Application granted granted Critical
Publication of TWI791970B publication Critical patent/TWI791970B/en

Links

Images

Abstract

A defect detection method includes: inputting an to-be tested image to a reconstruction model; outputting the an initial reconstruction map by the reconstruction model; inputting the initial reconstruction map to the reconstruction model; outputting a complete reconstruction map by the reconstruction model; comparing each of the plurality of pixels corresponding to the complete reconstruction map and the to-be tested image to generate a plurality of deviation values; generating an deviation image based on the deviation values; inputting the deviation image to a regression model, and outputting a defect position by the regression model.

Description

瑕疵檢測方法及瑕疵檢測裝置Defect detection method and defect detection device

本發明是關於一種檢測方法及檢測裝置,特別是關於一種應用於瑕疵檢測方法及瑕疵檢測裝置。The present invention relates to a detection method and a detection device, in particular to a defect detection method and a defect detection device.

一般而言,在進行瑕疵檢測時,現行的瑕疵檢測主要分成兩大類:傳統影像處理方式及機於深度學習的辨識系統。Generally speaking, when performing defect detection, the current defect detection is mainly divided into two categories: traditional image processing methods and recognition systems based on deep learning.

透過傳統影像處理方式進行瑕疵檢測時,若需要更換產線,則需要機台人員不斷進行參數的調整,調參過程需要大量的時間和有經驗的人員。When using traditional image processing methods to detect defects, if the production line needs to be replaced, the machine personnel need to continuously adjust the parameters. The parameter adjustment process requires a lot of time and experienced personnel.

深度學習的辨識系統進行瑕疵檢測的方法,是藉由資料學習最佳參數,不需有經驗人員進行機台的調整參數的行為,且通常準確率明顯高於傳統影像處理的方式,但在更換產線時,需要新的標註資料重新進行學習,且不同的瑕疵都需要含有一定數量,這會造成特定的瑕疵識別率較其他的差,通常識別率較差的瑕疵種類都是資料數量較低的瑕疵種類,但在生產過程中所有瑕疵出現的機率是不一致的,部分情況下可能出現機率小的瑕疵更為重要。The method of deep learning identification system for defect detection is to learn the best parameters from data, and does not require experienced personnel to adjust the parameters of the machine, and the accuracy is usually significantly higher than the traditional image processing method, but in the replacement During the production line, new labeling data is required for re-learning, and different defects need to contain a certain amount, which will cause the recognition rate of specific defects to be lower than others. Usually, the types of defects with poor recognition rates are defects with low data quantity types, but the probability of occurrence of all defects in the production process is inconsistent, and in some cases, defects with a small probability of occurrence may be more important.

然而,在上述的瑕疵檢測方法中,誤差大小的閾值(threshold)需要人工調整,如果輸入影像的瑕疵太大,還原出來的完整影像(golden image)效果不好,導致誤差大小的閥值更難調整。因此,如何自動化的選出瑕疵特徵及自動化的調整誤差的閾值,已成為本領域需解決的問題之一。However, in the above-mentioned flaw detection method, the error threshold (threshold) needs to be manually adjusted. If the flaws in the input image are too large, the effect of the restored complete image (golden image) will not be good, making the error threshold more difficult. Adjustment. Therefore, how to automatically select defect features and automatically adjust error thresholds has become one of the problems to be solved in this field.

為了解決上述的問題,本揭露內容之一態樣提供了一種瑕疵檢測方法。瑕疵檢測方法包括:輸入一待測影像至一重建模型,重建模型輸出一初始重建圖;輸入初始重建圖至重建模型,重建模型輸出一完整重建圖;比對完整重建圖與待測影像中對應的每個複數個像素,以產生複數個誤差值;依據此些誤差值產生一誤差影像;以及輸入誤差影像至一回歸模型,回歸模型輸出一瑕疵位置。In order to solve the above problems, an aspect of the present disclosure provides a defect detection method. The defect detection method includes: inputting an image to be tested into a reconstruction model, and the reconstruction model outputs an initial reconstruction image; inputting the initial reconstruction image into the reconstruction model, and the reconstruction model outputs a complete reconstruction image; comparing the complete reconstruction image with the image corresponding to the image to be tested Generate a plurality of error values for each of the plurality of pixels; generate an error image according to the error values; and input the error image to a regression model, and the regression model outputs a defect position.

本發明之又一態樣係於提供一種瑕疵檢測裝置,瑕疵檢測裝置包括一處理器。處理器用以將一待測影像輸入至一重建模型,重建模型輸出一初始重建圖,將初始重建圖輸入重建模型,該重建模型輸出一完整重建圖,比對完整重建圖與待測影像中對應的每個複數個像素,以產生複數個誤差值;依據此些誤差值產生一誤差影像;以及輸入誤差影像至一回歸模型,回歸模型輸出一瑕疵位置。Another aspect of the present invention is to provide a defect detection device, which includes a processor. The processor is used to input an image to be tested into a reconstruction model, the reconstruction model outputs an initial reconstruction image, the initial reconstruction image is input into the reconstruction model, the reconstruction model outputs a complete reconstruction image, and the complete reconstruction image is compared with the corresponding image in the test image Generate a plurality of error values for each of the plurality of pixels; generate an error image according to the error values; and input the error image to a regression model, and the regression model outputs a defect position.

綜上,本案的瑕疵檢測方法及瑕疵檢測裝置可以應用完整重建圖與待測影像的誤差值產生誤差影像,並將誤差影像輸入到回歸模型,以學出最佳的參數,藉此訓練出精準的瑕疵檢測裝置,因此瑕疵檢測方法及瑕疵檢測裝置可判別新輸入影像的瑕疵位置,節省產線換產品時人工調整閥值的人力。To sum up, the flaw detection method and flaw detection device in this case can use the error value of the complete reconstruction map and the image to be tested to generate an error image, and input the error image into the regression model to learn the best parameters, so as to train an accurate Therefore, the defect detection method and the defect detection device can determine the defect position of the newly input image, saving the manpower of manually adjusting the threshold when the production line changes products.

以下說明係為完成發明的較佳實現方式,其目的在於描述本發明的基本精神,但並不用以限定本發明。實際的發明內容必須參考之後的權利要求範圍。The following description is a preferred implementation of the invention, and its purpose is to describe the basic spirit of the invention, but not to limit the invention. For the actual content of the invention, reference must be made to the scope of the claims that follow.

必須了解的是,使用於本說明書中的“包含”、“包括”等詞,係用以表示存在特定的技術特徵、數值、方法步驟、作業處理、元件以及/或組件,但並不排除可加上更多的技術特徵、數值、方法步驟、作業處理、元件、組件,或以上的任意組合。It must be understood that words such as "comprising" and "including" used in this specification are used to indicate the existence of specific technical features, values, method steps, operations, components and/or components, but do not exclude possible Add more technical characteristics, values, method steps, operation processes, components, components, or any combination of the above.

於權利要求中使用如“第一”、“第二”、“第三”等詞係用來修飾權利要求中的元件,並非用來表示之間具有優先權順序,先行關係,或者是一個元件先於另一個元件,或者是執行方法步驟時的時間先後順序,僅用來區別具有相同名字的元件。Words such as "first", "second", and "third" used in the claims are used to modify the elements in the claims, and are not used to indicate that there is an order of priority, an antecedent relationship, or an element An element preceding another element, or a chronological order in performing method steps, is only used to distinguish elements with the same name.

請參照第1~2圖,第1圖係依照本發明一實施例繪示瑕疵檢測方法100之流程圖。第2圖係依照本發明一實施例繪示瑕疵檢測方法之示意圖。Please refer to FIGS. 1-2. FIG. 1 is a flow chart of a defect detection method 100 according to an embodiment of the present invention. FIG. 2 is a schematic diagram illustrating a defect detection method according to an embodiment of the present invention.

於一實施例中,瑕疵檢測方法100可以由瑕疵檢測裝置執行,瑕疵檢測裝置包含處理器及儲存裝置。In an embodiment, the defect detection method 100 may be executed by a defect detection device, and the defect detection device includes a processor and a storage device.

於一實施例中,處理器可用於執行瑕疵檢測方法100。處理器可以被實施為例如為微控制單元(microcontroller)、微處理器(microprocessor)、數位訊號處理器(digital signal processor)、特殊應用積體電路(application specific integrated circuit,ASIC)或一邏輯電路。In one embodiment, the processor can be used to execute the defect detection method 100 . The processor can be implemented as, for example, a microcontroller, a microprocessor, a digital signal processor, an application specific integrated circuit (ASIC), or a logic circuit.

於一實施例中,儲存裝置用於儲存各種影像,儲存裝置可以是唯讀記憶體、快閃記憶體、軟碟、硬碟、光碟、隨身碟、磁帶、可由網路存取之資料庫或熟悉此技藝者可輕易思及具有相同功能之儲存媒體。In one embodiment, the storage device is used to store various images, and the storage device may be a read-only memory, flash memory, floppy disk, hard disk, optical disk, flash drive, magnetic tape, a database that can be accessed by the network, or Those skilled in the art can easily think of storage media with the same function.

於步驟110中,處理器輸入一待測影像IMG0至一重建模型MD,重建模型MD輸出一初始重建圖IMG1。In step 110, the processor inputs an image to be tested IMG0 to a reconstruction model MD, and the reconstruction model MD outputs an initial reconstruction image IMG1.

於一實施例中,請參閱第3、4A~4C圖,第3圖係依照本發明一實施例繪示待測影像IMG0之示意圖。第4A~4C圖係依照本發明一實施例繪示重建圖之示意圖。In an embodiment, please refer to FIGS. 3 and 4A-4C. FIG. 3 is a schematic diagram illustrating the image to be measured IMG0 according to an embodiment of the present invention. Figures 4A-4C are schematic diagrams illustrating reconstructed images according to an embodiment of the present invention.

於一實施例中,待測影像IMG0如第3圖所示,待測影像IMG0是由一合成模型所產生。合成模型可以應用已知的類神經網路實現。更具體而言,處理器先取得一完整影像IMG5(golden image),將一已知瑕疵IMG6與完整圖像合成,合成方式可以使用如mixup演算法或是生成對抗網路(Generative Adversarial Nets,GAN)等方式,以產生待測影像IMG0。於一實施例中,處理器可以從一瑕疵資料庫讀取出已知瑕疵IMG6 (包含瑕疵的位置、形狀、大小)的原始瑕疵影像,將此已知瑕疵IMG6進行遮罩,以取得瑕疵遮罩影像IMG4,將原始的已知瑕疵IMG6、瑕疵遮罩影像(已知瑕疵範圍)IMG4及完整影像IMG5輸入合成模型CM後,產生合成的瑕疵影像,此合成的瑕疵影像可作為待測影像IMG0。於一實施例中,合成模型CM可以應用已知的軟體影像處理軟體或是影像處理電路實現。In one embodiment, the image to be tested IMG0 is shown in FIG. 3 , and the image to be tested IMG0 is generated by a synthetic model. Synthetic models can be implemented using known neural network-like implementations. More specifically, the processor first obtains a complete image IMG5 (golden image), and synthesizes a known defect IMG6 with the complete image. The synthesis method can use a mixup algorithm or a Generative Adversarial Nets (GAN) ) etc. to generate the image to be tested IMG0. In one embodiment, the processor can read the original defect image of the known defect IMG6 (including the position, shape and size of the defect) from a defect database, and mask the known defect IMG6 to obtain the defect mask Mask image IMG4, after inputting the original known defect IMG6, defect mask image (known defect range) IMG4 and complete image IMG5 into the synthesis model CM, a synthetic defect image is generated, and this synthetic defect image can be used as the image to be tested IMG0 . In one embodiment, the composite model CM can be realized by using known software image processing software or image processing circuit.

此外,瑕疵遮罩影像IMG4是指一遮罩(mask),不限以影像(image)的方式呈現。In addition, the blemish mask image IMG4 refers to a mask, and is not limited to be presented as an image.

於一實施例中,重建模型MD是以一自編碼(AutoEncoder)演算法或一變分自編碼器(Variaional autoencoder,VAE)以實現之。然而,本發明不限於此,只要是能夠是對攝影機所擷取的一部分或全部影像,推導計算出真實場景、完整二維影像及/或物體的三維立體空間資訊,並進行重建之電腦視覺技術都可以採取應用之。In one embodiment, the reconstruction model MD is realized by an autoencoder (AutoEncoder) algorithm or a variational autoencoder (Variaional autoencoder, VAE). However, the present invention is not limited thereto, as long as it is a computer vision technology that can deduce and calculate real scenes, complete two-dimensional images and/or three-dimensional spatial information of objects from part or all of the images captured by the camera, and reconstruct them can be applied.

於一實施例中,回歸模型RM是以一線性回歸(linear regression)演算法或一脊回歸(ridge regression)演算法以實現之。然而,本發明不限於此。In one embodiment, the regression model RM is implemented by a linear regression algorithm or a ridge regression algorithm. However, the present invention is not limited thereto.

於步驟120中,處理器輸入初始重建圖IMG1至重建模型MD,重建模型MD輸出一完整重建圖IMG1c。In step 120, the processor inputs the initial reconstructed graph IMG1 to the reconstructed model MD, and the reconstructed model MD outputs a complete reconstructed graph IMG1c.

於一實施例中,處理器在輸入初始重建圖IMG1至重建模型MD後,執行一循環重建(recursive reconstruct)演算法,以取得完整重建圖。更具體而言,如第4A~4C圖所示,初始重建圖IMG1被產生後,處理器將初始重建圖IMG1再次送入重建模型MD,重建模型MD依據此初始重建圖IMG1產生中間重建圖IMG1a;接著,重複進行重建模型MD輸出一當前中間重建圖(例如中間重建圖IMG1b),再將此當前中間重建圖輸入至重建模型MD的操作(即框選部分210的流程),直到滿足一停止條件時,將最後一張之當前中間重建圖視為完整重建圖IMG1c。 In one embodiment, the processor executes a recursive reconstruct algorithm after inputting the initial reconstructed image IMG1 to the reconstructed model MD to obtain a complete reconstructed image. More specifically, as shown in Figures 4A-4C, after the initial reconstruction image IMG1 is generated, the processor sends the initial reconstruction image IMG1 to the reconstruction model MD again, and the reconstruction model MD generates an intermediate reconstruction image IMG1a based on the initial reconstruction image IMG1 ; Then, repeat the reconstruction model MD to output a current intermediate reconstruction map (for example, the intermediate reconstruction map IMG1b), and then input this current intermediate reconstruction map to the operation of the reconstruction model MD (that is, the process of the frame selection part 210), until a stop is satisfied Conditions, the current intermediate reconstruction image of the last one is regarded as the complete reconstruction image IMG1c.

以第4A~4C圖為例,處理器將初始重建圖IMG1再次送入重建模型MD後,重建模型MD產生中間重建圖IMG1a,接著,處理器將中間重建圖IMG1a送入重建模型MD,重建模型MD產生中間重建圖IMG1b,接著,處理器再將中間重建圖IMG1b送入重建模型MD,重建模型MD產生完整重建圖IMG1c。其中,停止條件可以是指重複進行迭代中間重建圖的一預設次數。藉此,利用重複進行迭代中間重建圖的方式,可幫助重建模型MD找出還原目標(例如瑕疵部分)。 Taking Figures 4A~4C as an example, after the processor sends the initial reconstruction image IMG1 to the reconstruction model MD again, the reconstruction model MD generates an intermediate reconstruction image IMG1a, and then, the processor sends the intermediate reconstruction image IMG1a to the reconstruction model MD, and the reconstruction model The MD generates an intermediate reconstruction image IMG1b, and then, the processor sends the intermediate reconstruction image IMG1b to the reconstruction model MD, and the reconstruction model MD generates a complete reconstruction image IMG1c. Wherein, the stop condition may refer to a preset number of times for iterating the intermediate reconstruction image repeatedly. In this way, the reconstruction model MD can be helped to find the restoration target (such as the defective part) by repeatedly iterating the intermediate reconstruction image.

此外,利用循環重建機制(即框選部分210的流程),重建影像(即多次產生的中間重構圖)再次輸入到重建模型MD中進行多次還原的動作,可以增強消除大瑕疵的能力。 In addition, by using the cyclic reconstruction mechanism (ie, the process of the frame selection part 210), the reconstructed image (ie, the intermediate reconstruction map generated multiple times) is re-input into the reconstruction model MD for multiple restorations, which can enhance the ability to eliminate large defects.

於步驟130,處理器比對完整重建圖IMG1c與待測影像IMG0中對應的每個複數個像素,以產生複數個誤差值,依據此些誤差值產生一誤差影像IMG2。 In step 130, the processor compares each plurality of pixels corresponding to the complete reconstruction image IMG1c and the image under test IMG0 to generate a plurality of error values, and generates an error image IMG2 according to these error values.

於一實施例中,請參閱第5圖,第5圖係依照本發明一實施例繪示誤差影像IMG2之示意圖。例如,處理器比對完整重建圖IMG1c與待測影像IMG0中對應的每個複數個像素,將完整重建圖IMG1c與待測影像IMG0中每個對應像素的灰階值相減,以取得多個誤差值,透過這些誤差值產生誤差影像IMG2。 In an embodiment, please refer to FIG. 5 , which is a schematic diagram illustrating an error image IMG2 according to an embodiment of the present invention. For example, the processor compares each plurality of pixels corresponding to the complete reconstruction image IMG1c and the image to be tested IMG0, and subtracts the grayscale value of each corresponding pixel in the complete reconstruction image IMG1c from the image to be tested IMG0 to obtain multiple The error values are used to generate the error image IMG2.

於步驟140中,處理器輸入誤差影像IMG2至一回歸模型RM,回歸模型RM輸出一瑕疵位置IMG3。 In step 140, the processor inputs the error image IMG2 to a regression model RM, and the regression model RM outputs a defect position IMG3.

於一實施例中,回歸模型RM可以應用已知的演算法,例如簡單線性回歸模型(simple linear regression model)、複線性回歸模型(multiple linear regression model)...等。 In one embodiment, the regression model RM can apply a known algorithm, such as a simple linear regression model, a multiple linear regression model . . . and so on.

於一實施例中,請參閱第6圖,第6圖係依照本發明一實施例繪示瑕疵位置IMG3(為一範圍)之示意圖。於回歸模型RM輸出瑕疵位置IMG3後,處理器將瑕疵位置IMG3與已知瑕疵IMG6中對應的每個複數個像素進行相減,並將得到的此些相減值進行微分,詳細例子如:待測影像IMG0經由重建模型MD產生初始重建圖IMG1(此處的概念,以符號表示算式為:IMG1=MD(IMG0)),待測影像IMG0和初始重建圖IMG1相減得到誤差影像IMG2(此處的概念,以符號表示算式為:IMG2=|IMG0-IMG1|),誤差影像IMG2經由回歸模型RM產生瑕疵位置IMG3(此處的概念,以符號表示算式為:IMG3=RM(IMG2),比較瑕疵位置IMG3與已知瑕疵範圍中對應的每個像素,以產生最終誤差(即“Error”,以下以符號ERR表示之),於一例子中,最終誤差ERR由瑕疵遮罩影像IMG4與瑕疵位置IMG3相減而得(此處的概念,以符號表示算式為:ERR=IMG4-IMG3),對最終誤差ERR進行運算,例如微分運算, 可得瑕疵遮罩影像IMG4的梯度影像及瑕疵位置IMG3的梯度影像,藉由倒傳遞演算法(Back Propagation)可以往回推到回歸模型RM及重建模型MD所得到的梯度,藉此更新回歸模型RM及重建模型MD,以調整回歸模型RM及/或重建模型MD。 In an embodiment, please refer to FIG. 6 . FIG. 6 is a schematic diagram illustrating a defect position IMG3 (a range) according to an embodiment of the present invention. After the regression model RM outputs the blemish position IMG3, the processor subtracts the blemish position IMG3 from each complex number of pixels corresponding to the known blemish IMG6, and differentiates the obtained subtracted values. The detailed example is as follows: The measured image IMG0 generates the initial reconstruction image IMG1 through the reconstruction model MD (the concept here is represented by a symbolic formula: IMG1=MD(IMG0)), and the error image IMG2 (here The concept of the symbol is represented by the formula: IMG2=|IMG0-IMG1|), the error image IMG2 generates the defect position IMG3 through the regression model RM (the concept here, the formula is represented by the symbol: IMG3=RM(IMG2), compare the defects The position IMG3 corresponds to each pixel in the known defect range to generate the final error (that is, "Error", hereinafter represented by the symbol ERR). In one example, the final error ERR is determined by the defect mask image IMG4 and the defect position IMG3 It is obtained by subtraction (the concept here is represented by symbols and the formula is: ERR=IMG4-IMG3), and the final error ERR is calculated, such as differential operation, The gradient image of the defect mask image IMG4 and the gradient image of the defect position IMG3 can be obtained, and the gradient obtained by the regression model RM and the reconstruction model MD can be pushed back through the back propagation algorithm (Back Propagation), so as to update the regression model RM and reconstruction model MD to adjust regression model RM and/or reconstruction model MD.

舉例而言,瑕疵遮罩影像IMG4與瑕疵位置IMG3都是一為WxHx3的矩陣,其中符號W為矩陣的寬,符號H為矩陣的高,兩矩陣相減之後可以得到誤差值,誤差值進行微分能使用倒傳遞演算法(Back Propagation)調整前面模型的參數,包含重建模型的參數和回歸模型RM的一門檻值。此門檻值可以用以判斷瑕疵位置IMG3與待測影像IMG0的差異大小,誤差大於門檻值代表回歸模型RM判定該位置為瑕疵,而回歸模型RM在學習後,應能將瑕疵位置IMG3盡可能的逼近瑕疵遮罩影像(已知瑕疵範圍)IMG4。 For example, the defect mask image IMG4 and the defect position IMG3 are both a WxHx3 matrix, where the symbol W is the width of the matrix, and the symbol H is the height of the matrix. After subtracting the two matrices, the error value can be obtained, and the error value is differentiated Back Propagation can be used to adjust the parameters of the previous model, including the parameters of the reconstruction model and a threshold value of the regression model RM. This threshold value can be used to judge the difference between the defect position IMG3 and the image IMG0 to be tested. The error greater than the threshold value means that the regression model RM judges the position as a defect, and the regression model RM should be able to make the defect position IMG3 as close as possible after learning. Approximate flaw mask image (known flaw range) IMG4.

於一實施例中,當瑕疵位置IMG3和已知瑕疵IMG6足夠相似時(可藉由兩張影像的歐基里德距離(L2 distance)或結構相似性(structural similarity,SSIM)等方式計算相似度),代表已訓練完此瑕疵檢測裝置,即結束訓練階段(完成步驟110~140),於檢測階段時,瑕疵檢測裝置可以精準預測出一新輸入影像的瑕疵位置。 In one embodiment, when the defect position IMG3 is sufficiently similar to the known defect IMG6 (the similarity can be calculated by the Euclidean distance (L2 distance) or the structural similarity (structural similarity, SSIM) of the two images, etc. ), which means that the defect detection device has been trained, that is, the training stage is over (steps 110-140 are completed). In the detection stage, the defect detection device can accurately predict the defect position of a new input image.

換言之,瑕疵遮罩影像IMG4在產生待測影像時即為已知,用以訓練瑕疵檢測裝置的回歸模型RM及/或重建模型MD,當瑕疵位置IMG3和已知瑕疵IMG6足夠相似時,代表已訓練完此瑕疵檢測裝置,即結束訓練階段(完成步驟110~140)。於檢測(或測試)階段時,將一未知影像輸入到完成訓練的回歸模型RM及/或重建模型MD,以預測未知影像中的一預測瑕疵位置。 In other words, the defect mask image IMG4 is known when the image to be tested is generated, and is used to train the regression model RM and/or the reconstruction model MD of the defect detection device. When the defect position IMG3 is sufficiently similar to the known defect IMG6, it means that After training the defect detection device, the training phase ends (steps 110-140 are completed). In the detection (or testing) stage, an unknown image is input into the trained regression model RM and/or reconstruction model MD to predict a predicted defect position in the unknown image.

本發明之方法,或特定型態或其部份,可以以程式碼的型態存在。程式碼可以包含於實體媒體,如軟碟、光碟片、硬碟、或是任何其他機器可讀取(如電腦可讀取)儲存媒體,亦或不限於外在形式之電腦程式產品,其中,當程式碼被機器,如電腦載入且執行時,此機器變成用以參與本發明之裝置。程式碼也可以透過一些傳送媒體,如電線或電纜、光纖、或是任何傳輸型態進行傳送,其中,當程式碼被機器,如電腦接收、載入且執行時,此機器變成用以參與本發明之裝置。當在一般用途處理單元實作時,程式碼結合處理單元提供一操作類似於應用特定邏輯電路之獨特裝置。 The methods of the present invention, or specific forms or parts thereof, may exist in the form of program codes. The code may be contained in a physical medium, such as a floppy disk, compact disc, hard disk, or any other machine-readable (such as computer-readable) storage medium, or a computer program product without limitation in external form, wherein, When the program code is loaded and executed by a machine, such as a computer, the machine becomes a device for participating in the present invention. Code may also be sent via some transmission medium, such as wire or cable, optical fiber, or any type of transmission in which when the code is received, loaded, and executed by a machine, such as a computer, that machine becomes the Invented device. When implemented on a general-purpose processing unit, the code combines with the processing unit to provide a unique device that operates similarly to application-specific logic circuits.

綜上,本案的瑕疵檢測方法及瑕疵檢測裝置可以應用完整重建圖與待測影像的誤差值產生誤差影像,並將誤差影像輸入到回歸模型,以學出最佳的參數,藉此訓練出精準的瑕疵檢測裝置,因此瑕疵檢測方法及瑕疵檢測裝置可判別新輸入影像的瑕疵位置,節省產線換產品時人工調整閥值的人力。 To sum up, the flaw detection method and flaw detection device in this case can use the error value of the complete reconstruction map and the image to be tested to generate an error image, and input the error image into the regression model to learn the best parameters, so as to train an accurate Therefore, the defect detection method and the defect detection device can determine the defect position of the newly input image, saving the manpower of manually adjusting the threshold when the production line changes products.

雖然本發明已以實施方式揭露如上,然其並非用以限定本發明,任何熟習此技藝者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。 Although the present invention has been disclosed above in terms of implementation, it is not intended to limit the present invention. Anyone skilled in this art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection of the present invention The scope shall be defined by the appended patent application scope.

100:瑕疵檢測方法 100: Blemish Detection Methods

110~140:步驟 110~140: Steps

IMG0:待測影像 IMG0: image to be tested

MD:重建模型 MD: rebuild model

IMG1:初始重建圖 IMG1: Initial reconstruction map

IMG2:誤差影像 IMG2: error image

RM:回歸模型 RM: regression model

IMG3:瑕疵位置 IMG3: blemish location

IMG1:初始重建圖 IMG1: Initial reconstruction map

IMG1a、IMG1b:中間重建圖 IMG1a, IMG1b: Intermediate reconstruction maps

IMG1c:完整重建圖 IMG1c: Complete reconstruction map

IMG2:誤差影像 IMG2: error image

IMG3:瑕疵位置 IMG3: blemish location

IMG4:瑕疵遮罩影像 IMG4: Blemish Mask Image

IMG6:已知瑕疵 IMG6: Known flaws

IMG5:完整影像 IMG5: Full Image

第1圖係依照本發明一實施例繪示瑕疵檢測方法之流程圖。 第2圖係依照本發明一實施例繪示瑕疵檢測方法之示意圖。 第3係依照本發明一實施例繪示待測影像之示意圖。 第4A~4C圖依照本發明一實施例繪示重建圖之示意圖。 第5圖係依照本發明一實施例繪示誤差影像之示意圖。 第6圖係依照本發明一實施例繪示瑕疵位置之示意圖。FIG. 1 is a flowchart illustrating a defect detection method according to an embodiment of the present invention. FIG. 2 is a schematic diagram illustrating a defect detection method according to an embodiment of the present invention. The third is a schematic diagram showing the image to be tested according to an embodiment of the present invention. 4A-4C are schematic diagrams showing reconstructed images according to an embodiment of the present invention. FIG. 5 is a schematic diagram illustrating an error image according to an embodiment of the present invention. Fig. 6 is a schematic diagram illustrating the location of defects according to an embodiment of the present invention.

100:瑕疵檢測方法100: Blemish Detection Methods

110~140:步驟110~140: Steps

Claims (5)

一種瑕疵檢測方法,包括:輸入一待測影像至一重建模型,該重建模型輸出一初始重建圖;輸入該初始重建圖至該重建模型,該重建模型輸出一完整重建圖;比對該完整重建圖與該待測影像中對應的每個複數個像素,以產生複數個誤差值;依據該些誤差值產生一誤差影像;以及輸入該誤差影像至一回歸模型,該回歸模型輸出一瑕疵位置;其中,於該回歸模型輸出該瑕疵位置的步驟之後,更包含:比較該瑕疵位置與一瑕疵遮罩影像中對應的複數個像素,以產生一最終誤差;以及對該最終誤差進行運算,以調整該回歸模型或該重建模型;其中,於輸入該初始重建圖至該重建模型的步驟後,更包括:重複進行將該重建模型輸出一中間重建圖,再將該中間重建圖輸入至該重建模型的操作,直到滿足一停止條件時,將最後一張之該中間重建圖視為該完整重建圖。 A defect detection method, comprising: inputting an image to be tested to a reconstruction model, and the reconstruction model outputs an initial reconstruction image; inputting the initial reconstruction image to the reconstruction model, and the reconstruction model outputs a complete reconstruction image; comparing the complete reconstruction Mapping each plurality of pixels corresponding to the image to be tested to generate a plurality of error values; generating an error image according to the error values; and inputting the error image into a regression model, and the regression model outputs a defect position; Wherein, after the step of outputting the defect position by the regression model, it further includes: comparing the defect position with a plurality of corresponding pixels in a defect mask image to generate a final error; and calculating the final error to adjust The regression model or the reconstructed model; wherein, after the step of inputting the initial reconstructed image into the reconstructed model, further comprising: repeatedly outputting the reconstructed model into an intermediate reconstructed image, and then inputting the intermediate reconstructed image into the reconstructed model The operation until a stopping condition is satisfied, the last intermediate reconstruction image is regarded as the complete reconstruction image. 如申請專利範圍第1項所述之瑕疵檢測方法,其中,該瑕疵遮罩影像在產生該待測影像時即為已知。 The defect detection method described in claim 1 of the patent application, wherein the defect mask image is known when the image to be tested is generated. 如申請專利範圍第1項所述之瑕疵檢測方法,更包含:將一未知影像輸入到完成訓練的該回歸模型或該重建模型,以預測該未知影像中的一預測瑕疵位置。 The defect detection method described in claim 1 of the patent application further includes: inputting an unknown image into the trained regression model or the reconstruction model to predict a predicted defect position in the unknown image. 一種瑕疵檢測裝置,包括:一處理器,用以將一待測影像輸入至一重建模型,該重建模型輸出一初始重建圖,將該初始重建圖輸入該重建模型,該重建模型輸出一完整重建圖,比對該完整重建圖與該待測影像中對應的每個複數個像素,以產生複數個誤差值;依據該些誤差值產生一誤差影像;以及輸入該誤差影像至一回歸模型,該回歸模型輸出一瑕疵位置;其中,該處理器更用以比較該瑕疵位置與一瑕疵遮罩影像中對應的複數個像素,以產生一最終誤差;以及對該最終誤差進行運算,以調整該回歸模型或該重建模型;其中,該處理器更用以重複進行將該重建模型輸出一中間重建圖,再將該中間重建圖輸入至該重建模型的操作,直到滿足一停止條件時,將最後一張之該中間重建圖視為該完整重建圖。 A defect detection device, comprising: a processor for inputting an image to be tested into a reconstruction model, the reconstruction model outputs an initial reconstruction image, inputs the initial reconstruction image into the reconstruction model, and the reconstruction model outputs a complete reconstruction image, comparing the complete reconstruction image with each plurality of pixels corresponding to the image to be tested to generate a plurality of error values; generating an error image based on the error values; and inputting the error image to a regression model, the The regression model outputs a defect location; wherein, the processor is further used to compare the defect location with a plurality of corresponding pixels in a defect mask image to generate a final error; and operate on the final error to adjust the regression model or the reconstructed model; wherein, the processor is further configured to repeatedly output the reconstructed model into an intermediate reconstructed graph, and then input the intermediate reconstructed graph into the reconstructed model, until a stopping condition is met, and the last The intermediate reconstructed image is regarded as the complete reconstructed image. 如申請專利範圍第4項所述之瑕疵檢測裝置,其中,該待測影像為已知。 The defect detection device as described in item 4 of the scope of the patent application, wherein the image to be tested is known.
TW109111696A 2020-04-08 2020-04-08 Defect detection method and defect detection device TWI791970B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109111696A TWI791970B (en) 2020-04-08 2020-04-08 Defect detection method and defect detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109111696A TWI791970B (en) 2020-04-08 2020-04-08 Defect detection method and defect detection device

Publications (2)

Publication Number Publication Date
TW202139132A TW202139132A (en) 2021-10-16
TWI791970B true TWI791970B (en) 2023-02-11

Family

ID=79600963

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109111696A TWI791970B (en) 2020-04-08 2020-04-08 Defect detection method and defect detection device

Country Status (1)

Country Link
TW (1) TWI791970B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI792827B (en) * 2021-12-31 2023-02-11 鴻海精密工業股份有限公司 Method for detecting product appearance defects, computer device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105825200A (en) * 2016-03-31 2016-08-03 西北工业大学 High-spectrum abnormal object detection method based on background dictionary learning and structure sparse expression
CN109949224A (en) * 2019-02-26 2019-06-28 北京悦图遥感科技发展有限公司 A kind of method and device of the connection grade super-resolution rebuilding based on deep learning
WO2019233166A1 (en) * 2018-06-04 2019-12-12 杭州海康威视数字技术股份有限公司 Surface defect detection method and apparatus, and electronic device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105825200A (en) * 2016-03-31 2016-08-03 西北工业大学 High-spectrum abnormal object detection method based on background dictionary learning and structure sparse expression
WO2019233166A1 (en) * 2018-06-04 2019-12-12 杭州海康威视数字技术股份有限公司 Surface defect detection method and apparatus, and electronic device
CN109949224A (en) * 2019-02-26 2019-06-28 北京悦图遥感科技发展有限公司 A kind of method and device of the connection grade super-resolution rebuilding based on deep learning

Also Published As

Publication number Publication date
TW202139132A (en) 2021-10-16

Similar Documents

Publication Publication Date Title
Gehrig et al. Combining events and frames using recurrent asynchronous multimodal networks for monocular depth prediction
JP6544543B2 (en) Full Reference Image Quality Evaluation Method Based on Convolutional Neural Network
EP3800588A1 (en) System and method using knowledge distillation for training a machine learning classifier
CN115315731B (en) Adaptive learning for image classification
CN110852983A (en) Method for detecting defects in semiconductor device
CN110910322B (en) Picture processing method and device, electronic equipment and computer readable storage medium
JP2012032370A (en) Defect detection method, defect detection apparatus, learning method, program, and recording medium
KR102559021B1 (en) Apparatus and method for generating a defect image
CN110458791B (en) Quality defect detection method and detection equipment
CN114667522A (en) Converting data samples into normal data
Huber et al. Real-time 3D face fitting and texture fusion on in-the-wild videos
TWI683262B (en) Industrial image inspection method and system and computer readable recording medium
CN110929733A (en) Denoising method and device, computer equipment, storage medium and model training method
TWI791970B (en) Defect detection method and defect detection device
JP7426261B2 (en) Learning device, image inspection device, learned parameters, learning method, and image inspection method
CN117372424B (en) Defect detection method, device, equipment and storage medium
CN114298923A (en) Lens evaluation and image restoration method for machine vision measurement system
CN114219762A (en) Defect detection method based on image restoration
US11645579B2 (en) Automated machine learning tagging and optimization of review procedures
JP2019159835A (en) Learning program, learning method and learning device
CN112084855A (en) Outlier elimination method for video stream based on improved RANSAC method
JP7243801B2 (en) Neural network training method and defect detection method, device and storage medium
CN113552130A (en) Flaw detection method and flaw detection device
TWI810945B (en) Method for detecting defects, computer device and storage medium
KR102613633B1 (en) Ai model training apparatus and method for reading test results of a diagnostic kit