TW202035975A - Surface defect detection system and method thereof - Google Patents

Surface defect detection system and method thereof Download PDF

Info

Publication number
TW202035975A
TW202035975A TW108109545A TW108109545A TW202035975A TW 202035975 A TW202035975 A TW 202035975A TW 108109545 A TW108109545 A TW 108109545A TW 108109545 A TW108109545 A TW 108109545A TW 202035975 A TW202035975 A TW 202035975A
Authority
TW
Taiwan
Prior art keywords
image
defect
bounding box
computing device
deep learning
Prior art date
Application number
TW108109545A
Other languages
Chinese (zh)
Other versions
TWI694250B (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 TW108109545A priority Critical patent/TWI694250B/en
Application granted granted Critical
Publication of TWI694250B publication Critical patent/TWI694250B/en
Publication of TW202035975A publication Critical patent/TW202035975A/en

Links

Images

Abstract

A surface defect detection method applied to a suface of an object is disclosed. The method includes obtaining an image of the surface, performing a deep learning algorithm by a computing device to set a plurality of bounding boxes in the image and to output a plurality of feature parameters associated with the plurality of bounding boxes, with each bounding box enclosing a possible defect of the surface, and performing a classifying algorithm by the computing device according to the bounding boxes and the feature parameters to determine whether the surface conforms to a specification.

Description

表面缺陷偵測系統及其方法Surface defect detection system and method

本發明係關於缺陷檢測,特別是一種用於物件的表面的缺陷偵測系統及其方法。The present invention relates to defect detection, in particular to a defect detection system and method for the surface of an object.

在例如筆記型電腦或平板電腦之類的電腦出貨之前,必須由品管人員檢查是否有表面缺陷。品管人員檢查是否有規格文件中定義的刮痕、凹痕或其他表面缺陷。如果表面缺陷的類型及其嚴重程度超出規格中允許的範圍,則此電腦被認為是不合格;反之,如果表面缺陷的類型及其嚴重程度落在規格中允許的範圍內,則此電腦「通過」表面缺陷檢測。Before computers such as laptops or tablets are shipped, quality control personnel must check for surface defects. The quality control personnel checks whether there are scratches, dents or other surface defects defined in the specification documents. If the type and severity of the surface defect exceeds the range allowed in the specification, the computer is considered unqualified; on the contrary, if the type and severity of the surface defect falls within the range allowed in the specification, the computer "passes "Surface defect detection.

傳統上,表面缺陷檢測由人工檢測員執行。他們閱讀並遵循檢測規格文件以決定受檢的電腦是否通過。這種表面缺陷檢查工作不只需要大量的人力,而且採用人工檢測員還有三個缺點。Traditionally, surface defect detection is performed by human inspectors. They read and follow the inspection specification documents to determine whether the inspected computer passes. This kind of surface defect inspection not only requires a lot of manpower, but there are three disadvantages of using manual inspectors.

第一是「不精確」。人眼無法進行精確測量,尤其是在非常小的範圍內。即使比較兩個相似的物體,人眼也可能沒發現一個物體略小於另一個物體。這點同樣體現在例如表面粗糙度,尺寸以及任何需要測量的其他因素。儘管檢測規格文件的形式通常係尺寸閾值,但人類視覺仍無法作為完成任務的精確工具。The first is "inaccuracy." The human eye cannot make accurate measurements, especially in a very small range. Even when comparing two similar objects, the human eye may not find that one object is slightly smaller than the other. This is also reflected in the surface roughness, size and any other factors that need to be measured. Although the form of the inspection specification file is usually the size threshold, human vision still cannot be used as an accurate tool to complete the task.

第二是「不可靠」。判斷檢測規格中定義的某些表面缺陷需要非常精細的視覺。檢測可以非常複雜,例如:極小的尺寸;或者非常棘手,例如:容易與電腦表面紋理混淆。另外,眾所周知人類的眼睛可能被錯覺欺騙。因此,人類視覺檢查不總是可靠。The second is "unreliable". Judging certain surface defects defined in inspection specifications requires very fine vision. Detection can be very complicated, such as extremely small size; or very tricky, such as easily confused with computer surface texture. In addition, it is well known that human eyes can be deceived by illusions. Therefore, human visual inspection is not always reliable.

第三是「不一致」。人類容易疲勞或注意力不集中。例如,當人工檢測員輪班即將結束時,他或她可能會感到疲倦或失焦,因此沒檢測出表面缺陷,而將有缺陷的電腦當作正常產品放行。從檢查站出來的電腦品質隨著時間改變。不同的人工檢測員也有不同的判斷標準,從而導致檢查站出來的產品質量變動。The third is "inconsistency". Humans are prone to fatigue or inattention. For example, when a manual inspector's shift is about to end, he or she may feel tired or out of focus, so the surface defect is not detected, and the defective computer is released as a normal product. The quality of computers coming out of the checkpoint changes over time. Different manual inspectors also have different judgment standards, which leads to changes in the quality of products coming out of the inspection station.

另一方面,在傳統用於SMT產線或印刷電路板的缺陷檢測方式例如模板匹配(template matching)或電腦視覺(computer vision)等技術。然而,上述技術容易出現幾何套合誤差(geometric registration error),而且在缺陷類型數量增加時也難以更新配置,而當缺陷無法用幾何語言或規則精確描述時,上述技術也無法因應。雖然,人工檢測員仍然可以發現未對齊樣本中的缺陷,或規則不易描述的缺陷,例如指紋或污垢造成的表面污染,以及磨損或划痕造成的缺陷。然而,人工檢測員也有前文述及的缺點。整體而言,無論是人工檢測員、模板匹配或是電腦視覺技術皆無法完全勝任表面缺陷偵測流程中所有需求。On the other hand, the traditional defect detection methods used in SMT production lines or printed circuit boards, such as template matching or computer vision, are technologies. However, the above technologies are prone to geometric registration errors, and it is difficult to update the configuration when the number of defect types increases, and when the defects cannot be accurately described in geometric language or rules, the above technology cannot respond. Although, manual inspectors can still find defects in misaligned samples, or defects that are not easily described by rules, such as surface contamination caused by fingerprints or dirt, and defects caused by wear or scratches. However, manual inspectors also have the disadvantages mentioned above. On the whole, neither manual inspectors, template matching, or computer vision technology can fully meet all requirements in the surface defect detection process.

有鑑於此,本發明提出基於機器學習(machine learning,ML)為基礎的視覺辨識系統用於電腦的表面缺陷檢測。本發明包含系統及方法以達到自動表面缺陷檢測及分類的目標。In view of this, the present invention proposes a machine learning (ML)-based visual recognition system for computer surface defect detection. The invention includes systems and methods to achieve the goal of automatic surface defect detection and classification.

依據本發明一實施例所敘述的一種表面缺陷偵測方法,適用於一物件之一表面,所述的方法包括:以一攝像裝置取得該表面之一影像;以一計算裝置執行一深度學習演算法以從該影像中選取一定界框及輸出關聯於該定界框的一特徵參數,其中該定界框中包含該表面之一缺陷;以及以該計算裝置根據該定界框及該特徵參數執行一分類判定演算法,以決定該表面是否符合一規格。According to an embodiment of the present invention, a surface defect detection method is applicable to a surface of an object. The method includes: obtaining an image of the surface with a camera; and executing a deep learning algorithm with a computing device The method is to select a certain bounding box from the image and output a characteristic parameter related to the bounding box, wherein the bounding box contains a defect on the surface; and using the computing device according to the bounding box and the characteristic parameter A classification algorithm is executed to determine whether the surface meets a specification.

依據本發明一實施例所敘述的一種表面缺陷偵測系統,適用於一物件之一表面,所述的系統包括:一攝像裝置,用以取得該表面之一影像;一計算裝置,電性連接該攝像裝置,該計算裝置用以執行一深度學習演算法以從該影像中選取一定界框及輸出關聯於該定界框的一特徵參數,其中該定界框中包含該表面之一缺陷;該計算裝置更用以根據該定界框及該特徵參數執行一分類判定演算法,以決定該表面是否符合一規格;以及一後端處理裝置,電性連接該計算裝置,該後端處理裝置用以根據該計算裝置之判定結果執行關聯於該表面之作動。According to an embodiment of the present invention, a surface defect detection system is applicable to a surface of an object. The system includes: a camera device for obtaining an image of the surface; a computing device electrically connected The camera device and the computing device are used to execute a deep learning algorithm to select a bounding box from the image and output a characteristic parameter associated with the bounding box, wherein the bounding box contains a defect on the surface; The computing device is further used to execute a classification determination algorithm based on the bounding box and the characteristic parameter to determine whether the surface meets a specification; and a back-end processing device electrically connected to the computing device, the back-end processing device It is used to perform actions related to the surface according to the judgment result of the computing device.

藉由上述架構,本發明所提出的基於深度學習的系統係模仿人類視覺系統,只要提供樣本訓練影像,便能夠檢測到規則難以描述的模糊缺陷。此外,基於機器學習的表面缺陷檢測更能夠檢測出各種不斷增加的缺陷,而不會犧牲檢測性能以及速度。With the above architecture, the deep learning-based system proposed by the present invention imitates the human visual system. As long as sample training images are provided, it can detect fuzzy defects that are difficult to describe by rules. In addition, surface defect detection based on machine learning is more capable of detecting a variety of increasing defects without sacrificing detection performance and speed.

本發明所提出的基於深度學習的表面缺陷偵測系統及其方法比傳統的計算機視覺方法更能夠找到細微的缺陷。此外,本發明避免了人工檢測員的不精確、不可靠及不一致的缺點。在實際產線上,人工檢測員可依據檢測規範而容忍一定程度的缺陷。本發明在執行分配判定演算法時,同樣可基於機器學習的機制,從產線上的資料中學習而達到客製化判定的功效。The surface defect detection system and method based on deep learning proposed by the present invention can find subtle defects better than traditional computer vision methods. In addition, the present invention avoids the shortcomings of inaccuracy, unreliability and inconsistency of manual inspectors. In the actual production line, manual inspectors can tolerate a certain degree of defects according to the inspection specifications. When the present invention executes the allocation judgment algorithm, it can also learn from the data on the production line based on the machine learning mechanism to achieve the effect of customized judgment.

本發明所進行的缺陷檢測和分類可直接在產線上進行,而不必將影像資料發送到雲端伺服器去進行缺陷檢測。因此可不計入傳輸上的延遲。並且由於所有的檢測及分類運算皆是在本地端執行,因此傳輸大型影像資訊的成本及影像資料的安全性皆因此改善。The defect detection and classification performed by the present invention can be directly performed on the production line without sending the image data to the cloud server for defect detection. Therefore, the delay in transmission is not counted. And since all detection and classification operations are performed locally, the cost of transmitting large image information and the security of image data are improved.

本發明所揭露的表面缺陷偵測系統及其方法,透過深度學習演算法圈選出物件的表面上的缺陷,再由分類判定演算法依據規格文件判定該物件的表面是否可通過表面缺陷測試。本發明可以偵測出各種式樣的表面缺陷避免人工檢測帶來的不精確、不可靠及不一致等缺點,並且維持快速的偵測速度。In the surface defect detection system and method disclosed in the present invention, the defects on the surface of the object are circled through the deep learning algorithm, and then the classification judgment algorithm determines whether the surface of the object can pass the surface defect test according to the specification file. The invention can detect various styles of surface defects to avoid the shortcomings of inaccuracy, unreliability and inconsistency caused by manual detection, and maintain a fast detection speed.

以上之關於本揭露內容之說明及以下之實施方式之說明係用以示範與解釋本發明之精神與原理,並且提供本發明之專利申請範圍更進一步之解釋。The above description of the content of the disclosure and the description of the following embodiments are used to demonstrate and explain the spirit and principle of the present invention, and to provide a further explanation of the patent application scope of the present invention.

以下在實施方式中詳細敘述本發明之詳細特徵以及優點,其內容足以使任何熟習相關技藝者了解本發明之技術內容並據以實施,且根據本說明書所揭露之內容、申請專利範圍及圖式,任何熟習相關技藝者可輕易地理解本發明相關之目的及優點。以下之實施例係進一步詳細說明本發明之觀點,但非以任何觀點限制本發明之範疇。The detailed features and advantages of the present invention are described in detail in the following embodiments, and the content is sufficient to enable anyone familiar with the relevant art to understand the technical content of the present invention and implement it accordingly, and according to the content disclosed in this specification, the scope of patent application and the drawings Anyone who is familiar with the relevant art can easily understand the related purpose and advantages of the present invention. The following examples further illustrate the viewpoints of the present invention in detail, but do not limit the scope of the present invention by any viewpoint.

本發明適用於檢測物件L的一表面LS的缺陷。所述的表面LS基本上近似一平面,但該平面可能具有指定範圍內的高低落差。實務上,本發明可用於檢測筆記型電腦的頂蓋(Top Cover)、掌托(Palm rest,筆記型電腦內部表面除鍵盤和觸控板以外的平面區域)或平板電腦的觸控面板。The present invention is suitable for detecting defects on a surface LS of the object L. The surface LS is basically similar to a plane, but the plane may have a height difference within a specified range. In practice, the present invention can be used to detect the top cover (Top Cover) of the notebook computer, the palm rest (Palm rest, the inner surface of the notebook computer except the keyboard and the touch pad) or the touch panel of the tablet computer.

請參考圖1,其繪示本發明一實施例的表面缺陷偵測系統100的架構示意圖。所述的表面缺陷偵測系統100包括:攝像裝置10、計算裝置30及後端處理裝置50,其中計算裝置30電性連接攝像裝置10及後端處理裝置50,如圖1所示。Please refer to FIG. 1, which illustrates a schematic structural diagram of a surface defect detection system 100 according to an embodiment of the present invention. The surface defect detection system 100 includes a camera device 10, a computing device 30, and a back-end processing device 50. The computing device 30 is electrically connected to the camera device 10 and the back-end processing device 50, as shown in FIG.

攝像裝置10用以取得物件L的表面LS之一影像。實務上,可增設一發光裝置在物件L的周圍形成一均勻光場,藉此讓攝像裝置10取得清楚的影像。The imaging device 10 is used to obtain an image of the surface LS of the object L. In practice, a light emitting device can be added to form a uniform light field around the object L, so that the camera device 10 can obtain a clear image.

計算裝置30依據表面LS的影像決定表面LS是否符合一規格。換言之,計算裝置30判斷表面LS上的缺陷數量或缺陷嚴重程度是否在規格定義的容忍範圍內。The computing device 30 determines whether the surface LS meets a specification according to the image of the surface LS. In other words, the computing device 30 determines whether the number of defects or the severity of defects on the surface LS is within the tolerance range defined by the specifications.

後端處理裝置50用以根據計算裝置30之判定結果執行關聯於表面LS之作動。如圖1所示,後端處理裝置50例如係螢幕,可顯示計算裝置30的判斷結果供產線上的操作人員檢視。The back-end processing device 50 is used for performing actions related to the surface LS according to the determination result of the computing device 30. As shown in FIG. 1, the back-end processing device 50 is, for example, a screen, which can display the judgment result of the computing device 30 for inspection by an operator on the production line.

詳言之,計算裝置30的判斷分為兩個階段:第一階段為基於深度學習的缺陷偵測,第二階段為基於機器學習的分類判定。第一階段的輸出資料將作為第二階段的輸入資料。In detail, the judgment of the computing device 30 is divided into two stages: the first stage is defect detection based on deep learning, and the second stage is classification judgment based on machine learning. The output data of the first stage will be used as the input data of the second stage.

在第一階段,計算裝置30執行一深度學習演算法以從影像中選取複數個定界框(bounding box)及輸出關聯於這些定界框的複數個特徵參數,每一定界框中包含表面LS之一缺陷。此缺陷的類型可包括表面LS上之一刮傷、一磨損、一凹痕及一汙點等。In the first stage, the computing device 30 executes a deep learning algorithm to select a plurality of bounding boxes from the image and output a plurality of characteristic parameters associated with these bounding boxes, and each bounding box contains a surface LS One defect. The type of the defect may include a scratch, abrasion, a dent, a stain, etc. on the surface LS.

所述的深度學習演算法例如採用區域基礎的卷積神經網路(Region-based Convolutional Neural Network,R-CNN)經事先訓練得到的缺陷偵測模型。所述的區域基礎的卷積神經網路例如:Fast R-CNN、Faster R-CNN、Mask R-CNN、YOLO(You Only Look Once)或SSD(Single Shot Detection)。然而需注意的是,上述僅列舉可用於深度學習演算法的範例,而非用以限制本發明可採用的深度學習演算法。在本發明一實施例中,採用Faster R-CNN訓練缺陷偵測模型,其在辨識速度及準確率上皆具有良好的表現。The deep learning algorithm, for example, adopts a defect detection model obtained by pre-training a Region-based Convolutional Neural Network (R-CNN). The region-based convolutional neural network is for example: Fast R-CNN, Faster R-CNN, Mask R-CNN, YOLO (You Only Look Once) or SSD (Single Shot Detection). However, it should be noted that the above only lists examples that can be used for deep learning algorithms, and is not intended to limit the deep learning algorithms that can be used in the present invention. In an embodiment of the present invention, Faster R-CNN is used to train the defect detection model, which has a good performance in recognition speed and accuracy.

在本發明一實施例中,定界框為矩形。然而,若採用可圈選出缺陷形狀的深度學習演算法,則定界框也可以是不規則形。特徵參數包括矩形定界框之面積、對角線長度、信心指數及缺陷類型。信心指數例如以百分比方式呈現定界框內缺陷的符合程度。In an embodiment of the present invention, the bounding box is rectangular. However, if a deep learning algorithm that can circle the shape of the defect is used, the bounding box can also be irregular. The characteristic parameters include the area of the rectangular bounding box, the length of the diagonal, the confidence index and the defect type. The confidence index, for example, presents the degree of compliance with the defects in the bounding box in a percentage.

在第二階段,計算裝置30根據第一階段被輸出的定界框及特徵參數執行一分類判定演算法,以決定表面LS是否符合一規格。In the second stage, the computing device 30 executes a classification decision algorithm according to the bounding box and feature parameters output in the first stage to determine whether the surface LS meets a specification.

在一實施例中,計算裝置30將定界框數量及一面積比例作為輸入資料。定界框數量是在第一階段中被選取的定界框個數。面積比例是在第一階段中被選取的定界框之面積總和與表面LS之面積之比例。然而,本發明並不限制只採用上述兩個維度的資料執行分類判定演算法。In one embodiment, the computing device 30 uses the number of bounding boxes and an area ratio as input data. The number of bounding boxes is the number of bounding boxes selected in the first stage. The area ratio is the ratio of the total area of the bounding box selected in the first stage to the area of the surface LS. However, the present invention is not limited to only use the above two dimensions of data to execute the classification decision algorithm.

所述的分類判定演算法例如採用決策樹(Decision Tree)、支援向量機(Support Vector Machine,SVM)、及K-近鄰演算法(K Nearest Neighbor),KNN)其中之一者經事先機器訓練得到的二元分類判定模型,其用以判定表面LS通過或不通過。在本發明一實施例中,採用SVM訓練分類判定模型。The classification decision algorithm, for example, uses one of Decision Tree (Decision Tree), Support Vector Machine (SVM), and K-Nearest Neighbor (KNN) to be obtained through prior machine training The binary classification decision model of, which is used to determine whether the surface LS passes or fails. In an embodiment of the present invention, SVM is used to train the classification decision model.

在產線上,計算裝置30例如採用NVIDIA Jetson TX2套件,其可從雲端伺服器載入訓練後的Faster R-CNN及SVM模型。在實際檢測時,不需再行連線至伺服器,而是在產線上即時地針對表面LS上的刮痕等缺陷進行判定,因此增加缺陷判定的速度,同時也節省額外傳輸影像至雲端伺服器的時間及成本。然而需注意的是,本發明所述的計算裝置30亦可以是雲端伺服器本身。本發明對於計算裝置30的硬體類型並不特別限制。On the production line, the computing device 30 uses, for example, the NVIDIA Jetson TX2 package, which can load the trained Faster R-CNN and SVM models from the cloud server. In the actual inspection, there is no need to connect to the server again, but to determine the defects such as scratches on the surface LS in real time on the production line, thus increasing the speed of defect determination and saving additional transmission of images to the cloud server Time and cost of the device. However, it should be noted that the computing device 30 of the present invention can also be the cloud server itself. The invention does not particularly limit the type of hardware of the computing device 30.

請參考圖2,其係繪示本發明一實施例的表面缺陷偵測方法的流程。請參考步驟S1:攝像裝置10取得物件L之表面LS的一影像。Please refer to FIG. 2, which illustrates the flow of a surface defect detection method according to an embodiment of the present invention. Please refer to step S1: the camera device 10 obtains an image of the surface LS of the object L.

