TWI722861B - Classification method and a classification system - Google Patents

Classification method and a classification system Download PDF

Info

Publication number
TWI722861B
TWI722861B TW109111742A TW109111742A TWI722861B TW I722861 B TWI722861 B TW I722861B TW 109111742 A TW109111742 A TW 109111742A TW 109111742 A TW109111742 A TW 109111742A TW I722861 B TWI722861 B TW I722861B
Authority
TW
Taiwan
Prior art keywords
image
tested
classification
machine learning
training
Prior art date
Application number
TW109111742A
Other languages
Chinese (zh)
Other versions
TW202138785A (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 TW109111742A priority Critical patent/TWI722861B/en
Application granted granted Critical
Publication of TWI722861B publication Critical patent/TWI722861B/en
Publication of TW202138785A publication Critical patent/TW202138785A/en

Links

Images

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention discloses a classification method and a classification system. The classification system can use the classification method to classify to-be tested object into the good product area or the bad product area. The classification method comprise an automatic optical inspection device classification step. In the automatic optical inspection device classification step, the automatic optical inspection device will capture the image of to-be tested object to generate a to-be tested image, and the automatic optical inspection device will analyze the to-be tested image to classify it as good category or one of N preset defect categories. If the to-be tested image is classified into one of the N preset defect categories, a machine learning classification step is performed to use the one of the N machine learning models corresponding to the preset defect category to analyze to-be tested image to determine whether a defect corresponding to the preset defect category appears in the to-be tested image so as to determine whether the to-be tested object is a good or bad product.

Description

分類方法及分類系統Classification method and classification system

本發明涉及一種分類方法及分類系統,特別是一種利用自動光學檢測裝置及機器學習模型進行待測物分類的分類方法及分類系統。The invention relates to a classification method and a classification system, in particular to a classification method and a classification system for classifying an object to be tested by using an automatic optical detection device and a machine learning model.

自動光學檢測裝置(Automated Optical Inspection, AOI)已經普遍地被應用於各種檢測場合中。但自動光學檢測裝置在實際應用中,常會發生誤判的問題,為此造成相關業者的困擾。Automated Optical Inspection (AOI) has been widely used in various inspection occasions. However, in actual applications of automatic optical inspection devices, misjudgments often occur, which causes troubles for related industries.

本發明公開一種分類方法分類系統,主要用以改善利用自動光學檢測裝置(AOI)對各式待測物進行檢測時,自動光學檢測裝置(AOI)容易出現誤判的問題。The invention discloses a classification method classification system, which is mainly used to improve the problem that the automatic optical detection device (AOI) is prone to misjudgment when various types of test objects are detected by the automatic optical detection device (AOI).

本發明的其中一實施例公開一種分類方法,其適用於一分類系統,分類系統包含一自動光學檢測裝置、一處理裝置及一分類裝置,分類系統能執行分類方法以將一待測物分類至一良品區或一不良品區,分類方法包含:一自動光學檢測裝置分類步驟及一機器學習分類步驟。自動光學檢測裝置分類步驟包含:一影像擷取步驟及一影像分類步驟。影像擷取步驟:利用自動光學檢測裝置,對待測物進行一影像擷取,以產生一待測影像;影像分類步驟:利用自動光學檢測裝置或處理裝置分析待測影像,以判斷待測影像屬於一良品類別及N個預設瑕疵類別中的哪一類;其中,N為大於1的正整數;若判斷待測影像屬於良品類別,則利用分類裝置將待測物移載至良品區;若判斷待測影像屬於N個預設瑕疵類別中的其中一類,則執行一機器學習分類步驟;處理裝置儲存有對應於N個預設瑕疵類別的N個機器學習模型,N個機器學習模型是分別利用不完全相同的一訓練圖集(training set)進行模型訓練,且各個訓練圖檔包含對應於N個預設瑕疵類別中的其中一類的多個訓練圖檔及至少一個良品圖檔;機器學習分類步驟包含:一載入步驟:依據影像分類步驟的分類結果,將待測影像載入至相對應的其中一個機器學習模型中;一判斷步驟:利用載入有待測影像的機器學習模型,判斷待測影像為一覆判良品或一不良品;若利用載入有待測影像的機器學習模型判斷待測影像為覆判良品,則利用分類裝置將待測物移載至良品區;若利用載入有待測影像的機器學習模型判斷待測影像為不良品,則利用分類裝置將待測物移載至不良品區。One of the embodiments of the present invention discloses a classification method, which is suitable for a classification system. The classification system includes an automatic optical inspection device, a processing device and a classification device. The classification system can execute the classification method to classify a test object into A good product area or a defective product area, the classification method includes: an automatic optical inspection device classification step and a machine learning classification step. The classification step of the automatic optical inspection device includes: an image capturing step and an image classification step. Image capture step: use an automatic optical inspection device to capture an image of the object to be tested to generate an image to be tested; image classification step: use an automatic optical inspection device or processing device to analyze the image to be tested to determine whether the image to be tested belongs to A good product category and which of the N preset defect categories; where N is a positive integer greater than 1; if it is determined that the image to be tested belongs to the good product category, the classification device is used to move the object to be tested to the good product area; if judged If the image to be tested belongs to one of the N preset defect categories, a machine learning classification step is performed; the processing device stores N machine learning models corresponding to the N preset defect categories, and the N machine learning models are used separately A training set that is not exactly the same for model training, and each training image file includes multiple training images and at least one good product image file corresponding to one of the N preset defect categories; machine learning classification The steps include: a loading step: load the image to be tested into one of the corresponding machine learning models according to the classification result of the image classification step; a judging step: use the machine learning model loaded with the image to be tested to determine The image to be tested is a good product or a defective product; if the machine learning model loaded with the image to be tested is used to determine that the image to be tested is a good product, the classification device is used to transfer the object to be tested to the good product area; if used The machine learning model loaded with the image to be tested determines that the image to be tested is a defective product, and the classification device is used to transfer the object to be tested to the defective product area.

本發明的其中一實施例公開一種分類系統,其包含:一自動光學檢測裝置、一處理裝置及一分類裝置,分類系統能執行一分類方法以將一待測物分類至一良品區或一不良品區,分類方法包含:一自動光學檢測裝置分類步驟及一機器學習分類步驟。自動光學檢測裝置分類步驟包含:一影像擷取步驟:利用自動光學檢測裝置,對待測物進行一影像擷取,以產生一待測影像;一影像分類步驟:利用自動光學檢測裝置或處理裝置分析待測影像,以判斷待測影像屬於一良品類別及N個預設瑕疵類別中的哪一類;其中,N為大於1的正整數;若判斷待測影像屬於良品類別,則利用分類裝置將待測物移載至良品區;若判斷待測影像屬於N個預設瑕疵類別中的其中一類,則執行一機器學習分類步驟;處理裝置儲存有對應於N個預設瑕疵類別的N個機器學習模型,N個機器學習模型是分別利用不完全相同的一訓練圖集(training set)進行模型訓練,且各個訓練圖檔包含對應於N個預設瑕疵類別中的其中一類的多個訓練圖檔及至少一個良品圖檔;機器學習分類步驟包含:一載入步驟:依據影像分類步驟的分類結果,將待測影像載入至相對應的其中一個機器學習模型中;一判斷步驟:利用載入有待測影像的機器學習模型,判斷待測影像為一覆判良品或一不良品;若利用載入有待測影像的機器學習模型判斷待測影像為覆判良品,則利用分類裝置將待測物移載至良品區;若利用載入有待測影像的機器學習模型判斷待測影像為不良品,則利用分類裝置將待測物移載至不良品區。One of the embodiments of the present invention discloses a classification system, which includes: an automatic optical inspection device, a processing device, and a classification device. The classification system can execute a classification method to classify a test object into a good product area or a non-defective area. In the good product area, the classification method includes: an automatic optical inspection device classification step and a machine learning classification step. The automatic optical inspection device classification step includes: an image capture step: use the automatic optical inspection device to capture an image of the object to be tested to generate an image to be tested; an image classification step: use the automatic optical inspection device or processing device to analyze The image to be tested is used to determine which of a good product category and N preset defect categories the image to be tested belongs to; where N is a positive integer greater than 1; if it is determined that the image to be tested belongs to a good product category, the classification device will be used to The test object is transferred to the good product area; if it is determined that the image to be tested belongs to one of the N preset defect categories, a machine learning classification step is performed; the processing device stores N machine learnings corresponding to the N preset defect categories Model, N machine learning models use a different training set (training set) for model training, and each training image file contains multiple training image files corresponding to one of the N preset defect categories And at least one good product image file; the machine learning classification step includes: a loading step: according to the classification result of the image classification step, the image to be tested is loaded into one of the corresponding machine learning models; a judging step: using loading There is a machine learning model for the image to be tested to determine whether the image to be tested is a good product or a defective product; if the machine learning model loaded with the image to be tested is used to determine that the image to be tested is a good product, the classification device is used to The object to be tested is transferred to the good product area; if the machine learning model loaded with the image to be tested is used to determine that the image to be tested is defective, the classification device is used to transfer the object to be tested to the defective product area.

綜上所述,本發明的分類方法及分類系統通過自動光學檢測裝置分類步驟及機器學習分類步驟等設計,以及使被判定屬於不同預設瑕疵類別的待測影像,利用相對應的機器學習模型進行再次確認等設計,可以大幅改善習知僅利用自動光學檢測裝置進行待測物分類時,自動光學檢測裝置容易發生誤判的問題。In summary, the classification method and classification system of the present invention are designed through automatic optical inspection device classification steps and machine learning classification steps, and make the images to be tested that are judged to belong to different preset defect categories, using corresponding machine learning models Designs such as reconfirmation can greatly improve the problem that the automatic optical inspection device is prone to misjudgment when the conventional automatic optical inspection device is used to classify the object to be tested.

為能更進一步瞭解本發明的特徵及技術內容,請參閱以下有關本發明的詳細說明與附圖,但是此等說明與附圖僅用來說明本發明,而非對本發明的保護範圍作任何的限制。In order to further understand the features and technical content of the present invention, please refer to the following detailed descriptions and drawings about the present invention, but these descriptions and drawings are only used to illustrate the present invention, and do not make any claims about the protection scope of the present invention. limit.

於以下說明中,如有指出請參閱特定圖式或是如特定圖式所示,其僅是用以強調於後續說明中,所述及的相關內容大部份出現於該特定圖式中,但不限制該後續說明中僅可參考所述特定圖式。In the following description, if it is pointed out, please refer to the specific drawing or as shown in the specific drawing, it is only used to emphasize that in the subsequent description, most of the related content appears in the specific drawing. However, it is not limited that only the specific drawings can be referred to in this subsequent description.

請參閱圖1,其顯示為本發明的分類系統的方塊示意圖。本發明的分類系統100包含:一自動光學檢測裝置1、一處理裝置2、一儲存裝置3及一分類裝置4。自動光學檢測裝置(Automated Optical Inspection, AOI)包含一影像擷取器11,影像擷取器11用以對一待測物進行影像擷取,以產生一待測影像111。處理裝置2電性連接自動光學檢測裝置1,而處理裝置2能接收自動光學檢測裝置1所傳遞的所述待測影像111。Please refer to FIG. 1, which shows a block diagram of the classification system of the present invention. The classification system 100 of the present invention includes: an automatic optical inspection device 1, a processing device 2, a storage device 3 and a classification device 4. The Automated Optical Inspection (AOI) device includes an image capture device 11, and the image capture device 11 is used to capture an image of an object to be tested to generate an image to be tested 111. The processing device 2 is electrically connected to the automatic optical inspection device 1, and the processing device 2 can receive the image to be tested 111 transmitted by the automatic optical inspection device 1.

處理裝置2例如可以是各式電腦、伺服器等設備,而處理裝置2例如可以是包含有中央處理器(Central Processing Unit, CPU)或繪圖處理器(graphics processing unit)。儲存裝置3可以是各式記憶體、硬碟等,且儲存裝置3可以是與處理裝置2整合為一獨立的設備(例如伺服器設備、工業電腦設備等),於此不加以限制。分類裝置4電性連接處理裝置2,分類裝置4能依據處理裝置2所傳遞的指令,而將通過自動光學檢測裝置1的待測物,移載至一良品區或一不良品區。在實際應用中,分類裝置4具體所包含的硬體構件,可以是依據待測物的種類、外型、尺寸等變化,於此不加以限制。The processing device 2 may be, for example, various computers, servers, and other equipment, and the processing device 2 may, for example, include a central processing unit (CPU) or a graphics processing unit. The storage device 3 can be various types of memory, hard disk, etc., and the storage device 3 can be integrated with the processing device 2 into an independent device (such as server equipment, industrial computer equipment, etc.), which is not limited here. The sorting device 4 is electrically connected to the processing device 2, and the sorting device 4 can transfer the test object passing through the automatic optical inspection device 1 to a good product area or a defective product area according to the instructions transmitted by the processing device 2. In practical applications, the specific hardware components included in the classification device 4 may vary according to the type, appearance, size, etc. of the object to be measured, and it is not limited herein.

本發明的分類系統100用以執行本發明的一分類方法,以將一待測物分類至所述良品區或所述不良品區。本發明的分類方法包含:一自動光學檢測裝置分類步驟S1及一機器學習分類步驟S2,分類系統100是依序執行所述自動光學檢測裝置分類步驟S1及所述機器學習分類步驟S2,以決定將所述待測物分類至所述良品區或所述不良品區。The classification system 100 of the present invention is used to implement a classification method of the present invention to classify a test object into the good product area or the defective product area. The classification method of the present invention includes: an automatic optical inspection device classification step S1 and a machine learning classification step S2. The classification system 100 sequentially executes the automatic optical inspection device classification step S1 and the machine learning classification step S2 to determine The test object is classified into the good product area or the bad product area.

請一併參閱圖1及圖2,圖2顯示為本發明的分類方法的自動光學檢測裝置分類步驟的流程示意圖,所述自動光學檢測裝置分類步驟S1包含:Please refer to FIG. 1 and FIG. 2 together. FIG. 2 is a schematic flowchart of the automatic optical inspection device classification step of the classification method of the present invention. The automatic optical inspection device classification step S1 includes:

一影像擷取步驟S11:利用自動光學檢測裝置1,對待測物進行一影像擷取,以產生一待測影像111;An image capturing step S11: using the automatic optical inspection device 1 to capture an image of the object to be tested to generate an image to be tested 111;

一影像分類步驟S12:利用自動光學檢測裝置1或所述處理裝置2分析待測影像111,以判斷待測影像111屬於一良品類別及N個預設瑕疵類別中的哪一類;其中,N為大於1的正整數;An image classification step S12: use the automatic optical inspection device 1 or the processing device 2 to analyze the image to be tested 111 to determine which of the good product category and the N preset defect categories the tested image 111 belongs to; where N is A positive integer greater than 1;

若判斷待測影像111屬於良品類別,則利用分類裝置4將待測物移載至良品區;若判斷待測影像111屬於N個預設瑕疵類別中的其中一類,則執行所述機器學習分類步驟S2。換句話說,自動光學檢測裝置1及處理裝置2能分析待測影像,以判斷待測影像屬於N+1個類別(1個良品類別+N個預設瑕疵類別)中的哪一個。If it is determined that the image to be tested 111 belongs to the good product category, the classification device 4 is used to transfer the object to be tested to the good product area; if it is determined that the image to be tested 111 belongs to one of the N preset defect categories, the machine learning classification is performed Step S2. In other words, the automatic optical inspection device 1 and the processing device 2 can analyze the image to be tested to determine which of the N+1 categories (1 good product category + N preset defect categories) the test image belongs to.

請參閱圖3,其顯示為本發明的分類方法的實際例子的示意圖,假設待測物為隱形眼鏡,且隱形眼鏡(待測物)於生產過程中容易出現3種瑕疵態樣,其分別為長條狀刮痕、破洞及不規則狀雜物,則相關人員可以是將此3種瑕疵態樣分別定義為一第一預設瑕疵類別、一第二預設瑕疵類別及一第三預設瑕疵類別。Please refer to FIG. 3, which shows a schematic diagram of a practical example of the classification method of the present invention. It is assumed that the object to be tested is a contact lens, and the contact lens (the object to be tested) is prone to 3 types of defects during the production process, which are respectively For long scratches, holes, and irregular debris, the relevant personnel can define the three types of defects as a first preset type, a second preset type, and a third preset. Set the defect category.

於上述影像分類步驟S12中,自動光學檢測裝置1(或處理裝置2)將判斷待測影像中,是否出現屬於第一預設瑕疵類別的瑕疵、屬於所述第二預設瑕疵類別的瑕疵或屬於所述第三預設瑕疵類別的瑕疵,亦即,自動光學檢測裝置1(或處理裝置2)將通過待測影像111,來判斷待測物是否出現長條狀刮痕、破洞或不規則狀雜物的其中一種瑕疵。In the above-mentioned image classification step S12, the automatic optical inspection device 1 (or the processing device 2) will determine whether there are defects belonging to the first preset defect category, defects belonging to the second preset defect category, or The defects belonging to the third preset defect category, that is, the automatic optical inspection device 1 (or the processing device 2) will use the image 111 to determine whether the object to be tested has long scratches, holes, or not. One of the defects of regular debris.

若是自動光學檢測裝置1(或處理裝置2)判斷所述待測影像111中未出現屬於第一預設瑕疵類別的瑕疵、屬於第二預設瑕疵類別的瑕疵或屬於第三預設瑕疵類別的瑕疵(即,自動光學檢測裝置1通過待測影像111,判斷待測物未出現長條狀刮痕、破洞或不規則狀雜物的瑕疵)時,自動光學檢測裝置1(或處理裝置2)將判定所述待測影像111屬於所述良品類別,而自動光學檢測裝置1(或處理裝置2)將據以控制分類裝置4將此待測物移載至良品區。If the automatic optical inspection device 1 (or the processing device 2) determines that there are no defects belonging to the first preset defect category, defects belonging to the second preset defect category, or defects belonging to the third preset defect category in the image to be tested 111 Defects (that is, when the automatic optical inspection device 1 judges that the object to be tested does not have long strip scratches, holes, or irregularities based on the image 111 to be tested), the automatic optical inspection device 1 (or the processing device 2) ) It will be determined that the image to be tested 111 belongs to the good product category, and the automatic optical inspection device 1 (or the processing device 2) will accordingly control the classification device 4 to transfer the tested object to the good product area.

