CN113902939A - Industrial product large defect detection method based on twin network - Google Patents

Industrial product large defect detection method based on twin network Download PDF

Info

Publication number
CN113902939A
CN113902939A CN202110833024.5A CN202110833024A CN113902939A CN 113902939 A CN113902939 A CN 113902939A CN 202110833024 A CN202110833024 A CN 202110833024A CN 113902939 A CN113902939 A CN 113902939A
Authority
CN
China
Prior art keywords
network
image
twin network
loss function
distance
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110833024.5A
Other languages
Chinese (zh)
Inventor
许琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Deepvision Creative Technology Ltd
Original Assignee
Shenzhen Deepvision Creative Technology Ltd
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 Shenzhen Deepvision Creative Technology Ltd filed Critical Shenzhen Deepvision Creative Technology Ltd
Priority to CN202110833024.5A priority Critical patent/CN113902939A/en
Publication of CN113902939A publication Critical patent/CN113902939A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes
    • G06F18/24137Distances to cluster centroïds
    • G06F18/2414Smoothing the distance, e.g. radial basis function networks [RBFN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a twin network-based industrial product large defect detection method, which comprises the following steps: directly dividing the images into two categories of OK and NG so as to construct a plurality of image pairs; training the twin network using the image pairs; the image pair respectively passes through the convolution layer of the twin network and the full-connection network to extract a characteristic vector of the image; calculating a distance from the two feature vectors of the pair of images; if the distance is greater than the threshold, then calculating a loss function; if the loss function is 0, not updating the network parameters, and if the loss function is more than 0, updating the network parameters; and (4) identifying the image by using the trained twin network so as to detect the large defects of the product. The network for testing can be trained without manually marking pictures, and a single model can test a plurality of products instead of one product corresponding to one model.

Description

Industrial product large defect detection method based on twin network
Technical Field
The invention relates to the field of defect detection, in particular to a method for detecting large defects of industrial products based on a twin network.
Background
The rapid development of deep learning widens the application boundary of computer vision in industrial products, such as target positioning, identification, defect detection and the like. In an actual application scenario, deep learning belongs to supervised learning, and training is often performed by relying on a large amount of manual labeling data. Deep learning is mainly information of fitting data, and the deviation of the model can be caused by weak change of the data. In actual production, pictures of industrial products often need high-resolution pictures, so that the pictures occupy a large memory, and the pictures cannot be directly input into a model but input into a small picture. In actual production, due to illumination change of the photos, abrasion of equipment and the like, large defects such as large chipping, large cracks and the like can be caused, so that the model can be invisible to the defects, and large defects are missed. These large defect missed detections are very undesirable for the customer and affect the experience of using the model.
Generally, certain problems can be relieved by adding the large defects into model retraining, but due to the fact that the field environment is severe, pictures with the large defects are often unpredictable and small in quantity, and retraining requires a large amount of manual labeling and time cost. Such an operation is time-consuming, labor-consuming and easy, and has half the result. Certainly, the conventional image processing method is used for solving the problem, but the manual design algorithm can only solve one kind of defects of one product, and has no universality and poor stability.
Disclosure of Invention
The invention provides a twin network-based industrial product large defect detection method, which aims to solve at least one technical problem.
To solve the above problems, as an aspect of the present invention, there is provided a twin network-based industrial product macro defect detection method, including:
directly dividing the images into two categories of OK and NG so as to construct a plurality of image pairs;
training the twin network using the image pairs;
the image pair respectively passes through the convolution layer of the twin network and the full-connection network to extract a characteristic vector of the image;
calculating a distance from the two feature vectors of the pair of images;
if the distance is greater than the threshold, then calculating a loss function;
if the loss function is 0, not updating the network parameters, and if the loss function is more than 0, updating the network parameters;
and (4) identifying the image by using the trained twin network so as to detect the large defects of the product.
Preferably, the threshold value is dynamically settable to control the accuracy of the pair of similar pictures and the pair of dissimilar pictures.
Due to the adoption of the technical scheme, the invention has the following advantages: (1) for obvious defects, a network for testing can be trained without manually marking pictures. (2) A single model may test multiple products instead of one product for each model.
Drawings
Fig. 1 schematically shows a network framework diagram of the present invention.
Detailed Description
The following detailed description of embodiments of the invention, but the invention can be practiced in many different ways, as defined and covered by the claims.
In industrial production, the deep learning network often cannot see the large defect, resulting in missed detection of the large defect. Aiming at the problem in the industry, the invention provides a method for using a twin network to calculate the image similarity to judge whether the product has large defects or not, thereby reducing the omission of the large defects.
The method uses the twin network to compare two pictures to calculate the similarity of the pictures. And training a twin network by using the selected image pair, extracting the characteristics of the two images, and calculating the similarity of the characteristic pair. The method does not need to additionally label the image by using a tool, and can directly classify the image into two categories of OK and NG.
The image pairs are respectively input into the same twin network, then the distance between the characteristics of the two images is calculated, the images are dissimilar when the distance is larger than a certain threshold value, the images are similar when the distance is smaller than the certain threshold value, and the distance between the images with large defects and the images without the defects is larger. In practice, threshold values can be set as required to detect defects of different degrees. For example, in practical applications, the threshold value may be set to 1.5. If the distance between the two pictures is larger than the threshold value of 1.5, the two pictures are judged to be larger, the two pictures belong to a large defect, and if the distance between the two pictures is smaller than the threshold value of 1.5, the two pictures are judged to be similar and are normal pictures.
The invention uses a twin network to input images which are well paired in advance, the OK pictures of the same batch of products are paired with each other to form a positive sample, and the OK pictures and the NG pictures of the same batch are paired with each other to form a negative sample for training a model. And extracting picture characteristics of the two pictures through the convolution layer and the full-connection network respectively, and then calculating the distance. The convolutional network feature extraction may use a commonly used network structure.
Firstly, the paired pictures respectively pass through the convolution layer and the full-connection layer, and the distance is calculated for a group of obtained feature vectors, namely the similarity degree of the two pictures is that the smaller the distance is, the more similar the distance is, and the larger the distance is otherwise. And then calculating a loss function, wherein if the loss function is 0, the network parameters are not updated, and if the loss function is more than 0, the network parameters are updated.
Second, the threshold of the network may be set to 1.0. If the calculated distance is larger than 1.0 when the two normal pictures are judged to be wrong and the loss function is larger than 0, updating the network parameters by using a gradient descent algorithm to find out the parameters of a better network; if the two normal pictures are the same, the distance between the two pictures is calculated to be less than 1.0, and the network parameters are not updated. If the calculated distance is larger than 1.0, the parameters are not updated, otherwise, the calculated distance is smaller than 1.0, the loss function is larger than 0, and the network parameters are updated.
Preferably, different thresholds may be dynamically set to control the accuracy of the similar and dissimilar picture pairs. For example, in the test, since there is a difference in the distance between pictures, for example, the distance between some normal pictures is at most 2.0, the threshold may be set to be 2.0, and if the distance is at most 1.0, the threshold may be set to be 1.0.
The network frame diagram is shown in fig. 1, where the result output indicates the similarity between two pictures, and image 1 and image 2 are the paired pictures:
due to the adoption of the technical scheme, the invention has the following advantages: (1) for obvious defects, a network for testing can be trained without manually marking pictures. (2) A single model may test multiple products instead of one product for each model.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (2)

1. A twin network-based industrial product large defect detection method is characterized by comprising the following steps:
directly dividing the images into two categories of OK and NG so as to construct a plurality of image pairs;
training the twin network using the image pairs;
the image pair respectively passes through the convolution layer of the twin network and the full-connection network to extract a characteristic vector of the image;
calculating a distance from the two feature vectors of the pair of images;
if the distance is greater than the threshold, then calculating a loss function;
if the loss function is 0, not updating the network parameters, and if the loss function is more than 0, updating the network parameters;
and (4) identifying the image by using the trained twin network so as to detect the large defects of the product.
2. The twin network based industrial product macro defect detection method of claim 1, wherein a threshold value can be dynamically set to control the accuracy of the similar picture pair and the dissimilar picture pair.
CN202110833024.5A 2021-07-22 2021-07-22 Industrial product large defect detection method based on twin network Pending CN113902939A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110833024.5A CN113902939A (en) 2021-07-22 2021-07-22 Industrial product large defect detection method based on twin network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110833024.5A CN113902939A (en) 2021-07-22 2021-07-22 Industrial product large defect detection method based on twin network

Publications (1)

Publication Number Publication Date
CN113902939A true CN113902939A (en) 2022-01-07

Family

ID=79187866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110833024.5A Pending CN113902939A (en) 2021-07-22 2021-07-22 Industrial product large defect detection method based on twin network

Country Status (1)

Country Link
CN (1) CN113902939A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116091874A (en) * 2023-04-10 2023-05-09 成都数之联科技股份有限公司 Image verification method, training method, device, medium, equipment and program product
CN117078853A (en) * 2023-08-18 2023-11-17 广东工业大学 Workpiece defect sample amplification method based on digital twin body and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116091874A (en) * 2023-04-10 2023-05-09 成都数之联科技股份有限公司 Image verification method, training method, device, medium, equipment and program product
CN117078853A (en) * 2023-08-18 2023-11-17 广东工业大学 Workpiece defect sample amplification method based on digital twin body and storage medium
CN117078853B (en) * 2023-08-18 2024-03-19 广东工业大学 Workpiece defect sample amplification method based on digital twin body and storage medium

Similar Documents

Publication Publication Date Title
US10878283B2 (en) Data generation apparatus, data generation method, and data generation program
KR20190063839A (en) Method and System for Machine Vision based Quality Inspection using Deep Learning in Manufacturing Process
CN113344857B (en) Defect detection network training method, defect detection method and storage medium
CN113902939A (en) Industrial product large defect detection method based on twin network
KR20210008352A (en) System and method for detecting defects in imaged items
CN108827969A (en) Metal parts surface defects detection and recognition methods and device
CN111833303A (en) Product detection method and device, electronic equipment and storage medium
WO2020248513A1 (en) Ocr method for comprehensive performance test
US20150279054A1 (en) Image retrieval apparatus and image retrieval method
CN111179250B (en) Industrial product defect detection system based on multitask learning
CN111310826B (en) Method and device for detecting labeling abnormality of sample set and electronic equipment
CN113724231A (en) Industrial defect detection method based on semantic segmentation and target detection fusion model
KR102297232B1 (en) Anomaly Detection via Morphological Transformations
CN112508003A (en) Character recognition processing method and device
JP2019016249A (en) Determining apparatus, determining method, and determining program
CN115147418B (en) Compression training method and device for defect detection model
CN111967490A (en) Model training method for map detection and map detection method
CN111652846B (en) Semiconductor defect identification method based on characteristic pyramid convolution neural network
JP2009068946A (en) Flaw sorting apparatus, flaw sorting method and program
CN110378421B (en) Coal mine fire identification method based on convolutional neural network
KR20210122429A (en) Method and System for Artificial Intelligence based Quality Inspection in Manufacturing Process using Machine Vision Deep Learning
CN115471476A (en) Method, device, equipment and medium for detecting component defects
CN115019294A (en) Pointer instrument reading identification method and system
CN114881996A (en) Defect detection method and device
CN112651315A (en) Information extraction method and device of line graph, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination