TWI813522B - Classification Model Building Method - Google Patents
Classification Model Building Method Download PDFInfo
- Publication number
- TWI813522B TWI813522B TW111149014A TW111149014A TWI813522B TW I813522 B TWI813522 B TW I813522B TW 111149014 A TW111149014 A TW 111149014A TW 111149014 A TW111149014 A TW 111149014A TW I813522 B TWI813522 B TW I813522B
- Authority
- TW
- Taiwan
- Prior art keywords
- classification model
- training
- category
- preset
- classification
- Prior art date
Links
- 238000013145 classification model Methods 0.000 title claims abstract description 81
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000012549 training Methods 0.000 claims abstract description 66
- 238000012937 correction Methods 0.000 claims abstract description 19
- 238000013528 artificial neural network Methods 0.000 claims abstract description 13
- 238000012800 visualization Methods 0.000 claims abstract description 8
- 238000012360 testing method Methods 0.000 claims description 24
- 230000006870 function Effects 0.000 claims description 23
- 238000002372 labelling Methods 0.000 claims description 2
- 238000013526 transfer learning Methods 0.000 claims description 2
- 238000012545 processing Methods 0.000 description 28
- 230000007547 defect Effects 0.000 description 10
- 230000008569 process Effects 0.000 description 4
- 238000013527 convolutional neural network Methods 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 238000007689 inspection Methods 0.000 description 3
- 238000013135 deep learning Methods 0.000 description 2
- 230000002950 deficient Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 230000032683 aging Effects 0.000 description 1
- 238000011109 contamination Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000004438 eyesight Effects 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000007306 turnover Effects 0.000 description 1
- 238000011179 visual inspection Methods 0.000 description 1
Images
Landscapes
- Geophysics And Detection Of Objects (AREA)
- Apparatus For Radiation Diagnosis (AREA)
- Image Analysis (AREA)
Abstract
一種分類模型建立方法,由一電腦裝置來實施,包含以下步驟:(A)根據多筆訓練資料之多張訓練影像及多個類別標記,利用一神經網路演算法建立一用以分類一影像之類別的分類模型;(B)根據該分類模型,利用一神經網路可視化演算法,產生多張分別對應該等訓練影像的熱力圖,每一熱力圖具有一相關於該分類模型的模型感興趣區域;(C)產生多筆校正資料,每一校正資料包括對應該等訓練影像之其中一者的熱力圖,及對應該等訓練影像之其中該者的訓練感興趣區域位置標註;及(D)根據該等校正資料訓練該分類模型,以調整該分類模型之模型感興趣區域。A method for establishing a classification model, implemented by a computer device, includes the following steps: (A) Based on multiple training images and multiple category tags of multiple training data, use a neural network algorithm to create a model for classifying an image Classification model of the category; (B) According to the classification model, a neural network visualization algorithm is used to generate multiple heat maps corresponding to the training images. Each heat map has a model of interest related to the classification model. area; (C) generate multiple correction data, each correction data includes a heat map corresponding to one of the training images, and a training area of interest position annotation corresponding to one of the training images; and (D) ) train the classification model based on the correction data to adjust the model area of interest of the classification model.
Description
本發明是有關於一種模型建立方法,特別是指一種分類模型建立方法。The present invention relates to a method for establishing a model, in particular to a method for establishing a classification model.
半導體、面板(LED)、手機等電子產品製造過程中,零組件難免會出現不同程度的缺陷,例如產生在電路板及液晶面板上的孔洞、割痕、裂紋、錯位等,均會嚴重影響產品性能。During the manufacturing process of electronic products such as semiconductors, panels (LEDs), and mobile phones, components will inevitably have varying degrees of defects, such as holes, cuts, cracks, and misalignments on circuit boards and LCD panels, which will seriously affect the products. performance.
過往,為了判斷缺陷,傳統的檢測方式為人工目視檢視法,但人員需在強光照明下以顯微鏡進行,不僅對檢測人員的眼睛傷害很大、檢測人員常因視力老化無法勝任工作,人員流動率高,且存在不同檢測員判斷缺陷的主觀性以及效率低的缺點,難以滿足高速、高解析度的檢測要求。In the past, in order to judge defects, the traditional inspection method was manual visual inspection. However, personnel needed to use a microscope under strong light illumination, which not only caused great harm to the eyes of the inspectors, but also often caused inspection personnel to be unable to perform their work due to aging eyesight, resulting in personnel turnover. The rate is high, and there are disadvantages such as the subjectivity of different inspectors in judging defects and low efficiency, making it difficult to meet the high-speed and high-resolution inspection requirements.
為解決上述問題,中華民國專利公告號I694250提供一種表面缺陷偵測方法,其主要技術為執行一深度學習演算法以從一影像中選取多個定界框及輸出關聯於這些定界框的多個特徵參數,其中每個定界框中包含該表面之一可能缺陷,再根據該等定界框及該等特徵參數執行一分類判定演算法,以判斷該表面是否符合一規格,其中所述的深度學習演算法例如採用區域基礎的卷積神經網路(Region-based Convolutional Neural Network,R-CNN)經事先訓練得到的缺陷偵測模型。In order to solve the above problems, the Republic of China Patent Announcement No. I694250 provides a surface defect detection method. Its main technology is to execute a deep learning algorithm to select multiple bounding boxes from an image and output multiple bounding boxes associated with these bounding boxes. characteristic parameters, where each bounding box contains a possible defect of the surface, and then a classification determination algorithm is executed based on the bounding boxes and the characteristic parameters to determine whether the surface meets a specification, wherein The deep learning algorithm uses a defect detection model that has been trained in advance using a Region-based Convolutional Neural Network (R-CNN).
然而,用以分類出缺陷類別的缺陷偵測模型僅是根據訓練影像及對應的訓練參數,以現有的監督式學習演算法進行訓練,其中訓練參數包括具有缺陷之訓練影像標註的樣本定界框及對應的缺陷類型標籤,其準確率有所限制。However, the defect detection model used to classify defect types is only trained with the existing supervised learning algorithm based on the training images and corresponding training parameters. The training parameters include sample bounding boxes annotated with the training images with defects. and corresponding defect type labels, whose accuracy is limited.
因此,本發明的目的,即在提供一種提高模型準確率的分類模型建立方法。Therefore, the purpose of the present invention is to provide a method for establishing a classification model that improves model accuracy.
於是,本發明分類模型建立方法,由一電腦裝置來實施,該電腦裝置儲存有多筆訓練資料,每一訓練資料包括一訓練影像、一對應該訓練影像的訓練類別標註,及一對應該訓練影像的訓練感興趣區域位置標註,該方法包含一步驟(A)、一步驟(B)、一步驟(C),及(D)。Therefore, the classification model establishment method of the present invention is implemented by a computer device that stores a plurality of training data. Each training data includes a training image, a pair of training category annotations of the training image, and a pair of training data. The method includes a step (A), a step (B), a step (C), and (D) for position labeling of training regions of interest in images.
在該步驟(A)中,該電腦裝置根據該等訓練資料之訓練影像及類別標記,利用一神經網路演算法,建立一用以分類一影像之類別的分類模型。In the step (A), the computer device uses a neural network algorithm to establish a classification model for classifying an image category based on the training images and category labels of the training data.
在該步驟(B)中,該電腦裝置根據該分類模型,利用一神經網路可視化演算法,產生多張分別對應該等訓練影像的熱力圖,每一熱力圖具有一相關於該分類模型的模型感興趣區域。In step (B), the computer device uses a neural network visualization algorithm to generate a plurality of heat maps corresponding to the training images based on the classification model. Each heat map has a heat map related to the classification model. Model area of interest.
在該步驟(C)中,該電腦裝置產生多筆校正資料,每一校正資料包括對應該等訓練影像之其中一者的熱力圖,及對應該等訓練影像之其中該者的訓練感興趣區域位置標註。In this step (C), the computer device generates a plurality of correction data. Each correction data includes a heat map corresponding to one of the training images, and a training area of interest corresponding to the one of the training images. Location annotation.
在該步驟(D)中,該電腦裝置根據該等訓練資料及該等校正資料訓練該分類模型,以調整該分類模型之模型感興趣區域。In the step (D), the computer device trains the classification model based on the training data and the correction data to adjust the model area of interest of the classification model.
本發明之功效在於:藉由該電腦裝置建立該分類模型後,再產生包括該等熱力圖的該等校正資料,並根據該等校正資料調整該分類模型之模型感興趣區域,以提高該分類模型的準確率。The effect of the present invention is to: after establishing the classification model through the computer device, the correction data including the heat maps are generated, and the model interest area of the classification model is adjusted according to the correction data to improve the classification. The accuracy of the model.
在本發明被詳細描述之前,應當注意在以下的說明內容中,類似的元件是以相同的編號來表示。Before the present invention is described in detail, it should be noted that in the following description, similar elements are designated with the same numbering.
參閱圖1,用來實施本發明分類模型建立方法的一實施例的一電腦裝置1,包含一儲存單元11及一電連接該儲存單元11的處理單元12。Referring to FIG. 1 , a
該儲存單元11儲存多筆訓練資料及多筆測試資料,每一訓練資料包括一相關於一物件的訓練影像、一對應該訓練影像的訓練類別標註,及一對應該訓練影像的訓練感興趣區域位置標註。該訓練/測試類別標註包括一正常標註、一破損標註、一刮傷標註、一裂紋標註、一異物標註,及一沾汙標註,該訓練/測試感興趣區域位置標註為該物件的缺陷區域,若該物件為正常,該訓練/測試感興趣區域位置標註則為空,但不以此為限。The
參閱圖1及圖2,說明了該電腦裝置1如何執行本發明分類模型建立方法之該實施例,該實施例包含以下步驟。Referring to Figures 1 and 2, it is described how the
在步驟21中,該處理單元12根據該等訓練資料之訓練影像及類別標記,利用一神經網路演算法,建立一用以分類一影像之類別的分類模型。值得注意的是,在本實施例中,該神經網路演算法例如為卷積神經網路(Convolutional Neural Network, CNN),但不以此為限。In step 21 , the
搭配參閱圖3,以下說明步驟21包括的子步驟211~215。With reference to Figure 3, the
在子步驟211中,對於每一訓練影像,該處理單元12利用一預設分類模型,根據該訓練影像產生一第一分類結果。在本實施例中,該預設分類模型例如為最後一層的softmax函數改為sigmoid函數的Inception-ResNet-V2,但不以此為限。In
在子步驟212中,該處理單元12根據對應該等訓練影像的第一分類結果及訓練類別標註,利用一第一損失函數計算出一第一類別誤差值。In
值得注意的是,在本實施例中,該第一損失函數可為任意的損失函數,例如均方誤差(Mean square error, MSE)、平均絕對值誤差(Mean absolute error MAE)等損失函數。It is worth noting that in this embodiment, the first loss function can be any loss function, such as mean square error (Mean square error, MSE), mean absolute error MAE, and other loss functions.
在子步驟213中,該處理單元12根據該第一類別誤差值,判定該預設分類模型是否收斂。當該處理單元12判定出該預設分類模型不收斂時,流程進行子步驟214;而當該處理單元12判定出該預設分類模型收斂時,則流程進行子步驟215。In
在子步驟214中,該處理單元12調整該預設分類模型,並重複步驟211~213直到收斂。In
在子步驟215中,該處理單元12將該預設分類模型作為該分類模型。In
在步驟22中,該處理單元12根據該分類模型,利用一神經網路可視化演算法,產生多張分別對應該等訓練影像的熱力圖,每一熱力圖具有一相關於該分類模型的模型感興趣區域。In
值得注意的是,在本實施例中,該神經網路可視化演算法例如為梯度加權類別活化映射改良(Gradient-weighted Class Activation Mapping++, Grad-CAM++)演算法,根據該分類模型最後幾層的卷積(convolution)的特徵圖(feature map)獲得該等熱力圖,但不以此為限。It is worth noting that in this embodiment, the neural network visualization algorithm is, for example, the Gradient-weighted Class Activation Mapping++ (Grad-CAM++) algorithm. According to the volumes of the last few layers of the classification model, The heat map is obtained by using a feature map of convolution, but is not limited to this.
在步驟23中,該處理單元12產生多筆校正資料,每一校正資料包括對應該等訓練影像之其中一者的熱力圖,及對應該等訓練影像之其中該者的訓練感興趣區域位置標註。In
在步驟24中,該處理單元12根據該等校正資料訓練該分類模型,以調整該分類模型之模型感興趣區域。In
搭配參閱圖4,以下說明步驟24包括的子步驟241~242。With reference to Figure 4, the
在子步驟241中,該處理單元12根據該等校正資料,利用一第二損失函數,計算出一位置誤差值及一第二類別誤差值。In
值得注意的是,在本實施例中,該第二損失函數可為異於該第一損失函數的任意損失函數,該處理單元12利用該神經網路可視化演算法可微分且能反向傳播的特性計算出該位置誤差值及該第二類別誤差值。It is worth noting that in this embodiment, the second loss function can be any loss function different from the first loss function. The
在子步驟242中,該處理單元12根據該第二類別誤差值及該位置誤差,利用一遷移式學習(Transfer Learning)演算法訓練該分類模型。In
在步驟25中,該處理單元12根據該等測試資料判定該分類模型是否到達一預設標準。當該處理單元12判定出該分類模型未到達該預設標準時,結束流程;當該處理單元12判定出該分類模型未到達該預設標準時,則流程進行步驟26。In
值得注意的是,在本實施例中,該預設標準例如為該分類模型的準確率(Accuracy)大於一預設門檻值,在其他實施例亦可為該分類模型的精確率(Precision)、召回率(Recall)、F1分數(F1 Score)、及/或ROC曲線下面積(Area under the Curve of ROC, AUC ROC)大於各自對應的預設門檻值,不以此為限。It is worth noting that in this embodiment, the preset standard is, for example, that the accuracy of the classification model is greater than a preset threshold. In other embodiments, the preset standard can also be the accuracy of the classification model, The recall rate (Recall), F1 score (F1 Score), and/or area under the Curve of ROC (AUC ROC) are greater than their corresponding preset thresholds, but are not limited to this.
搭配參閱圖5,以下說明步驟25包括的子步驟251~253。With reference to Figure 5, the sub-steps 251~253 included in
在子步驟251中,對於每一測試資料的測試影像,該處理單元12利用該分類模型根據該測試影像產生一第二分類結果。In
在子步驟252中,該處理單元12根據該等測試影像對應的第二分類結果及測試類別標註計算出一準確率。In
在子步驟253中,該處理單元12判定該準確率是否大於一預設門檻值,以判定該分類模型是否到達該預設標準。當該處理單元12判定出該準確率大於該預設門檻值,判定該分類模型到達該預設標準。In
在步驟26中,該處理單元12調整該第一損失函數及該第二損失函數,並根據該位置誤差值及該第二類別誤差值計算出一相關於該位置誤差值及該第二類別誤差值的參數閾值。In
在步驟27中,該處理單元12根據該第一損失函數、該第二損失函數,及該參數閾值調整該分類模型,並重複步驟25直到該分類模型到達該預設標準。In
值得注意的是,在本實施例中,在步驟25會先判定該分類模型是否到達該預設標準,若未到達該預設標準,該處理單元12會調整該第一損失函數及該第二損失函數,並根據該位置誤差值及該第二類別誤差值計算出該參數閾值後,再重新調整該分類模型,以確保該分類模型的準確率,其他實施方式中,可僅執行步驟21~24,不以此為限。It is worth noting that in this embodiment, in
要特別注意的是,在該分類模型調整完成後,使用該分類模型判定一相關於一待測物件的待測影像時,亦可使用該神經網路可視化演算法獲得一對應該待測影像的熱力圖,以讓使用者不僅可以根據該分類模型輸出的分類結果得知該待測物件的類別外,亦可根據該熱力圖快速知道該待測物件的缺陷區域。It is important to note that after the classification model is adjusted, when using the classification model to determine a test image related to an object to be tested, the neural network visualization algorithm can also be used to obtain a pair of images to be tested. The heat map allows users to not only know the category of the object to be tested based on the classification results output by the classification model, but also to quickly know the defective areas of the object to be tested based on the heat map.
綜上所述,本發明分類模型建立方法,藉由該處理單元12建立該分類模型後,再產生包括該等熱力圖的該等校正資料,並根據該等校正資料調整該分類模型之模型感興趣區域,以提高該分類模型的準確率,此外,該分類模型不需要該等訓練資料的該等訓練感興趣區域位置標註進行訓練學習,該處理單元12利用該神經網路可視化演算法直接獲得包括模型感興趣區域的熱力圖,相較於需要根據界定框進行訓練學習的前案,本案的分類模型架構較為簡單,且預測速度較為快速,故確實能達成本發明的目的。In summary, the classification model establishment method of the present invention uses the
惟以上所述者,僅為本發明的實施例而已,當不能以此限定本發明實施的範圍,凡是依本發明申請專利範圍及專利說明書內容所作的簡單的等效變化與修飾,皆仍屬本發明專利涵蓋的範圍內。However, the above are only examples of the present invention and should not be used to limit the scope of the present invention. All simple equivalent changes and modifications made based on the patent scope of the present invention and the content of the patent specification are still within the scope of the present invention. within the scope covered by the patent of this invention.
1:電腦裝置
11:儲存單元
12:處理單元
21~27:步驟
211~215:子步驟
241~242:子步驟
251~253:子步驟
1: Computer device
11:Storage unit
12: Processing unit
21~27:
本發明的其他的特徵及功效,將於參照圖式的實施方式中清楚地呈現,其中:
圖1是一方塊圖,說明用以實施本發明分類模型建立方法的一實施例的一電腦裝置;
圖2是一流程圖,說明本發明分類模型建立方法的該實施例;
圖3是一流程圖,輔助說明圖2步驟21的子步驟;
圖4是一流程圖,輔助說明圖2步驟24的子步驟;及
圖5是一流程圖,輔助說明圖2步驟25的子步驟。
Other features and effects of the present invention will be clearly presented in the embodiments with reference to the drawings, in which:
Figure 1 is a block diagram illustrating a computer device used to implement an embodiment of the classification model building method of the present invention;
Figure 2 is a flow chart illustrating this embodiment of the classification model establishment method of the present invention;
Figure 3 is a flow chart to assist in explaining the sub-steps of step 21 in Figure 2;
Figure 4 is a flow chart to assist in explaining the sub-steps of
21~27:步驟 21~27: Steps
Claims (4)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW111149014A TWI813522B (en) | 2022-12-20 | 2022-12-20 | Classification Model Building Method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW111149014A TWI813522B (en) | 2022-12-20 | 2022-12-20 | Classification Model Building Method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TWI813522B true TWI813522B (en) | 2023-08-21 |
| TW202427226A TW202427226A (en) | 2024-07-01 |
Family
ID=88586081
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW111149014A TWI813522B (en) | 2022-12-20 | 2022-12-20 | Classification Model Building Method |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI813522B (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20190108420A1 (en) * | 2017-05-14 | 2019-04-11 | International Business Machines Corporation | Systems and methods for identifying a target object in an image |
| CN111126379A (en) * | 2019-11-22 | 2020-05-08 | 苏州浪潮智能科技有限公司 | A target detection method and device |
| TW202127312A (en) * | 2019-12-31 | 2021-07-16 | 大陸商鄭州富聯智能工坊有限公司 | Image processing method and computer readable medium thereof |
| CN114037830A (en) * | 2021-11-10 | 2022-02-11 | 深圳市联影高端医疗装备创新研究院 | Training method for enhanced image generation model, image processing method and device |
-
2022
- 2022-12-20 TW TW111149014A patent/TWI813522B/en active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20190108420A1 (en) * | 2017-05-14 | 2019-04-11 | International Business Machines Corporation | Systems and methods for identifying a target object in an image |
| CN111126379A (en) * | 2019-11-22 | 2020-05-08 | 苏州浪潮智能科技有限公司 | A target detection method and device |
| TW202127312A (en) * | 2019-12-31 | 2021-07-16 | 大陸商鄭州富聯智能工坊有限公司 | Image processing method and computer readable medium thereof |
| CN114037830A (en) * | 2021-11-10 | 2022-02-11 | 深圳市联影高端医疗装备创新研究院 | Training method for enhanced image generation model, image processing method and device |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202427226A (en) | 2024-07-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110658198B (en) | Optical detection method, optical detection device and optical detection system | |
| CN112070134B (en) | Power equipment image classification method, device, power equipment and storage medium | |
| CN117974595A (en) | A circuit board defect detection method and system using image processing technology | |
| TW202141027A (en) | Method and system for classifying defects in wafer using wafer-defect images, based on deep learning | |
| CN113409245A (en) | Automatic identification method for X-ray inspection defects of electronic components | |
| CN103500459B (en) | Printed circuit board defect detecting method based on regularization parameters | |
| CN112053317A (en) | Workpiece surface defect detection method based on cascade neural network | |
| CN101915769A (en) | An automatic optical inspection method for resistive components in printed circuit boards | |
| CN118534302B (en) | Circuit board positioning tool detection system based on artificial intelligence | |
| TWI618940B (en) | Device and method for detecting blind hole of printed circuit board | |
| TWI715051B (en) | Machine learning method and automatic optical inspection device using the method thereof | |
| TWI798650B (en) | Automated optical inspection method, automated optical inspection system and storage medium | |
| CN116309509A (en) | Solder joint defect detection method, device, electronic device and readable storage medium | |
| CN116152244A (en) | SMT defect detection method and system | |
| CN116934737A (en) | A method for identifying and classifying weld combination defects | |
| TWI813522B (en) | Classification Model Building Method | |
| CN118071733A (en) | PCB bare board defect detection method based on improved YOLOv8 neural network | |
| CN111598858B (en) | A detection method and system for rubber gloves based on migration learning | |
| CN116881530A (en) | Device surface defect detection system based on deep learning | |
| CN112053357A (en) | FPN-based steel surface flaw detection method | |
| JP7015235B2 (en) | Range-based real-time scanning electron microscope invisible binner | |
| Ma et al. | Automated void detection in high resolution x-ray printed circuit boards (PCBs) images with deep segmentation neural network | |
| TWI856420B (en) | Lead frame delivery method | |
| CN116245802B (en) | Electronic component defect identification method and device based on convolutional neural network | |
| Yu et al. | Enhancing IC substrate manufacturing through differential geometry and lightweight networks for etching defect detection |