相對地,若自動光學檢測裝置1(或處理裝置2)判斷所述待測影像111中出現屬於第一預設瑕疵類別的瑕疵、屬於第二預設瑕疵類別的瑕疵或屬於第三預設瑕疵類別的瑕疵(即,自動光學檢測裝置1通過待測影像111,判斷待測物出現長條狀刮痕、破洞或不規則狀雜物)時,自動光學檢測裝置1將判定所述待測影像屬於所述第一預設瑕疵類別、屬於第二預設瑕疵類別的瑕疵或屬於第三預設瑕疵類別的瑕疵,而後處理裝置2將執行所述機器學習分類步驟S2。In contrast, if the automatic optical inspection device 1 (or the processing device 2) determines that a defect belonging to the first preset defect category, a defect belonging to the second preset defect category, or a third preset defect appears in the image to be tested 111 Type of defects (ie, the automatic optical inspection device 1 judges that the object to be tested has long scratches, holes, or irregular debris through the image 111 to be tested), the automatic optical inspection device 1 will determine the object to be tested The image belongs to the first preset flaw category, the second preset flaw category, or the third preset flaw category, and the post-processing device 2 will execute the machine learning classification step S2.

在實際應用中,處理裝置2可以是儲存有對應於N個預設瑕疵類別的N筆預設灰階規則21。於所述影像分類步驟S12中,自動光學檢測裝置1將先計算待測影像111中的至少一區域內的所有像素的一灰階值,而後,自動光學檢測裝置將判斷至少一區域內的所有像素的灰階值是否符合N筆預設灰階規則22。若自動光學檢測裝置1判斷至少一區域內的所有像素的灰階值,符合其中一個預設灰階規則22,則判定待測影像111屬於預設灰階規則22所對應的預設瑕疵類別。其中,依據實際待測物的不同,自動光學檢測裝置1可以是計算待測影像中所有像素的灰階值,或者,僅計算待測影像中的一部分的區域內的所有像素的灰階值。In practical applications, the processing device 2 may store N preset grayscale rules 21 corresponding to N preset defect categories. In the image classification step S12, the automatic optical inspection device 1 will first calculate a grayscale value of all pixels in at least one area of the image to be tested 111, and then, the automatic optical inspection device will determine all pixels in at least one area Whether the gray scale value of the pixel meets the N preset gray scale rule 22. If the automatic optical inspection device 1 determines that the grayscale values of all pixels in at least one area meet one of the preset grayscale rules 22, it is determined that the image to be tested 111 belongs to the preset defect category corresponding to the preset grayscale rule 22. Among them, depending on the actual object to be measured, the automatic optical detection device 1 may calculate the grayscale values of all pixels in the image to be measured, or only calculate the grayscale values of all pixels in a part of the area of the image to be measured.

