TW202402117A - Training method for defect detection model and defect detection method for printed circuit board - Google Patents

Training method for defect detection model and defect detection method for printed circuit board Download PDF

Info

Publication number
TW202402117A
TW202402117A TW111147431A TW111147431A TW202402117A TW 202402117 A TW202402117 A TW 202402117A TW 111147431 A TW111147431 A TW 111147431A TW 111147431 A TW111147431 A TW 111147431A TW 202402117 A TW202402117 A TW 202402117A
Authority
TW
Taiwan
Prior art keywords
printed circuit
circuit board
sample
learning
information
Prior art date
Application number
TW111147431A
Other languages
Chinese (zh)
Other versions
TWI840006B (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 大陸商蘇州康代智能科技股份有限公司
Publication of TW202402117A publication Critical patent/TW202402117A/en
Application granted granted Critical
Publication of TWI840006B publication Critical patent/TWI840006B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30141Printed circuit board [PCB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Quality & Reliability (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)

Abstract

The present disclosure provides a training method for defect detection model and defect detection method for printed circuit board, wherein the training method comprises: acquiring design document information of a printed circuit board, wherein the design document information comprises region information of the printed circuit board; scanning the printed circuit board with a scanning camera device to obtain a scanned image of the printed circuit board; generating learning samples based on the scanned image and region information of the printed circuit board, wherein each learning sample comprises a sample image and a corresponding label, comprising capturing a partial image in the scanned image to obtain a sample image and manually labeling the sample image, wherein the label obtained by manual labeling comprises region information and defect information; establishing a sample library, comprising collecting and storing learning samples generated based on multiple printed circuit boards according to above steps; using the learning samples of the sample library to train a basic model and obtain the defect detection model of printed circuit board.

Description

印刷電路板缺陷檢測模型訓練方法及缺陷檢測方法Printed circuit board defect detection model training method and defect detection method

本發明涉及PCB缺陷檢測領域,尤其涉及一種印刷電路板缺陷檢測模型訓練方法及缺陷檢測方法。The invention relates to the field of PCB defect detection, and in particular to a printed circuit board defect detection model training method and a defect detection method.

自動光學檢測(Automated Optical Inspection,簡稱AOI)設備現已成為電子製造業確保產品質量的重要檢測工具和過程質量控製工具,AOI設備的檢測原理為:當自動檢測時,AOI設備通過高清CCD攝像頭自動掃描PCB產品以採集圖像,測試的檢測點與數據庫中的合格參數進行比較,經過圖像處理,檢查出被測產品上的缺陷。Automated Optical Inspection (AOI) equipment has now become an important inspection tool and process quality control tool for the electronics manufacturing industry to ensure product quality. The detection principle of AOI equipment is: when automatically inspecting, the AOI equipment automatically Scan the PCB product to collect images, compare the test detection points with the qualified parameters in the database, and detect defects on the tested product after image processing.

通常由AOI設備檢測到缺陷後,就會將缺陷信息發送給檢修工進行檢修。但是AOI設備的檢測精度較低,比如電路板上的灰塵或者汙點都會被AOI設備誤判為缺陷,因此,需要提高現有技術中的PCB缺陷精測精度。Usually after the defect is detected by the AOI equipment, the defect information will be sent to the maintenance worker for maintenance. However, the detection accuracy of AOI equipment is low. For example, dust or stains on the circuit board will be misjudged as defects by the AOI equipment. Therefore, it is necessary to improve the precision detection accuracy of PCB defects in the existing technology.

以上背景技術內容的公開僅用於輔助理解本發明的發明構思及技術方案,其並不必然屬於本專利申請的現有技術,也不必然會給出技術教導;在沒有明確的證據表明上述內容在本專利申請的申請日之前已經公開的情況下,上述背景技術不應當用於評價本申請的新穎性和創造性。The disclosure of the above background technology content is only used to assist in understanding the inventive concepts and technical solutions of the present invention. It does not necessarily belong to the prior art of this patent application, nor does it necessarily provide technical guidance; in the absence of clear evidence that the above content is If the patent application has been published before the filing date, the above background technology should not be used to evaluate the novelty and inventiveness of the application.

本發明的目的是提供一種印刷電路板缺陷檢測模型的訓練方法,以訓練得到改進的AI模型,能夠精確並快速地識別出電路板的缺陷。The purpose of the present invention is to provide a training method for a printed circuit board defect detection model so as to train an improved AI model that can accurately and quickly identify circuit board defects.

為達到上述目的,本發明採用的技術方案如下:In order to achieve the above objects, the technical solutions adopted by the present invention are as follows:

一種印刷電路板缺陷檢測模型訓練方法,包括以下步驟:A printed circuit board defect detection model training method includes the following steps:

獲取印刷電路板的設計文檔資訊,所述設計文檔資訊包括所述印刷電路板的層資訊和/或區域塊位置資訊;並利用掃描相機設備對所述印刷電路板進行掃描,得到所述印刷電路板的掃描圖像;Obtain the design document information of the printed circuit board, the design document information includes the layer information and/or the area block position information of the printed circuit board; and use a scanning camera device to scan the printed circuit board to obtain the printed circuit board Scanned image of the plate;

基於所述印刷電路板的掃描圖像和設計文檔資訊,生成一個或多個學習樣本,每個學習樣本包括樣本圖像及對應的標簽,包括:截取所述掃描圖像中的局部圖像,得到樣本圖像,並對所述樣本圖像進行人工打標,其中,人工打標所得到的標簽包括層資訊、區域塊位置資訊中的一種或兩種資訊以及缺陷資訊;Based on the scanned image of the printed circuit board and design document information, one or more learning samples are generated. Each learning sample includes a sample image and a corresponding label, including: intercepting a partial image in the scanned image, Obtain a sample image, and perform manual marking on the sample image, where the labels obtained by manual marking include one or two types of layer information, area block position information, and defect information;

建立樣本庫,包括按照上述步驟收集並存儲基於多個印刷電路板各自生成的學習樣本;Establish a sample library, including following the above steps to collect and store learning samples generated based on multiple printed circuit boards;

利用所述樣本庫的學習樣本,對基礎模型進行訓練,得到印刷電路板缺陷檢測模型。The basic model is trained using the learning samples of the sample library to obtain a printed circuit board defect detection model.

進一步地,所述基礎模型配置有第一學習子模塊和第二學習子模塊,其中,Further, the basic model is configured with a first learning sub-module and a second learning sub-module, wherein,

所述第一學習子模塊基於學習樣本中的樣本圖像和標簽中的缺陷資訊進行學習訓練,得到中間模型;The first learning sub-module performs learning and training based on the sample images in the learning sample and the defect information in the labels to obtain an intermediate model;

所述第二學習子模塊基於學習樣本中的標簽,學習所述層資訊、區域塊位置資訊中的一種或兩種資訊與缺陷資訊之間的特徵資訊;並且,The second learning sub-module learns feature information between one or both of the layer information, region block position information and defect information based on the labels in the learning sample; and,

所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習,得到所述印刷電路板缺陷檢測模型。The intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample to obtain the printed circuit board defect detection model.

進一步地,所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習包括:Further, the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample including:

若樣本圖像對應的層信息為電源層或接地層,則所述中間模型的學習目標為將樣本圖像中的特徵學習為非短路的特徵。If the layer information corresponding to the sample image is the power layer or the ground layer, the learning goal of the intermediate model is to learn the features in the sample image to be non-short-circuit features.

進一步地,所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習包括:Further, the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample including:

若樣本圖像對應的層信息為線路層或對應的區域塊位置資訊為銅面區域,則所述中間模型將學習註意力集中在特定學習樣本上,所述特定學習樣本的標簽中的缺陷資訊為有缺陷,且缺陷類型為短路、斷路以外的其他類型,或者所述特定學習樣本的標簽中的缺陷資訊為無缺陷。If the layer information corresponding to the sample image is the line layer or the corresponding area block position information is the copper surface area, the intermediate model will focus the learning attention on the specific learning sample, and the defect information in the label of the specific learning sample is defective, and the defect type is other than short circuit or open circuit, or the defect information in the label of the specific learning sample is no defect.

進一步地,所述中間模型學習所述特定學習樣本的方法為:Further, the method for the intermediate model to learn the specific learning sample is:

若所述特定學習樣本的樣本圖像中存在兩個分開的銅特徵或連接著兩根排線的線特徵,則弱化該樣本圖像中兩個分開的銅特徵的識別力或連接著兩根排線的線特徵的識別力。If there are two separate copper features or a line feature connecting two cables in the sample image of the specific learning sample, the recognition of the two separate copper features or the line feature connecting two cables in the sample image will be weakened. The ability to identify the line features of the wiring.

進一步地,所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習包括:Further, the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample including:

若樣本圖像對應的層信息為線路層或對應的區域塊位置資訊為銅面區域,則所述中間模型學習缺陷類型為短路的缺陷資訊所對應的樣本圖像的方法為:強化該樣本圖像中兩個分開的銅特徵的識別力,或者,強化該樣本圖像中連接著兩根排線的線特徵的識別力。If the layer information corresponding to the sample image is the circuit layer or the corresponding area block position information is the copper surface area, then the method for the intermediate model to learn the sample image corresponding to the defect information of the defect type is short circuit is to strengthen the sample image. The identification of two separate copper features in the image, or, the enhancement of the identification of the line feature connecting the two cables in the sample image.

進一步地,所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習包括:Further, the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample including:

若樣本圖像對應的層信息為線路層或對應的區域塊位置資訊為銅面區域,則所述中間模型學習缺陷類型為斷路的缺陷資訊所對應的樣本圖像的方法為:強化該樣本圖像中排線上存在缺口的特徵的識別力。If the layer information corresponding to the sample image is the line layer or the corresponding area block position information is the copper surface area, then the method for the intermediate model to learn the sample image corresponding to the defect information whose defect type is a circuit break is to strengthen the sample image. The ability to identify features with gaps in the alignment line in the image.

進一步地,對所述樣本庫進行預處理,包括:遍歷樣本庫中的樣本圖像,若樣本圖像對應的層信息為線路層或對應的區域塊位置資訊為銅面區域,則利用圖像處理器對該樣本圖像中的電子器件和銅導線分別標記不同的顏色;Further, preprocessing the sample library includes: traversing the sample images in the sample library. If the layer information corresponding to the sample image is the line layer or the corresponding area block position information is the copper surface area, use the image The processor marks the electronic devices and copper wires in the sample image with different colors;

利用完成預處理後的樣本庫的學習樣本,對基礎模型進行訓練,得到印刷電路板缺陷檢測模型。The basic model is trained using the learning samples of the preprocessed sample library to obtain the printed circuit board defect detection model.

進一步地,所述掃描相機設備集成在AOI設備上,所述印刷電路板的設計文檔資訊被輸入至所述AOI設備,所述基礎模型為所述AOI設備的檢測模型或其後端的AI模型。Further, the scanning camera device is integrated on an AOI device, the design document information of the printed circuit board is input to the AOI device, and the basic model is the detection model of the AOI device or its back-end AI model.

進一步地,利用所述樣本庫構建訓練集和測試集,利用所述訓練集對所述基礎模型進行多輪次的訓練;Further, the sample library is used to construct a training set and a test set, and the training set is used to perform multiple rounds of training on the basic model;

利用所述測試集對訓練後的模型進行驗證,包括:利用均方差誤差損失函數或平均絕對值誤差損失函數來計算訓練後的模型的損失值;並且根據預測結果與標簽一致的預測次數以及預測總次數來計算訓練後的模型的準確率;Using the test set to verify the trained model includes: using the mean square error loss function or the average absolute value error loss function to calculate the loss value of the trained model; and based on the number of predictions and predictions that the prediction results are consistent with the label The total number of times is used to calculate the accuracy of the trained model;

驗證所述損失值和準確率是否均滿足預設的訓練目標,則將當前訓練後的模型作為所述印刷電路板缺陷檢測模型;否則利用所述訓練集進行疊代訓練,直至疊代訓練得到的模型的損失值和準確率均通過驗證。Verify whether the loss value and accuracy meet the preset training goals, then use the currently trained model as the printed circuit board defect detection model; otherwise, use the training set for iterative training until the iterative training results The loss value and accuracy of the model have been verified.

根據本發明的另一方面,提供了一種印刷電路板缺陷檢測方法,包括以下步驟:According to another aspect of the present invention, a printed circuit board defect detection method is provided, including the following steps:

獲取待檢測的印刷電路板的圖像及其層資訊和/或區域塊位置資訊;Obtain the image of the printed circuit board to be inspected and its layer information and/or area block position information;

將所述印刷電路板的圖像及其層資訊和/或區域塊位置資訊輸入預先完成訓練的印刷電路板缺陷檢測模型;Input the image of the printed circuit board and its layer information and/or area block position information into a printed circuit board defect detection model that has been trained in advance;

所述印刷電路板缺陷檢測模型輸出檢測結果;The printed circuit board defect detection model outputs detection results;

其中,所述印刷電路板缺陷檢測模型通過以下步驟完成訓練:Among them, the printed circuit board defect detection model is trained through the following steps:

獲取印刷電路板的設計文檔資訊,所述設計文檔資訊包括所述印刷電路板的層資訊和/或區域塊位置資訊;並利用掃描相機設備對所述印刷電路板進行掃描,得到所述印刷電路板的掃描圖像;Obtain the design document information of the printed circuit board, the design document information includes the layer information and/or the area block position information of the printed circuit board; and use a scanning camera device to scan the printed circuit board to obtain the printed circuit board Scanned image of the plate;

基於所述印刷電路板的掃描圖像和設計文檔資訊,生成一個或多個學習樣本,每個學習樣本包括樣本圖像及對應的標簽,包括:截取所述掃描圖像中的局部圖像,得到樣本圖像,並對所述樣本圖像進行人工打標,其中,人工打標所得到的標簽包括層資訊、區域塊位置資訊中的一種或兩種資訊以及缺陷資訊;Based on the scanned image of the printed circuit board and design document information, one or more learning samples are generated. Each learning sample includes a sample image and a corresponding label, including: intercepting a partial image in the scanned image, Obtain a sample image, and perform manual marking on the sample image, where the labels obtained by manual marking include one or two types of layer information, area block position information, and defect information;

建立樣本庫,包括按照上述步驟收集並存儲基於多個印刷電路板各自生成的學習樣本;Establish a sample library, including following the above steps to collect and store learning samples generated based on multiple printed circuit boards;

利用所述樣本庫的學習樣本,對基礎模型進行訓練,所述基礎模型配置有第一學習子模塊和第二學習子模塊,所述第一學習子模塊基於學習樣本中的樣本圖像和標簽中的缺陷資訊進行學習訓練,得到中間模型;所述第二學習子模塊基於學習樣本中的標簽,學習所述層資訊、區域塊位置資訊中的一種或兩種資訊與缺陷資訊之間的特徵資訊;所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習,得到所述印刷電路板缺陷檢測模型。The basic model is trained using the learning samples of the sample library. The basic model is configured with a first learning sub-module and a second learning sub-module. The first learning sub-module is based on the sample images and labels in the learning samples. Learn and train the defect information in the sample to obtain an intermediate model; the second learning sub-module learns the characteristics between one or two of the layer information, region block position information and defect information based on the labels in the learning sample Information; the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample to obtain the printed circuit board defect detection model.

進一步地,所述印刷電路板缺陷檢測模型通過如上所述的印刷電路板缺陷檢測模型訓練方法訓練得到。Further, the printed circuit board defect detection model is trained by the printed circuit board defect detection model training method as described above.

本發明提供的技術方案帶來的有益效果如下:The beneficial effects brought by the technical solution provided by the present invention are as follows:

a. 充分利用電路板的區域資訊,去學習區域信息與缺陷之間的規律,訓練得到改進的AI模型,改進後的AI模型結合電路板的區域資訊對電路板圖像進行精準識別;a. Make full use of the regional information of the circuit board to learn the rules between regional information and defects, and train an improved AI model. The improved AI model combines the regional information of the circuit board to accurately identify the circuit board image;

b. 掌握電路板區域與電路板缺陷的關聯特徵,可以快速排除某些區域不可能存在的缺陷類型,提高缺陷檢測效率和檢測結果的精準度。b. Mastering the correlation characteristics between circuit board areas and circuit board defects can quickly eliminate defect types that are impossible to exist in certain areas, improving defect detection efficiency and accuracy of detection results.

為了使本技術領域的人員更好地理解本發明方案,下面將結合本發明實施例中的附圖,對本發明實施例中的技術方案進行清楚、完整地描述,顯然,所描述的實施例僅僅是本發明一部分的實施例,而不是全部的實施例。基於本發明中的實施例,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施例,都應當屬於本發明保護的範圍。In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only These are some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall within the scope of protection of the present invention.

需要說明的是,本發明的說明書和發明申請專利範圍及上述附圖中的術語「第一」、「第二」等是用於區別類似的對象,而不必用於描述特定的順序或先後次序。應該理解這樣使用的數據在適當情況下可以互換,以便這裏描述的本發明的實施例能夠以除了在這裏圖示或描述的那些以外的順序實施。此外,術語「包括」和「具有」以及他們的任何變形,意圖在於覆蓋不排他的包含,例如,包含了一系列步驟或單元的過程、方法、裝置、產品或設備不必限於清楚地列出的那些步驟或單元,而是可包括沒有清楚地列出的或對於這些過程、方法、產品或設備固有的其他步驟或單元。It should be noted that the terms "first", "second", etc. in the description of the invention, the patent scope of the invention, and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. . It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the invention described herein are capable of being practiced in sequences other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, processes, methods, devices, products or equipment that include a series of steps or units and need not be limited to those explicitly listed. Those steps or units may instead include other steps or units not expressly listed or inherent to the processes, methods, products or devices.

在印刷電路板(PCB)缺陷檢測中,通常是將電路板的掃描圖像輸入AI模型,通過圖像分析技術去提取圖像中的特徵,分析是否符合缺陷的特徵,也就是說,目前的缺陷檢測技術中,僅對電路板圖像進行分析檢測。本發明提出了一種電路板圖像結合其相應區域資訊來作出缺陷檢測的技術,利用電路板的整層所屬區域資訊或局部所屬區域資訊來協助AI模型更快、更準地得出PCB缺陷檢測結果。如圖1所示,每個電路板/每種類型的電路板均有相應的設計文檔,裏面會詳細記錄電路板的各個層資訊,以及每層上的分佈設計資訊,稱之為區域塊位置資訊;在利用AOI設備對電路板進行掃描之前,將設計文檔輸入AOI設備,AOI設備按照設計文檔逐一地對對應的PCB各層進行掃描,本發明實施例中,AOI設備將掃描的PCB圖像與相應的PCB區域資訊(層資訊和/或區域塊位置資訊)發送給後端的AI模型,AI模型根據這兩個輸入資訊,得到PCB缺陷檢測結果,在本發明的一個實施例中,AOI具備缺陷初步識別的功能,相應地,將AOI設備識別到有缺陷的區域截取出來,得到PCB子圖像,再傳給後端的AI模型。In printed circuit board (PCB) defect detection, the scanned image of the circuit board is usually input into the AI model, and the features in the image are extracted through image analysis technology to analyze whether they match the characteristics of the defect. In other words, the current In defect detection technology, only the circuit board image is analyzed and detected. The present invention proposes a technology that combines circuit board images with corresponding area information to perform defect detection. The whole layer or local area information of the circuit board is used to assist the AI model in obtaining PCB defect detection faster and more accurately. result. As shown in Figure 1, each circuit board/each type of circuit board has a corresponding design document, which records in detail the information on each layer of the circuit board, as well as the distributed design information on each layer, which is called the area block location. Information; before using the AOI device to scan the circuit board, the design document is input into the AOI device, and the AOI device scans the corresponding PCB layers one by one according to the design document. In the embodiment of the present invention, the AOI device combines the scanned PCB image with The corresponding PCB area information (layer information and/or area block position information) is sent to the back-end AI model. The AI model obtains PCB defect detection results based on these two input information. In one embodiment of the present invention, the AOI has defects. The preliminary identification function, accordingly, intercepts the defective areas identified by the AOI device, obtains the PCB sub-image, and then passes it to the back-end AI model.

PCB掃描圖像上稍有異常的局部區域被AOI設備識別,根據經驗,其中會有被誤判的情況,比如一些灰塵或者汙點,而被截取出的子圖像發送給AI模型,由其結合各個PCB子圖像的區域信息對各個PCB子圖像進行精確識別,有效排除AOI設備誤識別的假缺陷。不同於其他PCB缺陷檢測模型,本發明中的AI模型是一種結合區域資訊對PCB圖像進行AI識別的模型,為此,本發明提出了一種對其訓練的方法,如圖2所示,印刷電路板缺陷檢測模型訓練方法包括以下步驟:A slightly abnormal local area on the PCB scan image is identified by the AOI device. According to experience, there will be misjudgements, such as some dust or stains, and the intercepted sub-image is sent to the AI model, which combines the various The regional information of PCB sub-images accurately identifies each PCB sub-image, effectively eliminating false defects misidentified by AOI equipment. Different from other PCB defect detection models, the AI model in the present invention is a model that combines regional information to perform AI recognition of PCB images. To this end, the present invention proposes a method for training it, as shown in Figure 2, Printing The circuit board defect detection model training method includes the following steps:

獲取印刷電路板的設計文檔資訊,所述設計文檔資訊包括所述印刷電路板的層資訊和/或區域塊位置資訊;並利用掃描相機設備對所述印刷電路板進行掃描,得到所述印刷電路板的掃描圖像;Obtain the design document information of the printed circuit board, the design document information includes the layer information and/or the area block position information of the printed circuit board; and use a scanning camera device to scan the printed circuit board to obtain the printed circuit board. Scanned image of the plate;

基於所述印刷電路板的掃描圖像和設計文檔資訊,生成一個或多個學習樣本,每個學習樣本包括樣本圖像及對應的標簽,包括:截取所述掃描圖像中的局部圖像,得到樣本圖像,並對所述樣本圖像進行人工打標,其中,人工打標所得到的標簽包括層資訊、區域塊位置資訊中的一種或兩種資訊以及缺陷資訊;Based on the scanned image of the printed circuit board and design document information, one or more learning samples are generated. Each learning sample includes a sample image and a corresponding label, including: intercepting a partial image in the scanned image, Obtain a sample image, and perform manual marking on the sample image, where the labels obtained by manual marking include one or two types of layer information, area block position information, and defect information;

建立樣本庫,包括按照上述步驟收集並存儲基於多個印刷電路板各自生成的學習樣本;Establish a sample library, including following the above steps to collect and store learning samples generated based on multiple printed circuit boards;

利用所述樣本庫的學習樣本,對基礎模型進行訓練,得到印刷電路板缺陷檢測模型。The basic model is trained using the learning samples of the sample library to obtain a printed circuit board defect detection model.

利用具有印刷電路板的層資訊和/或區域塊位置資訊(在圖3中簡稱為區域信息)的學習樣本,對AI基礎模型進行訓練的具體方式如下:參見圖3,所述基礎模型配置有第一學習子模塊和第二學習子模塊,其中,Using learning samples with printed circuit board layer information and/or area block position information (referred to as area information in Figure 3), the specific method of training the AI basic model is as follows: See Figure 3, the basic model is configured with The first learning sub-module and the second learning sub-module, where,

所述第一學習子模塊基於學習樣本中的樣本圖像和標簽中的缺陷資訊進行學習訓練,得到中間模型;The first learning sub-module performs learning and training based on the sample images in the learning sample and the defect information in the labels to obtain an intermediate model;

所述第二學習子模塊基於學習樣本中的標簽,學習所述層資訊、區域塊位置資訊中的一種或兩種資訊與缺陷資訊之間的特徵資訊;並且,The second learning sub-module learns feature information between one or both of the layer information, region block position information and defect information based on the labels in the learning sample; and,

所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習,得到所述印刷電路板缺陷檢測模型。The intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample to obtain the printed circuit board defect detection model.

其中,所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習包括以下幾個方面:Wherein, the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample, including the following aspects:

第一方面、第二學習子模塊學習到電源層或接地層的PCB圖像不存在短路缺陷的特徵資訊,基於此學習成果,中間模型在學習層資訊為電源層或接地層的樣本圖像時,中間模型的學習目標為將樣本圖像中的特徵學習為非短路的特徵。In the first aspect, the second learning sub-module learned that the PCB image of the power layer or ground layer does not have the characteristic information of short circuit defects. Based on this learning result, the intermediate model uses the sample image of the power layer or ground layer when the learning layer information is the sample image of the power layer or ground layer. , the learning goal of the intermediate model is to learn the features in the sample image into non-short-circuit features.

第二方面、第二學習子模塊學習到層資訊為線路層或對應的區域塊位置資訊為銅面區域的圖像中,缺陷類型大概率集中在短路、斷路兩大類型,基於此學習成果,中間模型在學習線路層或對應的區域塊位置資訊為銅面區域的樣本圖像時,中間模型將學習註意力集中在特定學習樣本上,所述特定學習樣本的標簽中的缺陷資訊為有缺陷,且缺陷類型為短路、斷路以外的其他類型,或者所述特定學習樣本的標簽中的缺陷資訊為無缺陷。即對小概率的缺陷類型進行學習,降低將線路層或銅面區域的圖像中的缺陷誤識別為短路或斷路類型的概率,提高識別正確率。In the second aspect, the second learning sub-module learned that in images where the layer information is the line layer or the corresponding area block position information is the copper surface area, the defect types are likely to be concentrated in the two types of short circuit and open circuit. Based on this learning result, When the intermediate model learns the line layer or the corresponding area block position information to be a sample image of the copper surface area, the intermediate model focuses the learning attention on the specific learning sample, and the defect information in the label of the specific learning sample is defective. , and the defect type is other than short circuit and open circuit, or the defect information in the label of the specific learning sample is no defect. That is, it learns low-probability defect types, reduces the probability of mistakenly identifying defects in images of the circuit layer or copper surface area as short circuit or open circuit types, and improves the accuracy of identification.

具體地,中間模型學習所述特定學習樣本的方法為:若所述特定學習樣本的樣本圖像中存在兩個分開的銅特徵或連接著兩根排線的線特徵,則弱化該樣本圖像中兩個分開的銅特徵的識別力或連接著兩根排線的線特徵的識別力。Specifically, the method for the intermediate model to learn the specific learning sample is: if there are two separate copper features or line features connecting two cables in the sample image of the specific learning sample, then weaken the sample image. Discrimination of two separate copper features or line features connecting two flat cables.

協力廠商面、除了第二方面的將學習註意力集中在特定學習樣本上,同樣也需要對非特定學習樣本(即標簽中的缺陷資訊為短路或斷路類型)進行學習,對於短路類型的樣本圖像,中間模型強化該樣本圖像中兩個分開的銅特徵的識別力;或者,中間模型強化該樣本圖像中連接著兩根排線的線特徵的識別力。對於斷路類型的樣本圖像,所述中間模型結合所述第二學習子模塊學習到的特徵資訊,強化該樣本圖像中排線上存在缺口的特徵的識別力。For third parties, in addition to the second aspect of focusing learning attention on specific learning samples, it is also necessary to learn non-specific learning samples (that is, the defect information in the label is short circuit or open circuit type). For short circuit type sample graphs For example, the intermediate model enhances the recognition of the two separate copper features in the sample image; or the intermediate model enhances the recognition of the line feature connecting the two cables in the sample image. For a sample image of the circuit break type, the intermediate model combines the feature information learned by the second learning sub-module to enhance the ability to identify features of gaps on the wiring line in the sample image.

在本發明的一個實施例中,電路板的區域資訊可以用來對所述樣本庫進行預處理,包括:遍歷樣本庫中的樣本圖像,若樣本圖像對應的層信息為線路層或對應的區域塊位置資訊為銅面區域,則利用圖像處理器對該樣本圖像中的電子器件和銅導線分別標記不同的顏色;利用完成預處理後的樣本庫的學習樣本,對基礎模型進行訓練,得到印刷電路板缺陷檢測模型。通過獲知哪些區域是電子器件的所在區域,哪些區域是銅導線的所在區域,可以對電子器件和銅導線分別標記不同的顏色,可以使得模型更容易區分電子器件和銅導線,進一步提高缺陷識別的效率和精確度。In one embodiment of the present invention, the area information of the circuit board can be used to preprocess the sample library, including: traversing the sample images in the sample library. If the layer information corresponding to the sample image is the circuit layer or the corresponding The area block position information is the copper surface area, and the image processor is used to mark the electronic devices and copper wires in the sample image with different colors; the basic model is trained using the learning samples of the preprocessed sample library , obtain the printed circuit board defect detection model. By knowing which areas are where electronic devices are located and which areas are where copper wires are located, electronic devices and copper wires can be marked with different colors, making it easier for the model to distinguish electronic devices and copper wires, further improving the efficiency and efficiency of defect identification. Accuracy.

在印刷電路板缺陷檢測模型的訓練過程中,還涉及模型的收斂和驗證:利用所述樣本庫構建訓練集和測試集,利用所述訓練集對所述基礎模型進行多輪次的訓練;The training process of the printed circuit board defect detection model also involves the convergence and verification of the model: using the sample library to construct a training set and a test set, and using the training set to perform multiple rounds of training on the basic model;

利用所述測試集對訓練後的模型進行驗證,包括:利用均方差誤差損失函數或平均絕對值誤差損失函數來計算訓練後的模型的損失值;並且根據預測結果與標簽一致的預測次數以及預測總次數來計算訓練後的模型的準確率: Using the test set to verify the trained model includes: using the mean square error loss function or the average absolute value error loss function to calculate the loss value of the trained model; and based on the number of predictions and predictions that the prediction results are consistent with the label The total number of times to calculate the accuracy of the trained model: ;

驗證所述損失值和準確率是否均滿足預設的訓練目標,則將當前訓練後的模型作為所述印刷電路板缺陷檢測模型;否則利用所述訓練集進行疊代訓練,直至疊代訓練得到的模型的損失值和準確率均通過驗證。Verify whether the loss value and accuracy meet the preset training goals, then use the currently trained model as the printed circuit board defect detection model; otherwise, use the training set for iterative training until the iterative training results The loss value and accuracy of the model have been verified.

在本發明的一個實施例中,提供了一種印刷電路板缺陷檢測方法,如圖4所示,檢測方法包括以下步驟:In one embodiment of the present invention, a printed circuit board defect detection method is provided. As shown in Figure 4, the detection method includes the following steps:

獲取待檢測的印刷電路板的圖像及其層資訊和/或區域塊位置資訊;Obtain the image of the printed circuit board to be inspected and its layer information and/or area block position information;

將所述印刷電路板的圖像及其層資訊和/或區域塊位置資訊輸入預先完成訓練的印刷電路板缺陷檢測模型;Input the image of the printed circuit board and its layer information and/or area block position information into a printed circuit board defect detection model that has been trained in advance;

所述印刷電路板缺陷檢測模型輸出檢測結果;The printed circuit board defect detection model outputs detection results;

其中,所述印刷電路板缺陷檢測模型通過以下步驟完成訓練:Among them, the printed circuit board defect detection model is trained through the following steps:

獲取印刷電路板的設計文檔資訊,所述設計文檔資訊包括所述印刷電路板的層資訊和/或區域塊位置資訊;並利用掃描相機設備對所述印刷電路板進行掃描,得到所述印刷電路板的掃描圖像;Obtain the design document information of the printed circuit board, the design document information includes the layer information and/or the area block position information of the printed circuit board; and use a scanning camera device to scan the printed circuit board to obtain the printed circuit board Scanned image of the plate;

基於所述印刷電路板的掃描圖像和設計文檔資訊,生成一個或多個學習樣本,每個學習樣本包括樣本圖像及對應的標簽,包括:截取所述掃描圖像中的局部圖像,得到樣本圖像,並對所述樣本圖像進行人工打標,其中,人工打標所得到的標簽包括層資訊、區域塊位置資訊中的一種或兩種資訊以及缺陷資訊;Based on the scanned image of the printed circuit board and design document information, one or more learning samples are generated. Each learning sample includes a sample image and a corresponding label, including: intercepting a partial image in the scanned image, Obtain a sample image, and perform manual marking on the sample image, where the labels obtained by manual marking include one or two types of layer information, area block position information, and defect information;

建立樣本庫,包括按照上述步驟收集並存儲基於多個印刷電路板各自生成的學習樣本;Establish a sample library, including following the above steps to collect and store learning samples generated based on multiple printed circuit boards;

利用所述樣本庫的學習樣本,對基礎模型進行訓練,所述基礎模型配置有第一學習子模塊和第二學習子模塊,所述第一學習子模塊基於學習樣本中的樣本圖像和標簽中的缺陷資訊進行學習訓練,得到中間模型;所述第二學習子模塊基於學習樣本中的標簽,學習所述層資訊、區域塊位置資訊中的一種或兩種資訊與缺陷資訊之間的特徵資訊;所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習,得到所述印刷電路板缺陷檢測模型。The basic model is trained using the learning samples of the sample library. The basic model is configured with a first learning sub-module and a second learning sub-module. The first learning sub-module is based on the sample images and labels in the learning samples. Learn and train the defect information in the sample to obtain an intermediate model; the second learning sub-module learns the characteristics between one or two of the layer information, region block position information and defect information based on the labels in the learning sample Information; the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample to obtain the printed circuit board defect detection model.

本缺陷檢測方法實施例是利用上述訓練方法實施例所訓練得到的印刷電路板缺陷檢測模型對輸入的待檢測的印刷電路板的圖像及其層資訊和/或區域塊位置資訊進行AI識別,進而輸出缺陷檢測結果。將上述印刷電路板缺陷檢測模型訓練方法實施例的全部內容通過引入本印刷電路板缺陷檢測方法實施例。This embodiment of the defect detection method uses the printed circuit board defect detection model trained in the above training method embodiment to perform AI recognition on the input image of the printed circuit board to be inspected and its layer information and/or area block position information. Then output the defect detection results. The entire content of the above embodiment of the printed circuit board defect detection model training method is introduced into this embodiment of the printed circuit board defect detection method.

需要說明的是,在本文中,諸如第一和第二等之類的關系術語僅僅用來將一個實體或者操作與另一個實體或操作區分開來,而不一定要求或者暗示這些實體或操作之間存在任何這種實際的關系或者順序。而且,術語「包括」、「包含」或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、物品或者設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、物品或者設備所固有的要素。在沒有更多限製的情況下,由語句「包括一個……」限定的要素,並不排除在包括所述要素的過程、方法、物品或者設備中還存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations are mutually exclusive. any such actual relationship or sequence exists between them. Furthermore, the terms "comprises," "comprises" or any other variations thereof are intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also those not expressly listed other elements, or elements inherent to the process, method, article or equipment. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article, or device that includes the stated element.

以上所述僅是本申請的具體實施方式,應當指出,對於本技術領域的普通技術人員來說,在不脫離本申請原理的前提下,還可以做出若幹改進和潤飾,這些改進和潤飾也應視為本申請的保護範圍。The above are only specific embodiments of the present application. It should be noted that those of ordinary skill in the technical field can also make several improvements and modifications without departing from the principles of the present application. These improvements and modifications can also be made. should be regarded as the scope of protection of this application.

without

為了更清楚地說明本申請實施例或現有技術中的技術方案,下面將對實施例或現有技術描述中所需要使用的附圖作簡單地介紹,顯而易見地,下面描述中的附圖僅僅是本申請中記載的一些實施例,對於本領域普通技術人員來講,在不付出創造性勞動的前提下,還可以根據這些附圖獲得其他的附圖。 圖1為本發明的一個示例性實施例提供的構思圖; 圖2為本發明的一個示例性實施例提供的印刷電路板缺陷檢測模型訓練的流程示意圖; 圖3為本發明的一個示例性實施例提供的利用電路板區域資訊對AI基礎模型進行訓練的流程示意圖; 圖4為本發明的一個示例性實施例提供的印刷電路板缺陷檢測的資訊流圖。 In order to more clearly explain the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the purpose of describing the embodiments or the prior art. For some of the embodiments recorded in the application, those of ordinary skill in the art can also obtain other drawings based on these drawings without exerting creative efforts. Figure 1 is a conceptual diagram provided by an exemplary embodiment of the present invention; Figure 2 is a schematic flow chart of printed circuit board defect detection model training provided by an exemplary embodiment of the present invention; Figure 3 is a schematic flowchart of training an AI basic model using circuit board area information according to an exemplary embodiment of the present invention; FIG. 4 is an information flow diagram of printed circuit board defect detection provided by an exemplary embodiment of the present invention.

Claims (12)

一種印刷電路板缺陷檢測模型訓練方法,其中,包括以下步驟: 獲取印刷電路板的設計文檔資訊,所述設計文檔資訊包括所述印刷電路板的層資訊和/或區域塊位置資訊;並利用掃描相機設備對所述印刷電路板進行掃描,得到所述印刷電路板的掃描圖像; 基於所述印刷電路板的掃描圖像和設計文檔資訊,生成一個或多個學習樣本,每個學習樣本包括樣本圖像及對應的標簽,包括:截取所述掃描圖像中的局部圖像,得到樣本圖像,並對所述樣本圖像進行人工打標,其中,人工打標所得到的標簽包括層資訊、區域塊位置資訊中的一種或兩種資訊以及缺陷資訊; 建立樣本庫,包括按照上述步驟收集並存儲基於多個印刷電路板各自生成的學習樣本; 利用所述樣本庫的學習樣本,對基礎模型進行訓練,得到印刷電路板缺陷檢測模型。 A printed circuit board defect detection model training method, which includes the following steps: Obtain the design document information of the printed circuit board, the design document information includes the layer information and/or the area block position information of the printed circuit board; and use a scanning camera device to scan the printed circuit board to obtain the printed circuit board Scanned image of the plate; Based on the scanned image of the printed circuit board and design document information, one or more learning samples are generated. Each learning sample includes a sample image and a corresponding label, including: intercepting a partial image in the scanned image, Obtain a sample image, and perform manual marking on the sample image, where the labels obtained by manual marking include one or two types of layer information, area block position information, and defect information; Establish a sample library, including following the above steps to collect and store learning samples generated based on multiple printed circuit boards; The basic model is trained using the learning samples of the sample library to obtain a printed circuit board defect detection model. 如請求項1所述的印刷電路板缺陷檢測模型訓練方法,其中,所述基礎模型配置有第一學習子模塊和第二學習子模塊, 所述第一學習子模塊基於學習樣本中的樣本圖像和標簽中的缺陷資訊進行學習訓練,得到中間模型; 所述第二學習子模塊基於學習樣本中的標簽,學習所述層資訊、區域塊位置資訊中的一種或兩種資訊與缺陷資訊之間的特徵資訊;並且, 所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習,得到所述印刷電路板缺陷檢測模型。 The printed circuit board defect detection model training method according to claim 1, wherein the basic model is configured with a first learning sub-module and a second learning sub-module, The first learning sub-module performs learning and training based on the sample images in the learning sample and the defect information in the labels to obtain an intermediate model; The second learning sub-module learns feature information between one or both of the layer information, region block position information and defect information based on the labels in the learning sample; and, The intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample to obtain the printed circuit board defect detection model. 如請求項2所述的印刷電路板缺陷檢測模型訓練方法,其中,所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習包括: 若樣本圖像對應的層信息為電源層或接地層,則所述中間模型的學習目標為將樣本圖像中的特徵學習為非短路的特徵。 The printed circuit board defect detection model training method according to claim 2, wherein the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample including : If the layer information corresponding to the sample image is the power layer or the ground layer, the learning goal of the intermediate model is to learn the features in the sample image to be non-short-circuit features. 如請求項2所述的印刷電路板缺陷檢測模型訓練方法,其中,所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習包括: 若樣本圖像對應的層信息為線路層或對應的區域塊位置資訊為銅面區域,則所述中間模型將學習註意力集中在特定學習樣本上,所述特定學習樣本的標簽中的缺陷資訊為有缺陷,且缺陷類型為短路、斷路以外的其他類型,或者所述特定學習樣本的標簽中的缺陷資訊為無缺陷。 The printed circuit board defect detection model training method according to claim 2, wherein the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample including : If the layer information corresponding to the sample image is the line layer or the corresponding area block position information is the copper surface area, the intermediate model will focus the learning attention on the specific learning sample, and the defect information in the label of the specific learning sample is defective, and the defect type is other than short circuit or open circuit, or the defect information in the label of the specific learning sample is no defect. 如請求項4所述的印刷電路板缺陷檢測模型訓練方法,其中,所述中間模型學習所述特定學習樣本的方法為: 若所述特定學習樣本的樣本圖像中存在兩個分開的銅特徵或連接著兩根排線的線特徵,則弱化該樣本圖像中兩個分開的銅特徵的識別力或連接著兩根排線的線特徵的識別力。 The printed circuit board defect detection model training method as described in claim 4, wherein the method for the intermediate model to learn the specific learning sample is: If there are two separate copper features or a line feature connecting two cables in the sample image of the specific learning sample, the recognition of the two separate copper features or the line feature connecting two cables in the sample image will be weakened. The ability to identify the line features of the wiring. 如請求項2所述的印刷電路板缺陷檢測模型訓練方法,其中,所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習包括: 若樣本圖像對應的層信息為線路層或對應的區域塊位置資訊為銅面區域,則所述中間模型學習缺陷類型為短路的缺陷資訊所對應的樣本圖像的方法為:強化該樣本圖像中兩個分開的銅特徵的識別力,或者,強化該樣本圖像中連接著兩根排線的線特徵的識別力。 The printed circuit board defect detection model training method according to claim 2, wherein the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample including : If the layer information corresponding to the sample image is the circuit layer or the corresponding area block position information is the copper surface area, then the method for the intermediate model to learn the sample image corresponding to the defect information of the defect type is short circuit is to strengthen the sample image. The identification of two separate copper features in the image, or, the enhancement of the identification of the line feature connecting the two cables in the sample image. 如請求項2所述的印刷電路板缺陷檢測模型訓練方法,其中,所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習包括: 若樣本圖像對應的層信息為線路層或對應的區域塊位置資訊為銅面區域,則所述中間模型學習缺陷類型為斷路的缺陷資訊所對應的樣本圖像的方法為:強化該樣本圖像中排線上存在缺口的特徵的識別力。 The printed circuit board defect detection model training method according to claim 2, wherein the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample including : If the layer information corresponding to the sample image is the line layer or the corresponding area block position information is the copper surface area, then the method for the intermediate model to learn the sample image corresponding to the defect information whose defect type is a circuit break is to strengthen the sample image. The ability to identify features with gaps in the alignment line in the image. 如請求項1至7中任一項所述的印刷電路板缺陷檢測模型訓練方法,其中,對所述樣本庫進行預處理,包括: 遍歷樣本庫中的樣本圖像,若樣本圖像對應的層信息為線路層或對應的區域塊位置資訊為銅面區域,則利用圖像處理器對該樣本圖像中的電子器件和銅導線分別標記不同的顏色; 利用完成預處理後的樣本庫的學習樣本,對基礎模型進行訓練,得到印刷電路板缺陷檢測模型。 The printed circuit board defect detection model training method as described in any one of claims 1 to 7, wherein preprocessing the sample library includes: Traverse the sample images in the sample library. If the layer information corresponding to the sample image is the line layer or the corresponding area block position information is the copper surface area, the image processor is used to separately analyze the electronic devices and copper wires in the sample image. Mark different colors; The basic model is trained using the learning samples of the preprocessed sample library to obtain the printed circuit board defect detection model. 如請求項1至7中任一項所述的印刷電路板缺陷檢測模型訓練方法,其中,所述掃描相機設備集成在AOI設備上,所述印刷電路板的設計文檔資訊被輸入至所述AOI設備,所述基礎模型為所述AOI設備的檢測模型或其後端的AI模型。The printed circuit board defect detection model training method according to any one of claims 1 to 7, wherein the scanning camera device is integrated on an AOI device, and the design document information of the printed circuit board is input to the AOI equipment, and the basic model is the detection model of the AOI equipment or its back-end AI model. 如請求項1至7中任一項所述的印刷電路板缺陷檢測模型訓練方法,其中,利用所述樣本庫構建訓練集和測試集,利用所述訓練集對所述基礎模型進行多輪次的訓練; 利用所述測試集對訓練後的模型進行驗證,包括:利用均方差誤差損失函數或平均絕對值誤差損失函數來計算訓練後的模型的損失值;並且根據預測結果與標簽一致的預測次數以及預測總次數來計算訓練後的模型的準確率; 驗證所述損失值和準確率是否均滿足預設的訓練目標,則將當前訓練後的模型作為所述印刷電路板缺陷檢測模型;否則利用所述訓練集進行疊代訓練,直至疊代訓練得到的模型的損失值和準確率均通過驗證。 The printed circuit board defect detection model training method according to any one of claims 1 to 7, wherein the sample library is used to construct a training set and a test set, and the training set is used to perform multiple rounds on the basic model training; Using the test set to verify the trained model includes: using the mean square error loss function or the average absolute value error loss function to calculate the loss value of the trained model; and based on the number of predictions and predictions that the prediction results are consistent with the label The total number of times is used to calculate the accuracy of the trained model; To verify whether the loss value and accuracy meet the preset training goals, the currently trained model will be used as the printed circuit board defect detection model; otherwise, the training set will be used for iterative training until the iterative training results The loss value and accuracy of the model have been verified. 一種印刷電路板缺陷檢測方法,其中,包括以下步驟: 獲取待檢測的印刷電路板的圖像及其層資訊和/或區域塊位置資訊; 將所述印刷電路板的圖像及其層資訊和/或區域塊位置資訊輸入預先完成訓練的印刷電路板缺陷檢測模型; 所述印刷電路板缺陷檢測模型輸出檢測結果; 其中,所述印刷電路板缺陷檢測模型通過以下步驟完成訓練: 獲取印刷電路板的設計文檔資訊,所述設計文檔資訊包括所述印刷電路板的層資訊和/或區域塊位置資訊;並利用掃描相機設備對所述印刷電路板進行掃描,得到所述印刷電路板的掃描圖像; 基於所述印刷電路板的掃描圖像和設計文檔資訊,生成一個或多個學習樣本,每個學習樣本包括樣本圖像及對應的標簽,包括:截取所述掃描圖像中的局部圖像,得到樣本圖像,並對所述樣本圖像進行人工打標,其中,人工打標所得到的標簽包括層資訊、區域塊位置資訊中的一種或兩種資訊以及缺陷資訊; 建立樣本庫,包括按照上述步驟收集並存儲基於多個印刷電路板各自生成的學習樣本; 利用所述樣本庫的學習樣本,對基礎模型進行訓練,所述基礎模型配置有第一學習子模塊和第二學習子模塊,所述第一學習子模塊基於學習樣本中的樣本圖像和標簽中的缺陷資訊進行學習訓練,得到中間模型;所述第二學習子模塊基於學習樣本中的標簽,學習所述層資訊、區域塊位置資訊中的一種或兩種資訊與缺陷資訊之間的特徵資訊;所述中間模型結合所述第二學習子模塊學習到的特徵資訊,對所述學習樣本中的樣本圖像進行再學習,得到所述印刷電路板缺陷檢測模型。 A printed circuit board defect detection method, which includes the following steps: Obtain the image of the printed circuit board to be inspected and its layer information and/or area block position information; Input the image of the printed circuit board and its layer information and/or area block position information into a printed circuit board defect detection model that has been trained in advance; The printed circuit board defect detection model outputs detection results; Among them, the printed circuit board defect detection model is trained through the following steps: Obtain the design document information of the printed circuit board, the design document information includes the layer information and/or the area block position information of the printed circuit board; and use a scanning camera device to scan the printed circuit board to obtain the printed circuit board. Scanned image of the plate; Based on the scanned image of the printed circuit board and design document information, one or more learning samples are generated. Each learning sample includes a sample image and a corresponding label, including: intercepting a partial image in the scanned image, Obtain a sample image, and perform manual marking on the sample image, where the labels obtained by manual marking include one or two types of layer information, area block position information, and defect information; Establish a sample library, including following the above steps to collect and store learning samples generated based on multiple printed circuit boards; The basic model is trained using the learning samples of the sample library. The basic model is configured with a first learning sub-module and a second learning sub-module. The first learning sub-module is based on the sample images and labels in the learning samples. Learn and train the defect information in the sample to obtain an intermediate model; the second learning sub-module learns the characteristics between one or two of the layer information, region block position information and defect information based on the labels in the learning sample Information; the intermediate model combines the feature information learned by the second learning sub-module to re-learn the sample images in the learning sample to obtain the printed circuit board defect detection model. 如請求項11所述的印刷電路板缺陷檢測方法,其中,所述印刷電路板缺陷檢測模型通過如請求項3至10中任一項所述的印刷電路板缺陷檢測模型訓練方法訓練得到。The printed circuit board defect detection method according to claim 11, wherein the printed circuit board defect detection model is trained by the printed circuit board defect detection model training method according to any one of claims 3 to 10.
TW111147431A 2022-06-20 2022-12-09 Training method for defect detection model and defect detection method for printed circuit board TWI840006B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210694133.8 2022-06-20
CN202210694133.8A CN114782431B (en) 2022-06-20 2022-06-20 Printed circuit board defect detection model training method and defect detection method

Publications (2)

Publication Number Publication Date
TW202402117A true TW202402117A (en) 2024-01-01
TWI840006B TWI840006B (en) 2024-04-21

Family

ID=

Also Published As

Publication number Publication date
CN114782431A (en) 2022-07-22
CN114782431B (en) 2022-10-14

Similar Documents

Publication Publication Date Title
TWI757825B (en) System and method for pcb inspection based on false defect detection
Mahalingam et al. Pcb-metal: A pcb image dataset for advanced computer vision machine learning component analysis
CN116718600B (en) Detection device for intelligent detection of wire harness product
CN113850749A (en) Method for training defect detector
Chavan et al. Quality control of PCB using image processing
CN114782431B (en) Printed circuit board defect detection model training method and defect detection method
TW202401294A (en) Pcb defect detection system and pcb defect detection method
CN113191362B (en) Transformer equipment oil leakage defect detection device and method
Londe et al. Automatic PCB defects detection and classification using MATLAB
CN116363567B (en) Wafer defect identification method and system based on AOI visual inspection
CN114226262A (en) Flaw detection method, flaw classification method and flaw detection system
TWI840006B (en) Training method for defect detection model and defect detection method for printed circuit board
WO2023080587A1 (en) Deep learning-based mlcc stacked alignment inspection system and method
CN115937555A (en) Industrial defect detection algorithm based on standardized flow model
JP7423368B2 (en) Defect detection device and method
Alves et al. Detecting Customer Induced Damages in Motherboards with Deep Neural Networks
CN112927170B (en) Automatic defect removing method in semiconductor manufacturing process
TWI749714B (en) Method for defect detection, method for defect classification and system thereof
CN1459628A (en) Circuit board plate material surface defect instant informing device
CN110989422A (en) Management system and management method for AOI (automated optical inspection) over-inspection parameters based on serial number code spraying
TWM606740U (en) Defect detection system
CN114494103A (en) Defect detection method and device
KR20210106038A (en) Automatic apparatus for inspecting separator of secondary battery using ai technology based on deep learning
TWI832180B (en) Method and system for flaw detecting
CN117853826B (en) Object surface precision identification method based on machine vision and related equipment