請參考步驟S2:計算裝置30執行一深度學習演算法以從影像中選取一定界框及輸出關聯於定界框的一特徵參數,其中定界框中包含表面LS之一缺陷。Please refer to step S2: the computing device 30 executes a deep learning algorithm to select a certain bounding box from the image and output a characteristic parameter associated with the bounding box, where the bounding box contains a defect of the surface LS.

請參考圖3,其係深度學習演算法在表面LS的影像上標示定界框B1~B4及例外區域B5的示意圖。定界框B1圍繞一刮痕。定界框B2圍繞一磨損或一汙痕。需注意的是,深度學習演算法對於每個缺陷皆單獨標記,無論標示出的定界框是否重疊。例如,圖3中有重疊部分的定界框B3和B4分別屬於兩個缺陷。Please refer to FIG. 3, which is a schematic diagram of the deep learning algorithm marking the bounding boxes B1 to B4 and the exception area B5 on the image of the surface LS. The bounding frame B1 surrounds a scratch. The bounding box B2 surrounds a wear or a stain. It should be noted that the deep learning algorithm marks each defect separately, regardless of whether the marked bounding boxes overlap. For example, the overlapping bounding boxes B3 and B4 in Fig. 3 belong to two defects respectively.

請參考步驟S3:計算裝置30根據定界框及特徵參數執行一分類判定演算法,以決定表面LS是否符合一規格。Please refer to step S3: the computing device 30 executes a classification determination algorithm according to the bounding box and characteristic parameters to determine whether the surface LS meets a specification.