承接上述例子,假設待測物為隱形眼鏡,所述分類系統100是要對隱形眼鏡的中心區域A(即隱形眼鏡實際用來矯正使用者視力的區域)進行檢測,以判斷隱形眼鏡於中心區域A的範圍內是否出現長條狀刮痕、破洞及不規則雜物的其中一種瑕疵;當然,瑕疵的類型不以此三種為限,其可依據需求加以變化,舉例來說,瑕疵還可以是包含有直線瑕疵、實心圓瑕疵、空心圓瑕疵等。假設隱形眼鏡的中心區域A未出現上述任何一種瑕疵時,待測影像111於所述中心區域A的所有像素的平均灰階值大致為200,而隱形眼鏡的中心區域A出現長條狀刮痕的瑕疵時,所述瑕疵所對應的所有像素的灰階值大致介於120~150,隱形眼鏡的中心區域A出現破洞時,所述瑕疵所對應的所有像素的灰階值大致介於70~80,而隱形眼鏡的中心區域A出現不規則狀雜物時,所述瑕疵所對應的所有像素的灰階值大致介於20~50。處理裝置2可以是具有三個預設灰階規則其分別為:規則1:中心區域A內的至少50~100個像素的灰階值介於120~150;規則2:中心區域A內的部分的像素的灰階值介於70~80;規則3:中心區域A內的部分像素的灰階值介於20~50。需說明的是,上述規則1、規則2及規則3是相關人員依據實際所欲分類的瑕疵種類進行設計,也就是說,在實際應用中,規則的數量及規則具體包含的內容,可以依據待測物的不同及瑕疵種類、外型等不同而設計。Continuing the above example, assuming that the test object is a contact lens, the classification system 100 is to detect the central area A of the contact lens (that is, the area where the contact lens is actually used to correct the user’s vision) to determine whether the contact lens is in the central area Whether there are long strips of scratches, holes, and irregular debris in the scope of A; Of course, the types of defects are not limited to these three types, which can be changed according to requirements, for example, the defects can also be It includes straight line flaws, solid circle flaws, hollow circle flaws, etc. Assuming that the central area A of the contact lens does not have any of the above-mentioned defects, the average grayscale value of all pixels in the central area A of the image 111 to be tested is approximately 200, and the central area A of the contact lens has a striped scratch When a defect occurs, the grayscale value of all pixels corresponding to the defect is approximately between 120 and 150. When a hole appears in the central area A of the contact lens, the grayscale value of all pixels corresponding to the defect is approximately 70 ~80, and when irregular debris appears in the central area A of the contact lens, the grayscale values of all pixels corresponding to the defect are approximately between 20-50. The processing device 2 may have three preset grayscale rules, which are: Rule 1: At least 50-100 pixels in the central area A have grayscale values between 120-150; Rule 2: The part in the central area A The grayscale values of the pixels are between 70 and 80; Rule 3: The grayscale values of some pixels in the central area A are between 20 and 50. It should be noted that the above rules 1, rules 2, and 3 are designed by relevant personnel based on the types of defects that they actually want to classify. That is to say, in practical applications, the number of rules and the specific content of the rules can be based on the types of defects to be classified. Designed for the difference of the measured object, the type of defect, the appearance, etc.

承上,在分類系統100執行所述影像分類步驟S12時,自動光學檢測裝置1將會計算待測影像111的中心區域A的所有像素的灰階值,並且判斷各個所述像素的灰階值是否介於120~150、70~80或20~50,若中心區域中超過50個像素的灰階值是介於120~150,則自動光學檢測裝置1將判定所述待測影像111屬於第一預設瑕疵類別;若中心區域中部分像素的灰階值是介於70~80,則自動光學檢測裝置1將判定所述待測影像111屬於第二預設瑕疵類別;若中心區域中部分像素的灰階值是介於20~50,則自動光學檢測裝置1將判定所述待測影像111屬於第三預設瑕疵類別。In summary, when the classification system 100 executes the image classification step S12, the automatic optical inspection device 1 will calculate the grayscale value of all pixels in the central area A of the image to be tested 111, and determine the grayscale value of each pixel Whether it is between 120-150, 70-80, or 20-50, if the grayscale value of more than 50 pixels in the central area is between 120-150, the automatic optical inspection device 1 will determine that the image to be tested 111 belongs to the first A preset defect category; if the grayscale values of some pixels in the central area are between 70 and 80, the automatic optical inspection device 1 will determine that the image to be tested 111 belongs to the second preset defect category; if the central area is partially If the grayscale value of the pixel is between 20-50, the automatic optical inspection device 1 will determine that the image to be tested 111 belongs to the third preset defect category.

在不同實施例中,所述待測影像可以是通過二值化(Binarization)處理後的影像,也就是說,自動光學檢測裝置1的影像擷取器11擷取待測物的影像後,將對該影像進行二值化處理,以產生所述待測影像,而所述待測影像中,瑕疵的部分將呈現為白色(灰階值255),其餘部分則呈現為黑色(灰階值0),或者是,瑕疵部分呈黑色,其餘部分呈白色。如圖4及圖5所示,其分別顯示為兩種不同的待測影像的示意圖。在實際應用中,相關人員可以是使自動光學檢測裝置1依據兩筆不同的預設灰階規則21,將圖4及圖5所示的兩張待測影像分類至兩個不同的預設瑕疵類別中。具體來說,自動光學檢測裝置1的其中一筆預設灰階規則21可以是:判斷待測影像中所有灰階值為255的像素所共同構成的圖樣的長度是否大於100像素,且圖樣的長寬比為100:1;另一筆預設灰階規則21則可以是:判斷待測影像中所有灰階值為255的像素所共同構成的圖樣的面積是否大於500像素,且圖樣的長寬比為1:1。In different embodiments, the image to be measured may be an image processed by binarization, that is, after the image capture device 11 of the automatic optical inspection device 1 captures the image of the object to be measured, Binarize the image to generate the image to be tested. In the image to be tested, the flawed part will appear as white (grayscale value 255), and the rest will appear as black (grayscale value 0 ), or, the blemishes are black and the rest are white. As shown in Figures 4 and 5, they are respectively shown as schematic diagrams of two different images to be tested. In practical applications, the relevant personnel can make the automatic optical inspection device 1 classify the two images to be tested shown in FIGS. 4 and 5 into two different preset defects according to two different preset grayscale rules 21 Category. Specifically, one of the preset gray scale rules 21 of the automatic optical inspection device 1 may be: judging whether the length of the pattern formed by all pixels with a gray scale value of 255 in the image to be measured is greater than 100 pixels, and the length of the pattern is The aspect ratio is 100:1; another preset grayscale rule 21 can be: determine whether the area of the pattern formed by all pixels with a grayscale value of 255 in the image to be tested is greater than 500 pixels, and the aspect ratio of the pattern It is 1:1.

另外,值得一提的是,自動光學檢測裝置1的影像擷取器11擷取待測物的彩色影像後,可以是先將該彩色影像依據三原色(RGB)分離出三張僅分別保留紅色、綠色及藍色的影像,而後再分別將三張影像進行二值化處理,最後利用預設灰階值規則,分別判斷三張影像中是否出現符合預設灰階規則的圖樣,若其中一張影像出現符合預設灰階值規則的圖樣,則判定該影像屬於對應於該預設灰階值規則的預設瑕疵類別。In addition, it is worth mentioning that after the image picker 11 of the automatic optical inspection device 1 captures the color image of the object to be tested, it can first separate the color image into three images according to the three primary colors (RGB), and only retain the red, Green and blue images, then the three images are binarized, and finally the preset grayscale value rules are used to determine whether there are patterns that meet the preset grayscale rules in the three images. If one of them If the image has a pattern that meets the preset gray-scale value rule, it is determined that the image belongs to the preset defect category corresponding to the preset gray-scale value rule.

在不同的實施例中,自動光學檢測裝置1的影像擷取器11擷取待測物的彩色影像後,可以是先將彩色影像中R、G、B三個數值取平均值、最高值或最低值後,再將該彩色影像轉換為黑白影像,接著,在進行二值化處理,以產生出所述待測影像,最後,自動光學檢測裝置1則是判斷所述待測影像中是否存在符合預設灰階值規則的圖樣,以判定所述待測影像屬於哪一個預設瑕疵類別或為良品類別。In different embodiments, after the image picker 11 of the automatic optical inspection device 1 picks up the color image of the object to be tested, it may first take the three values of R, G, and B in the color image as the average value, the highest value, or After the lowest value, the color image is converted into a black-and-white image, and then binarization is performed to generate the image to be tested. Finally, the automatic optical inspection device 1 determines whether there is any image in the image to be tested. The pattern conforming to the preset grayscale value rule is used to determine which preset defect category or good product category the image to be tested belongs to.

請一併參閱圖1及圖6,圖6顯示為本發明的分類方法的機器學習分類步驟的流程示意圖。在實際應用中,處理裝置2儲存有N個預設灰階規則21及對應於N個預設瑕疵類別的N個機器學習模型22,而儲存裝置3則儲存有N個訓練圖集(training set)31,各個訓練圖集31包含至少一個良品圖檔311及對應於N個預設瑕疵類別中的其中一類的多個不良品訓練圖檔312。N個機器學習模型22是對應利用N個所述訓練圖集31進行模型訓練,亦即,N個機器學習模型22是分別利用不完全相同的一個所述訓練圖集31進行模型訓練。其中,在實際實施中,各個訓練圖集31可以是包含有相同的良品圖檔311,但不以此為限。Please refer to FIG. 1 and FIG. 6 together. FIG. 6 is a schematic flowchart of the machine learning classification step of the classification method of the present invention. In practical applications, the processing device 2 stores N preset grayscale rules 21 and N machine learning models 22 corresponding to the N preset defect categories, and the storage device 3 stores N training set ) 31, each training atlas 31 includes at least one good product image file 311 and a plurality of defective product training image files 312 corresponding to one of the N preset defect categories. The N machine learning models 22 correspond to the use of N training atlas 31 for model training, that is, the N machine learning models 22 respectively use a different training atlas 31 for model training. Wherein, in actual implementation, each training atlas 31 may include the same good product image files 311, but it is not limited to this.

