A notebook screen defect detection method, system and device

Through the two-stage deep network model and transfer learning technology, the accuracy and adaptability problems of traditional notebook screen defect detection methods are solved, more efficient detection and classification are achieved, cost and time are reduced, and product quality is improved.

CN115049581BActive Publication Date: 2024-10-18ARTIFICIAL INTELLIGENCE RES INST OF HEFEI COMPREHENSIVE NAT SCI CENT (ANHUI ARTIFICIAL INTELLIGENCE LAB)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111338786.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-12
Publication Date
2024-10-18
Estimated Expiration
2041-11-12

AI Technical Summary

Technical Problem

Traditional notebook screen defect detection methods have problems such as low detection accuracy, single scene adaptability, poor portability, and high hardware resource requirements, resulting in high cost and time costs.

Method used

Using a two-stage deep network model, through two-stage processing of semantic segmentation and classification, combined with transfer learning and data enhancement technology, it reduces network model parameters and hardware support requirements, improves detection accuracy and classification accuracy, and solves the problem of less training data problem.

Benefits of technology

It achieves higher detection accuracy and classification accuracy, reduces production line time and capital costs, and improves product quality and competitiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115049581B_ABST
    Figure CN115049581B_ABST
Patent Text Reader

Abstract

A method, system and device for detecting defects in notebook screens of the present invention, wherein the method comprises collecting detection videos of notebook appearance production lines under high-definition cameras, obtaining images to be detected, feeding them into trained two-stage classifiers, obtaining detection results and outputting them; wherein the model training steps are as follows: collecting images and preprocessing them, constructing training sample sets, establishing a two-stage network model structure and pre-training the network model in the KolektorSDD data set, and adjusting model parameters; two-stage network model parameter migration, migrating the two-stage structure and parameters of the source domain to the target domain for notebook screen defect detection, and fine-tuning the two-stage network model parameters by inputting target domain samples to obtain a classification and detection network. The two-stage network model adopted by the present invention not only has smaller network model parameters, requires lower hardware support, reduces cost issues and training time, but also improves classification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent manufacturing defect detection, and in particular to a notebook screen defect detection method, system and device. Background Art

[0002] The traditional appearance defect detection method uses manual inspection, which has the disadvantages of time-consuming, high labor cost, and high false detection rate. Later, the industry introduced ASI (automated surface defect inspection) systems, but most of them are based on traditional machine vision technology including:

[0003] 1) Methods based on traditional digital image processing plus machine learning. This type of method first uses algorithms such as difference method, boundary fuzzy defect segmentation method and filtering method to artificially create features (feature engineering) based on human experience, and then uses machine learning methods (such as support vector machine, template matching) to train samples to determine whether there are defects in the appearance of the notebook. For example, Peng Gan et al. used Gaussian image filtering and median filtering methods to detect screen point, line and block defects. 2) Pen appearance defect detection method based on deep learning. Compared with traditional machine learning methods, deep learning generally does not require various manually designed image preprocessing technologies, has stronger adaptability and scalability, and can obtain more accurate appearance defect detection results under large sample training. It has been widely used in recent years.

[0004] Of the two methods mentioned above, the former has a low algorithm complexity and can be easily ported to ordinary embedded devices, but its accuracy is not high, and there are problems such as false detection and missed detection, and its adaptation scenarios are relatively single and its portability is poor. The latter has a wide adaptability and high accuracy. Although it avoids complex traditional feature engineering, its algorithm complexity is high, requires a large number of training samples, and is prone to gradient disappearance. In actual applications, there may be no or few samples available for training. At the same time, existing deep learning has high requirements for hardware resources, and the cost is correspondingly high. Summary of the invention

[0005] The present invention provides a notebook screen defect detection method, system and device, which can solve at least one of the technical problems in the background technology.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] A method for detecting defects in a notebook screen, comprising: performing the following steps by a computer device:

[0008] Collect inspection videos from the notebook appearance production line under high-definition cameras, obtain the images to be inspected, send them to the trained two-stage classifier, obtain the inspection results and output them;

[0009] Among them, the training steps of the two-stage classifier are as follows:

[0010] S1, collect images and preprocess them to build a training sample set,

[0011] S2, establish a two-stage network model structure and pre-train the network model on the KolektorSDD dataset, adjust the model parameters to obtain the weights and offsets of the two stages in the source domain;