請參考步驟S4:後端處理裝置根據計算裝置30之判定結果執行關聯於表面LS之作動。例如以螢幕顯示判定結果,或以輸送裝置區分通過與不通過的表面LS。Please refer to step S4: the back-end processing device executes actions related to the surface LS according to the determination result of the computing device 30. For example, the judgment result is displayed on the screen, or the passing and non-passing surfaces LS are distinguished by the conveying device.

於本發明另一實施例,在步驟S1取得影像之前,更包括:以一發光裝置在物件L的周圍形成一均勻光場。藉此,可減少環境光影響攝像裝置10取得表面LS的影像。In another embodiment of the present invention, before acquiring the image in step S1, the method further includes: forming a uniform light field around the object L with a light emitting device. In this way, the influence of ambient light on the image obtained by the imaging device 10 on the surface LS can be reduced.

於本發明另一實施例,在步驟S2執行深度學習演算法之前,更包括:以計算裝置30針對影像設置一例外區域(如圖3的B5);且所選取之定界框與例外區域無重疊。例外區域B5例如是筆記型電腦上蓋的廠牌名稱。深度學習演算法針對該例外區域B5不做任何缺陷偵測。In another embodiment of the present invention, before the deep learning algorithm is executed in step S2, the method further includes: setting an exception area for the image by the computing device 30 (B5 of FIG. 3); and the selected bounding box and the exception area are not overlapping. The exception area B5 is, for example, the name of the brand on the notebook computer. The deep learning algorithm does not perform any defect detection for the exception area B5.