當分類系統100執行完所述自動光學檢測裝置分類步驟S1後,且自動光學檢測裝置1判斷當前的待測影像屬於N個預設瑕疵類別中的其中一個時,分類系統100將執行所述機器學習分類步驟S2,所述機器學習分類步驟S2包含:After the classification system 100 has performed the automatic optical inspection device classification step S1, and the automatic optical inspection device 1 determines that the current image to be tested belongs to one of the N preset defect categories, the classification system 100 will execute the machine Learning classification step S2, the machine learning classification step S2 includes:

一載入步驟S21:依據影像分類步驟S1的分類結果,將待測影像111載入至相對應的其中一個機器學習模型22中;A loading step S21: load the image to be tested 111 into one of the corresponding machine learning models 22 according to the classification result of the image classification step S1;

一判斷步驟S22:利用載入有待測影像111的機器學習模型22,判斷待測影像111為一覆判良品或一不良品;A judging step S22: using the machine learning model 22 loaded with the image to be tested 111 to determine whether the image to be tested 111 is a good product or a defective product;

若利用載入有待測影像111的機器學習模型22判斷待測影像111為覆判良品,則利用分類裝置4將待測物移載至良品區;若利用載入有待測影像111的機器學習模型22判斷待測影像111為不良品,則利用分類裝置4將待測物移載至不良品區。特別說明的是,在具體的應用中,分類系統100可以是具有N個不良品區,N個不良品區對應於N個預設瑕疵類別,而當機器學習模型22判斷待測影像為不良品時,處理裝置2可以是控制分類裝置4將待測物,移載至相對應的不良品區中。If the machine learning model 22 loaded with the image 111 to be tested is used to determine that the image 111 to be tested is a good product under review, the classification device 4 is used to transfer the object to be tested to the good product area; if a machine with the image 111 to be tested is used The learning model 22 determines that the image to be tested 111 is a defective product, and the classification device 4 is used to transfer the object to be tested to the defective product area. It is particularly noted that in a specific application, the classification system 100 may have N defective product areas, the N defective product areas corresponding to N preset defect categories, and when the machine learning model 22 determines that the image to be tested is defective At this time, the processing device 2 may control the sorting device 4 to transfer the object to be tested to the corresponding defective product area.

請一併參閱圖1、圖7及圖8,圖7顯示為本發明的分類系統的儲存裝置的其中一個實施例的方塊示意圖,圖8為本發明的分類方法的其中一個實際例子的說明示意圖。承接上述例子,在實際應用中,儲存裝置3中可以是儲存有三個機器學習模型及三個訓練圖集。三個機器學習模型分別定義為一第一機器學習模型22A、一第二機器學習模型22B及一第三機器學習模型22C。三個訓練圖集31分別定義為一第一訓練圖集31A、一第二訓練圖集31B及一第三訓練圖集31C。第一訓練圖集31A中例如可以是儲存有三張不良品訓練圖檔312A1、312A2、312A3,其中一張不良品訓練圖檔312A1的中心區域A的左下方出現一個的長條狀刮痕D11,且長條狀刮痕D11的長度方向是由左上向右下延伸;其中一張不良品訓練圖檔312A2的中心區域A的右上方出現一個長條狀刮痕D12,且長條狀刮痕D12的長度方向是由左上向右下延伸;其中一張不良品訓練圖檔312A3的中心區域A的中心位置出現一個長條狀刮痕D13,且長條狀刮痕D13的長度方向是由右上向左下延伸。Please refer to FIG. 1, FIG. 7 and FIG. 8. FIG. 7 is a block diagram of one embodiment of the storage device of the classification system of the present invention, and FIG. 8 is an explanatory diagram of an actual example of the classification method of the present invention . Following the above example, in practical applications, the storage device 3 may store three machine learning models and three training atlases. The three machine learning models are respectively defined as a first machine learning model 22A, a second machine learning model 22B, and a third machine learning model 22C. The three training atlas 31 are respectively defined as a first training atlas 31A, a second training atlas 31B, and a third training atlas 31C. For example, the first training atlas 31A may store three defective training image files 312A1, 312A2, 312A3, and one of the defective training image files 312A1 has a strip-shaped scratch D11 at the bottom left of the central area A. And the length of the strip-shaped scratch D11 extends from upper left to lower right; one of the defective training image files 312A2 has a strip-shaped scratch D12 at the upper right of the central area A, and a strip-shaped scratch D12 The length direction of is extending from upper left to lower right; one of the defective product training files 312A3 has a long scratch D13 in the center of the central area A, and the length of the long scratch D13 is from upper right to Extends to the bottom left.

第二訓練圖集31B中例如可以是儲存有三張不良品訓練圖檔312B1、312B2、312B3,其中一張不良品訓練圖檔312B1的中心區域A的左下方出現一個的不規則狀破洞D21;其中一張不良品訓練圖檔312B2的中心區域A的右上方出現一個不規則狀破洞D22;其中一張不良品訓練圖檔312B3的中心區域A的中心位置出現一個不規則狀破洞D23;且三張不良品訓練圖檔312B1、312B2、312B3中出現的不規則狀破洞D21、D22、D23的外型及尺寸不完全相同。For example, the second training atlas 31B may store three defective training image files 312B1, 312B2, 312B3, and one of the defective training image files 312B1 has an irregular hole D21 in the lower left of the central area A; An irregular hole D22 appears in the upper right of the central area A of one of the defective product training files 312B2; an irregular hole D23 appears in the center of the central area A of one of the defective product training files 312B3; In addition, the irregular holes D21, D22, and D23 appearing in the three defective training image files 312B1, 312B2, and 312B3 have different shapes and sizes.

第三訓練圖集31C中例如可以是儲存有三張不良品訓練圖檔312C1、312C2、312C3,其中一張不良品訓練圖檔312C1的中心區域A的左下方出現一個的不規則狀雜物D31;其中一張不良品訓練圖檔312C2的中心區域A的右上方出現一個不規則狀雜物D32;其中一張不良品訓練圖檔312C3的中心區域A的中心位置出現一個不規則狀雜物D33;且三張不良品訓練圖檔312C1、312C2、312C3中出現的不規則狀雜物D31、D32、D33的外型及尺寸不完全相同。For example, the third training atlas 31C may store three defective training image files 312C1, 312C2, 312C3, and one of the defective training image files 312C1 has an irregular debris D31 at the lower left of the central area A; An irregular debris D32 appeared at the upper right of the central area A of one of the defective training image files 312C2; an irregular debris D33 appeared at the center of the central area A of one of the defective training image files 312C3; Moreover, the appearance and size of the irregular debris D31, D32, and D33 appearing in the three defective product training image files 312C1, 312C2, and 312C3 are not exactly the same.

假設自動光學檢測裝置1對待測物進行影像擷取後,所產生的待測影像111如圖8所示,則於上述自動光學檢測裝置分類步驟S1中,所述待測影像111將被判定屬於前述第一預設瑕疵類別,而於上述機器學習分類步驟S2中,處理裝置2將會把所述待測影像111輸入至第一機器學習模型22A中,而後,處理裝置2將可以利用第一機器學習模型22A判斷出所述待測影像111具有所述第一瑕疵類別的瑕疵,而處理裝置2將可據以判定所述待測影像111屬於不良品,最後,處理裝置2將可以控制分類裝置4將待測物移載至不良品區。Assuming that after the automatic optical inspection device 1 performs image capture of the object to be tested, the generated image to be tested 111 is as shown in FIG. 8, then in the above-mentioned automatic optical inspection device classification step S1, the to-be-tested image 111 will be determined to belong to The aforementioned first preset defect category, and in the aforementioned machine learning classification step S2, the processing device 2 will input the image to be tested 111 into the first machine learning model 22A, and then the processing device 2 will be able to use the first The machine learning model 22A determines that the image to be tested 111 has a defect of the first defect category, and the processing device 2 can determine that the image to be tested 111 is a defective product, and finally, the processing device 2 can control the classification The device 4 transfers the object to be tested to the defective product area.

依上所述,由於第一訓練圖檔集31A中所包含的各個不良品訓練圖檔312僅具有第一瑕疵類別的瑕疵,而第一訓練圖檔集31A中的各個不良品訓練圖集31並不具有其他瑕疵類別的瑕疵,因此,當如圖5所示的從未出現於第一訓練圖檔集31A中的待測影像111,被輸入至第一機器學習模型22A中時,第一機器學習模型22A能夠精確地判斷出,圖5的待測影像111出現有屬於第一瑕疵類別的瑕疵。As described above, since each defective product training image file 312 included in the first training image file set 31A only has defects of the first defect category, and each defective product training image collection 31 in the first training image file set 31A has only defects of the first defect category. It does not have defects of other types of defects. Therefore, when the image to be tested 111 that has never appeared in the first training image file set 31A as shown in FIG. 5 is input into the first machine learning model 22A, the first The machine learning model 22A can accurately determine that the image to be tested 111 in FIG. 5 has a defect belonging to the first defect category.

如上述說明,相反來說,假設單一個機器學習模型的訓練圖集中,包含有多種不同瑕疵類型的圖檔,則所述單一個機器學習模型在輸入一個從未出現於訓練圖集中的圖檔時,機器學習模型將容易出現誤判所述圖檔所具有的瑕疵所屬的類型的問題。另外,申請人在實際的實驗中,發現使單一個機器學習模型僅針對單一種瑕疵類型進行訓練,所述機器學習模型到達預定的判斷準確率所需的訓練時間,將明顯低於單一個機器學習模組同時對多種瑕疵類型進行訓練,所述機器學習模型判斷各種瑕疵類型到達相同的判斷準確率所需的訓練時間。As explained above, on the contrary, assuming that the training atlas of a single machine learning model contains multiple types of images with different defect types, then the single machine learning model inputs an image that never appears in the training atlas At this time, the machine learning model will be prone to misjudge the type of the defect of the image file. In addition, in actual experiments, the applicant found that a single machine learning model is only trained for a single defect type. The training time required for the machine learning model to reach a predetermined judgment accuracy rate will be significantly lower than that of a single machine. The learning module trains multiple defect types at the same time, and the machine learning model judges the training time required for the various defect types to reach the same judgment accuracy rate.