[0012] S3. Two-stage network model parameter migration: the two-stage structure and parameters of the source domain are migrated to the target domain of laptop screen defect detection, and the two-stage network model parameters are fine-tuned by inputting target domain samples to obtain the classification and detection network.

[0013] Furthermore, in step S1, the following subdivision steps S11 to S12 are specifically included:

[0014] S11: Collect inspection videos from a notebook appearance production line under a high-definition camera, extract original samples of video key frames containing appearance defects, use "center normalization" image preprocessing on the original samples, and construct a training sample set;

[0015] S12: Annotate the pixel areas containing appearance defects in the dataset image with rectangular boxes, wherein one dataset image contains multiple rectangular boxes, i.e., multiple appearance defects, but each rectangular box only contains one target to be detected, and the annotated label results are saved in an XML file according to the VOC dataset format; wherein each image corresponds to an XML file with the same name, which contains the center point coordinate information (x, y) of each rectangular box in the dataset image, the width w of the rectangular box, and the height h of the rectangular box;

[0016] Here, the labels in each batch of images, i.e. (x, y, w, h), are normalized in size, that is, they are mapped to a sub-region under 64*64 coordinates in the original image coordinate system according to the unchanged aspect ratio of the original image, and the transformed coordinate information is stored in an XML file as the input for the subsequent training of the target domain model.

[0017] Furthermore, the specific steps for the deep two-stage network model structure constructed in the above step S2 are:

[0018] The two-stage deep network classifier treats the laptop defect screen detection problem as an unclassified problem. First, a semantic segmentation fully convolutional network is trained by taking the pixels of the source domain input image as the sample set, and then deconvolution is performed to obtain the pixel-level prediction structure, such as Figure 2 ,Second, in the next stage, the output and the features of the segmentation network are combined for classification, and finally the classification output result is obtained, such as Figure 3 .

[0019] Furthermore, the above step S2 specifically includes:

[0020] S21: In the first stage, the CNN network feature extraction and classification stage is trained; the input image is resized to 96*96, and a 3*3 convolution kernel is used for convolution operation. The formula is:

[0021]

[0022] : the (i,j)th element of the convolutional layer, f: conversion function,

[0023] The operation process of input parameters and convolution kernel, Represents the input layer offset;

[0024] Each convolutional layer represents a feature map containing texture, shape, or other features;

[0025] Five convolutional layers were selected to extract image features. The number of convolution kernels in the 1st to 5th convolutional layers was 12, 18, 24, 32, and 64, with a step size of 1. A pooling layer was then connected to reduce the number of neural network layers. At the same time, the maximum pooling can also reduce the amount of weight parameters to avoid overfitting. Two fully connected layers were then connected to integrate the features extracted by the feature extraction layer. At the same time, the second fully connected layer only included two neurons corresponding to the binary classification problem, 0 for no defect or 1 for defect. Finally, a softmax connection layer was connected to output the classification probability.

[0026] In order to prevent overfitting, the entire network connects a pooling layer to each convolutional layer, and uses image enhancement (movement, flipping, scaling, etc.) to process the image;

[0027] S22: The second stage is the stage of training CNN network feature extraction and semantic segmentation;

[0028] The semantic segmentation network is divided into two parts: encoding and decoding. The encoding part is used to calculate and extract image features, and the decoding part is the opposite process of the compression part, which restores the compression process and realizes defect location in space.

[0029] The semantic segmentation network encoding part still selects 5 convolution layers, 1-5 are: 32, 64, 128, 256, 512 convolution kernels respectively. At the same time, each convolution layer uses padding technology and connects to the maximum pooling layer; the decoding part has a symmetrical network structure with the encoding part, but uses 2*2 upsampling on the input data, so that after decoding, the output image size is equal to the original image.

[0030] Furthermore, in step S21, image enhancement is used to process the image, including movement, flipping, and scaling.

[0031] Furthermore, step S3 is further divided into the following specific operations:

[0032] S31: Transfer learning uses the parameters in Ds and Ts to improve the performance of the objective function Ft in Dt. It assumes that the source task model and the target task model share training parameters through parameter transfer, and the parameters w of each source problem domain target task and source problem domain task are divided into two parts, one of which is the same between tasks, and the other is unique between each task.