於本發明另一實施例,在步驟S2執行深度學習演算法之前,更包括:以一伺服器取得複數個訓練影像及對應的訓練參數。In another embodiment of the present invention, before executing the deep learning algorithm in step S2, the method further includes: obtaining a plurality of training images and corresponding training parameters by a server.

所述的訓練影像的來源包括具有缺陷之表面LS之影像及不具有缺陷之表面LS之影像。在初次訓練時,有缺陷的訓練影像至少需500張,而不具缺陷的訓練影像至少需100張。藉此讓深度學習演算法學習如何辨識出缺陷及其各種型態。需注意的是,上述影像張數的數量僅為範例,而非作為本發明之一限制。The sources of the training images include images of the surface LS with defects and images of the surface LS without defects. In the initial training, at least 500 defective training images are required, and at least 100 non-defective training images. This allows the deep learning algorithm to learn how to identify defects and their various types. It should be noted that the above-mentioned number of images is only an example, not a limitation of the present invention.

訓練參數包括具有缺陷之訓練影像標註的樣本定界框及對應的缺陷類型標籤,樣本定界框是包含缺陷整體之一矩形。The training parameters include a sample bounding box labeled with a training image with a defect and a corresponding defect type label. The sample bounding box is a rectangle that contains the defect as a whole.

伺服器在取得如上所述的訓練影像及對應的訓練參數之後,即可依據這些訓練資料執行深度學習演算法以產生一缺陷偵測模型。After obtaining the training images and corresponding training parameters as described above, the server can execute a deep learning algorithm based on the training data to generate a defect detection model.

