TWI755213B - Method and device for detecting defections, computer device and storage medium - Google Patents

Method and device for detecting defections, computer device and storage medium Download PDF

Info

Publication number
TWI755213B
TWI755213B TW109145519A TW109145519A TWI755213B TW I755213 B TWI755213 B TW I755213B TW 109145519 A TW109145519 A TW 109145519A TW 109145519 A TW109145519 A TW 109145519A TW I755213 B TWI755213 B TW I755213B
Authority
TW
Taiwan
Prior art keywords
image
error
detected
target
positive sample
Prior art date
Application number
TW109145519A
Other languages
Chinese (zh)
Other versions
TW202226052A (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 TW109145519A priority Critical patent/TWI755213B/en
Application granted granted Critical
Publication of TWI755213B publication Critical patent/TWI755213B/en
Publication of TW202226052A publication Critical patent/TW202226052A/en

Links

Images

Abstract

The present application relates to an image detection technique, and the present application provides a method and a device for detecting defections, a computer device and a storage medium. The method can obtain a detection image and a plurality of positive sample images, encode the detection image and the plurality of positive sample images to obtain a target vector and a plurality of subtexts, and decode the target vector and the plurality of subtexts. The method further obtains a bull's-eye chart image and a plurality of reconstruction images, compares the bull's-eye chart image and the detection image to obtain a target error, compares each reconstruction image and each positive sample image to obtain a reconstruction error. The method further determines a test probability and a test error of the detection image, determines an estimated probability and a sample error of each positive sample image and determines an error threshold. The method further determines a test result according to the test error and the error threshold. The present application can detect subtle defects in the detection image and improve the accuracy of a defect detection.

Description

瑕疵檢測方法、裝置、電腦裝置及儲存介質 Defect detection method, device, computer device and storage medium

本申請涉及圖像檢測技術領域,尤其涉及一種瑕疵檢測方法、裝置、電腦裝置及儲存介質。 The present application relates to the technical field of image detection, and in particular, to a defect detection method, device, computer device and storage medium.

為了提高工業產品的品質,在對工業產品進行打包前,通常會對工業產品進行一定的瑕疵檢測。由於目前的瑕疵檢測方法在重構圖像的過程中會產生一定的誤差,導致無法檢測到出有細微瑕疵的產品,從而降低瑕疵檢測的準確度。 In order to improve the quality of industrial products, certain defects are usually detected on industrial products before they are packaged. Because the current defect detection method will generate certain errors in the process of reconstructing the image, it is impossible to detect products with subtle defects, thereby reducing the accuracy of defect detection.

鑒於以上內容,有必要提供一種瑕疵檢測方法、裝置、電腦裝置及儲存介質,能夠檢測出待檢測圖像中是否具有細微瑕疵,從而提高瑕疵檢測的準確度。 In view of the above, it is necessary to provide a defect detection method, device, computer device and storage medium, which can detect whether there are subtle defects in the image to be inspected, thereby improving the accuracy of defect detection.

本申請的第一方面提供一種瑕疵檢測方法,所述瑕疵檢測方法包括:當接收到瑕疵檢測請求時,根據所述瑕疵檢測請求獲取待檢測圖像及多張正樣本圖像;利用編碼器對所述待檢測圖像進行編碼處理,得到與所述待檢測圖像對應的目標向量,並利用所述編碼器對所述多張正樣本圖像進行編碼處理,得到與所述多張正樣本圖像對應的多個潛向量; 利用與所述編碼器對應的解碼器對所述目標向量進行解碼處理,得到與所述待檢測圖像對應的靶心圖表像,並利用所述解碼器對所述多個潛向量進行解碼處理,得到與所述多張正樣本圖像對應的多張重構圖像;將所述靶心圖表像與所述待檢測圖像進行比較,得到目標誤差,並根據所述多張重構圖像及所述多張正樣本圖像確定每張正樣本圖像的重構誤差;將所述目標向量輸入至預先訓練好的高斯混合模型中,得到所述待檢測圖像的測試概率,並將所述多個潛向量輸入至所述高斯混合模型中,得到每張正樣本圖像的估測概率;根據所述目標誤差及所述測試概率確定所述待檢測圖像的測試誤差,並根據每個重構誤差及每個估測概率確定每張正樣本圖像的樣本誤差;從所述樣本誤差中選取誤差閾值,並根據所述測試誤差及所述誤差閾值確定所述待檢測圖像的檢測結果。 A first aspect of the present application provides a flaw detection method, the flaw detection method includes: when a flaw detection request is received, acquiring an image to be detected and a plurality of positive sample images according to the flaw detection request; The to-be-detected image is encoded to obtain a target vector corresponding to the to-be-detected image, and the encoder is used to encode the plurality of positive sample images to obtain a target vector corresponding to the plurality of positive samples. Multiple latent vectors corresponding to the image; The target vector is decoded by the decoder corresponding to the encoder to obtain a bullseye image corresponding to the to-be-detected image, and the decoder is used to decode the multiple latent vectors, Obtain multiple reconstructed images corresponding to the multiple positive sample images; compare the bullseye image with the to-be-detected image to obtain the target error, and determine the target error according to the multiple reconstructed images and the multiple images. The positive sample image determines the reconstruction error of each positive sample image; the target vector is input into the pre-trained Gaussian mixture model, the test probability of the to-be-detected image is obtained, and the multiple latent images are obtained. The vector is input into the Gaussian mixture model, and the estimated probability of each positive sample image is obtained; the test error of the to-be-detected image is determined according to the target error and the test probability, and according to each reconstruction error and each estimated probability to determine the sample error of each positive sample image; select an error threshold from the sample error, and determine the detection result of the to-be-detected image according to the test error and the error threshold.

本申請的第二方面提供一種瑕疵檢測裝置,所述瑕疵檢測裝置包括:獲取單元,用於當接收到瑕疵檢測請求時,根據所述瑕疵檢測請求獲取待檢測圖像及多張正樣本圖像;編碼單元,用於利用編碼器對所述待檢測圖像進行編碼處理,得到與所述待檢測圖像對應的目標向量,並利用所述編碼器對所述多張正樣本圖像進行編碼處理,得到與所述多張正樣本圖像對應的多個潛向量;解碼單元,用於利用與所述編碼器對應的解碼器對所述目標向量進行解碼處理,得到與所述待檢測圖像對應的靶心圖表像,並利用所述解碼器對所述多個潛向量進行解碼處理,得到與所述多張正樣本圖像對應的多張重構圖像; 確定單元,用於將所述靶心圖表像與所述待檢測圖像進行比較,得到目標誤差,並根據所述多張重構圖像及所述多張正樣本圖像確定每張正樣本圖像的重構誤差;輸入單元,用於將所述目標向量輸入至預先訓練好的高斯混合模型中,得到所述待檢測圖像的測試概率,並將所述多個潛向量輸入至所述高斯混合模型中,得到每張正樣本圖像的估測概率;所述確定單元,還用於根據所述目標誤差及所述測試概率確定所述待檢測圖像的測試誤差,並根據每個重構誤差及每個估測概率確定每張正樣本圖像的樣本誤差;所述確定單元,還用於從所述樣本誤差中選取誤差閾值,並根據所述測試誤差及所述誤差閾值確定所述待檢測圖像的檢測結果。 A second aspect of the present application provides a defect detection device, the defect detection device includes: an acquisition unit configured to, when a defect detection request is received, acquire an image to be detected and a plurality of positive sample images according to the defect detection request The coding unit is used to encode the image to be detected using an encoder to obtain a target vector corresponding to the image to be detected, and to encode the multiple positive sample images using the encoder processing, to obtain a plurality of latent vectors corresponding to the plurality of positive sample images; a decoding unit, used for decoding the target vector with a decoder corresponding to the encoder, to obtain a picture corresponding to the to-be-detected image image corresponding bullseye images, and use the decoder to decode the multiple latent vectors to obtain multiple reconstructed images corresponding to the multiple positive sample images; The determining unit is configured to compare the bullseye image with the to-be-detected image to obtain a target error, and determine the value of each positive sample image according to the multiple reconstructed images and the multiple positive sample images. Reconstruction error; an input unit for inputting the target vector into a pre-trained Gaussian mixture model to obtain the test probability of the to-be-detected image, and inputting the multiple latent vectors into the Gaussian mixture In the model, the estimated probability of each positive sample image is obtained; the determining unit is further configured to determine the test error of the to-be-detected image according to the target error and the test probability, and according to each reconstruction The error and each estimated probability determine the sample error of each positive sample image; the determining unit is further configured to select an error threshold from the sample error, and determine the error threshold according to the test error and the error threshold The detection result of the image to be detected.

本申請的第三方面提供一種電腦裝置,所述電腦裝置包括:儲存器,儲存至少一個指令;及處理器,獲取所述儲存器中儲存的指令以實現所述瑕疵檢測方法。 A third aspect of the present application provides a computer device, the computer device comprising: a storage for storing at least one instruction; and a processor for acquiring the instruction stored in the storage to implement the defect detection method.

本申請的第四方面提供一種電腦可讀儲存介質,所述電腦可讀儲存介質中儲存有至少一個指令,所述至少一個指令被電腦裝置中的處理器獲取以實現所述瑕疵檢測方法。 A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction, and the at least one instruction is acquired by a processor in a computer device to implement the defect detection method.

由以上技術方案可以看出,本申請透過確定圖像重構時產生的重構誤差,以及透過確定高斯混合模型產生的估測概率,能夠準確確定出誤差閾值,進而透過比較測試誤差與所述誤差閾值,由於是從數值上對所述測試誤差與所述誤差閾值進行比較,因此能夠檢測出所述待檢測圖像中是否具有細微瑕疵,從而提高瑕疵檢測的準確度。 It can be seen from the above technical solutions that the present application can accurately determine the error threshold by determining the reconstruction error generated during image reconstruction and by determining the estimated probability generated by the Gaussian mixture model, and then by comparing the test error with the above. As for the error threshold, since the test error is numerically compared with the error threshold, it is possible to detect whether there are subtle defects in the to-be-detected image, thereby improving the accuracy of defect detection.

1:電腦裝置 1: Computer device

12:儲存器 12: Storage

13:處理器 13: Processor

11:瑕疵檢測裝置 11: Defect detection device

110:獲取單元 110: Get Unit

111:編碼單元 111: coding unit

112:解碼單元 112: decoding unit

113:確定單元 113: Determine unit

114:輸入單元 114: Input unit

115:生成單元 115: Generate unit

圖1是本申請瑕疵檢測方法的較佳實施例的流程圖。 FIG. 1 is a flowchart of a preferred embodiment of the flaw detection method of the present application.

圖2是本申請瑕疵檢測裝置的較佳實施例的功能模組圖。 FIG. 2 is a functional module diagram of a preferred embodiment of the defect detection device of the present application.

圖3是本申請實現瑕疵檢測方法的較佳實施例的電腦裝置的結構示意圖。 FIG. 3 is a schematic structural diagram of a computer device for implementing a preferred embodiment of the defect detection method of the present application.

為了使本申請的目的、技術方案和優點更加清楚,下面結合附圖和具體實施例對本申請進行詳細描述。 In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in detail below with reference to the accompanying drawings and specific embodiments.

如圖1所示,是本申請瑕疵檢測方法的較佳實施例的流程圖。根據不同的需求,該流程圖中步驟的順序可以改變,某些步驟可以省略。 As shown in FIG. 1 , it is a flowchart of a preferred embodiment of the defect detection method of the present application. According to different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted.

所述瑕疵檢測方法應用於一個或者多個電腦裝置1中,所述電腦裝置1是一種能夠按照事先設定或儲存的指令,自動進行數值計算和/或資訊處理的設備,其硬體包括但不限於微處理器、專用積體電路(Application Specific Integrated Circuit,ASIC)、可程式設計閘陣列(Field-Programmable Gate Array,FPGA)、數位信號處理器(Digital Signal Processor,DSP)、嵌入式設備等。 The defect detection method is applied to one or more computer devices 1, and the computer device 1 is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but not Limited to microprocessors, Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), Digital Signal Processors (DSPs), embedded devices, etc.