綜上所述,本發明的分類方法及分類系統,先利用自動光學檢測裝置1對待測物進行影像擷取以產生待測影像,並利用自動光學檢測裝置1對待測影像進行分析,以判斷待測影像中是否出現有符合N個預設瑕疵類別中的任一個瑕疵,若出現N個預設瑕疵類別中的其中一個瑕疵時,則再利用僅對特定類別瑕疵進行訓練的機器學習模型,來對待測影像進行再一次的判別,藉此,再次確認待測影像中是否出現特定類別的瑕疵,本發明的分類方法及分類系統,透過自動光學檢測裝置及機器學習模型的相互配合,不但可以準確地判斷出待測物是否出現瑕疵外,還可以準確地判斷出待測物是否出現預設類別的瑕疵。In summary, the classification method and classification system of the present invention first use the automatic optical detection device 1 to capture images of the object to be tested to generate the image to be tested, and use the automatic optical detection device 1 to analyze the image to be tested to determine the object to be tested. Measure whether there is any defect in the N preset defect categories in the test image. If one of the N preset defect categories appears, then a machine learning model that only trains on specific types of defects is used. The image to be tested is judged again to confirm whether there are specific types of defects in the image to be tested. The classification method and classification system of the present invention can not only be accurate through the cooperation of the automatic optical detection device and the machine learning model. In addition to judging whether the object under test has defects, it can also accurately determine whether the object under test has defects of a preset type.

需說明的是,對於生產廠商而言,對其所生產出的產品進行瑕疵檢測是一種常規的流程,而對生產廠商而言更重要的是判斷出待測物出現何種瑕疵,如此生產廠商才得以依據瑕疵種類,來對生產流程進行調校,是以,本發明的分類方法及分類系統通過自動光學檢測裝置及N個機器學習模型等設計,不但可以準確地判斷出待測物是否具有瑕疵外,還可以準確地判斷出瑕疵屬於哪一種類型。It should be noted that for manufacturers, it is a routine process to detect defects in their products, and it is more important for manufacturers to determine what defects are present in the object to be tested, so the manufacturer It is possible to adjust the production process according to the types of defects. Therefore, the classification method and classification system of the present invention are designed through automatic optical detection devices and N machine learning models, etc., not only can accurately determine whether the object to be tested has In addition to flaws, it is also possible to accurately determine which type of flaw belongs to.

請一併參閱圖1及圖9,其顯示為發明的分類方法的機器學習分類步驟的另一實施例的流程示意圖。本實施例與前述實施例最大不同之處在於:於所述判斷步驟S22中,是利用機器學習模型22判斷待測影像為覆判良品、不良品或一未知品。Please refer to FIG. 1 and FIG. 9 together, which show a schematic flowchart of another embodiment of the machine learning classification step of the inventive classification method. The biggest difference between this embodiment and the previous embodiments is that in the determining step S22, the machine learning model 22 is used to determine whether the image to be tested is a good product, a defective product, or an unknown product.

若機器學習模型22判斷待測影像111為未知品,則利用分類裝置4將待測物移載至一未知品區,且處理裝置2將發出一提示資訊23,以提醒覆判人員對設置於未知品區的待測物進行人工查驗。在實際應用中,提示資訊22例如可以是一控制訊號,而分類方法的相關發光裝置、發聲裝置,接收所述控制訊號(提示資訊22)後,將發出特定的光束、聲音;當然,提示資訊22也可以是被顯示於一顯示裝置中。If the machine learning model 22 determines that the image to be tested 111 is an unknown product, the classification device 4 is used to transfer the object to be tested to an unknown product area, and the processing device 2 will send out a prompt message 23 to remind the reviewers to The test objects in the unknown area are manually inspected. In practical applications, the prompt information 22 may be, for example, a control signal, and the related light emitting device and sound device of the classification method will emit a specific light beam and sound after receiving the control signal (prompt information 22); of course, the prompt information 22 can also be displayed on a display device.

如圖1所示,分類系統100還可以包含有一輸入裝置5,輸入裝置5鄰近於未知品區設置,輸入裝置5用以提供使用者操作,以對應產生一判定結果資訊51。若設置於未知區的待測物經人工查驗,且輸入裝置5被操作而產生所述判定結果資訊51,而處理裝置2依據判定結果資訊51判定待測物屬於N個預設瑕疵類別中的其中一類,則處理裝置2將待測影像111儲存於相對應的預設瑕疵類別對應的機器學習模型22的訓練圖集31中,且處理裝置2將依據所述判定結果資訊,控制分類裝置4將待測物移載至「良品區」或「不良品區」。在實際應用中,分類系統100於未知品區的周圍還可以是設置有一顯示裝置,顯示裝置能顯示待測影像,而使用者即可通過顯示裝置觀看設置於未知品區的待測物所對應的待測影像,並據以判斷待測影像中的瑕疵是屬於哪一種類型,而後,使用者可以通過操作輸入裝置5(例如各式觸控螢幕、輸入按鍵等)來產生所述判定結果資訊51。As shown in FIG. 1, the classification system 100 may further include an input device 5 arranged adjacent to the unknown area, and the input device 5 is used to provide user operations to correspondingly generate a determination result information 51. If the test object set in the unknown area is manually inspected, and the input device 5 is operated to generate the determination result information 51, and the processing device 2 determines that the test object belongs to the N preset defect categories according to the determination result information 51 For one type, the processing device 2 stores the image 111 to be tested in the training atlas 31 of the machine learning model 22 corresponding to the corresponding preset defect category, and the processing device 2 will control the classification device 4 according to the determination result information. Move the object to be tested to the "good product area" or "defective product area". In practical applications, the classification system 100 can also be provided with a display device around the unknown area, the display device can display the image to be tested, and the user can view the corresponding object to be tested set in the unknown area through the display device Based on the image to be tested, determine which type of defect the image to be tested belongs to. Then, the user can generate the determination result information by operating the input device 5 (such as various touch screens, input buttons, etc.) 51.

請參閱圖10,其顯示為本發明的分類方法的實際例子的示意圖,承接前述的本發明的分類方法應用於隱形眼鏡的分類的例子,在實際應用中,假設待測影像111中實際存在的瑕疵為「破洞」,但自動光學檢測裝置1錯誤地判斷待測影像111中具有「長條刮痕」,而待測影像111被對應輸入至第一機器學習模型22A中,此時,第一機器學習模型22A將為把待測影像111判定為「未知品」。在具體實施中,各個機器學習模型可以是利用邏輯回歸的Sigmoid函數,對應計算出待測影像為覆判良品的機率及待測影像為不良品的機率,假設機器學習模型所計算出的待測影像為覆判良品的機率及待測影像為不良品的機率都不超過預定的閥值(例如不超過0.8),則機器學習模型將會把所述待測影像判定為「未知品」。Please refer to FIG. 10, which shows a schematic diagram of an actual example of the classification method of the present invention, which inherits the foregoing example of the classification method of the present invention applied to the classification of contact lenses. The defect is a "hole", but the automatic optical inspection device 1 erroneously determines that the image to be tested 111 has a "scratch", and the image to be tested 111 is correspondingly input to the first machine learning model 22A. At this time, the first machine learning model 22A A machine learning model 22A will determine the image to be tested 111 as "unknown". In specific implementation, each machine learning model can be a Sigmoid function using logistic regression to calculate the probability that the image to be tested is a good product and the probability that the image to be tested is a defective product. Assuming that the machine learning model calculates the probability of being tested The probability that the image is a good product and the probability that the image to be tested is a defective product does not exceed a predetermined threshold (for example, no more than 0.8), and the machine learning model will determine the image to be tested as an "unknown product."

依上所述,通過使機器學習模型增加「未知品」的判斷機制的設計,將可以讓使用者更清楚地瞭解自動光學檢測裝置1在面對何種待測影像時可能發生哪一種誤判,藉此,相關人員可以對應修改自動光學檢測裝置1判斷待測影像的相關規則。As mentioned above, by adding the "unknown" judging mechanism to the machine learning model, the user will be able to understand more clearly what kind of misjudgment may occur when the automatic optical inspection device 1 faces the image to be tested. In this way, relevant personnel can correspondingly modify the relevant rules of the automatic optical inspection device 1 to determine the image to be tested.

請一併參閱圖11及圖12,圖11及圖12分別顯示為通過二值化處理的待測影像。如圖11所示,在實際應用中,若是通過二值化處理後的待測影像中,出現不連續的類似於直線狀瑕疵的圖樣,則自動光學檢測裝置1將難以正確地判斷出所述待測影像中所出現的瑕疵屬於哪一種預設瑕疵類別,此時若是自動光學檢測裝置1將圖11的待測影像分類至直線狀瑕疵的預設瑕疵類別,則所述待測影像通過相對應的機器學習模組的判斷後,將可被正確地判斷出待測影像是否屬於直線狀瑕疵的預設瑕疵類別。另外,若是分類方法於所述判斷步驟S22中,是利用機器學習模型22判斷待測影像為覆判良品、不良品或未知品,則自動光學檢測裝置1也可以是將出現不連續的類似於直線狀瑕疵的圖樣的待測影像分類為未知品。Please refer to FIG. 11 and FIG. 12 together. FIG. 11 and FIG. 12 respectively show the image to be tested through the binarization process. As shown in Figure 11, in practical applications, if a discontinuous pattern similar to a linear defect appears in the image to be tested after the binarization process, it will be difficult for the automatic optical inspection device 1 to correctly determine the What kind of preset defect category does the flaw appearing in the image to be tested belong to? At this time, if the automatic optical inspection device 1 classifies the image to be tested in FIG. 11 into the preset flaw category of linear flaws, the image to be tested passes the phase After the judgment of the corresponding machine learning module, it can be correctly judged whether the image to be tested belongs to the preset defect category of linear defect. In addition, if the classification method in the determination step S22 is to use the machine learning model 22 to determine whether the image to be tested is a good product, a defective product, or an unknown product, the automatic optical inspection device 1 may also be a discontinuous similar The image to be tested with a pattern of linear flaws is classified as an unknown product.

如圖12所示,在實際應用中,若是待測影像中,除了出現直線狀的瑕疵外還出現灰色條紋(雜訊),則自動光學檢測裝置1將難以正確地判斷出所述待測影像中所出現的瑕疵屬於哪一種預設瑕疵類別,此時自動光學檢測裝置1無論是將所述待測影像分類為直線狀瑕疵的預設瑕疵類別,或是,將所述待測影像分類為未知品類別,所述待測影像內所包含的瑕疵,都可以在後續的過程中,被正確地判斷出來。As shown in FIG. 12, in practical applications, if the image to be tested has gray stripes (noise) in addition to linear flaws, it will be difficult for the automatic optical inspection device 1 to correctly determine the image to be tested. Which type of preset defect category does the defect appearing in in the optical system belong to? At this time, the automatic optical inspection device 1 either classifies the image to be tested as the preset defect category of linear defects, or classifies the image to be tested as The category of unknown products and the defects contained in the image to be tested can all be correctly judged in the subsequent process.