另外,訓練影像各自具有第一影像或第二影像的標註,第一影像的標註代表該影像符合一規格;第二影像的標註代表該影像不符合該規格。舉例來說,原本不具有缺陷的100影像一般而言會被標註為第一影像,而在具有缺陷的500張影像中,可能有150張影像因為缺陷數量較少或缺陷面積總和較小而被標註為第一影像,其餘350張影像被標註為第二影像。因此,在所有600張訓練影像中,有250張影像被標註為第一影像,有350張影像被標註為第二影像。伺服器依據這些訓練影像與它們各自的標註執行分類判定演算法,而產生分類判定模型。In addition, the training images each have a label of the first image or the second image. The label of the first image represents that the image meets a specification; the label of the second image represents that the image does not meet the specification. For example, 100 images that originally did not have defects are generally marked as the first image. Among 500 images with defects, 150 images may be marked because of the small number of defects or the small sum of defect areas. Marked as the first image, the remaining 350 images are marked as the second image. Therefore, among all 600 training images, 250 images are labeled as the first image, and 350 images are labeled as the second image. The server executes a classification judgment algorithm based on these training images and their respective annotations to generate a classification judgment model.

計算裝置30從伺服器載入訓練完成的缺陷偵測模型及分類判定模型,並且在步驟S2及步驟S3分別執行這兩個模型,以執行對於表面LS的表面缺陷偵測。The computing device 30 loads the trained defect detection model and the classification judgment model from the server, and executes the two models in step S2 and step S3 to perform surface defect detection on the surface LS.

實務上,缺陷偵測模型可以將實際檢測所用的資料作為訓練資料以更新模型,藉此提升缺陷偵測的準確度。In practice, the defect detection model can use the data used in actual detection as training data to update the model, thereby improving the accuracy of defect detection.

另外,在訓練過程中,可將訓練影像先行劃分成多個子影像,以減少訓練時伺服器處理的資料吞吐量。In addition, during the training process, the training image can be divided into multiple sub-images in advance to reduce the data throughput processed by the server during training.

綜合以上所述,本發明所揭露的表面缺陷偵測系統及其方法,透過深度學習演算法可精確地標示出物件的表面上的各種型態缺陷,並由分類判定演算法依據規格文件判定該表面是否可通過表面缺陷測試。本發明可以偵測出各種式樣的表面缺陷避免人工檢測帶來的不精確、不可靠及不一致等缺點,並且維持快速的偵測速度。In summary, the surface defect detection system and method disclosed in the present invention can accurately mark various types of defects on the surface of an object through a deep learning algorithm, and the classification judgment algorithm determines the defect according to the specification file. Whether the surface can pass the surface defect test. The invention can detect various styles of surface defects to avoid the shortcomings of inaccuracy, unreliability and inconsistency caused by manual detection, and maintain a fast detection speed.

雖然本發明以前述之實施例揭露如上,然其並非用以限定本發明。在不脫離本發明之精神和範圍內,所為之更動與潤飾,均屬本發明之專利保護範圍。關於本發明所界定之保護範圍請參考所附之申請專利範圍。Although the present invention is disclosed in the foregoing embodiments, it is not intended to limit the present invention. All changes and modifications made without departing from the spirit and scope of the present invention fall within the scope of patent protection of the present invention. For the scope of protection defined by the present invention, please refer to the attached patent scope.

100:表面缺陷偵測系統 10:攝像裝置 30:計算裝置 50:後端處理裝置 L:物件 LS:物件表面 S1~S4:步驟 B1~B4:定界框 B5:例外區域100: Surface defect detection system 10: Camera 30: Computing device 50: back-end processing device L: Object LS: Object surface S1~S4: steps B1~B4: bounding box B5: Exceptional area

圖1係依據本發明一實施例所繪示的表面缺陷偵測系統的架構圖。 圖2係依據本發明一實施例所繪示的表面缺陷偵測方法的流程圖。 圖3係繪示在物件的表面上標註的定界框及例外區域。FIG. 1 is a structural diagram of a surface defect detection system according to an embodiment of the invention. 2 is a flowchart of a surface defect detection method according to an embodiment of the invention. Figure 3 shows the bounding box and exception area marked on the surface of the object.

S1~S4:步驟 S1~S4: steps

Claims (11)