[0033] Compute Gaussian distribution using Manhattan distance:

[0034]

[0035] D: data dimension, Σ data covariance corresponds to a positive definite symmetric matrix,

[0036] Define the intermediate feature extraction of the CNN network model:

[0037] ,

[0038] Intermediate Features Manhattan calculation formula: M(x)= x; Output value, , and finally get a Matrix, in order to minimize the final error, a maximum pooling layer is applied to each intermediate feature extraction layer that calculates Manhattan, and finally an error loss minimization formula is defined:

[0039]

[0040] Obtained based on engineering experience.

[0041] On the other hand, the present invention also discloses a notebook screen defect detection system, comprising the following units:

[0042] An image acquisition and processing unit, used to acquire and pre-process images and construct a training sample set;

[0043] The model building unit is used to build a two-stage network model structure and pre-train the network model on the KolektorSDD dataset, and adjust the model parameters to obtain the weights and offsets of the two stages in the source domain;

[0044] A model determination unit is used to transfer the parameters of the two-stage network model, transfer the structure and parameters of the two-stage in the source domain to the target domain of laptop screen defect detection, and fine-tune the parameters of the two-stage network model by inputting samples of the target domain to obtain a classification and detection network;

[0045] The detection unit is used to collect the detection video of the notebook appearance production line under the high-definition camera, obtain the picture to be detected, send it to the trained two-stage classifier, obtain the detection result and output it.

[0046] On the other hand, the present invention also discloses a notebook screen defect detection system, comprising the following units:

[0047] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.

[0048] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.

[0049] It can be seen from the above technical solutions that the notebook screen defect detection method and system of the present invention is a notebook screen defect detection and classification method based on autonomous learning, which is used to overcome the low detection accuracy, single scene adaptability, poor migration of traditional machine learning, and proposes a data enhancement method based on the Gaussian discriminant network model to solve the problem of less training data. The present invention can reduce the time and capital costs of traditional notebook production lines, while introducing intelligent detection and classification, which is of great significance to industrial transformation and upgrading, improving product quality, and enhancing competitiveness.

[0050] In general, the two-stage network model used in the present invention not only has smaller network model parameters, requires lower hardware support, reduces cost issues and training time, but also improves classification accuracy. At the same time, the present invention proposes a deep support vector data description optimization method to solve the gradient vanishing problem in the migration training process. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 Overall flow chart of laptop screen defect detection;

[0052] Figure 2 The structure diagram of the semantic segmentation network of the two-stage network;

[0053] Figure 3 Defect detection classification network structure diagram of two-stage network;

[0054] Figure 4 is a diagram of the defect detection result of surface A of a specific embodiment;

[0055] Figure 5 It is a diagram of the B-side defect detection results of a specific embodiment. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.

[0057] like Figure 1 As shown, the notebook screen defect detection method described in this embodiment performs the following steps by a computer device:

[0058] Step 1: Establish an image acquisition system. The key to defect detection is to have a clear image with sharp edges, which can greatly reduce the difficulty of defect detection and improve the precision and accuracy of defect extraction. Therefore, it is necessary to analyze the field of view of the notebook screen surface and design the system imaging structure in a targeted manner. At the same time, the influence of the workpiece feeding module on the system imaging effect should also be considered.

[0059] Step 2: Establish a two-stage network model structure and pre-train the network model on the KolektorSDD dataset, and adjust the model parameters to obtain the weights and offsets of the two stages in the source domain.

[0060] Step 3: Two-stage network model parameter migration, transfer the two-stage structure and parameters of the source domain to the target domain (laptop screen defect detection), and fine-tune the two-stage network model parameters by inputting target domain samples to obtain the classification and detection network

[0061] Step 4: Send the image to be tested from the high-definition camera on the production line to the trained two-stage classifier to obtain the test results and output them.

[0062] The following are detailed descriptions:

[0063] Furthermore, in step S1, the following subdivision steps S11 to S12 are specifically included:

[0064] S11: Collect inspection videos from the notebook appearance production line under a high-definition camera, then extract the original samples of the video key frames containing appearance defects, use "mean normalization" image preprocessing on the original samples, and construct a training sample set.