依上所述,本發明的分類方法及分類系統,即使在待測影像中出現不連續的瑕疵圖像或是出現干擾圖樣,仍可以通過後續的機器學習模型或是將待測影像判斷為未知品等步驟,而正確地對待測物進行分類。As mentioned above, the classification method and classification system of the present invention, even if discontinuous flaw images or interference patterns appear in the image to be tested, the subsequent machine learning model or the image to be tested can still be judged as unknown. And other steps, and correctly classify the object to be tested.

在上述各實施例中,本發明的分類方法還可以包含有一訓練集擴充步驟:利用處理裝置2將被機器學習模型22判斷為覆判良品或不良品的待測影像111,依據影像分類步驟的分類結果,存入相對應的其中一個機器學習模型22所對應的訓練圖集31中。而後,處理裝置2可以是在訓練圖集31所包含的圖檔增加至一預定數量時,使各個機器學習模型利用擴充後的訓練圖集31再次進行模型訓練,如此,將可提升各機器學習模型的判斷準確度。In the above-mentioned embodiments, the classification method of the present invention may further include a training set expansion step: using the processing device 2 to judge the image 111 to be tested as good or defective by the machine learning model 22, according to the image classification step The classification result is stored in the training atlas 31 corresponding to one of the corresponding machine learning models 22. Then, the processing device 2 can make each machine learning model use the expanded training atlas 31 to perform model training again when the image files included in the training atlas 31 increase to a predetermined number. In this way, each machine learning can be improved. The judgment accuracy of the model.

在不同的實施例中,於所述訓練集擴充步驟中,處理裝置2也可以是將被機器學習模型22判斷為覆判良品或不良品的待測影像111,依據影像分類步驟的分類結果,隨機地存入相對應的其中一個機器學習模型22所對應的訓練圖集31中或相對應的其中一個機器學習模型22所對應的一驗證圖集(Validation Dataset)中,所述驗證圖集中儲存有多張已經被確認(例如是已經被標籤化)的良品圖檔、不良品圖檔。更具體來說,各個機器學習模型在進行模型訓練過程中,是利用相對應的訓練圖集進行模型訓練,而利用相對應的驗證圖集來進行訓練結果驗證。透過使被機器學習模型判斷為覆判良品或不良品的待測影像「隨機地」存入相對應的訓練圖集或是驗證圖集中的設計,將可以避免於訓練圖集中新增過多的待測影像,而使得機器學習模型再次訓練後,發生過度學習(Overfitting)的問題。In a different embodiment, in the training set expansion step, the processing device 2 may also be the image to be tested 111 that is judged by the machine learning model 22 to be a good product or a defective product, and according to the classification result of the image classification step, Randomly stored in the training atlas 31 corresponding to one of the corresponding machine learning models 22 or in a validation dataset (Validation Dataset) corresponding to one of the corresponding machine learning models 22, and the validation atlas is stored in a centralized manner There are multiple images of good products and defective products that have been confirmed (for example, have been labeled). More specifically, during the model training process of each machine learning model, the corresponding training atlas is used for model training, and the corresponding verification atlas is used to verify the training results. By "randomly" storing the images to be tested that are judged as good or defective by the machine learning model into the corresponding training atlas or the design in the verification atlas, it will be possible to avoid adding too many waits to the training atlas. After the machine learning model is trained again, the problem of over-learning (Overfitting) occurs.

上述本發明的分類方法及分類系統中的N個機器學習模型,可以是利用卷積神經網路(Convolutional Neural Network,CNN)模型,配合N個訓練圖集及N個驗證圖集,進行訓練來生成,但各個機器學習模型21不侷限於利用卷積神經網路模型生成。在實際實施中,處理裝置2或是儲存裝置3可以是預先儲存有三個不同深度的卷積神經網路模型,在對N個機器學習模型21進行模型訓練時,處理裝置2例如可以是先依據N個預設瑕疵類別所對應的訓練圖集,判斷N個訓練圖中所存在的瑕疵的難易度(例如是利用瑕疵面積標準差、瑕疵灰階值標準差、瑕疵長寬比等),而後,處理裝置2將依據判斷結果於三個不同深度的卷積神經網路模型中擇一作為生成N個機器學習模型21的基本模型。The N machine learning models in the above-mentioned classification method and classification system of the present invention can be trained by using a Convolutional Neural Network (CNN) model with N training atlases and N verification atlases. However, each machine learning model 21 is not limited to being generated using a convolutional neural network model. In actual implementation, the processing device 2 or the storage device 3 may be pre-stored with three convolutional neural network models of different depths. When performing model training on the N machine learning models 21, the processing device 2 may be based on The training atlas corresponding to the N preset defect categories to determine the difficulty of the defects in the N training images (for example, using the standard deviation of the defect area, the standard deviation of the gray scale value of the defect, the aspect ratio of the defect, etc.), and then The processing device 2 selects one of three convolutional neural network models of different depths as a basic model for generating N machine learning models 21 according to the judgment result.

若是處理裝置2選擇其中一個深度相對較低的卷積神經網路模型配合N個訓練圖集及N個驗證圖集,生成N個機器學習模型21,且超過預定數量的機器學習模型的準確度(Accuracy)、精確率(Precision)或召回率(Recall)未達預定的標準時,處理裝置2則可以是改用深度相對較深的卷積神經網路模型,再重新配合N個訓練圖集及N個驗證圖集,以重新生成新的N個機器學習模型。在實際應用中,處理裝置2可以是反覆地更換卷積神經網路模型,直到生成N個符合預定準確度的機器學習模型21。If the processing device 2 selects one of the convolutional neural network models with relatively low depth to cooperate with N training atlases and N verification atlases to generate N machine learning models 21, and the accuracy of the predetermined number of machine learning models is exceeded (Accuracy), Precision (Precision), or Recall (Recall) does not reach the predetermined standard, the processing device 2 can switch to a relatively deep convolutional neural network model, and then re-coordinate with N training atlases and N verification atlases to regenerate new N machine learning models. In practical applications, the processing device 2 may repeatedly change the convolutional neural network model until N machine learning models 21 meeting the predetermined accuracy are generated.

補充說明的是,上述所指不同深度的卷積神經網路模型,是表示三個卷積神經網路模型具有不同數量的卷積層(Convolution Layer)、池化層(Pooling Layer)及全連接層(Fully connection Layer),舉例來說,深度較低的卷積神經網路模型可以是依據具有第一卷積層、第一池化層、第二卷積層、第二池化層及全連接層,深度較深的卷積神經網路模型可以是依據具有第一卷積層、第一池化層、第二卷積層、第二池化層、第三卷積層、第三池化層、第一全連接層及第二全連接層。In addition, the above-mentioned convolutional neural network models of different depths mean that the three convolutional neural network models have different numbers of convolution layers (Convolution Layer), pooling layer (Pooling Layer), and fully connected layer (Fully connection Layer), for example, a low-depth convolutional neural network model can be based on having a first convolutional layer, a first pooling layer, a second convolutional layer, a second pooling layer, and a fully connected layer. The deeper convolutional neural network model can be based on the first convolutional layer, the first pooling layer, the second convolutional layer, the second pooling layer, the third convolutional layer, the third pooling layer, and the first full The connection layer and the second fully connected layer.

值得一提的是,在不同的實施例中,於所述影像分類步驟S12及所述載入步驟S21之間,還可以是包含有一影像切割步驟,所述影像切割步驟包含:利用自動光學檢測裝置1或處理裝置2,對所述待測影像進行分割,以由所述待測影像中切割出一瑕疵影像,而於所述載入步驟S21中所載入的待測影像,則是所述瑕疵影像。舉例來說,假設自動光學檢測裝置1對待測物進行影像擷取而產生的待測影像為1000像素*1000像素,而後,若自動光學檢測裝置1判斷待測影像中,出現長度為100像素且瑕疵對應圖樣的長寬比為100:1的瑕疵,則自動光學檢測裝置1將待測影像切割為200像素*200像素的瑕疵影像,而所述瑕疵影像中則是包含有長度為100像素且瑕疵對應圖樣的長寬比為100:1的瑕疵,接著,於所述載入步驟S21中,則是載入200像素*200像素的瑕疵影像至相對應的機器學習模型中。依上所述,通過所述影像切割步驟的設計,將可以加速機器學習模型進行影像辨識的速度。It is worth mentioning that in different embodiments, between the image classification step S12 and the loading step S21, an image cutting step may also be included, and the image cutting step includes: using automatic optical inspection The device 1 or the processing device 2 divides the image to be tested to cut out a defect image from the image to be tested, and the image to be tested loaded in the loading step S21 is Describe the flawed image. For example, suppose that the automatic optical inspection device 1 performs image capture on the object to be tested and the image to be tested is 1000 pixels*1000 pixels, and then, if the automatic optical inspection device 1 determines that the image to be tested has a length of 100 pixels and If the defect corresponds to a defect with a 100:1 aspect ratio of the pattern, the automatic optical inspection device 1 cuts the image to be tested into a defect image of 200 pixels*200 pixels, and the defect image contains 100 pixels in length and The defect corresponds to the defect with the aspect ratio of the pattern of 100:1. Then, in the loading step S21, the defect image of 200 pixels*200 pixels is loaded into the corresponding machine learning model. As mentioned above, through the design of the image cutting step, the speed of image recognition by the machine learning model can be accelerated.

另外,在分類方法包含所述影像切割步驟及訓練集擴充步驟的實施例中,被存入於其中一個機器學習模型22所對應的訓練圖集31中的影像即為所述瑕疵影像。In addition, in an embodiment where the classification method includes the image cutting step and the training set expansion step, the image stored in the training atlas 31 corresponding to one of the machine learning models 22 is the defect image.