一種表面缺陷偵測方法,適用於一物件之一表面,所述的方法包括:以一攝像裝置取得該表面之一影像;以一計算裝置執行一深度學習演算法以從該影像中選取一定界框及輸出關聯於該定界框的一特徵參數,其中該定界框中包含該表面之一缺陷;以及以該計算裝置根據該定界框及該特徵參數執行一分類判定演算法,以決定該表面是否符合一規格。A method for detecting surface defects is suitable for a surface of an object. The method includes: obtaining an image of the surface with a camera device; and executing a deep learning algorithm with a computing device to select a certain boundary from the image The frame and output are related to a characteristic parameter of the bounding box, where the bounding box contains a defect on the surface; and the computing device executes a classification decision algorithm according to the bounding box and the characteristic parameter to determine Whether the surface meets a specification. 如請求項1所述的表面缺陷偵測方法,其中該深度學習演算法係一區域基礎的卷積神經網路(R-CNN)。The surface defect detection method according to claim 1, wherein the deep learning algorithm is a region-based convolutional neural network (R-CNN). 如請求項2所述的表面缺陷偵測方法,其中該區域基礎的卷積神經網路係Fast R-CNN、Faster R-CNN、Mask R-CNN或YOLO。The surface defect detection method according to claim 2, wherein the convolutional neural network based on the region is Fast R-CNN, Faster R-CNN, Mask R-CNN or YOLO. 如請求項1所述的表面缺陷偵測方法,其中該定界框係一矩形,且該特徵參數包括該矩形之一面積、該矩形之一對角線長度、一信心指數及一缺陷類型,該缺陷類型包括該表面上之一刮傷、一磨損、一凹痕及一汙點。The surface defect detection method according to claim 1, wherein the bounding frame is a rectangle, and the characteristic parameter includes an area of the rectangle, a diagonal length of the rectangle, a confidence index and a defect type, The defect types include a scratch, a wear, a dent and a stain on the surface. 如請求項1所述的表面缺陷偵測方法,其中該分類判定演算法係Decision Tree、SVM、及KNN其中之一者。The surface defect detection method according to claim 1, wherein the classification judgment algorithm is one of Decision Tree, SVM, and KNN. 如請求項1所述的表面缺陷偵測方法,且在該計算裝置執行該分類判定演算法之前,更包括:以該計算裝置從該影像中選取另至少一定界框及輸出關聯於該至少一定界框的另至少一特徵參數,其中該至少一定界框中包含該表面之另至少一缺陷;計算由該深度學習演算法所選取的該些定界框之一數量;計算由該深度學習演算法所選取的該些定界框之面積總和與該表面之面積之一比例;以及以該計算裝置依據該數量及該比例執行該分類判定演算法以決定該表面是否符合該規格。The method for detecting surface defects according to claim 1, and before the computing device executes the classification and determination algorithm, further includes: selecting another bounding box from the image by the computing device and outputting the at least certain bounding box. At least one other characteristic parameter of the bounding box, wherein the at least certain bounding box contains at least one other defect of the surface; calculating the number of one of the bounding boxes selected by the deep learning algorithm; calculating by the deep learning algorithm The ratio of the total area of the bounding boxes selected by the method to the area of the surface; and the computing device executes the classification determination algorithm according to the number and the ratio to determine whether the surface meets the specification. 如請求項1所述的表面缺陷偵測方法,其中在執行該深度學習演算法之前,更包括:以該計算裝置針對該影像設置一例外區域;且所選取之該定界框與該例外區域無重疊。The surface defect detection method according to claim 1, wherein before executing the deep learning algorithm, it further comprises: setting an exception area for the image by the computing device; and the selected bounding box and the exception area No overlap. 如請求項1所述的表面缺陷偵測方法,其中在取得該影像之前更包括:以一發光裝置在該物件的周圍形成一均勻光場。The surface defect detection method according to claim 1, wherein before obtaining the image, it further comprises: forming a uniform light field around the object with a light emitting device. 如請求項1所述的表面缺陷偵測方法,在執行該深度學習演算法之前更包括:以一伺服器取得複數個訓練影像,其中該些訓練影像包括具有該缺陷之該表面之影像及不具有該缺陷之該表面之影像;每一具有該缺陷之該些訓練影像中具有一樣本定界框及一缺陷類型,該樣本定界框係包含該缺陷整體之一矩形,該缺陷類型關聯於該缺陷;每一該些訓練影像更包括一第一影像標註或一第二影像標註,其中該第一影像標註代表該訓練影像符合該規格,該第二影像之標註代表該訓練影像不符合該規格;以該伺服器依據該些訓練影像、該些樣本定界框及該些缺陷類型執行該深度學習演算法以產生一缺陷偵測模型;以該伺服器依據該些訓練影像、該第一影像標註及該第二影像標註執行該分類判定演算法以產生一分類判定模型;以及以該計算裝置從該伺服器載入該缺陷偵測模型及該分類判定模型。The surface defect detection method according to claim 1, before executing the deep learning algorithm, it further includes: obtaining a plurality of training images by a server, wherein the training images include images of the surface with the defect and images An image of the surface with the defect; each of the training images with the defect has a sample bounding box and a defect type. The sample bounding box includes a rectangle of the defect as a whole, and the defect type is associated with The defect; each of the training images further includes a first image annotation or a second image annotation, where the first image annotation represents that the training image meets the specification, and the annotation of the second image represents that the training image does not meet the Specifications; the server executes the deep learning algorithm according to the training images, the sample bounding boxes and the defect types to generate a defect detection model; the server according to the training images, the first The image annotation and the second image annotation execute the classification judgment algorithm to generate a classification judgment model; and load the defect detection model and the classification judgment model from the server by the computing device. 一種表面缺陷偵測系統,適用於一物件之一表面,所述的系統包括:一攝像裝置,用以取得該表面之一影像;一計算裝置,電性連接該攝像裝置,該計算裝置用以執行一深度學習演算法以從該影像中選取一定界框及輸出關聯於該定界框的一特徵參數,其中該定界框中包含該表面之一缺陷;該計算裝置更用以根據該定界框及該特徵參數執行一分類判定演算法,以決定該表面是否符合一規格;以及一後端處理裝置,電性連接該計算裝置,該後端處理裝置用以根據該計算裝置之判定結果執行關聯於該表面之作動。A surface defect detection system is suitable for a surface of an object. The system includes: a camera device for obtaining an image of the surface; a computing device electrically connected to the camera device, the computing device for A deep learning algorithm is executed to select a certain bounding box from the image and output a characteristic parameter associated with the bounding box, where the bounding box contains a defect on the surface; the computing device is further used to determine The bounding box and the characteristic parameter execute a classification judgment algorithm to determine whether the surface meets a specification; and a back-end processing device electrically connected to the computing device, and the back-end processing device is used to determine the result of the computing device Perform actions associated with the surface. 如請求項10所述的表面缺陷偵測系統,其中該深度學習演算法係一區域基礎的卷積神經網路;該分類判定演算法係Decision Tree、SVM、及KNN其中之一者;以及該計算裝置更用以從該影像中選取另至少一定界框及輸出關聯於該至少一定界框的另至少一特徵參數,並依據一數量及一比例執行該分類判定演算法;其中該至少一定界框中包含該表面之另至少一缺陷;該數量係關聯於該深度學習演算法所選取的該些定界框;且該比例係關聯於該深度學習演算法所選取的該些定界框之面積總和與該表面之面積。The surface defect detection system according to claim 10, wherein the deep learning algorithm is a region-based convolutional neural network; the classification judgment algorithm is one of Decision Tree, SVM, and KNN; and the The computing device is further used to select another at least certain bounding box from the image and output another at least one characteristic parameter associated with the at least certain bounding box, and execute the classification determination algorithm according to a quantity and a ratio; wherein the at least certain bounding box The frame contains at least one other defect of the surface; the quantity is related to the bounding boxes selected by the deep learning algorithm; and the ratio is related to the bounding boxes selected by the deep learning algorithm The sum of the area and the area of the surface.
TW108109545A 2019-03-20 2019-03-20 Surface defect detection system and method thereof TWI694250B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108109545A TWI694250B (en) 2019-03-20 2019-03-20 Surface defect detection system and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108109545A TWI694250B (en) 2019-03-20 2019-03-20 Surface defect detection system and method thereof