[0065] S12: Annotate the pixel areas containing appearance defects in the dataset images with rectangular boxes, where a dataset image can contain multiple rectangular boxes, i.e., multiple appearance defects, but each rectangular box only contains one target to be detected, and the annotated label results are saved in an xml file in the VOC dataset format; where each image corresponds to an xml file with the same name, which contains the center point coordinate information (x, y) of each rectangular box in the dataset image, the width w of the rectangular box, and the height h of the rectangular box. It should be noted that the size of the labels in each batch image, i.e., (x, y, w, h), is normalized here, i.e., it is mapped to a sub-area under 64*64 coordinates in the original image coordinate system according to the unchanged aspect ratio of the original image, and the transformed coordinate information is stored in the xml file as the input for the subsequent training of the target domain model.

[0066] The specific steps for the deep two-stage network model structure constructed in the above step S2 are:

[0067] The two-stage deep network classifier treats the laptop defect screen detection problem as an unclassified problem. First, a semantic segmentation fully convolutional network is trained by taking the pixels of the source domain input image as the sample set, and then deconvolution is performed to obtain the pixel-level prediction structure. Second, in the next stage, the output and the features of the segmentation network are combined for classification, and finally the classification output result is obtained.

[0068] S21: The first stage is the feature extraction and classification stage of the CNN network training. The input image is resized to 96*96, and a 3*3 convolution kernel is used for convolution operation. The formula is:

[0069]

[0070] : the (i,j)th element of the convolutional layer, f: conversion function,

[0071] The operation process of input parameters and convolution kernel, Represents the input layer offset

[0072] Each convolution layer represents a feature map containing texture, shape or other features. Based on engineering experience, this example selects 5 convolution layers to extract image features. The number of convolution kernels from 1 to 5 is: 12, 18, 24, 32, 64, with a step size of 1. Then a pooling layer is connected to reduce the number of neural network layers. At the same time, the maximum pooling can also reduce the amount of weight parameters to avoid overfitting. Then two fully connected layers are connected to integrate the features extracted by the feature extraction layer. At the same time, the second fully connected layer only includes two neurons corresponding to the binary classification problem (0 (no defect) or 1 (defective)), and finally a softmax connection layer is connected to output the classification probability. In order to prevent overfitting, the entire network connects a pooling layer to each convolution layer, and uses image enhancement (movement, flipping, scaling, etc.) to process the image.

[0073] S22: The second stage is the feature extraction and semantic segmentation stage of training the CNN network. This example proposes a semantic segmentation network divided into two parts: encoding and decoding. The encoding part is used to calculate and extract image features, and decoding is the opposite process of the compression part, which restores the compression process and realizes defect location in space. The encoding part of the semantic segmentation network in this example still selects 5 convolution layers, 1-5 are: 32, 64, 128, 256, 512 convolution kernels, and each convolution layer uses padding technology and connects the maximum pooling layer; the decoding part is a symmetrical network structure with the encoding part, but the input data is upsampled by 2*2, so that after decoding, the output image size is equal to the original image.

[0074] For the S3 two-stage network model parameter migration, the structure and parameters of the two stages in the source domain are migrated to the target domain (laptop screen defect detection), and the parameters of the two-stage network model are fine-tuned by inputting target domain samples to obtain the classification and detection network. The steps are divided into the following specific operations:

[0075] S31: Transfer learning uses the parameters in Ds and Ts to improve the performance of the objective function Ft in Dt. It assumes that the source task model (KolektorSDD) and the target task model share training parameters through parameter transfer, and the parameters w of each source problem domain target task and source problem domain task can be divided into two parts, one of which is the same between tasks, and the other is unique between each task. Due to the noise in the target domain samples, the small number of samples, and the defects are usually small targets, in order to improve the generalization ability and robustness of the model. According to engineering experience, the CNN network feature map usually shows spatial features in the middle part, and this part of the features can usually improve the model accuracy. When the test sample satisfies the Gaussian distribution, this example uses Manhattan distance to calculate the Gaussian distribution:

[0076]

[0077] D: data dimension, Σ data covariance (positive definite symmetric matrix)

[0078] Define the intermediate feature extraction of the CNN network model:

[0079] ,