所述電腦裝置1可以是任何一種可與用戶進行人機交互的電子產品,例如,個人電腦、平板電腦、智慧手機、個人數位助理(Personal Digital Assistant,PDA)、遊戲機、互動式網路電視(Internet Protocol Television,IPTV)、智慧式穿戴式設備等。 The computer device 1 can be any electronic product that can interact with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, and an interactive network television. (Internet Protocol Television, IPTV), smart wearable devices, etc.

所述電腦裝置1還可以包括網路設備和/或使用者設備。其中,所述網路設備包括,但不限於單個網路服務器、多個網路服務器組成的伺服器組或基於雲計算(Cloud Computing)的由大量主機或網路服務器構成的雲。 The computer device 1 may also include network equipment and/or user equipment. Wherein, the network device includes, but is not limited to, a single network server, a server group formed by multiple network servers, or a cloud formed by a large number of hosts or network servers based on cloud computing (Cloud Computing).

所述電腦裝置1所處的網路包括但不限於網際網路、廣域網路、都會區網路、局域網、虛擬私人網路(Virtual Private Network,VPN)等。 The network where the computer device 1 is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.

步驟S10,當接收到瑕疵檢測請求時,根據所述瑕疵檢測請求獲取待檢測圖像及多張正樣本圖像。 In step S10, when a defect detection request is received, an image to be detected and a plurality of positive sample images are acquired according to the defect detection request.

在本申請的至少一個實施例中,所述瑕疵檢測請求可以由用戶觸發(例如:透過預設功能按鍵進行觸發),也可以在預設時間內自動觸發,本申請不作限制。 In at least one embodiment of the present application, the defect detection request may be triggered by a user (eg, triggered by a preset function button), or may be automatically triggered within a preset time, which is not limited in this application.

其中,所述預設時間可以是時間點(例如:每天早上九點),也可以是時間段。 Wherein, the preset time may be a time point (for example, nine o'clock in the morning every day), or a time period.

在本申請的至少一個實施例中,所述瑕疵檢測請求中攜帶的資訊包括,但不限於:檢測對象等。 In at least one embodiment of the present application, the information carried in the defect detection request includes, but is not limited to, a detection object and the like.

在本申請的至少一個實施例中,所述電腦裝置根據所述瑕疵檢測請求獲取待檢測圖像及多張正樣本圖像包括:解析所述瑕疵檢測請求的方法體,得到所述瑕疵檢測請求攜帶的資料資訊;獲取預設標籤,並從所述資料資訊中獲取與所述預設標籤對應的資訊,作為所述檢測物件;根據所述檢測物件從待檢測庫中獲取所述待檢測圖像,並根據所述檢測物件從樣本庫中獲取所述多張正樣本圖像。 In at least one embodiment of the present application, the computer device acquiring the image to be detected and the plurality of positive sample images according to the flaw detection request includes: parsing the method body of the flaw detection request to obtain the flaw detection request data information carried; obtain a preset label, and obtain information corresponding to the preset label from the data information, as the detection object; obtain the to-be-detected image from the to-be-detected library according to the detection object image, and obtain the plurality of positive sample images from the sample library according to the detection object.

其中,所述預設標籤是指預先定義好的標籤,例如,所述預設標籤可以是name。 Wherein, the preset tag refers to a pre-defined tag, for example, the preset tag may be name.

進一步地,所述待檢測庫中儲存未進行瑕疵檢測的待檢測圖像,所述樣本庫中儲存多張無瑕疵的正樣本圖像。 Further, the to-be-detected images without flaw detection are stored in the to-be-detected library, and a plurality of flawless positive sample images are stored in the sample library.

透過解析所述瑕疵檢測請求的方法體,能夠縮短所述瑕疵檢測請求的解析時長,進而提高解析效率,進而透過預設標籤與檢測物件的映射關係,能夠準確確定所述檢測物件,進而能夠準確獲取所述待檢測圖像以及所述多張正樣本圖像。 By parsing the method body of the flaw detection request, the parsing time of the flaw detection request can be shortened, thereby improving parsing efficiency, and the detection object can be accurately determined through the mapping relationship between the preset label and the detection object, and then the detection object can be accurately determined. Accurately acquire the to-be-detected image and the multiple positive sample images.

步驟S11,利用編碼器對所述待檢測圖像進行編碼處理,得到與所述待檢測圖像對應的目標向量,並利用所述編碼器對所述多張正樣本圖像進行編碼處理,得到與所述多張正樣本圖像對應的多個潛向量。 Step S11, using an encoder to perform encoding processing on the image to be detected to obtain a target vector corresponding to the image to be detected, and using the encoder to perform encoding processing on the plurality of positive sample images to obtain: a plurality of latent vectors corresponding to the plurality of positive sample images.

在本申請的至少一個實施例中,所述編碼器可以是自編碼器(autoencoder,AE)中的編碼器。進一步地,所述編碼器中包含多個隱層,所述多個隱層的數量可以根據應用場景任意設置。 In at least one embodiment of the present application, the encoder may be an encoder in an autoencoder (AE). Further, the encoder includes multiple hidden layers, and the number of the multiple hidden layers can be arbitrarily set according to application scenarios.

在本申請的至少一個實施例中,所述電腦裝置利用編碼器對所述待檢測圖像進行編碼處理,得到與所述待檢測圖像對應的目標向量包括:對所述待檢測圖像進行向量化處理,得到所述待檢測圖像的第一特徵向量;提取所述編碼器中的隱層;利用所述隱層對所述第一特徵向量進行運算,得到所述目標向量。 In at least one embodiment of the present application, the computer device performs encoding processing on the image to be detected by using an encoder, and obtaining a target vector corresponding to the image to be detected includes: performing an encoding process on the image to be detected. Vectorization processing is performed to obtain the first feature vector of the image to be detected; the hidden layer in the encoder is extracted; the first feature vector is operated by using the hidden layer to obtain the target vector.

具體地,所述電腦裝置利用所述隱層對所述第一特徵向量進行運算,得到所述目標向量包括:獲取所述隱層的權重矩陣及偏置值;將所述第一特徵向量與所述權重矩陣進行相乘運算,得到運算結果;將所述運算結果與所述偏置值進行相加運算,得到所述目標向量。 Specifically, the computer device uses the hidden layer to operate on the first eigenvector, and obtaining the target vector includes: obtaining the weight matrix and offset value of the hidden layer; combining the first eigenvector with The weight matrix is multiplied to obtain an operation result; the operation result and the offset value are added to obtain the target vector.

在其他實施例中,所述電腦裝置利用所述隱層對每個第二特徵向量進行運算的方式與所述電腦裝置利用所述隱層對所述第一特徵向量進行運算的方式相同,本申請對此不再贅述。 In other embodiments, the computer device uses the hidden layer to operate each second feature vector in the same manner as the computer device uses the hidden layer to operate the first feature vector. The application will not repeat this.

步驟S12,利用與所述編碼器對應的解碼器對所述目標向量進行解碼處理,得到與所述待檢測圖像對應的靶心圖表像,並利用所述解碼器對所述多個潛向量進行解碼處理,得到與所述多張正樣本圖像對應的多張重構圖像。 Step S12, use the decoder corresponding to the encoder to decode the target vector to obtain a bullseye image corresponding to the to-be-detected image, and use the decoder to perform decoding on the multiple latent vectors. A decoding process is performed to obtain a plurality of reconstructed images corresponding to the plurality of positive sample images.

在本申請的至少一個實施例中,所述解碼器可以是所述自編碼器中的解碼器。進一步地,所述解碼器中包含與所述編碼器中的隱層對應的運算層。 In at least one embodiment of the present application, the decoder may be a decoder in the auto-encoder. Further, the decoder includes an operation layer corresponding to the hidden layer in the encoder.

在本申請的至少一個實施例中,所述電腦裝置利用所述運算層對所述目標向量進行運算,並對運算後得到的向量進行還原處理,得到所述目標向量。 In at least one embodiment of the present application, the computer apparatus operates on the target vector by using the operation layer, and performs reduction processing on the vector obtained after the operation to obtain the target vector.

在其他實施例中,所述電腦裝置得到所述多張重構圖像的方式與得到所述目標向量的方式相同,本申請對此不再贅述。 In other embodiments, the manner in which the computer device obtains the plurality of reconstructed images is the same as the manner in which the target vector is obtained, which will not be repeated in this application.

步驟S13,將所述靶心圖表像與所述待檢測圖像進行比較,得到目標誤差,並根據所述多張重構圖像及所述多張正樣本圖像確定每張正樣本圖像的重構誤差。 Step S13, compare the bullseye image with the to-be-detected image to obtain the target error, and determine the reconstruction of each positive sample image according to the multiple reconstructed images and the multiple positive sample images error.

在本申請的至少一個實施例中,所述目標誤差是指所述待檢測圖像在重構時產生的誤差。 In at least one embodiment of the present application, the target error refers to an error generated during reconstruction of the image to be detected.

在本申請的至少一個實施例中,所述電腦裝置將所述靶心圖表像與所述待檢測圖像進行比較,得到目標誤差包括:提取所述待檢測圖像的所有圖元點,得到多個待檢測圖元點,並提取所述靶心圖表像的所有圖元點,得到多個目標圖元點;將每個目標圖元點與每個待檢測圖元點進行比較,得到比較結果;當比較結果表明目標圖元點與待檢測圖元點不同時,計算目標圖元點與待檢測圖元點不同的數量,並作為第一數量,以及計算所述多個目標圖元點的數量作為第二數量;將所述第一數量除以所述第二數量,得到所述目標誤差。 In at least one embodiment of the present application, the computer device compares the bullseye image with the to-be-detected image, and obtaining the target error includes: extracting all the primitive points of the to-be-detected image to obtain multiple each primitive point to be detected, and extract all primitive points of the bullseye image to obtain a plurality of target primitive points; compare each target primitive point with each primitive point to be detected to obtain a comparison result; When the comparison result shows that the target primitive point is different from the to-be-detected primitive point, calculate the number of the target primitive point and the to-be-detected primitive point different as the first number, and calculate the number of the multiple target primitive points As a second quantity; the target error is obtained by dividing the first quantity by the second quantity.

透過上述實施方式,能夠準確確定所述目標誤差。 Through the above-described embodiments, the target error can be accurately determined.

在其他實施例中,所述電腦裝置確定每張正樣本圖像的重構誤差的方式與確定所述目標誤差的方式相同,本申請對此不再贅述。 In other embodiments, the method of determining the reconstruction error of each positive sample image by the computer device is the same as the method of determining the target error, which will not be repeated in this application.

步驟S14,將所述目標向量輸入至預先訓練好的高斯混合模型(Gaussian Mixture Model,GMM)中,得到所述待檢測圖像的測試概率,並將所述多個潛向量輸入至所述高斯混合模型中,得到每張正樣本圖像的估測概率。 Step S14, inputting the target vector into a pre-trained Gaussian Mixture Model (GMM) to obtain the test probability of the image to be detected, and inputting the multiple latent vectors into the Gaussian Mixture Model (GMM) In the mixed model, the estimated probability of each positive sample image is obtained.

在本申請的至少一個實施例中,所述高斯混合模型是指開源的混合模型,所述高斯混合模型中包括多個單高斯模型。 In at least one embodiment of the present application, the Gaussian mixture model refers to an open-source mixture model, and the Gaussian mixture model includes a plurality of single Gaussian models.

在本申請的至少一個實施例中,所述電腦裝置將所述目標向量輸入至預先訓練好的高斯混合模型中,得到所述待檢測圖像的測試概率,並將所述多個潛向量輸入至所述高斯混合模型中,得到每張正樣本圖像的估測概率包括:將所述多個潛向量輸入至所述高斯混合模型中,得到所述多張正樣本圖像的特徵分佈;根據所述特徵分佈確定所述多個潛向量的平均值及協方差,並獲取所述高斯混合模型的混合係數;根據所述目標向量、所述平均值、所述協方差及所述混合係數確定所述待檢測圖像的測試概率,並根據每個潛向量、所述平均值、所述協方差及所述混合係數確定每張正樣本圖像的估測概率。 In at least one embodiment of the present application, the computer device inputs the target vector into a pre-trained Gaussian mixture model, obtains the test probability of the to-be-detected image, and inputs the multiple latent vectors into In the Gaussian mixture model, obtaining the estimated probability of each positive sample image includes: inputting the multiple latent vectors into the Gaussian mixture model to obtain the feature distribution of the multiple positive sample images; Determine the mean value and covariance of the multiple latent vectors according to the feature distribution, and obtain the mixture coefficient of the Gaussian mixture model; according to the target vector, the mean value, the covariance and the mixture coefficient The test probability of the image to be detected is determined, and the estimated probability of each positive sample image is determined according to each latent vector, the average value, the covariance and the mixing coefficient.

透過上述實施方式,能夠準確確定所述測試概率及所述估測概率。 Through the above embodiment, the test probability and the estimated probability can be accurately determined.

步驟S15,根據所述目標誤差及所述測試概率確定所述待檢測圖像的測試誤差,並根據每個重構誤差及每個估測概率確定每張正樣本圖像的樣本誤差。 Step S15: Determine the test error of the to-be-detected image according to the target error and the test probability, and determine the sample error of each positive sample image according to each reconstruction error and each estimated probability.

在本申請的至少一個實施例中,所述電腦裝置根據每個重構誤差及每個估測概率確定每張正樣本圖像的樣本誤差包括:計算每個估測概率的對數,得到每個估測概率的對數值;對每個對數值的相反數及每個重構誤差進行加權和運算,得到所述樣本誤差。 In at least one embodiment of the present application, the computer device determining the sample error of each positive sample image according to each reconstruction error and each estimated probability includes: calculating the logarithm of each estimated probability to obtain each Estimate the log value of the probability; perform a weighted sum operation on the inverse of each log value and each reconstruction error to obtain the sample error.

例如:估測概率為0.01,重構誤差為0.03,計算估測概率的對數,得到對數值為:log(0.01)=-2,計算對數值的相反數,得到值為2,計算2及0.03的加權和,當估測概率占樣本誤差的比例為20%,重構誤差占樣本誤差的比例為80%,計算得到所述樣本誤差為:2*20%+0.03*80%=0.424。 For example: the estimated probability is 0.01, the reconstruction error is 0.03, the logarithm of the estimated probability is calculated, and the logarithm value is: log(0.01)=-2, the inverse of the logarithm value is calculated, and the value is 2, calculate 2 and 0.03 The weighted sum of , when the estimated probability accounts for 20% of the sample error, and the reconstruction error accounts for 80% of the sample error, the calculated sample error is: 2*20%+0.03*80%=0.424.

透過上述實施方式,能夠確定圖像重構過程及概率分佈產生的誤差區間。 Through the above-mentioned embodiments, the error interval generated by the image reconstruction process and the probability distribution can be determined.

步驟S16,從所述樣本誤差中選取誤差閾值,並根據所述測試誤差及所述誤差閾值確定所述待檢測圖像的檢測結果。 Step S16, selecting an error threshold from the sample errors, and determining the detection result of the to-be-detected image according to the test error and the error threshold.

在本申請的至少一個實施例中,所述檢測結果包括所述待檢測圖像有瑕疵及所述待檢測圖像無瑕疵。 In at least one embodiment of the present application, the detection result includes that the image to be inspected is defective and the image to be inspected is flawless.

在本申請的至少一個實施例中,所述電腦裝置從所述樣本誤差中選取誤差閾值包括:將所述樣本誤差按照從小至大的順序進行排序,得到誤差清單及每個樣本誤差的樣本序號;計算所述樣本誤差的數量,並將所述數量乘以配置值,得到目標數值;從所述誤差清單中選取樣本序號等於所述目標數值的樣本誤差,作為所述誤差閾值。 In at least one embodiment of the present application, selecting the error threshold from the sample errors by the computer device includes: sorting the sample errors in ascending order to obtain an error list and a sample serial number of each sample error ; Calculate the quantity of the sample error, and multiply the quantity by the configuration value to obtain the target value; select the sample error whose sample serial number is equal to the target value from the error list as the error threshold.

透過上述實施方式,能夠確定影響圖像重構過程及概率分佈時產生的誤差。 Through the above-described embodiments, errors generated when the image reconstruction process and probability distribution are affected can be determined.

在本申請的至少一個實施例中,所述電腦裝置根據所述測試誤差及所述誤差閾值確定所述待檢測圖像的檢測結果包括:當所述測試誤差小於所述誤差閾值時,將所述檢測結果確定為所述待檢測圖像無瑕疵;或者當所述測試誤差大於或者等於所述誤差閾值時,將所述檢測結果確定為所述待檢測圖像有瑕疵。 In at least one embodiment of the present application, the computer device determining the detection result of the to-be-detected image according to the test error and the error threshold includes: when the test error is less than the error threshold, setting the The detection result is determined as the image to be detected is flawless; or when the test error is greater than or equal to the error threshold, the detection result is determined as the image to be detected as defective.

透過所述測試誤差與所述誤差閾值進行比較,由於是從數值上對所述測試誤差與所述誤差閾值進行比較,因此,能夠檢測出所述待檢測圖像中是否具有細微瑕疵,從而提高瑕疵檢測的準確度。 By comparing the test error with the error threshold, since the test error is numerically compared with the error threshold, it is possible to detect whether there are subtle flaws in the image to be detected, thereby improving the performance of the image. Accuracy of flaw detection.

在本申請的至少一個實施例中,當所述待檢測圖像有瑕疵時,所述電腦裝置根據所述待檢測圖像生成提醒資訊,並將所述提醒資訊發送至指定連絡人的終端設備中。 In at least one embodiment of the present application, when the image to be detected is defective, the computer device generates reminder information according to the image to be detected, and sends the reminder information to a terminal device of a designated contact person middle.

其中,所述指定連絡人可以是負責檢測所述檢測物件的品質人員。 Wherein, the designated contact person may be a quality person responsible for testing the testing object.

透過上述實施方式,能夠在所述待檢測圖像中有瑕疵時,及時通知所述指定連絡人。 Through the above-mentioned embodiment, when there is a defect in the image to be detected, the designated contact person can be notified in time.

由以上技術方案可以看出,本申請透過確定圖像重構時產生的重構誤差,以及透過確定高斯混合模型產生的估測概率,能夠準確確定出誤差閾值,進而透過比較測試誤差與所述誤差閾值,由於是從數值上對所述測試誤差與所述誤差閾值進行比較,因此能夠檢測出所述待檢測圖像中是否具有細微瑕疵,從而提高瑕疵檢測的準確度。 It can be seen from the above technical solutions that the present application can accurately determine the error threshold by determining the reconstruction error generated during image reconstruction and by determining the estimated probability generated by the Gaussian mixture model, and then by comparing the test error with the above. As for the error threshold, since the test error is numerically compared with the error threshold, it is possible to detect whether there are subtle defects in the to-be-detected image, thereby improving the accuracy of defect detection.

如圖2所示,是本申請瑕疵檢測裝置的較佳實施例的功能模組圖。所述瑕疵檢測裝置11包括獲取單元110、編碼單元111、解碼單元112、確定單元113、輸入單元114及生成單元115。本申請所稱的模組/單元是指一種能夠被處理器13所獲取,並且能夠完成固定功能的一系列電腦程式段,其儲存在儲存器12中。在本實施例中,關於各模組/單元的功能將在後續的實施例中詳述。 As shown in FIG. 2 , it is a functional module diagram of a preferred embodiment of the defect detection device of the present application. The defect detection device 11 includes an acquisition unit 110 , an encoding unit 111 , a decoding unit 112 , a determination unit 113 , an input unit 114 and a generation unit 115 . The module/unit referred to in this application refers to a series of computer program segments that can be acquired by the processor 13 and can perform fixed functions, and are stored in the storage 12 . In this embodiment, the functions of each module/unit will be described in detail in subsequent embodiments.

當接收到瑕疵檢測請求時,獲取單元110根據所述瑕疵檢測請求獲取待檢測圖像及多張正樣本圖像。 When receiving the defect detection request, the acquiring unit 110 acquires the image to be detected and a plurality of positive sample images according to the defect detection request.

在本申請的至少一個實施例中,所述瑕疵檢測請求可以由用戶觸發(例如:透過預設功能按鍵進行觸發),也可以在預設時間內自動觸發,本申請不作限制。 In at least one embodiment of the present application, the defect detection request may be triggered by a user (eg, triggered by a preset function button), or may be automatically triggered within a preset time, which is not limited in this application.

其中,所述預設時間可以是時間點(例如:每天早上九點),也可以是時間段。 Wherein, the preset time may be a time point (for example, nine o'clock in the morning every day), or a time period.

在本申請的至少一個實施例中,所述瑕疵檢測請求中攜帶的資訊包括,但不限於:檢測對象等。 In at least one embodiment of the present application, the information carried in the defect detection request includes, but is not limited to, a detection object and the like.

在本申請的至少一個實施例中,所述獲取單元110根據所述瑕疵檢測請求獲取待檢測圖像及多張正樣本圖像包括:解析所述瑕疵檢測請求的方法體,得到所述瑕疵檢測請求攜帶的資料資訊;獲取預設標籤,並從所述資料資訊中獲取與所述預設標籤對應的資訊,作為所述檢測物件;根據所述檢測物件從待檢測庫中獲取所述待檢測圖像,並根據所述檢測物件從樣本庫中獲取所述多張正樣本圖像。 In at least one embodiment of the present application, the acquiring unit 110 acquiring the image to be detected and a plurality of positive sample images according to the flaw detection request includes: parsing the method body of the flaw detection request to obtain the flaw detection request Request the carried data information; obtain a preset label, and obtain the information corresponding to the preset label from the data information as the detection object; obtain the to-be-detected object from the to-be-detected library according to the detection object image, and obtain the plurality of positive sample images from the sample library according to the detection object.

其中,所述預設標籤是指預先定義好的標籤,例如,所述預設標籤可以是name。 Wherein, the preset tag refers to a pre-defined tag, for example, the preset tag may be name.

進一步地,所述待檢測庫中儲存未進行瑕疵檢測的待檢測圖像,所述樣本庫中儲存多張無瑕疵的正樣本圖像。 Further, the to-be-detected images without flaw detection are stored in the to-be-detected library, and a plurality of flawless positive sample images are stored in the sample library.

透過解析所述瑕疵檢測請求的方法體,能夠縮短所述瑕疵檢測請求的解析時長,進而提高解析效率,進而透過預設標籤與檢測物件的映射關係,能夠準確確定所述檢測物件,進而能夠準確獲取所述待檢測圖像以及所述多張正樣本圖像。 By parsing the method body of the flaw detection request, the parsing time of the flaw detection request can be shortened, thereby improving parsing efficiency, and the detection object can be accurately determined through the mapping relationship between the preset label and the detection object, and then the detection object can be accurately determined. Accurately acquire the to-be-detected image and the multiple positive sample images.

編碼單元111利用編碼器對所述待檢測圖像進行編碼處理,得到與所述待檢測圖像對應的目標向量,並利用所述編碼器對所述多張正樣本圖像進行編碼處理,得到與所述多張正樣本圖像對應的多個潛向量。 The encoding unit 111 uses an encoder to perform encoding processing on the image to be detected to obtain a target vector corresponding to the image to be detected, and uses the encoder to perform encoding processing on the plurality of positive sample images to obtain a plurality of latent vectors corresponding to the plurality of positive sample images.

在本申請的至少一個實施例中,所述編碼器可以是自編碼器(autoencoder,AE)中的編碼器。進一步地,所述編碼器中包含多個隱層,所述多個隱層的數量可以根據應用場景任意設置。 In at least one embodiment of the present application, the encoder may be an encoder in an autoencoder (AE). Further, the encoder includes multiple hidden layers, and the number of the multiple hidden layers can be arbitrarily set according to application scenarios.

在本申請的至少一個實施例中,所述編碼單元111利用編碼器對所述待檢測圖像進行編碼處理,得到與所述待檢測圖像對應的目標向量包括:對所述待檢測圖像進行向量化處理,得到所述待檢測圖像的第一特徵向量; 提取所述編碼器中的隱層;利用所述隱層對所述第一特徵向量進行運算,得到所述目標向量。 In at least one embodiment of the present application, the encoding unit 111 uses an encoder to perform encoding processing on the image to be detected, and obtaining a target vector corresponding to the image to be detected includes: encoding the image to be detected Perform vectorization processing to obtain the first feature vector of the to-be-detected image; Extracting the hidden layer in the encoder; using the hidden layer to operate on the first feature vector to obtain the target vector.

具體地,所述編碼單元111利用所述隱層對所述第一特徵向量進行運算,得到所述目標向量包括:獲取所述隱層的權重矩陣及偏置值;將所述第一特徵向量與所述權重矩陣進行相乘運算,得到運算結果;將所述運算結果與所述偏置值進行相加運算,得到所述目標向量。 Specifically, the encoding unit 111 uses the hidden layer to operate on the first feature vector, and obtaining the target vector includes: acquiring the weight matrix and offset value of the hidden layer; Perform a multiplication operation with the weight matrix to obtain an operation result; perform an addition operation on the operation result and the offset value to obtain the target vector.

在其他實施例中,所述編碼單元111利用所述隱層對每個第二特徵向量進行運算的方式與所述編碼單元111利用所述隱層對所述第一特徵向量進行運算的方式相同,本申請對此不再贅述。 In other embodiments, the encoding unit 111 uses the hidden layer to operate each second feature vector in the same manner as the encoding unit 111 uses the hidden layer to operate the first feature vector , which will not be repeated in this application.

解碼單元112利用與所述編碼器對應的解碼器對所述目標向量進行解碼處理,得到與所述待檢測圖像對應的靶心圖表像,並利用所述解碼器對所述多個潛向量進行解碼處理,得到與所述多張正樣本圖像對應的多張重構圖像。 The decoding unit 112 uses the decoder corresponding to the encoder to decode the target vector to obtain a bullseye image corresponding to the image to be detected, and uses the decoder to perform decoding on the multiple latent vectors. A decoding process is performed to obtain a plurality of reconstructed images corresponding to the plurality of positive sample images.

在本申請的至少一個實施例中,所述解碼器可以是所述自編碼器中的解碼器。進一步地,所述解碼器中包含與所述編碼器中的隱層對應的運算層。 In at least one embodiment of the present application, the decoder may be a decoder in the auto-encoder. Further, the decoder includes an operation layer corresponding to the hidden layer in the encoder.

在本申請的至少一個實施例中,所述解碼單元112利用所述運算層對所述目標向量進行運算,並對運算後得到的向量進行還原處理,得到所述目標向量。 In at least one embodiment of the present application, the decoding unit 112 uses the operation layer to operate on the target vector, and performs restoration processing on the vector obtained after the operation to obtain the target vector.

在其他實施例中,所述解碼單元112得到所述多張重構圖像的方式與得到所述目標向量的方式相同,本申請對此不再贅述。 In other embodiments, the manner in which the decoding unit 112 obtains the plurality of reconstructed images is the same as the manner in which the target vector is obtained, which will not be repeated in this application.

確定單元113將所述靶心圖表像與所述待檢測圖像進行比較,得到目標誤差,並根據所述多張重構圖像及所述多張正樣本圖像確定每張正樣本圖像的重構誤差。 The determining unit 113 compares the bullseye image with the to-be-detected image to obtain the target error, and determines the reconstruction of each positive sample image according to the multiple reconstructed images and the multiple positive sample images error.

在本申請的至少一個實施例中,所述目標誤差是指所述待檢測圖像在重構時產生的誤差。 In at least one embodiment of the present application, the target error refers to an error generated during reconstruction of the image to be detected.

在本申請的至少一個實施例中,所述確定單元113將所述靶心圖表像與所述待檢測圖像進行比較,得到目標誤差包括:提取所述待檢測圖像的所有圖元點,得到多個待檢測圖元點,並提取所述靶心圖表像的所有圖元點,得到多個目標圖元點;將每個目標圖元點與每個待檢測圖元點進行比較,得到比較結果;當比較結果表明目標圖元點與待檢測圖元點不同時,計算目標圖元點與待檢測圖元點不同的數量,並作為第一數量,以及計算所述多個目標圖元點的數量作為第二數量;將所述第一數量除以所述第二數量,得到所述目標誤差。 In at least one embodiment of the present application, the determining unit 113 compares the bullseye image with the image to be detected, and obtaining the target error includes: extracting all the primitive points of the image to be detected, and obtaining multiple primitive points to be detected, and extract all primitive points of the bullseye image to obtain multiple target primitive points; compare each target primitive point with each primitive point to be detected to obtain a comparison result ; When the comparison result shows that the target primitive point is different from the primitive point to be detected, calculate the different quantity of the target primitive point and the primitive point to be detected, and use it as the first quantity, and calculate the number of the plurality of target primitive points. Quantity as the second quantity; dividing the first quantity by the second quantity to obtain the target error.

透過上述實施方式,能夠準確確定所述目標誤差。 Through the above-described embodiments, the target error can be accurately determined.

在其他實施例中,所述確定單元113確定每張正樣本圖像的重構誤差的方式與確定所述目標誤差的方式相同,本申請對此不再贅述。 In other embodiments, the manner in which the determining unit 113 determines the reconstruction error of each positive sample image is the same as the manner in which the target error is determined, which will not be repeated in this application.

輸入單元114將所述目標向量輸入至預先訓練好的高斯混合模型(Gaussian Mixture Model,GMM)中,得到所述待檢測圖像的測試概率,並將所述多個潛向量輸入至所述高斯混合模型中,得到每張正樣本圖像的估測概率。 The input unit 114 inputs the target vector into a pre-trained Gaussian Mixture Model (GMM), obtains the test probability of the image to be detected, and inputs the multiple latent vectors into the Gaussian In the mixed model, the estimated probability of each positive sample image is obtained.

在本申請的至少一個實施例中,所述高斯混合模型是指開源的混合模型,所述高斯混合模型中包括多個單高斯模型。 In at least one embodiment of the present application, the Gaussian mixture model refers to an open-source mixture model, and the Gaussian mixture model includes a plurality of single Gaussian models.

在本申請的至少一個實施例中,所述輸入單元114將所述目標向量輸入至預先訓練好的高斯混合模型中,得到所述待檢測圖像的測試概率,並將所述多個潛向量輸入至所述高斯混合模型中,得到每張正樣本圖像的估測概率包括:將所述多個潛向量輸入至所述高斯混合模型中,得到所述多張正樣本圖像的特徵分佈; 根據所述特徵分佈確定所述多個潛向量的平均值及協方差,並獲取所述高斯混合模型的混合係數;根據所述目標向量、所述平均值、所述協方差及所述混合係數確定所述待檢測圖像的測試概率,並根據每個潛向量、所述平均值、所述協方差及所述混合係數確定每張正樣本圖像的估測概率。 In at least one embodiment of the present application, the input unit 114 inputs the target vector into a pre-trained Gaussian mixture model to obtain the test probability of the to-be-detected image, and converts the multiple latent vectors Input into the Gaussian mixture model, and obtaining the estimated probability of each positive sample image includes: inputting the multiple latent vectors into the Gaussian mixture model to obtain the feature distribution of the multiple positive sample images ; Determine the mean value and covariance of the multiple latent vectors according to the feature distribution, and obtain the mixture coefficient of the Gaussian mixture model; according to the target vector, the mean value, the covariance and the mixture coefficient The test probability of the image to be detected is determined, and the estimated probability of each positive sample image is determined according to each latent vector, the average value, the covariance and the mixing coefficient.

透過上述實施方式,能夠準確確定所述測試概率及所述估測概率。 Through the above embodiment, the test probability and the estimated probability can be accurately determined.

所述確定單元113根據所述目標誤差及所述測試概率確定所述待檢測圖像的測試誤差,並根據每個重構誤差及每個估測概率確定每張正樣本圖像的樣本誤差。 The determining unit 113 determines the test error of the to-be-detected image according to the target error and the test probability, and determines the sample error of each positive sample image according to each reconstruction error and each estimated probability.

在本申請的至少一個實施例中,所述確定單元113根據每個重構誤差及每個估測概率確定每張正樣本圖像的樣本誤差包括:計算每個估測概率的對數,得到每個估測概率的對數值;對每個對數值的相反數及每個重構誤差進行加權和運算,得到所述樣本誤差。 In at least one embodiment of the present application, the determining unit 113 determining the sample error of each positive sample image according to each reconstruction error and each estimated probability includes: calculating the logarithm of each estimated probability to obtain each logarithmic values of the estimated probabilities; perform a weighted sum operation on the inverse of each logarithmic value and each reconstruction error to obtain the sample error.

例如:估測概率為0.01,重構誤差為0.03,計算估測概率的對數,得到對數值為:log(0.01)=-2,計算對數值的相反數,得到值為2,計算2及0.03的加權和,當估測概率占樣本誤差的比例為20%,重構誤差占樣本誤差的比例為80%,計算得到所述樣本誤差為:2*20%+0.03*80%=0.424。 For example: the estimated probability is 0.01, the reconstruction error is 0.03, the logarithm of the estimated probability is calculated, and the logarithm value is: log(0.01)=-2, the inverse of the logarithm value is calculated, and the value is 2, calculate 2 and 0.03 The weighted sum of , when the estimated probability accounts for 20% of the sample error, and the reconstruction error accounts for 80% of the sample error, the calculated sample error is: 2*20%+0.03*80%=0.424.

透過上述實施方式,能夠確定圖像重構過程及概率分佈產生的誤差區間。 Through the above-mentioned embodiments, the error interval generated by the image reconstruction process and the probability distribution can be determined.

所述確定單元113從所述樣本誤差中選取誤差閾值,並根據所述測試誤差及所述誤差閾值確定所述待檢測圖像的檢測結果。 The determining unit 113 selects an error threshold from the sample errors, and determines a detection result of the to-be-detected image according to the test error and the error threshold.

在本申請的至少一個實施例中,所述檢測結果包括所述待檢測圖像有瑕疵及所述待檢測圖像無瑕疵。 In at least one embodiment of the present application, the detection result includes that the image to be inspected is defective and the image to be inspected is flawless.

在本申請的至少一個實施例中,所述確定單元113從所述樣本誤差中選取誤差閾值包括: 將所述樣本誤差按照從小至大的順序進行排序,得到誤差清單及每個樣本誤差的樣本序號;計算所述樣本誤差的數量,並將所述數量乘以配置值,得到目標數值;從所述誤差清單中選取樣本序號等於所述目標數值的樣本誤差,作為所述誤差閾值。 In at least one embodiment of the present application, the determining unit 113 selecting an error threshold from the sample errors includes: Sort the sample errors in ascending order to obtain the error list and the sample serial number of each sample error; calculate the number of the sample errors, and multiply the number by the configuration value to obtain the target value; The sample error whose sample serial number is equal to the target value is selected from the error list as the error threshold.

透過上述實施方式,能夠確定影響圖像重構過程及概率分佈時產生的誤差。 Through the above-described embodiments, errors generated when the image reconstruction process and probability distribution are affected can be determined.

在本申請的至少一個實施例中,所述確定單元113根據所述測試誤差及所述誤差閾值確定所述待檢測圖像的檢測結果包括:當所述測試誤差小於所述誤差閾值時,將所述檢測結果確定為所述待檢測圖像無瑕疵;或者當所述測試誤差大於或者等於所述誤差閾值時,將所述檢測結果確定為所述待檢測圖像有瑕疵。 In at least one embodiment of the present application, the determining unit 113 determining the detection result of the to-be-detected image according to the test error and the error threshold includes: when the test error is less than the error threshold, setting The detection result is determined that the image to be detected is flawless; or when the test error is greater than or equal to the error threshold, the detection result is determined that the image to be detected is defective.

透過所述測試誤差與所述誤差閾值進行比較,由於是從數值上對所述測試誤差與所述誤差閾值進行比較,因此,能夠檢測出所述待檢測圖像中是否具有細微瑕疵,從而提高瑕疵檢測的準確度。 By comparing the test error with the error threshold, since the test error is numerically compared with the error threshold, it is possible to detect whether there are subtle flaws in the image to be detected, thereby improving the performance of the image. Accuracy of flaw detection.

在本申請的至少一個實施例中,當所述待檢測圖像有瑕疵時,生成單元115根據所述待檢測圖像生成提醒資訊,並將所述提醒資訊發送至指定連絡人的終端設備中。 In at least one embodiment of the present application, when the image to be detected is defective, the generating unit 115 generates reminder information according to the image to be detected, and sends the reminder information to the terminal device of the designated contact person .

其中,所述指定連絡人可以是負責檢測所述檢測物件的品質人員。 Wherein, the designated contact person may be a quality person responsible for testing the testing object.

透過上述實施方式,能夠在所述待檢測圖像中有瑕疵時,及時通知所述指定連絡人。 Through the above-mentioned embodiment, when there is a defect in the image to be detected, the designated contact person can be notified in time.

由以上技術方案可以看出,本申請透過確定圖像重構時產生的重構誤差,以及透過確定高斯混合模型產生的估測概率,能夠準確確定出誤差閾值,進而透過比較測試誤差與所述誤差閾值,由於是從數值上對所述測試誤差 與所述誤差閾值進行比較,因此能夠檢測出所述待檢測圖像中是否具有細微瑕疵,從而提高瑕疵檢測的準確度。 It can be seen from the above technical solutions that the present application can accurately determine the error threshold by determining the reconstruction error generated during image reconstruction and by determining the estimated probability generated by the Gaussian mixture model, and then by comparing the test error with the above. error threshold, due to the numerical error on the test By comparing with the error threshold, it is possible to detect whether there are subtle flaws in the to-be-detected image, thereby improving the accuracy of flaw detection.

如圖3所示,是本申請實現瑕疵檢測方法的較佳實施例的電腦裝置的結構示意圖。 As shown in FIG. 3 , it is a schematic structural diagram of a computer device according to a preferred embodiment of the flaw detection method of the present application.

在本申請的一個實施例中,所述電腦裝置1包括,但不限於,儲存器12、處理器13,以及儲存在所述儲存器12中並可在所述處理器13上運行的電腦程式,例如瑕疵檢測程式。 In one embodiment of the present application, the computer device 1 includes, but is not limited to, a storage 12 , a processor 13 , and a computer program stored in the storage 12 and running on the processor 13 , such as defect detection programs.

本領域技術人員可以理解,所述示意圖僅僅是電腦裝置1的示例,並不構成對電腦裝置1的限定,可以包括比圖示更多或更少的部件,或者組合某些部件,或者不同的部件,例如所述電腦裝置1還可以包括輸入輸出設備、網路接入設備、匯流排等。 Those skilled in the art can understand that the schematic diagram is only an example of the computer device 1, and does not constitute a limitation on the computer device 1. It may include more or less components than the one shown, or combine some components, or different Components, such as the computer device 1, may also include input and output devices, network access devices, bus bars, and the like.

所述處理器13可以是中央處理單元(Central Processing Unit,CPU),還可以是其他通用處理器、數位訊號處理器(Digital Signal Processor,DSP)、專用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式設計閘陣列(Field-Programmable Gate Array,FPGA)或者其他可程式設計邏輯器件、分立門或者電晶體邏輯器件、分立硬體元件等。通用處理器可以是微處理器或者該處理器也可以是任何常規的處理器等,所述處理器13是所述電腦裝置1的運算核心和控制中心,利用各種介面和線路連接整個電腦裝置1的各個部分,及獲取所述電腦裝置1的作業系統以及安裝的各類應用程式、程式碼等。 The processor 13 may be a Central Processing Unit (CPU), other general-purpose processors, a Digital Signal Processor (DSP), or an Application Specific Integrated Circuit (ASIC). , Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor 13 is the computing core and control center of the computer device 1, and uses various interfaces and lines to connect the entire computer device 1 , and obtain the operating system of the computer device 1 and various installed applications, code, etc.

所述處理器13獲取所述電腦裝置1的作業系統以及安裝的各類應用程式。所述處理器13獲取所述應用程式以實現上述各個瑕疵檢測方法實施例中的步驟,例如圖1所示的步驟。 The processor 13 acquires the operating system of the computer device 1 and various installed applications. The processor 13 acquires the application program to implement the steps in each of the above-mentioned embodiments of the defect detection method, such as the steps shown in FIG. 1 .

示例性的,所述電腦程式可以被分割成一個或多個模組/單元,所述一個或者多個模組/單元被儲存在所述儲存器12中,並由所述處理器13獲取,以完成本申請。所述一個或多個模組/單元可以是能夠完成特定功能的一系列電腦程式指令段,該指令段用於描述所述電腦程式在所述電腦裝置1中的獲取過 程。例如,所述電腦程式可以被分割成獲取單元110、編碼單元111、解碼單元112、確定單元113、輸入單元114及生成單元115。 Exemplarily, the computer program can be divided into one or more modules/units, and the one or more modules/units are stored in the storage 12 and acquired by the processor 13, to complete this application. The one or more modules/units may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the acquisition process of the computer program in the computer device 1. Procedure. For example, the computer program may be divided into an acquisition unit 110 , an encoding unit 111 , a decoding unit 112 , a determination unit 113 , an input unit 114 , and a generation unit 115 .

所述儲存器12可用於儲存所述電腦程式和/或模組,所述處理器13透過運行或獲取儲存在所述儲存器12內的電腦程式和/或模組,以及調用儲存在儲存器12內的資料,實現所述電腦裝置1的各種功能。所述儲存器12可主要包括儲存程式區和儲存資料區,其中,儲存程式區可儲存作業系統、至少一個功能所需的應用程式(比如聲音播放功能、圖像播放功能等)等;儲存資料區可儲存根據電腦裝置的使用所創建的資料等。此外,儲存器12可以包括非易失性儲存器,例如硬碟、儲存器、插接式硬碟,智慧儲存卡(Smart Media Card,SMC),安全數位(Secure Digital,SD)卡,快閃儲存器卡(Flash Card)、至少一個磁碟儲存器件、快閃儲存器器件、或其他非易失性固態儲存器件。 The storage 12 can be used to store the computer programs and/or modules, and the processor 13 executes or obtains the computer programs and/or modules stored in the storage 12, and calls the computer programs and/or modules stored in the storage 12. 12 to realize various functions of the computer device 1 . The storage 12 may mainly include a program storage area and a data storage area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; storage data The area can store data etc. created according to the use of the computer device. In addition, the storage 12 may include non-volatile storage such as hard disk, storage, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, flash memory A memory card (Flash Card), at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.

所述儲存器12可以是電腦裝置1的外部儲存器和/或內部儲存器。進一步地,所述儲存器12可以是具有實物形式的儲存器,如儲存器條、TF卡(Trans-flash Card)等等。 The storage 12 may be an external storage and/or an internal storage of the computer device 1 . Further, the storage 12 may be a storage in physical form, such as a storage bar, a TF card (Trans-flash Card), and the like.

所述電腦裝置1集成的模組/單元如果以軟體功能單元的形式實現並作為獨立的產品銷售或使用時,可以儲存在一個電腦可讀取儲存介質中。基於這樣的理解,本申請實現上述實施例方法中的全部或部分流程,也可以透過電腦程式來指令相關的硬體來完成,所述的電腦程式可儲存於一電腦可讀儲存介質中,該電腦程式在被處理器獲取時,可實現上述各個方法實施例的步驟。 If the modules/units integrated in the computer device 1 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present application realizes all or part of the processes in the methods of the above embodiments, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is acquired by the processor, the steps of each of the above method embodiments can be implemented.

其中,所述電腦程式包括電腦程式代碼,所述電腦程式代碼可以為原始程式碼形式、物件代碼形式、可獲取檔或某些中間形式等。所述電腦可讀介質可以包括:能夠攜帶所述電腦程式代碼的任何實體或裝置、記錄介質、隨身碟、移動硬碟、磁碟、光碟、電腦儲存器、唯讀儲存器(ROM,Read-Only Memory)。 Wherein, the computer program includes computer program code, and the computer program code may be in the form of original code, object code, obtainable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, pen drive, removable hard disk, magnetic disk, optical disk, computer storage, read-only storage (ROM, Read-only storage) Only Memory).

結合圖1,所述電腦裝置1中的所述儲存器12儲存多個指令以實現一種瑕疵檢測方法,所述處理器13可獲取所述多個指令從而實現: 當接收到瑕疵檢測請求時,根據所述瑕疵檢測請求獲取待檢測圖像及多張正樣本圖像;利用編碼器對所述待檢測圖像進行編碼處理,得到與所述待檢測圖像對應的目標向量,並利用所述編碼器對所述多張正樣本圖像進行編碼處理,得到與所述多張正樣本圖像對應的多個潛向量;利用與所述編碼器對應的解碼器對所述目標向量進行解碼處理,得到與所述待檢測圖像對應的靶心圖表像,並利用所述解碼器對所述多個潛向量進行解碼處理,得到與所述多張正樣本圖像對應的多張重構圖像;將所述靶心圖表像與所述待檢測圖像進行比較,得到目標誤差,並根據所述多張重構圖像及所述多張正樣本圖像確定每張正樣本圖像的重構誤差;將所述目標向量輸入至預先訓練好的高斯混合模型中,得到所述待檢測圖像的測試概率,並將所述多個潛向量輸入至所述高斯混合模型中,得到每張正樣本圖像的估測概率;根據所述目標誤差及所述測試概率確定所述待檢測圖像的測試誤差,並根據每個重構誤差及每個估測概率確定每張正樣本圖像的樣本誤差;從所述樣本誤差中選取誤差閾值,並根據所述測試誤差及所述誤差閾值確定所述待檢測圖像的檢測結果。 Referring to FIG. 1 , the storage 12 in the computer device 1 stores a plurality of instructions to implement a defect detection method, and the processor 13 can obtain the plurality of instructions to implement: When a flaw detection request is received, the image to be detected and a plurality of positive sample images are obtained according to the flaw detection request; and use the encoder to encode the multiple positive sample images to obtain multiple latent vectors corresponding to the multiple positive sample images; use the decoder corresponding to the encoder Perform decoding processing on the target vector to obtain a bullseye image corresponding to the image to be detected, and use the decoder to perform decoding processing on the multiple latent vectors to obtain images corresponding to the multiple positive samples Corresponding multiple reconstructed images; compare the bullseye image with the to-be-detected image to obtain the target error, and determine each positive sample image according to the multiple reconstructed images and the multiple positive sample images image reconstruction error; input the target vector into the pre-trained Gaussian mixture model to obtain the test probability of the to-be-detected image, and input the multiple latent vectors into the Gaussian mixture model, Obtain the estimated probability of each positive sample image; determine the test error of the to-be-detected image according to the target error and the test probability, and determine each positive image according to each reconstruction error and each estimated probability. The sample error of the sample image; an error threshold is selected from the sample error, and the detection result of the to-be-detected image is determined according to the test error and the error threshold.

具體地,所述處理器13對上述指令的具體實現方法可參考圖1對應實施例中相關步驟的描述,在此不贅述。 Specifically, for the specific implementation method of the above-mentioned instruction by the processor 13, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 1 , which is not repeated here.

在本申請所提供的幾個實施例中,應該理解到,所揭露的系統,裝置和方法,可以透過其它的方式實現。例如,以上所描述的裝置實施例僅僅是示意性的,例如,所述模組的劃分,僅僅為一種邏輯功能劃分,實際實現時可以有另外的劃分方式。 In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and other division methods may be used in actual implementation.

所述作為分離部件說明的模組可以是或者也可以不是物理上分開的,作為模組顯示的部件可以是或者也可以不是物理單元,即可以位於一個地 方,或者也可以分佈到多個網路單元上。可以根據實際的需要選擇其中的部分或者全部模組來實現本實施例方案的目的。 The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place. It can also be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申請各個實施例中的各功能模組可以集成在一個處理單元中,也可以是各個單元單獨物理存在,也可以兩個或兩個以上單元集成在一個單元中。上述集成的單元既可以採用硬體的形式實現,也可以採用硬體加軟體功能模組的形式實現。 In addition, each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.

因此,無論從哪一點來看,均應將實施例看作是示範性的,而且是非限制性的,本申請的範圍由所附請求項而不是上述說明限定,因此旨在將落在請求項的等同要件的含義和範圍內的所有變化涵括在本申請內。不應將請求項中的任何附關聯圖標記視為限制所涉及的請求項。 Accordingly, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of this application is defined by the appended claims rather than the foregoing description, and is therefore intended to fall within the scope of the claims. All changes within the meaning and scope of the equivalents of , are included in this application. Any associated icon indicia in a claim should not be considered to limit the claim to which it relates.

此外,顯然“包括”一詞不排除其他單元或步驟,單數不排除複數。本申請中陳述的多個單元或裝置也可以由一個單元或裝置透過軟體或者硬體來實現。第一、第二等詞語用來表示名稱,而並不表示任何特定的順序。 Furthermore, it is clear that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or devices stated in this application may also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to denote names and do not denote any particular order.

最後應說明的是,以上實施例僅用以說明本申請的技術方案而非限制,儘管參照較佳實施例對本申請進行了詳細說明,本領域的普通技術人員應當理解,可以對本申請的技術方案進行修改或等同替換,而不脫離本申請技術方案的精神和範圍。 Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application rather than limitations. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present application.

Claims (9)

一種瑕疵檢測方法,其中,所述瑕疵檢測方法包括:當接收到瑕疵檢測請求時,根據所述瑕疵檢測請求獲取待檢測圖像及多張正樣本圖像;利用編碼器對所述待檢測圖像進行編碼處理,得到與所述待檢測圖像對應的目標向量,包括:對所述待檢測圖像進行向量化處理,得到所述待檢測圖像的第一特徵向量;提取所述編碼器中的隱層;利用所述隱層對所述第一特徵向量進行運算,得到所述目標向量,並利用所述編碼器對所述多張正樣本圖像進行編碼處理,得到與所述多張正樣本圖像對應的多個潛向量;利用與所述編碼器對應的解碼器對所述目標向量進行解碼處理,得到與所述待檢測圖像對應的靶心圖表像,並利用所述解碼器對所述多個潛向量進行解碼處理,得到與所述多張正樣本圖像對應的多張重構圖像;將所述靶心圖表像與所述待檢測圖像進行比較,得到目標誤差,並根據所述多張重構圖像及所述多張正樣本圖像確定每張正樣本圖像的重構誤差;將所述目標向量輸入至預先訓練好的高斯混合模型中,得到所述待檢測圖像的測試概率,並將所述多個潛向量輸入至所述高斯混合模型中,得到每張正樣本圖像的估測概率;根據所述目標誤差及所述測試概率確定所述待檢測圖像的測試誤差,並根據每個重構誤差及每個估測概率確定每張正樣本圖像的樣本誤差;從所述樣本誤差中選取誤差閾值,並根據所述測試誤差及所述誤差閾值確定所述待檢測圖像的檢測結果。 A flaw detection method, wherein the flaw detection method comprises: when a flaw detection request is received, acquiring an image to be detected and a plurality of positive sample images according to the flaw detection request; performing encoding processing on the image to be detected to obtain a target vector corresponding to the image to be detected, including: performing vectorization processing on the image to be detected to obtain a first feature vector of the image to be detected; extracting the encoder The hidden layer in ; use the hidden layer to operate on the first feature vector to obtain the target vector, and use the encoder to encode the plurality of positive sample images to obtain the same multiple latent vectors corresponding to the positive sample image; decode the target vector by using the decoder corresponding to the encoder to obtain a bullseye image corresponding to the image to be detected, and use the decoding process to decode the target vector. The device decodes the multiple latent vectors to obtain multiple reconstructed images corresponding to the multiple positive sample images; compares the bullseye image with the to-be-detected image to obtain the target error, and Determine the reconstruction error of each positive sample image according to the multiple reconstructed images and the multiple positive sample images; input the target vector into a pre-trained Gaussian mixture model to obtain the image to be detected the test probability of the image, and input the multiple latent vectors into the Gaussian mixture model to obtain the estimated probability of each positive sample image; determine the to-be-detected image according to the target error and the test probability The test error of the image is determined, and the sample error of each positive sample image is determined according to each reconstruction error and each estimated probability; an error threshold is selected from the sample errors, and according to the test error and the error threshold A detection result of the to-be-detected image is determined. 如請求項1所述的瑕疵檢測方法,其中,所述將所述靶心圖表像與所述待檢測圖像進行比較,得到目標誤差包括:提取所述待檢測圖像的所有圖元點,得到多個待檢測圖元點,並提取所述靶心圖表像的所有圖元點,得到多個目標圖元點;將每個目標圖元點與每個待檢測圖元點進行比較,得到比較結果; 當比較結果表明目標圖元點與待檢測圖元點不同時,計算目標圖元點與待檢測圖元點不同的數量,並作為第一數量,以及計算所述多個目標圖元點的數量作為第二數量;將所述第一數量除以所述第二數量,得到所述目標誤差。 The defect detection method according to claim 1, wherein the comparing the bullseye image with the to-be-detected image to obtain the target error comprises: extracting all the primitive points of the to-be-detected image to obtain multiple primitive points to be detected, and extract all primitive points of the bullseye image to obtain multiple target primitive points; compare each target primitive point with each primitive point to be detected to obtain a comparison result ; When the comparison result shows that the target primitive point is different from the to-be-detected primitive point, calculate the number of the target primitive point and the to-be-detected primitive point different as the first number, and calculate the number of the multiple target primitive points As a second quantity; the target error is obtained by dividing the first quantity by the second quantity. 如請求項1所述的瑕疵檢測方法,其中,所述將所述目標向量輸入至預先訓練好的高斯混合模型中,得到所述待檢測圖像的測試概率,並將所述多個潛向量輸入至所述高斯混合模型中,得到每張正樣本圖像的估測概率包括:將所述多個潛向量輸入至所述高斯混合模型中,得到所述多張正樣本圖像的特徵分佈;根據所述特徵分佈確定所述多個潛向量的平均值及協方差,並獲取所述高斯混合模型的混合係數;根據所述目標向量、所述平均值、所述協方差及所述混合係數確定所述待檢測圖像的測試概率,並根據每個潛向量、所述平均值、所述協方差及所述混合係數確定每張正樣本圖像的估測概率。 The flaw detection method according to claim 1, wherein the target vector is input into a pre-trained Gaussian mixture model to obtain the test probability of the to-be-detected image, and the multiple latent vectors are Input into the Gaussian mixture model, and obtaining the estimated probability of each positive sample image includes: inputting the multiple latent vectors into the Gaussian mixture model to obtain the feature distribution of the multiple positive sample images ; Determine the mean value and covariance of the multiple latent vectors according to the feature distribution, and obtain the mixture coefficient of the Gaussian mixture model; According to the target vector, the mean value, the covariance and the mixture The coefficient determines the test probability of the image to be detected, and the estimated probability of each positive sample image is determined according to each latent vector, the average value, the covariance and the mixing coefficient. 如請求項1所述的瑕疵檢測方法,其中,所述根據每個重構誤差及每個估測概率確定每張正樣本圖像的樣本誤差包括:計算每個估測概率的對數,得到每個估測概率的對數值;對每個對數值的相反數及每個重構誤差進行加權和運算,得到所述樣本誤差。 The flaw detection method according to claim 1, wherein the determining the sample error of each positive sample image according to each reconstruction error and each estimated probability includes: calculating the logarithm of each estimated probability, and obtaining each logarithmic values of the estimated probabilities; perform a weighted sum operation on the inverse of each logarithmic value and each reconstruction error to obtain the sample error. 如請求項1所述的瑕疵檢測方法,其中,所述從所述樣本誤差中選取誤差閾值包括:將所述樣本誤差按照從小至大的順序進行排序,得到誤差清單及每個樣本誤差的樣本序號;計算所述樣本誤差的數量,並將所述數量乘以配置值,得到目標數值; 從所述誤差清單中選取樣本序號等於所述目標數值的樣本誤差,作為所述誤差閾值。 The defect detection method according to claim 1, wherein the selecting an error threshold from the sample errors comprises: sorting the sample errors in ascending order to obtain an error list and a sample of each sample error serial number; calculate the quantity of the sample error, and multiply the quantity by the configuration value to obtain the target value; A sample error whose sample serial number is equal to the target value is selected from the error list as the error threshold. 如請求項1所述的瑕疵檢測方法,其中,所述根據所述測試誤差及所述誤差閾值確定所述待檢測圖像的檢測結果包括:當所述測試誤差小於所述誤差閾值時,將所述檢測結果確定為所述待檢測圖像無瑕疵;或者當所述測試誤差大於或者等於所述誤差閾值時,將所述檢測結果確定為所述待檢測圖像有瑕疵。 The defect detection method according to claim 1, wherein the determining the detection result of the to-be-detected image according to the test error and the error threshold comprises: when the test error is less than the error threshold, determining The detection result is determined that the image to be detected is flawless; or when the test error is greater than or equal to the error threshold, the detection result is determined that the image to be detected is defective. 一種瑕疵檢測裝置,其中,所述瑕疵檢測裝置包括:獲取單元,用於當接收到瑕疵檢測請求時,根據所述瑕疵檢測請求獲取待檢測圖像及多張正樣本圖像;編碼單元,用於利用編碼器對所述待檢測圖像進行編碼處理,得到與所述待檢測圖像對應的目標向量,包括:對所述待檢測圖像進行向量化處理,得到所述待檢測圖像的第一特徵向量;提取所述編碼器中的隱層;利用所述隱層對所述第一特徵向量進行運算,得到所述目標向量,並利用所述編碼器對所述多張正樣本圖像進行編碼處理,得到與所述多張正樣本圖像對應的多個潛向量;解碼單元,用於利用與所述編碼器對應的解碼器對所述目標向量進行解碼處理,得到與所述待檢測圖像對應的靶心圖表像,並利用所述解碼器對所述多個潛向量進行解碼處理,得到與所述多張正樣本圖像對應的多張重構圖像;確定單元,用於將所述靶心圖表像與所述待檢測圖像進行比較,得到目標誤差,並根據所述多張重構圖像及所述多張正樣本圖像確定每張正樣本圖像的重構誤差;輸入單元,用於將所述目標向量輸入至預先訓練好的高斯混合模型中,得到所述待檢測圖像的測試概率,並將所述多個潛向量輸入至所述高斯混合模型中,得到每張正樣本圖像的估測概率; 所述確定單元,還用於根據所述目標誤差及所述測試概率確定所述待檢測圖像的測試誤差,並根據每個重構誤差及每個估測概率確定每張正樣本圖像的樣本誤差;所述確定單元,還用於從所述樣本誤差中選取誤差閾值,並根據所述測試誤差及所述誤差閾值確定所述待檢測圖像的檢測結果。 A defect detection device, wherein the defect detection device comprises: an acquisition unit for acquiring an image to be detected and a plurality of positive sample images according to the defect detection request when a defect detection request is received; an encoding unit for using Using an encoder to perform encoding processing on the image to be detected to obtain a target vector corresponding to the image to be detected includes: performing vectorization processing on the image to be detected to obtain a vector of the image to be detected. the first feature vector; extract the hidden layer in the encoder; use the hidden layer to operate on the first feature vector to obtain the target vector, and use the encoder to perform operations on the multiple positive sample images image encoding processing to obtain a plurality of latent vectors corresponding to the plurality of positive sample images; a decoding unit for decoding the target vector by using a decoder corresponding to the encoder to obtain a decoding process corresponding to the the bullseye image corresponding to the image to be detected, and the decoder is used to decode the multiple latent vectors to obtain multiple reconstructed images corresponding to the multiple positive sample images; the determining unit is used for converting The bullseye image is compared with the to-be-detected image to obtain the target error, and the reconstruction error of each positive sample image is determined according to the plurality of reconstructed images and the plurality of positive sample images; the input unit , used to input the target vector into the pre-trained Gaussian mixture model to obtain the test probability of the image to be detected, and input the multiple latent vectors into the Gaussian mixture model to obtain each Estimated probability of positive sample images; The determining unit is further configured to determine the test error of the to-be-detected image according to the target error and the test probability, and determine the value of each positive sample image according to each reconstruction error and each estimated probability. Sample error; the determining unit is further configured to select an error threshold from the sample error, and determine the detection result of the to-be-detected image according to the test error and the error threshold. 一種電腦裝置,其中,所述電腦裝置包括:儲存器,儲存至少一個指令;及處理器,獲取所述儲存器中儲存的指令以實現如請求項1至6中任意一項所述的瑕疵檢測方法。 A computer device, wherein the computer device comprises: a storage for storing at least one instruction; and a processor for acquiring the instructions stored in the storage to implement defect detection according to any one of claim 1 to claim 6 method. 一種電腦可讀儲存介質,其中:所述電腦可讀儲存介質中儲存有至少一個指令,所述至少一個指令被電腦裝置中的處理器獲取以實現如請求項1至6中任意一項所述的瑕疵檢測方法。 A computer-readable storage medium, wherein: the computer-readable storage medium stores at least one instruction, and the at least one instruction is acquired by a processor in a computer device to implement any one of claim 1 to 6. defect detection method.
TW109145519A 2020-12-22 2020-12-22 Method and device for detecting defections, computer device and storage medium TWI755213B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109145519A TWI755213B (en) 2020-12-22 2020-12-22 Method and device for detecting defections, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109145519A TWI755213B (en) 2020-12-22 2020-12-22 Method and device for detecting defections, computer device and storage medium

Publications (2)

Publication Number Publication Date
TWI755213B true TWI755213B (en) 2022-02-11
TW202226052A TW202226052A (en) 2022-07-01

Family

ID=81329508

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109145519A TWI755213B (en) 2020-12-22 2020-12-22 Method and device for detecting defections, computer device and storage medium

Country Status (1)

Country Link
TW (1) TWI755213B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102706881A (en) * 2012-03-19 2012-10-03 天津工业大学 Cloth defect detecting method based on machine vision
TW201710664A (en) * 2015-09-09 2017-03-16 中原大學 Defect inspection device controls the main light source module relative to irradiation angle and irradiation position on the article under inspection
CN109313799A (en) * 2016-12-21 2019-02-05 华为技术有限公司 Image processing method and equipment
TW202018431A (en) * 2018-08-15 2020-05-16 荷蘭商Asml荷蘭公司 Utilize machine learning in selecting high quality averaged sem images from raw images automatically
TW202044067A (en) * 2019-05-22 2020-12-01 以色列商應用材料以色列公司 Machine learning-based classification of defects in a semiconductor specimen

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102706881A (en) * 2012-03-19 2012-10-03 天津工业大学 Cloth defect detecting method based on machine vision
TW201710664A (en) * 2015-09-09 2017-03-16 中原大學 Defect inspection device controls the main light source module relative to irradiation angle and irradiation position on the article under inspection
CN109313799A (en) * 2016-12-21 2019-02-05 华为技术有限公司 Image processing method and equipment
TW202018431A (en) * 2018-08-15 2020-05-16 荷蘭商Asml荷蘭公司 Utilize machine learning in selecting high quality averaged sem images from raw images automatically
TWI705312B (en) * 2018-08-15 2020-09-21 荷蘭商Asml荷蘭公司 Method for evaluating images of a printed pattern and associated computer program product
TW202044067A (en) * 2019-05-22 2020-12-01 以色列商應用材料以色列公司 Machine learning-based classification of defects in a semiconductor specimen

Also Published As

Publication number Publication date
TW202226052A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
US20220198228A1 (en) Method for detecting defects in multi-scale images and computing device utilizing method
CN109167816B (en) Information pushing method, device, equipment and storage medium
CN109766176B (en) Scanning progress calculation method and device based on large-scale network space detection
US20230214989A1 (en) Defect detection method, electronic device and readable storage medium
US20220189008A1 (en) Method for detecting data defects and computing device utilizing method
CN111597309A (en) Similar enterprise recommendation method and device, electronic equipment and medium
CN108648135B (en) Hidden model training and using method, device and computer readable storage medium
TWI755213B (en) Method and device for detecting defections, computer device and storage medium
US20220198633A1 (en) Defect detection method, electronic device and storage medium
CN114943672A (en) Image defect detection method and device, electronic equipment and storage medium
TWI755212B (en) Method and related equipment for determinting input dimensions of model
TWI769633B (en) Method and device for detecting image defects, computer device and medium
CN115022201B (en) Data processing function test method, device, equipment and storage medium
TWI803243B (en) Method for expanding images, computer device and storage medium
CN116977247A (en) Image processing method, device, electronic equipment and storage medium
TWI762193B (en) Image defect detection method, image defect detection device, electronic device and storage media
TWI778519B (en) Defective image generation method, defective image generation device, electronic device and storage media
US20220198645A1 (en) Model input size determination method, electronic device and storage medium
CN114881913A (en) Image defect detection method and device, electronic equipment and storage medium
TWI807854B (en) Method for detecting defects, computer device and storage medium
CN111814759A (en) Method and device for acquiring face quality label value, server and storage medium
CN110888811A (en) Code coverage rate information processing method and device, electronic equipment and medium
TW202401375A (en) Method for detecting defects, electronic device and computer-readable storage medium
TWI792134B (en) Image defect detection method, image defect detection device, electronic device, and storage media
TWI765475B (en) Method and device for detecting image defects, computer device and medium