Publications (2)

Publication Number Publication Date
TWI694250B TWI694250B (en) 2020-05-21
TW202035975A true TW202035975A (en) 2020-10-01

Family

ID=71896246

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108109545A TWI694250B (en) 2019-03-20 2019-03-20 Surface defect detection system and method thereof

Country Status (1)

Country Link
TW (1) TWI694250B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI816060B (en) * 2020-10-28 2023-09-21 友達光電股份有限公司 Monitor system and method thereof
CN114626538A (en) * 2020-12-09 2022-06-14 艾聚达信息技术(苏州)有限公司 Artificial intelligence model automatic lifting training system and method
TWI815492B (en) * 2022-06-06 2023-09-11 中國鋼鐵股份有限公司 Method and system for classifying defects on surface of steel stripe

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SG11201902745RA (en) * 2016-10-17 2019-05-30 Kla Tencor Corp Optimizing training sets used for setting up inspection-related algorithms
JP6973742B2 (en) * 2017-06-15 2021-12-01 リョーエイ株式会社 Inspection method for metal processed surface, inspection device for metal processed surface
CN109118482B (en) * 2018-08-07 2019-12-31 腾讯科技(深圳)有限公司 Panel defect analysis method and device and storage medium

Also Published As

Publication number Publication date
TWI694250B (en) 2020-05-21

Similar Documents

Publication Publication Date Title
CN109934814B (en) Surface defect detection system and method thereof
TWI689875B (en) Defect inspection and classification apparatus and training apparatus using deep learning system
US10878283B2 (en) Data generation apparatus, data generation method, and data generation program
US11132786B2 (en) Board defect filtering method based on defect list and circuit layout image and device thereof and computer-readable recording medium
TWI694250B (en) Surface defect detection system and method thereof
CN109946303A (en) Check device and method
KR20210008352A (en) System and method for detecting defects in imaged items
TW202038145A (en) Adversarial training system and method for noisy labels
JP5718781B2 (en) Image classification apparatus and image classification method
CN110880175B (en) Welding spot defect detection method, system and equipment
Eshkevari et al. Automatic dimensional defect detection for glass vials based on machine vision: A heuristic segmentation method
US11315229B2 (en) Method for training defect detector
JP2023134688A (en) System and method for detecting and classifying pattern in image with vision system
WO2024002187A1 (en) Defect detection method, defect detection device, and storage medium
TW202242390A (en) Defect inspection device, defect inspection method, and manufacturing method
Hartl et al. Automated visual inspection of friction stir welds: a deep learning approach
Coskun et al. Integration of digital quality control for intelligent manufacturing of industrial ceramic tiles
Biagio et al. Automatic inspection of aeronautic components
US11176419B1 (en) Method for labeling image
KR20210122429A (en) Method and System for Artificial Intelligence based Quality Inspection in Manufacturing Process using Machine Vision Deep Learning
TWI722861B (en) Classification method and a classification system
Zhang et al. Automatic forgery detection for x-ray non-destructive testing of welding
Yang et al. Camera module Lens blemish detection based on neural network interpretability
Cui et al. Real-time industrial vision system for automatic product surface inspection
JP2023093283A (en) Egg surface defect detection system