[0080] Intermediate Features Manhattan calculation formula: M(x)= x; Output value, , and finally get a Matrix, in order to minimize the final error, a maximum pooling layer is applied to each intermediate feature extraction layer that calculates Manhattan. Finally, we define a formula for minimizing the error loss:

[0081]

[0082] Obtained based on engineering experience.

[0083] like Figure 4 and Figure 5 As shown, this method can effectively detect defects in the appearance of notebooks during production, such as scratches and damages, under visible light imaging conditions.

[0084] On the other hand, the present invention also discloses a notebook screen defect detection system, comprising the following units:

[0085] An image acquisition and processing unit, used to acquire and pre-process images and construct a training sample set;

[0086] The model building unit is used to build a two-stage network model structure and pre-train the network model on the KolektorSDD dataset, and adjust the model parameters to obtain the weights and offsets of the two stages in the source domain;

[0087] A model determination unit is used to transfer the parameters of the two-stage network model, transfer the structure and parameters of the two-stage in the source domain to the target domain of laptop screen defect detection, and fine-tune the parameters of the two-stage network model by inputting samples of the target domain to obtain a classification and detection network;

[0088] The detection unit is used to collect the detection video of the notebook appearance production line under the high-definition camera, obtain the picture to be detected, send it to the trained two-stage classifier, obtain the detection result and output it.

[0089] It is understandable that the system provided by the embodiment of the present invention corresponds to the method provided by the embodiment of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the above method.

[0090] The embodiment of the present application also provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus.

[0091] Memory, used to store computer programs;

[0092] The processor is used to implement the above-mentioned notebook screen defect detection method when executing the program stored in the memory, and the method includes:

[0093] Collect inspection videos from the notebook appearance production line under high-definition cameras, obtain the images to be inspected, send them to the trained two-stage classifier, obtain the inspection results and output them;

[0094] Among them, the training steps of the two-stage classifier are as follows:

[0095] S1, collect images and preprocess them to build a training sample set,

[0096] S2, establish a two-stage network model structure and pre-train the network model on the KolektorSDD dataset, adjust the model parameters to obtain the weights and offsets of the two stages in the source domain;

[0097] S3. Two-stage network model parameter migration: the two-stage structure and parameters of the source domain are migrated to the target domain of laptop screen defect detection, and the two-stage network model parameters are fine-tuned by inputting target domain samples to obtain the classification and detection network.

[0098] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0099] The communication interface is used for communication between the above electronic device and other devices.

[0100] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0101] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0102] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned notebook screen defect detection methods are implemented.

[0103] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the notebook screen defect detection methods in the above embodiments.

[0104] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0105] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0106] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0107] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A notebook screen defect detection method, characterized in that: Follow the steps below on your computer device, Collect inspection videos from the notebook appearance production line under high-definition cameras, obtain the images to be inspected, send them to the trained two-stage classifier, obtain the inspection results and output them; Among them, the training steps of the two-stage classifier are as follows: S1, collect images and preprocess them to build a training sample set, S2, establish a two-stage network model structure and pre-train the network model on the KolektorSDD dataset, adjust the model parameters to obtain the weights and offsets of the two stages in the source domain; S3, two-stage network model parameter migration, the structure and parameters of the two stages in the source domain are migrated to the target domain of laptop screen defect detection, and the parameters of the two-stage network model are fine-tuned by inputting samples from the target domain to obtain the classification and detection network; The above step S2 specifically includes: S21: In the first stage, the CNN network feature extraction and classification stage is trained; the input image is resized to 96*96, and a 3*3 convolution kernel is used for convolution operation. The formula is: : the (i,j)th element of the convolutional layer, f: conversion function, The operation process of input parameters and convolution kernel, Represents the input layer offset; Each convolutional layer represents a feature map containing texture, shape, or other features; Five convolutional layers were selected to extract image features. The number of convolution kernels in the 1st to 5th convolutional layers was 12, 18, 24, 32, and 64, with a step size of 1. A pooling layer was then connected to reduce the number of neural network layers. At the same time, the maximum pooling can also reduce the amount of weight parameters to avoid overfitting. Two fully connected layers were then connected to integrate the features extracted by the feature extraction layer. At the same time, the second fully connected layer only included two neurons corresponding to the binary classification problem, 0 for no defect or 1 for defect. Finally, a softmax connection layer was connected to output the classification probability. In order to prevent overfitting, the entire network connects a pooling layer to each convolutional layer and uses image enhancement to process the image. S22: The second stage is the stage of training CNN network feature extraction and semantic segmentation; The semantic segmentation network is divided into two parts: encoding and decoding. The encoding part is used to calculate and extract image features, and the decoding part is the opposite process of the compression part, which restores the compression process and realizes defect location in space. The semantic segmentation network coding part still selects 5 convolution layers, 1-5 are: 32, 64, 128, 256, 512 convolution kernels, and each convolution layer uses padding technology and connects to the maximum pooling layer; the decoding part is a symmetrical network structure with the encoding part, but the input data is upsampled by 2*2, so that after decoding, the output image size is equal to the original image; Step S3 is further divided into the following specific operations: S31: Transfer learning uses the parameters in Ds and Ts to improve the performance of the objective function Ft in Dt. It assumes that the source task model and the target task model share training parameters through parameter transfer, and the parameters w of each source problem domain target task and source problem domain task are divided into two parts, one of which is the same between tasks, and the other is unique between each task. Compute Gaussian distribution using Manhattan distance: D: data dimension, Σ data covariance corresponds to a positive definite symmetric matrix, Define the intermediate feature extraction of the CNN network model: , Intermediate Features Manhattan calculation formula: M(x)= x; Output value, and finally get a Matrix, in order to minimize the final error, a maximum pooling layer is applied to each intermediate feature extraction layer that calculates Manhattan, and finally an error loss minimization formula is defined: Obtained based on engineering experience.