綜上所述,本發明的分類方法及分類系統通過自動光學檢測裝置分類步驟及機器學習分類步驟等設計,以及使被判定屬於不同預設瑕疵類別的待測影像,利用相對應的機器學習模型進行再次確認等設計,可以大幅改善習知僅利用自動光學檢測裝置進行待測物分類時,自動光學檢測裝置容易發生誤判的問題。In summary, the classification method and classification system of the present invention are designed through automatic optical inspection device classification steps and machine learning classification steps, and make the images to be tested that are judged to belong to different preset defect categories, using corresponding machine learning models Designs such as reconfirmation can greatly improve the problem that the automatic optical inspection device is prone to misjudgment when the conventional automatic optical inspection device is used to classify the object to be tested.

以上所述僅為本發明的較佳可行實施例,非因此侷限本發明的專利範圍,故舉凡運用本發明說明書及圖式內容所做的等效技術變化,均包含於本發明的保護範圍內。The above descriptions are only the preferred and feasible embodiments of the present invention, which do not limit the scope of the present invention. Therefore, all equivalent technical changes made by using the description and drawings of the present invention are included in the protection scope of the present invention. .

100:分類系統 1:自動光學檢測裝置 11:影像擷取器 111:待測影像 2:處理裝置 21:預設灰階規則 22、22A、22B、22C:機器學習模型 23:提示資訊 3:儲存裝置 31:訓練圖集 311:良品圖檔 312:不良品訓練圖檔 4:分類裝置 5:輸入裝置 51:判定結果資訊 100: Classification system 1: Automatic optical inspection device 11: Image grabber 111: Image to be tested 2: Processing device 21: Preset grayscale rules 22, 22A, 22B, 22C: machine learning model 23: Information 3: storage device 31: Training Atlas 311: Good product image file 312: Bad product training image file 4: Sorting device 5: Input device 51: Judgment result information

圖1為本發明的分類系統的方塊示意圖。Figure 1 is a block diagram of the classification system of the present invention.

圖2為本發明的分類方法的自動光學檢測裝置分類步驟的流程示意圖。2 is a schematic flow chart of the classification steps of the automatic optical inspection device of the classification method of the present invention.

圖3為本發明的分類方法的其中一個實際例子的說明示意圖。Fig. 3 is an explanatory diagram of an actual example of the classification method of the present invention.

圖4為通過二值化處理後的待測影像的其中一個實際例的示意圖。FIG. 4 is a schematic diagram of an actual example of the image to be measured after the binarization process.

圖5為通過二值化處理的待測影像的其中一個實施例的示意圖。FIG. 5 is a schematic diagram of one embodiment of the image to be measured through binarization processing.

圖6為本發明的分類方法的機器學習分類步驟的流程示意圖。FIG. 6 is a schematic flowchart of the machine learning classification step of the classification method of the present invention.

圖7為本發明的分類系統的儲存裝置的其中一個實施例的方塊示意圖。FIG. 7 is a block diagram of one embodiment of the storage device of the classification system of the present invention.

圖8為本發明的分類方法的其中一個實際例子的說明示意圖。Fig. 8 is an explanatory diagram of an actual example of the classification method of the present invention.

圖9為發明的分類方法的機器學習分類步驟的另一實施例的流程示意圖。FIG. 9 is a schematic flowchart of another embodiment of the machine learning classification step of the inventive classification method.

圖10為本發明的分類方法的其中一個實際例子的說明示意圖。Fig. 10 is an explanatory diagram of an actual example of the classification method of the present invention.

圖11為通過二值化處理的待測影像的其中一個實施例的示意圖。FIG. 11 is a schematic diagram of one embodiment of the image to be measured through binarization processing.

圖12為待測影像的其中一個實施例的示意圖。FIG. 12 is a schematic diagram of one embodiment of the image to be measured.

100:分類系統 100: Classification system

1:自動光學檢測裝置 1: Automatic optical inspection device

11:影像擷取器 11: Image grabber

111:待測影像 111: Image to be tested

2:處理裝置 2: Processing device

21:預設灰階規則 21: Preset grayscale rules

22:機器學習模型 22: Machine learning model

23:提示資訊 23: Information

3:儲存裝置 3: storage device

31:訓練圖集 31: Training Atlas

311:良品圖檔 311: Good product image file

312:不良品訓練圖檔 312: Bad product training image file

4:分類裝置 4: Sorting device

5:輸入裝置 5: Input device

51:判定結果資訊 51: Judgment result information

Claims (10)

一種分類方法,其適用於一分類系統,所述分類系統包含一自動光學檢測裝置、一處理裝置及一分類裝置,所述分類系統能執行所述分類方法以將一待測物分類至一良品區或一不良品區,所述分類方法包含:一自動光學檢測裝置分類步驟,其包含:一影像擷取步驟:利用所述自動光學檢測裝置,對所述待測物進行一影像擷取,以產生一待測影像;一影像分類步驟:利用所述自動光學檢測裝置或所述處理裝置分析所述待測影像,以判斷所述待測影像屬於一良品類別及N個預設瑕疵類別中的哪一類;其中,N為大於1的正整數;若判斷所述待測影像屬於所述良品類別,則利用所述分類裝置將所述待測物移載至所述良品區;若判斷所述待測影像屬於N個所述預設瑕疵類別中的其中一類,則執行一機器學習分類步驟;所述處理裝置儲存有對應於N個所述預設瑕疵類別的N個機器學習模型,N個所述機器學習模型是分別利用不完全相同的一訓練圖集(training set)進行模型訓練,且各個所述訓練圖檔包含對應於N個所述預設瑕疵類別中的其中一類的多個訓練圖檔及至少一個良品圖檔;所述機器學習分類步驟包含:一載入步驟:依據所述影像分類步驟的分類結果,將所述待測影像載入至相對應的其中一個所述機器學習模型中; 一判斷步驟:利用載入有所述待測影像的所述機器學習模型,判斷所述待測影像為一覆判良品或一不良品;若利用載入有所述待測影像的所述機器學習模型判斷所述待測影像為所述覆判良品,則利用所述分類裝置將所述待測物移載至所述良品區;若利用載入有所述待測影像的所述機器學習模型判斷所述待測影像為所述不良品,則利用所述分類裝置將所述待測物移載至所述不良品區。 A classification method, which is suitable for a classification system, the classification system includes an automatic optical detection device, a processing device and a classification device, the classification system can execute the classification method to classify a test object into a good product Area or a defective product area, the classification method includes: an automatic optical inspection device classification step, which includes: an image capturing step: using the automatic optical inspection device to perform an image capture of the object under test, To generate an image to be tested; an image classification step: use the automatic optical inspection device or the processing device to analyze the image to be tested to determine that the image to be tested belongs to a good product category and N preset defect categories Which type of; where N is a positive integer greater than 1; if it is determined that the image to be tested belongs to the good product category, the classification device is used to transfer the object to be tested to the good product area; If the image to be tested belongs to one of the N preset defect categories, a machine learning classification step is performed; the processing device stores N machine learning models corresponding to the N preset defect categories, and N Each of the machine learning models uses a training set (training set) that is not exactly the same for model training, and each of the training images includes a plurality of types corresponding to one of the N preset defect categories. Training image files and at least one good image file; the machine learning classification step includes: a loading step: according to the classification result of the image classification step, the image to be tested is loaded to one of the corresponding machines In the learning model; A determination step: using the machine learning model loaded with the image to be tested to determine whether the image to be tested is a good product or a defective product; if the machine loaded with the image to be tested is used If the learning model determines that the image to be tested is the good product for review, the classification device is used to transfer the object to be tested to the good product area; if the machine learning loaded with the image to be tested is used The model determines that the image to be tested is the defective product, and then uses the classification device to transfer the object to be tested to the defective product area. 如請求項1所述的分類方法,其中,所述分類系統還包含一儲存裝置,所述儲存裝置儲存有多個所述訓練圖集,所述分類方法還包含一訓練集擴充步驟:將被所述機器學習模型判斷為所述覆判良品或所述不良品的所述待測影像,依據所述影像分類步驟的分類結果,存入相對應的其中一個所述機器學習模型所對應的所述訓練圖集中。 The classification method according to claim 1, wherein the classification system further includes a storage device storing a plurality of the training atlases, and the classification method further includes a training set expansion step: The machine learning model determines that the image to be tested is the good product or the defective product. According to the classification result of the image classification step, it is stored in the corresponding one of the machine learning models. Described in the training atlas. 如請求項1所述的分類方法,其中,所述分類系統還包含一儲存裝置,所述儲存裝置儲存有多個所述訓練圖集,所述分類方法還包含一訓練集擴充步驟:將被所述機器學習模型判斷為所述不良品的所述待測影像,依據所述影像分類步驟的分類結果,隨機地存入相對應的其中一個所述機器學習模型所對應的所述訓練圖集或是相對應的其中一個所述機器學習模型所對應的一驗證圖集;各個所述驗證圖集包含各個所述機器學習模型進行模型驗證時所使用的多個驗證圖檔。 The classification method according to claim 1, wherein the classification system further includes a storage device storing a plurality of the training atlases, and the classification method further includes a training set expansion step: According to the classification result of the image classification step, the machine learning model determines that the image to be tested is the defective product, and randomly stores the corresponding training atlas corresponding to one of the machine learning models Or a verification atlas corresponding to one of the corresponding machine learning models; each of the verification atlases includes a plurality of verification images used by each of the machine learning models for model verification. 如請求項1所述的分類方法,其中,所述分類系統能利用所述分類方法將所述待測物分類至所述良品區、所述不良品區或一未知品區,所述分類系統包含一輸入裝置,所述 輸入裝置鄰近於所述未知品區設置;於所述判斷步驟中,是利用所述機器學習模型判斷所述待測影像為所述覆判良品、所述不良品或一未知品;若所述機器學習模型判斷所述待測影像為所述未知品,則利用所述分類裝置將所述待測物移載至所述未知品區,並發出一提示資訊,以提醒覆判人員對設置於所述未知品區的所述待測物進行人工查驗;若設置於所述未知區的所述待測物經人工查驗,且所述輸入裝置被操作而產生一判定結果資訊,而所述處理裝置依據所述判定結果資訊判定所述待測物屬於N個所述預設瑕疵類別中的其中一類,則所述處理裝置將所述待測影像儲存於相對應的所述預設瑕疵類別對應的所述機器學習模型的所述訓練圖集中,且所述處理裝置將依據所述判定結果資訊控制所述分類裝置將所述待測物移載至所述不良品區。 The classification method according to claim 1, wherein the classification system can use the classification method to classify the test object into the good product area, the defective product area or an unknown product area, and the classification system Includes an input device, the The input device is arranged adjacent to the unknown product area; in the determining step, the machine learning model is used to determine that the image to be tested is the good product, the defective product, or an unknown product; The machine learning model determines that the image to be tested is the unknown product, and then uses the classification device to transfer the object to be tested to the unknown product area, and sends out a prompt message to remind reviewers to The object to be tested in the unknown area is manually inspected; if the object to be tested placed in the unknown area is manually inspected and the input device is operated to generate a determination result information, the processing The device determines that the object to be tested belongs to one of the N preset defect categories according to the determination result information, and the processing device stores the image to be tested in the corresponding preset defect category The training atlas of the machine learning model of, and the processing device will control the classification device to transfer the object to be tested to the defective product area according to the determination result information. 如請求項1所述的分類方法,其中,所述處理裝置儲存有對應於N個所述預設瑕疵類別的N筆預設灰階規則;於所述影像分類步驟中,所述自動光學檢測裝置將先計算所述待測影像中的至少一區域內的所有像素的一灰階值,而後,所述自動光學檢測裝置將判斷至少一所述區域內的所有像素的所述灰階值是否符合N筆預設灰階規則;若所述自動光學檢測裝置判斷至少一所述區域內的所有像素的所述灰階值,符合其中一個所述預設灰階規則,則判定所述待測影像屬於所述預設灰階規則所對應的所述預設瑕疵類別。 The classification method according to claim 1, wherein the processing device stores N preset grayscale rules corresponding to the N preset defect categories; in the image classification step, the automatic optical detection The device will first calculate a grayscale value of all pixels in at least one area in the image to be measured, and then, the automatic optical detection device will determine whether the grayscale value of all pixels in at least one area is Meets N preset gray-scale rules; if the automatic optical detection device determines that the gray-scale values of all pixels in at least one of the regions meet one of the preset gray-scale rules, then determine the to-be-tested The image belongs to the preset defect category corresponding to the preset grayscale rule. 一種分類系統,其包含:一自動光學檢測裝置、一處理裝置及一分類裝置,所述分類系統能執行如請求項1所述的分類方法。 A classification system, comprising: an automatic optical inspection device, a processing device, and a classification device. The classification system can execute the classification method described in claim 1. 如請求項6所述的分類系統,其中,所述分類系統還包含一儲存裝置,所述儲存裝置儲存有多個所述訓練圖集,所述分類方法還包含一訓練集擴充步驟:將被所述機器學習模型判斷為所述覆判良品或不良品的所述待測影像,依據所述影像分類步驟的分類結果,存入相對應的其中一個所述機器學習模型所對應的所述訓練圖集中。 The classification system according to claim 6, wherein the classification system further includes a storage device storing a plurality of the training atlases, and the classification method further includes a training set expansion step: The machine learning model judges the image to be tested as the good product or the defective product, and according to the classification result of the image classification step, it is stored in the training corresponding to one of the machine learning models. Atlas. 如請求項6所述的分類系統,其中,所述分類系統還包含一儲存裝置,所述儲存裝置儲存有多個所述訓練圖集,所述分類方法還包含一訓練集擴充步驟:將被所述機器學習模型判斷為所述不良品的所述待測影像,依據所述影像分類步驟的分類結果,隨機地存入相對應的其中一個所述機器學習模型所對應的所述訓練圖集或是相對應的其中一個所述機器學習模型所對應的一驗證圖集;各個所述驗證圖集包含各個所述機器學習模型進行模型驗證時所使用的多個驗證圖檔。 The classification system according to claim 6, wherein the classification system further includes a storage device storing a plurality of the training atlases, and the classification method further includes a training set expansion step: According to the classification result of the image classification step, the machine learning model determines that the image to be tested is the defective product, and randomly stores the corresponding training atlas corresponding to one of the machine learning models Or a verification atlas corresponding to one of the corresponding machine learning models; each of the verification atlases includes a plurality of verification images used by each of the machine learning models for model verification. 如請求項6所述的分類系統,其中,所述分類系統能利用所述分類方法將所述待測物分類至所述良品區、所述不良品區或一未知品區,所述分類系統包含一輸入裝置,所述輸入裝置鄰近於所述未知品區設置;於所述判斷步驟中,是利用所述機器學習模型判斷所述待測影像為所述覆判良品、所述不良品或一未知品;若所述機器學習模型判斷所述待測影像為所述未知品,則利用所述分類裝置將所述待測物移載至所述未知品區,並發出一提示資訊,以提醒覆判人員對設置於所述未知品區的所述待測物進行人工查驗;若設置於所述未知區的所述待測物經人工查驗,且所述輸入裝置被操作而產生一判定結果資訊,而所述處理裝置依據所述判定結果資訊判定所述待測物屬於N個所述預 設瑕疵類別中的其中一類,則所述處理裝置將所述待測影像儲存於相對應的所述預設瑕疵類別對應的所述機器學習模型的所述訓練圖集中,且所述處理裝置將依據所述判定結果資訊控制所述分類裝置將所述待測物移載至所述不良品區。 The classification system according to claim 6, wherein the classification system can use the classification method to classify the test object into the good product area, the defective product area or an unknown product area, and the classification system An input device is included, and the input device is arranged adjacent to the unknown product area; in the determining step, the machine learning model is used to determine that the image to be tested is the good product, the defective product, or An unknown product; if the machine learning model determines that the image to be tested is the unknown product, the classification device is used to transfer the object to be tested to the unknown product area, and a prompt message is issued to Remind the judges to perform manual inspection of the test object set in the unknown area; if the test object set in the unknown area is manually inspected and the input device is operated to produce a judgment Result information, and the processing device determines that the object under test belongs to the N number of predictions based on the determination result information. Set one of the defect categories, the processing device stores the image to be tested in the training atlas of the machine learning model corresponding to the preset defect category, and the processing device will According to the determination result information, the classification device is controlled to transfer the object to be tested to the defective product area. 如請求項6所述的分類系統,其中,所述處理裝置儲存有對應於N個所述預設瑕疵類別的N筆預設灰階規則;於所述影像分類步驟中,所述自動光學檢測裝置將先計算所述待測影像中的至少一區域內的所有像素的一灰階值,而後,所述自動光學檢測裝置將判斷至少一所述區域內的所有像素的所述灰階值是否符合N筆預設灰階規則;若所述自動光學檢測裝置判斷至少一所述區域內的所有像素的所述灰階值,符合其中一個所述預設灰階規則,則判定所述待測影像屬於所述預設灰階規則所對應的所述預設瑕疵類別。 The classification system according to claim 6, wherein the processing device stores N preset grayscale rules corresponding to the N preset defect categories; in the image classification step, the automatic optical detection The device will first calculate a grayscale value of all pixels in at least one area in the image to be measured, and then, the automatic optical detection device will determine whether the grayscale value of all pixels in at least one area is Meets N preset gray-scale rules; if the automatic optical detection device determines that the gray-scale values of all pixels in at least one of the regions meet one of the preset gray-scale rules, then determine the to-be-tested The image belongs to the preset defect category corresponding to the preset grayscale rule.
TW109111742A 2020-04-08 2020-04-08 Classification method and a classification system TWI722861B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109111742A TWI722861B (en) 2020-04-08 2020-04-08 Classification method and a classification system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109111742A TWI722861B (en) 2020-04-08 2020-04-08 Classification method and a classification system

Publications (2)

Publication Number Publication Date
TWI722861B true TWI722861B (en) 2021-03-21
TW202138785A TW202138785A (en) 2021-10-16

Family

ID=76036146

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109111742A TWI722861B (en) 2020-04-08 2020-04-08 Classification method and a classification system

Country Status (1)

Country Link
TW (1) TWI722861B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114002225A (en) * 2021-10-19 2022-02-01 业成科技(成都)有限公司 Optical detection system and method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101210889A (en) * 2006-12-30 2008-07-02 大元科技股份有限公司 Holographic type automatic optical detection system and method
TW201930908A (en) * 2018-01-05 2019-08-01 財團法人工業技術研究院 Board defect filtering method and device thereof and computer-readabel recording medium
TWI692700B (en) * 2017-10-05 2020-05-01 敖翔科技股份有限公司 Smart defect calibration system and the method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101210889A (en) * 2006-12-30 2008-07-02 大元科技股份有限公司 Holographic type automatic optical detection system and method
TWI692700B (en) * 2017-10-05 2020-05-01 敖翔科技股份有限公司 Smart defect calibration system and the method thereof
TW201930908A (en) * 2018-01-05 2019-08-01 財團法人工業技術研究院 Board defect filtering method and device thereof and computer-readabel recording medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114002225A (en) * 2021-10-19 2022-02-01 业成科技(成都)有限公司 Optical detection system and method
CN114002225B (en) * 2021-10-19 2023-05-12 业成科技(成都)有限公司 Optical detection system and method

Also Published As

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

Similar Documents

Publication Publication Date Title
CN109934814B (en) Surface defect detection system and method thereof
US11017259B2 (en) Defect inspection method, defect inspection device and defect inspection system
EP3502966B1 (en) Data generation apparatus, data generation method, and data generation program
JP4616864B2 (en) Appearance inspection method and apparatus, and image processing evaluation system
TWI557650B (en) System and method for identifying defects in a material
KR102058427B1 (en) Apparatus and method for inspection
US11313806B2 (en) Defect inspection method and defect inspection device
KR100598381B1 (en) in-line typed apparatus for auto wafer-defect classification and control method thereof
JP2018036241A (en) Inspection method, inspection device, inspection program and recording medium
CN114266743A (en) FPC defect detection method, system and storage medium based on HSV and CNN
TWI722861B (en) Classification method and a classification system
JP2021143884A (en) Inspection device, inspection method, program, learning device, learning method, and trained dataset
TWI694250B (en) Surface defect detection system and method thereof
CN116542984A (en) Hardware defect detection method, device, computer equipment and storage medium
JP2007285880A (en) Sample image registration method in board inspection, and sample image producing system
JP7298176B2 (en) Defect inspection device and trained model
JP5405245B2 (en) Image inspection method and image inspection apparatus
US11176419B1 (en) Method for labeling image
CN114226262A (en) Flaw detection method, flaw classification method and flaw detection system
JP2981434B2 (en) Pattern defect detection method and apparatus
Mansano et al. Inspection of metallic surfaces using local binary patterns
KR20190119801A (en) Vehicle Headlight Alignment Calibration and Classification, Inspection of Vehicle Headlight Defects
CN105277569B (en) Route board detecting method based on three-dimensional feature
KR20230036650A (en) Defect detection method and system based on image patch
JP3652589B2 (en) Defect inspection equipment