2. The notebook screen defect detection method according to claim 1, characterized in that: In step S1, the following subdivision steps S11 to S12 are specifically included: S11: Collect inspection videos of notebook appearance production lines under high-definition cameras, extract original samples of video key frames containing appearance defects, use "center normalization" image preprocessing on the original samples, and construct a training sample set; S12: Annotate the pixel areas containing appearance defects in the dataset image with rectangular boxes, wherein one dataset image contains multiple rectangular boxes, i.e., multiple appearance defects, but each rectangular box only contains one target to be detected, and the annotated label results are saved in an XML file according to the VOC dataset format; wherein each image corresponds to an XML file with the same name, which contains the center point coordinate information (x, y) of each rectangular box in the dataset image, the width w of the rectangular box, and the height h of the rectangular box; Here, the labels in each batch of images, i.e. (x, y, w, h), are normalized in size, that is, they are mapped to a sub-region under 64*64 coordinates in the original image coordinate system according to the unchanged aspect ratio of the original image, and the transformed coordinate information is stored in an XML file as the input for the subsequent training of the target domain model.

3. The notebook screen defect detection method according to claim 2, characterized in that: The specific steps for the deep two-stage network model structure constructed in the above step S2 are: The two-stage deep network classifier treats the laptop defect screen detection problem as an unclassified problem. First, a semantic segmentation fully convolutional network is trained by taking the pixels of the source domain input image as the sample set, and deconvolution is performed at the end to obtain the pixel-level prediction structure. Second, in the next stage, the output and the features of the segmentation network are combined for classification, and finally the classification output result is obtained.

4. The notebook screen defect detection method according to claim 3, characterized in that: In step S21, image enhancement is used to process the image, including movement, flipping, and scaling.

5. A laptop screen defect detection system, capable of implementing the laptop screen defect detection method according to any one of claims 1 to 4, characterized in that: It includes the following units: An image acquisition and processing unit, used to acquire and pre-process images and construct a training sample set; The model building unit is used to build a two-stage network model structure and pre-train the network model on the KolektorSDD dataset, and adjust the model parameters to obtain the weights and offsets of the two stages in the source domain; A model determination unit is used to transfer the parameters of the two-stage network model, transfer the structure and parameters of the two-stage in the source domain to the target domain of laptop screen defect detection, and fine-tune the parameters of the two-stage network model by inputting samples of the target domain to obtain a classification and detection network; The detection unit is used to collect the detection video of the notebook appearance production line under the high-definition camera, obtain the picture to be detected, send it to the trained two-stage classifier, obtain the detection result and output it.

6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 4.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Target detection positioning optimization method based on unsupervised domain adaptation

    CN109977918A

  • Notebook screen defect detection method based on autonomous learning network model and medium

    CN113569737A