Display screen foreign body detection method, model training method, device, equipment and medium
Through the combination of dual-camera shooting and deep learning models, efficient and accurate identification of foreign objects in the various layers of the display screen is achieved, solving the problems of low efficiency and poor accuracy in the existing technology.
Patent Information
- Application Number
- CN202410298286.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-03-15
AI Technical Summary
The existing technology has low efficiency and poor accuracy in detecting layered foreign matter in the display screen, making it difficult to accurately distinguish foreign matter in each layer structure of the display screen.
Dual cameras are used to capture two strabismus images of the display screen to be detected, and the depth value of each pixel point of the foreign object is output through the display screen foreign object detection model, and the image feature extraction and fusion module, depth information extraction module and depth estimation semantic segmentation network module are used to carry out the process. Foreign body delamination detection.
It improves the accuracy and efficiency of foreign body detection on the display screen, reduces detection errors, and can more accurately identify the location of foreign bodies in each layer of the display screen.
Smart Images

Figure CN118229781B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of display screen detection, and in particular to a display screen foreign body detection method, model training method, device, equipment and medium. Background Art
[0002] The display screen has a multi-layer structure, which includes a glass protective film, a CG cover glass, an OCA glue and a display pixel layer from top to bottom.
[0003] During the production process of display screens, dust, dirt and other foreign objects may appear between the various layers of the display screen due to various reasons. The attention paid to foreign objects at different levels is different. For example, foreign objects in the glass protective film-CG cover glass are insignificant, while foreign objects in the CG cover glass-OCA glue and OCA glue-display pixel layer will affect the display effect of the display screen. Therefore, it is necessary to distinguish and detect foreign objects in different structural layers of the display screen. However, the thickness of each layer of the display screen is very small and tightly connected, and the volume of various foreign objects is also at the pixel level. Therefore, the detection of layered foreign objects in the display screen has always been a difficult point in the industry.
[0004] In the existing technical solutions, depth of field camera solutions and multi-layer reflection solutions are usually used for layered foreign body detection. However, when using the depth of field camera solution for foreign body detection, the detection efficiency is very low because the depth of field camera has a very small field of view. The multi-layer reflection solution uses forward lighting and forward camera photography based on the different light reflectivity at the connection of different structural layers of the display screen, and performs card control based on the grayscale value of the foreign body. However, since the thickness of each layer of the display screen is very small and tightly connected, the volume of various foreign bodies is also at the pixel level, and the grayscale value difference of each layer of foreign bodies is very small, the detection error is large, and it is not accurate enough. Summary of the invention
[0005] In order to solve the above technical problems, the present disclosure provides a display screen foreign body detection method, model training method, device, equipment and medium.
[0006] In a first aspect, an embodiment of the present disclosure provides a method for detecting foreign matter on a display screen, comprising:
[0007] Obtain two oblique images of the display screen to be inspected taken by dual cameras;
[0008] The two oblique images are input into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body;
[0009] Foreign object layer detection is performed based on the depth value of each pixel point of the foreign object to detect the hierarchical position of the foreign object in the display screen.
[0010] In some embodiments, after acquiring two oblique images taken by dual cameras, the method further includes:
[0011] Preprocessing the two oblique images respectively to obtain two target oblique images;
[0012] The two oblique images are input into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body, including:
[0013] The two oblique target images are input into the display screen foreign object detection model, and the display screen foreign object detection model outputs the depth value of each pixel point of the foreign object.
[0014] In some embodiments, the display screen foreign body detection model includes an image feature extraction and fusion module, a depth information extraction module, and a depth estimation semantic segmentation network module;
[0015] The two oblique images are input into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body, including:
[0016] Inputting the two oblique vision images into the image feature extraction and fusion module to obtain high-dimensional feature information of the oblique vision images;
[0017] Inputting the high-dimensional feature information into the depth information extraction module to extract the depth information feature space of the oblique view image;
[0018] The depth information feature space is input into the depth estimation semantic segmentation network module to obtain the depth value of each pixel point of the foreign object.
[0019] In a second aspect, the present disclosure provides a model training method, including:
[0020] Build a display screen foreign body detection model;
[0021] Acquire multiple sets of training sample data and depth values of foreign objects corresponding to each set of training sample data, wherein each set of training sample data includes two sample oblique images;
[0022] Based on each set of training sample data and the depth value of the foreign object corresponding to each set of training sample data, the display screen foreign object detection model to be trained is trained to obtain the depth prediction result of the foreign object of each set of training sample data;
[0023] Based on the depth value of the foreign object corresponding to each set of training sample data, loss calculation is performed on the depth prediction result of the foreign object of each set of training sample data to obtain the loss calculation result of the display screen foreign object detection model;
[0024] Based on the loss calculation result of the display screen foreign object detection model, the model parameters of the display screen foreign object detection model are updated.
[0025] In some embodiments, after updating the model parameters of the display screen foreign body detection model based on the loss calculation result of the display screen foreign body detection model, the method further includes:
[0026] Recording the number of training cycles of the display screen foreign body detection model;
[0027] Determine whether the depth prediction result of the foreign object of each set of training sample data converges to the depth value of the foreign object corresponding to each set of training sample data;
[0028] If the depth prediction result of the foreign object in each set of training sample data has converged to the depth value of the foreign object corresponding to each set of training sample data, or the number of training cycles of the display screen foreign object detection model is greater than a preset number threshold, it is determined that the training of the display screen foreign object detection model is completed.
[0029] In some embodiments, the display screen foreign body detection model includes an image feature extraction and fusion module, a depth information extraction module, and a depth estimation semantic segmentation network module;
[0030] The image feature extraction and fusion module includes a dual-pyramid feature extraction submodule, a hybrid attention mechanism submodule, and a dual-image feature fusion submodule.
[0031] In a third aspect, an embodiment of the present disclosure provides a display screen foreign body detection device, comprising:
[0032] An acquisition module, used to acquire two oblique images of the display screen to be detected taken by dual cameras;
[0033] A module is obtained, which is used to input the two oblique images into a display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body;
[0034] The detection module is used to perform layered detection of foreign objects according to the depth value of each pixel point of the foreign object, and detect the hierarchical position of the foreign object in the display screen.
[0035] In a fourth aspect, an embodiment of the present disclosure provides a model training device, including:
[0036] A building module for building a display screen foreign body detection model;
[0037] A sample acquisition module, used to acquire multiple sets of training sample data and the depth value of the foreign matter corresponding to each set of training sample data, wherein each set of training sample data includes two sample oblique images;
[0038] An obtaining module is used to train the display screen foreign body detection model to be trained based on each set of training sample data and the depth value of the foreign body corresponding to each set of training sample data, and obtain the depth prediction result of the foreign body for each set of training sample data;
[0039] A loss calculation module, used to perform loss calculation on the depth prediction result of the foreign object of each set of training sample data based on the depth value of the foreign object corresponding to each set of training sample data, so as to obtain the loss calculation result of the display screen foreign object detection model;
[0040] An updating module is used to update the model parameters of the display screen foreign body detection model based on the loss calculation result of the display screen foreign body detection model.
[0041] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including:
[0042] Memory;
[0043] Processor; and
[0044] Computer programs;
[0045] The computer program is stored in the memory and is configured to be executed by the processor to implement the method as described in the first aspect or the second aspect.
[0046] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method as described in the first aspect or the second aspect.
[0047] In a seventh aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the method for detecting foreign matter on a display screen as described above is implemented.
[0048] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0049] In the display screen foreign body detection method, model training method, device, equipment and medium provided by the embodiments of the present disclosure, two oblique images of the display screen to be detected taken by dual cameras are obtained, and the two oblique images are input into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body, and the foreign body layer detection is performed according to the depth value of each pixel point of the foreign body, and the hierarchical position of the foreign body in the display screen is detected. Compared with the problems of low detection efficiency and poor detection accuracy in the prior art, the present disclosure obtains two oblique images of the display screen to be detected taken by dual cameras, and the two oblique images are input into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body, and then the depth value of each pixel point of the foreign body is used to perform foreign body layer detection, and the hierarchical position of the foreign body in the display screen is detected, which can reduce the error of display screen foreign body detection, improve the accuracy of display screen foreign body detection, and improve detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0052] Figure 1 is a flow chart of a method for detecting foreign matter on a display screen provided by an embodiment of the present disclosure;
[0053] Figure 2 is a schematic diagram of a display screen foreign body detection scenario provided by an embodiment of the present disclosure;
[0054] Figure 3 is a flow chart of a model training method provided by an embodiment of the present disclosure;
[0055] Figure 4 It is a schematic diagram of a framework of a display screen foreign body detection model provided by an embodiment of the present disclosure;
[0056] Figure 5 A schematic diagram of the structure of a display screen foreign body detection device provided by an embodiment of the present disclosure;
[0057] Figure 6 A schematic diagram of the structure of a model training device provided in an embodiment of the present disclosure;
[0058] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0059] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0060] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0061] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0062] As an emerging technology, deep learning has flourished in the field of image processing. Its ability to autonomously learn image data features avoids the tediousness of manually designing algorithms. Its precise detection performance, high detection efficiency, and good generalization performance for various types of image tasks have made deep learning technology widely used in the field of image processing, including image detection, image classification, image reconstruction, etc.
[0063] The structure of the display screen is multi-layered, including glass protective film, CG cover glass, OCA glue and display pixel layer from top to bottom. During the production process of the display screen, due to various reasons, foreign matter such as dust layer and dirt will be caused between the various layers of the display screen. The attention paid to foreign matter at different levels is different. For example, foreign matter in the glass protective film-CG cover glass is insignificant, while foreign matter in the CG cover glass-OCA glue and OCA glue-display pixel layer will affect the display effect of the display screen. Therefore, it is necessary to distinguish and detect foreign matter in different structural layers of the display screen. However, the thickness of each layer of the display screen is very small and tightly connected, and the volume of various foreign matter is also at the pixel level. Therefore, the detection of layered foreign matter in the display screen has always been a difficult point in the industry.
[0064] The depth estimation neural network based on deep learning extracts the feature information of the image and uses the feature relationship between each pixel point to obtain the depth relationship of each pixel, so as to obtain the layered position of each layered foreign body according to the depth estimation value.
[0065] Convolutional Neural Networks (CNN) are a type of feedforward neural network that includes convolutional calculations and has a deep structure. It is one of the representative algorithms of deep learning. Convolutional neural networks have representation learning capabilities and can perform shift-invariant classification on input information according to their hierarchical structure. Therefore, they are also called "Shift-Invariant Artificial Neural Networks (SIANN)".
[0066] Time delay network and LeNet-5 are the earliest convolutional neural networks. With the introduction of deep learning theory and the improvement of numerical computing equipment, convolutional neural networks have developed rapidly and have been applied to computer vision, natural language processing and other fields. Convolutional neural networks are constructed by imitating the visual perception mechanism of organisms. They can perform supervised learning and unsupervised learning. The convolution kernel parameter sharing in the hidden layer and the sparsity of the inter-layer connection enable convolutional neural networks to learn grid-like topology features such as pixels and audio with a small amount of computation, with stable results and no additional feature engineering requirements for the data.
[0067] The convolutional neural network mainly includes the input layer and the hidden layer, which are described as follows:
[0068] 1.1 Convolutional Neural Network Input Layer
[0069] The input layer of a convolutional neural network can process multi-dimensional data. The input layer of a one-dimensional convolutional neural network receives a one-dimensional or two-dimensional array, where the one-dimensional array is usually time or spectrum sampling; the two-dimensional array may contain multiple channels; the input layer of a two-dimensional convolutional neural network receives a two-dimensional or three-dimensional array; the input layer of a three-dimensional convolutional neural network receives a four-dimensional array. Since convolutional neural networks are widely used in the field of computer vision, many studies presuppose three-dimensional input data when introducing their structure, that is, two-dimensional pixels and RGB channels on a plane. Similar to other neural network algorithms, since the gradient descent algorithm is used for learning, the input features of convolutional neural networks need to be standardized. Specifically, before inputting the learning data into the convolutional neural network, the input data needs to be normalized in the channel or time / frequency dimension. If the input data is pixels, the original pixel values distributed in [0,255] can also be normalized to the [0,1] interval. Standardization of input features is conducive to improving the learning efficiency and performance of convolutional neural networks.
[0070] 1.2 Convolutional Neural Network Hidden Layer
[0071] The hidden layer of a convolutional neural network includes three common structures: convolutional layer, pooling layer, and fully connected layer. In some more modern algorithms, there may be complex structures such as Inception modules and residual blocks. Among the common structures, convolutional layers and pooling layers are unique to convolutional neural networks. The convolution kernel in the convolution layer contains weight coefficients, while the pooling layer does not. Taking LeNet-5 as an example, the order of the three common structures in the hidden layer is usually: input-convolutional layer-pooling layer-fully connected layer-output. Convolutional kernel: The function of the convolutional layer is to extract features from the input data. It contains multiple convolution kernels. Each element of the convolution kernel corresponds to a weight coefficient and a bias vector, which is similar to a neuron in a feedforward neural network. Each neuron in the convolutional layer is connected to multiple neurons in a similar area in the previous layer. The size of the area depends on the size of the convolution kernel, which is also called the "receptive field", which is similar to the receptive field of visual cortical cells. When the convolution kernel is working, it will regularly scan the input features, perform matrix element multiplication on the input features within the receptive field, and superimpose the deviation.
[0072] This disclosure also introduces several attention mechanisms, which are described as follows:
[0073] 1. Self-Attention
[0074] The self-attention mechanism was originally applied to the field of speech and text to process the input character encoding vectors. The first step in calculating self-attention is to create 3 vectors from each input vector. For each word, we create a Query vector, a Key vector, and a Value vector. These vectors are generated by multiplying the embedded word by the 3 training matrices we created during the training process.
[0075] The second step in calculating self attention is to calculate the score. For example, in calculating the self attention of the first word "thinking". We need to score each word of the input sentence based on this word. When we encode a word at a certain position, the score determines the degree of attention to other words of the input sentence. The corresponding word is scored by clicking the query vector and the key vector. So, if we process the self attention at the starting position, the first score is the dot product of and, and the second score is the dot product of and.
[0076] The calculation for the third and fourth steps is to divide the score of the second step by (The dimension of the key vector is usually 64, and its square root = 8, which can make the gradient more stable during training. It is not a unique value and is not limited to a specific value. The output is then normalized by the softmax function so that the final list sums to 1. This softmax score determines the degree of representation of each word position in each sentence. Obviously, the softmax score of the current word corresponding to the position of this word in the sentence is the highest, but sometimes the attention mechanism can also pay attention to other words besides the current word.
[0077] The fifth step is to multiply each Value vector by the softmax score. The actual meaning here is to reduce the attention to irrelevant words while keeping the attention to the current word unchanged.
[0078] The sixth step is to accumulate the vector of weighted values. In this step, the output of the self-attention layer for the first word is generated.
[0079] 2. Cross-Attention
[0080] The computation of Cross-Attention is the same as Self-Attention except that the input to the self-attention mechanism is different. Cross-Attention combines two independent embedding sequences of the same dimension asymmetrically, while the input to Self-Attention is a single embedding sequence. One of the sequences is used as the query input, while the other sequence is used as the key and value input.
[0081] 3. Deformable Attention
[0082] The core problem of applying Transformer attention to image feature maps is that it will look at all possible spatial locations. To solve this problem, a deformable attention module is introduced. The deformable attention module only cares about a small set of key sampling points around the reference point, regardless of the spatial size of the feature map. By assigning a small fixed number of keys to each query, the convergence and feature space resolution issues can be alleviated.
[0083] Given an input feature map x∈R C×H×W , let q be the context feature Z q The query element, P q is a two-dimensional reference point. Input feature map x(C x H x W), each pixel in the feature map is a C-channel vector Z q, the index of each pixel point (reference point) is the two-dimensional position coordinate P q M represents the number of heads in the multi-head attention mechanism. Each head only considers Z q Nearby K points (K is much smaller than H x W). Δ p m q k Represents the position offset of the sampling, which is a two-dimensional coordinate (the initial sampling point is fixed, but the coordinates of more noteworthy points will be predicted through the fully connected layer calculation later). m q k Represents the attention weight (∑ k=1 A m q k =1). m and W' m Represents the weight parameters of two sets of fully connected layers. Among them, the two values A that need to be learned and predicted m q k and Δ p m q k All through Z q Calculated. Specifically, the position offset Δ p m q k It is learnable and is obtained by passing the query through the fully connected layer. m q k It is directly obtained by passing the query through the fully connected layer. Each query samples K positions in each head and only needs to interact with the features of these positions (x(P q +Δ p m q k ) represents the value interpolated based on the sampling point position).
[0084] Deformable-Attention greatly reduces the amount of calculation by only calculating a limited number of other feature points near a feature point instead of calculating all the feature points in the entire feature map, and makes the feature point ignore many other feature points that are not related to itself, making the attention calculation more accurate. It is especially suitable for images with higher resolution and fewer pixels occupied by defects.
[0085] Figure 1A flow chart of the method for detecting foreign matter on a display screen provided in an embodiment of the present disclosure. The method can be applied to electronic devices, which may be portable mobile devices such as smart phones, tablet computers, laptop computers, in-vehicle navigation devices, and smart sports equipment; they may also be fixed devices such as personal computers and smart home appliances. The method can be applied to scenarios where foreign matter on a display screen is detected, and can also be applied to scenarios where the hierarchical position of foreign matter on a display screen is determined. It can reduce the error of detecting foreign matter on a display screen, improve the effect of detecting foreign matter on a display screen, and improve detection efficiency. It is understandable that the method for detecting foreign matter on a display screen provided in an embodiment of the present disclosure can also be applied in other scenarios.
[0086] Below Figure 1 The method for detecting foreign matter on a display screen shown in the figure is introduced, and the specific steps of the method are as follows:
[0087] S101, obtaining two oblique images of the display screen to be inspected taken by dual cameras.
[0088] like Figure 2 As shown, two cameras and two light sources are used to perform opposite oblique shooting, that is, the left light source is turned on and the right camera is used to take pictures, and the right light source is turned on and the left camera is used to take pictures, so that two oblique images are obtained. This shooting method can better highlight the depth information of the foreign object. The use of two images makes the depth information advantages of the foreign object complement each other, and the depth estimation value of the foreign object can be better obtained in the later depth information estimation.
[0089] In some embodiments, after acquiring two oblique images taken by dual cameras, the method further includes: preprocessing the two oblique images respectively to obtain two target oblique images. Optionally, the preprocessing of the image includes but is not limited to image cropping. The defect image captured by the camera includes some surrounding background parts in addition to the screen part of the display screen. This part of the image is unnecessary. Useless or redundant images will also increase the time cost and GPU memory consumption during detection. Therefore, it is necessary to remove these useless images by cropping and only retain the display screen image content.
[0090] In some embodiments, the step of inputting the two oblique images into a display screen foreign object detection model, and having the display screen foreign object detection model output the depth value of each pixel point of the foreign object, includes: inputting the two target oblique images into the display screen foreign object detection model, and having the display screen foreign object detection model output the depth value of each pixel point of the foreign object.
[0091] S102, inputting the two oblique images into a display screen foreign object detection model, and the display screen foreign object detection model outputs the depth value of each pixel point of the foreign object.
[0092] In this step, after acquiring the two oblique images, the electronic device inputs the two oblique images into the display screen foreign object detection model, and obtains the depth value of each pixel point of the foreign object through the display screen foreign object detection model.
[0093] In some embodiments, the display screen foreign body detection model includes an image feature extraction and fusion module, a depth information extraction module, and a depth estimation semantic segmentation network module.
[0094] Specifically, S102 includes but is not limited to S1021, S1022, and S1023:
[0095] S1021, inputting the two oblique vision images into the image feature extraction and fusion module to obtain high-dimensional feature information of the oblique vision images;
[0096] S1022, inputting the high-dimensional feature information into the depth information extraction module to extract the depth information feature space of the oblique view image;
[0097] S1023: Input the depth information feature space into the depth estimation semantic segmentation network module to obtain the depth value of each pixel point of the foreign object.
[0098] like Figure 4 As shown in the figure, the display screen foreign body detection model is divided into the Backbone (left part) of the image feature extraction and fusion module, the Neck (middle part) of the depth information extraction module, and the depth estimation semantic segmentation network module (right part). The entire display screen foreign body detection model is divided into three parts. The left side is the image feature extraction and fusion module. Two images are obtained by taking pictures with two oblique cameras. The Backbone extracts the image feature information of each image and fuses them to complement the pixel depth information of each image to generate a unified high-dimensional feature information space. The high-dimensional feature information space is sent to the depth information extraction module in the middle. The multi-head convolution operation based on Xception is used to obtain more accurate pixel depth information, which is sent to the depth estimation semantic segmentation network module. The depth estimation semantic segmentation network module on the right uses the attention-based deconvolution operation and combines the feature information of the Backbone to output the final depth estimation image.
[0099] S103 , performing foreign object layer detection according to the depth value of each pixel point of the foreign object, and detecting the layer position of the foreign object in the display screen.
[0100] In this step, after obtaining the depth value of each pixel point of the foreign object, the electronic device will perform foreign object layer detection according to the depth value of each pixel point of the foreign object, and detect the hierarchical position of the foreign object in the display screen. The display screen foreign object detection method provided by the present invention can reduce the error of display screen foreign object detection and improve the accuracy of display screen foreign object detection.
[0101] The disclosed embodiment obtains two oblique images of the display screen to be detected taken by dual cameras, inputs the two oblique images into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body, and then performs foreign body layered detection based on the depth value of each pixel point of the foreign body to detect the hierarchical position of the foreign body in the display screen. Compared with the problems of low detection efficiency and poor detection accuracy in the prior art, the disclosed embodiment obtains two oblique images of the display screen to be detected taken by dual cameras, inputs the two oblique images into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body, and then performs foreign body layered detection based on the depth value of each pixel point of the foreign body to detect the hierarchical position of the foreign body in the display screen, which can reduce the error of foreign body detection on the display screen, improve the accuracy of foreign body detection on the display screen, and improve the detection efficiency.
[0102] Figure 3 A flow chart of the model training method provided in the embodiment of the present disclosure, such as Figure 3 As shown, the method includes the following steps:
[0103] S301, constructing a display screen foreign body detection model.
[0104] In this step, the electronic device builds a display screen foreign body detection model. The display screen foreign body detection model can be a depth estimation neural network model. Specifically, a depth estimation neural network DDE-Net based on dual-camera vision is designed. In the image feature information extraction and fusion stage, a Multi-Attention mechanism based on Deformable-Attention is used to form a dual feature pyramid structure to extract and fuse the depth feature information in the two images, and align the feature vectors. In the depth information extraction stage, a multi-layer neural network based on Xception is used, and convolutions with different receptive fields are used to extract depth information from the feature map. In the depth information estimation stage, the Upsample module is used to perform semantic segmentation of the depth information, and finally a depth estimation map of each pixel of the image is obtained.
[0105] like Figure 4As shown in the figure, the display screen foreign body detection model is divided into the Backbone (left part) of the image feature extraction and fusion module, the Neck (middle part) of the depth information extraction module, and the depth estimation semantic segmentation network module (right part). The entire display screen foreign body detection model is divided into three parts. The left side is the image feature extraction and fusion module. Two images are obtained by taking pictures with two oblique cameras. The Backbone extracts the image feature information of each image and fuses them to complement the pixel depth information of each image to generate a unified high-dimensional feature information space. The high-dimensional feature information space is sent to the depth information extraction module in the middle. The multi-head convolution operation based on Xception is used to obtain more accurate pixel depth information, which is sent to the depth estimation semantic segmentation network module. The depth estimation semantic segmentation network module on the right uses the attention-based deconvolution operation and combines the feature information of the Backbone to output the final depth estimation image.
[0106] The following specifically introduces the image feature extraction and fusion module, the depth information extraction module, and the depth estimation semantic segmentation network module:
[0107] 1) Image feature extraction and fusion module
[0108] Optionally, the image feature extraction and fusion module includes a dual-pyramid feature extraction submodule, a hybrid attention mechanism submodule, and a dual-image feature fusion submodule.
[0109] 1.1) Dual pyramid feature extraction submodule
[0110] This module is based on the Mixed-Attention mechanism of Deformable-Attention and forms a dual feature pyramid structure.
[0111] The module is divided into two symmetrical left and right pyramids and an attention module in the middle. The left and right pyramids are used to extract the feature information of each layer of the left and right oblique views respectively. The feature information of each layer of the two images is deeply fused using a hybrid attention module based on Deformable-Attention.
[0112] The input feature map F1 passes through 4 convolution blocks to generate 4 hierarchical features (F2-F5). The size of each hierarchical feature is half of the previous layer, and the channel is twice that of the previous layer. The F5 feature layer obtains the intermediate result feature layer D5.
[0113] D5 is bilinearly interpolated to obtain R5, making the feature size the same as F4. R5 is then superimposed with F4 according to the feature channel, and then a 1×1 convolution block is used to fuse the features between channels to obtain the intermediate result feature layer D4.
[0114] D4 and R5 are added, and R4 is obtained through bilinear interpolation, so that the feature size is the same as F3. R4 is then superimposed with F3 according to the feature channel, and then a 1×1 convolution block is used to fuse the features between channels to obtain the intermediate result feature layer D3.
[0115] D3 and R4 are added and bilinearly interpolated to obtain R3, so that the feature size is the same as F2. R3 is then superimposed with F2 according to the feature channel, and then a 1×1 convolution block is used to fuse the features between channels to obtain the intermediate result feature layer D2.
[0116] D2 and R3 are added, and R2 is obtained through bilinear interpolation, so that the feature size is the same as F1. R2 is then superimposed with F1 according to the feature channel, and then a 1×1 convolution block is used to fuse the features between channels to obtain the intermediate result feature layer D1.
[0117] D1 and R2 are added to obtain the final result R1. The feature size of R1 is the same as that of F1, but the number of channels is more than that of F1.
[0118] 1.2) Hybrid Attention Mechanism Submodule
[0119] Input two sets of feature codes to get two sets of Query and Value values. Use the Query values to perform hybrid attention calculations based on Deformable-Attention. Superimpose the results on the channels and use 1×1 convolution to fuse the channel features to get a new Z value.
[0120] 1.3) Dual-image feature fusion submodule
[0121] The dual-image feature fusion module (Mixed-Attention) includes a self-attention module (Self-Attention), a cross-attention module (Cross-Attention) and an addition and normalization operation;
[0122] The Cross Attention module can align and fuse the feature information of two images. The Deformable Attention module calculates the information of all feature points by focusing only on the information of a limited number of feature points near a certain feature point, and pays more attention to other feature points that are closely related to the feature point, effectively solving the problem of a surge in computational complexity caused by the high resolution of defect images and the difficulty in detecting small-size defects.
[0123] Input two image feature encodings to obtain two sets of Query and Value values. These two sets (Q, V) first perform self-attention calculation based on Deformable-Attention to obtain their own Z values, and then encode to obtain two new sets of Query and Value values, perform mutual attention calculation, and obtain two new sets of Z values, which are added to the previous Z values and normalized.
[0124] 2) Depth Information Extraction Module
[0125] By using multiple (N) depth estimation modules, each module uses the Xception-based convolution module multiple times (k times) to extract deep space information, and then the output of each module head is superimposed through a channel and convolution operation to obtain a unified deep feature information space.
[0126] 3) Depth estimation semantic segmentation network module
[0127] After obtaining the feature space of depth information from the depth information extraction network, multiple Upsample modules and the feature information obtained from Backbone are used to perform semantic segmentation operations for depth estimation, and finally a depth estimation map for each pixel is obtained.
[0128] Multiple Upsample modules include feature summation, regional pixel attention module (RPA), deconvolution operation (conv_t), and AttentionDropOut module (ADO).
[0129] Optionally, the depth estimation semantic segmentation network module includes a regional pixel attention module and an attention random inactivation module.
[0130] 3.1) Regional Pixel Attention Module
[0131] The Regional Pixel Attention (RPA) module assigns a weight to each pixel in the input feature region, so that the neural network pays more attention to the regions with obvious image features. The input feature (B, C, H, W) is first compressed into (B, C*r, H / 2, W / 2) by a BatchNorm-DefConv-ReLU, where r<1; then restored to (B, C, H / 4, W / 4) by a BatchNorm-DefConv, and the weight of each pixel value is generated by the SigMoid function. Finally, it is restored to (B, C, H, W) by bilinear interpolation, and multiplied one-to-one with the original input feature.
[0132] 3.2) Attention Dropout Module
[0133] Based on the attention random inactivation (Dropout) method, different from the random method used in general Dropout, it uses attention to retain more important feature information, making the performance and generalization of the neural network better.
[0134] The input features are subjected to two batch normalization + variable convolution + ReLU / SigMiod to generate an attention matrix of the same size as the original features. According to the value of the attention matrix, the neurons at the corresponding positions of the original feature matrix whose attention is less than the threshold are set to zero.
[0135] S302, obtaining multiple sets of training sample data and the depth value of the foreign matter corresponding to each set of training sample data, wherein each set of training sample data includes two sample oblique images.
[0136] In this step, the electronic device obtains multiple sets of training sample data and the depth value of the foreign matter corresponding to each set of training sample data, wherein each set of training sample data includes two sample oblique images. Optionally, the multiple sets of training sample data and the depth value of the foreign matter corresponding to each set of training sample data can be data stored locally in the electronic device, or can be from data stored in a server. Optionally, in terms of labeling the sample data set, a microscope is used to manually obtain the hierarchical position of each foreign matter, and the foreign matter pixels at different hierarchical positions are marked with different colors.
[0137] In some embodiments, the multiple sets of training sample data are defect images obtained by taking photos. Before being sent to the display screen foreign body detection model for training, these images need to be preprocessed, including image cropping and image data set enhancement.
[0138] Image cropping (or scaling): In addition to the display screen, the defective image captured by the camera also includes some surrounding background parts. This part of the image is unnecessary and may affect the training and detection of the display foreign body detection model. The extra images will also increase the time cost of display foreign body detection model training and detection and GPU memory consumption. Therefore, it is necessary to remove these useless images by cropping and only retain the display image content. The length and width of the display image and the photo image are made to be powers of 2 for ease of later calculations.
[0139] Dataset enhancement: A large number of sample images are required for the training of the display foreign body detection model. The model is built by learning data features from a large number of samples. Sometimes the data set is not sufficient, and taking photos to increase the data set requires additional time and manpower costs. Sample data needs to be artificially increased through data enhancement. Data enhancement includes image operations such as rotating, offsetting, mirroring, cropping, stretching, and grayscale conversion, so that the new image has a certain difference from the image. In a sense, a new image is generated and the data set is expanded. Training the model based on sufficient training sample data can improve the accuracy of the display foreign body detection model.
[0140] After obtaining the data set, it is necessary to annotate the data set to obtain the depth reference value of each foreign object. For example, a microscope is used to manually observe each foreign object at different levels, and the foreign object pixels at different levels are annotated with different colors using semantic segmentation.
[0141] S303 , training the display screen foreign object detection model to be trained based on each set of training sample data and the depth value of the foreign object corresponding to each set of training sample data, and obtaining the depth prediction result of the foreign object for each set of training sample data.
[0142] In this step, the electronic device trains the display screen foreign object detection model to be trained based on each set of training sample data and the depth value of the foreign object corresponding to each set of training sample data, and obtains the depth prediction result of the foreign object for each set of training sample data. Since the parameters of the model are not optimal, the depth prediction result of the foreign object during the training process may not be close to the depth value of the foreign object. Training the model based on enough training sample data can improve the accuracy of the display screen foreign object detection model.
[0143] S304 , performing loss calculation on the depth prediction result of the foreign object of each group of training sample data based on the depth value of the foreign object corresponding to each group of training sample data, to obtain the loss calculation result of the display screen foreign object detection model.
[0144] After obtaining the depth prediction result of the foreign object of each set of training sample data, the depth prediction result of the foreign object of each set of training sample data is subjected to loss calculation based on the depth value of the foreign object corresponding to each set of training sample data, and the loss calculation result of the display screen foreign object detection model is obtained. The smaller the loss calculation result is, the closer the depth prediction result of the foreign object is to the depth value of the foreign object, the more accurate the foreign object detection is, and the higher the current accuracy of the model is. Specifically, the loss calculation can be performed through a loss function.
[0145] In some embodiments, a Scale-Invariant Error loss function is used:
[0146]
[0147] Among them, y is the actual depth value, y* is the depth prediction result, and i and j are a pair of pixels in the depth map.
[0148] S305: Based on the loss calculation result of the display screen foreign object detection model, update the model parameters of the display screen foreign object detection model.
[0149] In this step, according to the loss calculation result of the display screen foreign body detection model, the model parameters of the display screen foreign body detection model are updated, thereby improving the detection accuracy of the display screen foreign body detection model. As the number of training times increases, the parameters of the model are continuously adjusted so that the depth prediction result of the foreign body is closer and closer to the depth value of the foreign body.
[0150] In some embodiments, S305 may also include but is not limited to S306, S307, and S308:
[0151] S306: Record the number of training cycles of the display screen foreign body detection model.
[0152] S307 , determining whether the depth prediction result of the foreign object of each set of training sample data converges to the depth value of the foreign object corresponding to each set of training sample data.
[0153] The electronic device determines whether the depth prediction result of the foreign object of each set of training sample data converges to the depth value of the foreign object corresponding to each set of training sample data. If the depth prediction result of the foreign object is close to the depth value of the foreign object, it means that the depth prediction result of the foreign object converges to the depth value of the foreign object.
[0154] S308: If the depth prediction result of the foreign object in each set of training sample data has converged to the depth value of the foreign object corresponding to each set of training sample data, or the number of training cycles of the display screen foreign object detection model is greater than a preset number threshold, it is determined that the training of the display screen foreign object detection model is completed.
[0155] When the depth prediction result of the foreign object in each set of training sample data has converged to the depth value of the foreign object corresponding to each set of training sample data, or the number of training cycles of the display screen foreign object detection model is greater than the preset threshold, the training of the display screen foreign object detection model is completed, and the display screen foreign object detection model can be used to detect foreign objects on the display screen.
[0156] The disclosed embodiment constructs a display screen foreign body detection model, obtains multiple sets of training sample data and the depth value of the foreign body corresponding to each set of training sample data, and each set of training sample data includes two sample oblique images. Then, based on each set of training sample data and the depth value of the foreign body corresponding to each set of training sample data, the display screen foreign body detection model to be trained is trained to obtain the depth prediction result of the foreign body of each set of training sample data, and based on the depth value of the foreign body corresponding to each set of training sample data, the loss calculation of the depth prediction result of the foreign body of each set of training sample data is performed to obtain the loss calculation result of the display screen foreign body detection model. Further, based on the loss calculation result of the display screen foreign body detection model, the model parameters of the display screen foreign body detection model are updated, and the number of training cycles of the display screen foreign body detection model is recorded. It is determined whether the depth prediction result of the foreign body of each set of training sample data converges to the depth value of the foreign body corresponding to each set of training sample data. Furthermore, if the depth prediction result of the foreign object of each set of training sample data has converged to the depth value of the foreign object corresponding to each set of training sample data, or the number of training cycles of the display screen foreign object detection model is greater than the preset number threshold, it is determined that the training of the display screen foreign object detection model is completed. Since the display screen foreign object detection model is trained, the depth prediction result of the foreign object of each set of training sample data is calculated based on the depth value of the foreign object corresponding to each set of training sample data, and the loss calculation result of the display screen foreign object detection model is obtained. Through the loss calculation result, the model parameters are continuously updated to improve the accuracy of the display screen foreign object detection model, thereby improving the display screen foreign object detection performance.
[0157] Figure 5 The structure diagram of the display screen foreign body detection device provided in the embodiment of the present disclosure. The display screen foreign body detection device can be the electronic device as described in the above embodiment, or the display screen foreign body detection device can be a component or assembly in the electronic device. The display screen foreign body detection device provided in the embodiment of the present disclosure can execute the processing flow provided in the display screen foreign body detection method embodiment, such as Figure 5 As shown, the display screen foreign body detection device 50 includes: an acquisition module 51, a obtaining module 52, and a detection module 53; wherein the acquisition module 51 is used to obtain two oblique images of the display screen to be detected taken by dual cameras; the obtaining module 52 is used to input the two oblique images into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body; the detection module 53 is used to perform foreign body layered detection according to the depth value of each pixel point of the foreign body, and detect the hierarchical position of the foreign body in the display screen.
[0158] Optionally, after acquiring the two oblique images taken by the dual cameras, the display screen foreign body detection device 50 further includes: a processing module 54; the processing module 54 is used to pre-process the two oblique images respectively to obtain two target oblique images;
[0159] The obtaining module 52 inputs the two oblique images into the display screen foreign object detection model, and the display screen foreign object detection model outputs the depth value of each pixel point of the foreign object. It is specifically used to: input the two target oblique images into the display screen foreign object detection model, and the display screen foreign object detection model outputs the depth value of each pixel point of the foreign object.
[0160] Optionally, the display screen foreign body detection model includes an image feature extraction and fusion module, a depth information extraction module, and a depth estimation semantic segmentation network module;
[0161] The obtaining module 52 inputs the two oblique images into the display screen foreign object detection model, and when the display screen foreign object detection model outputs the depth value of each pixel point of the foreign object, it is specifically used to: input the two oblique images into the image feature extraction and fusion module to obtain high-dimensional feature information of the oblique images; input the high-dimensional feature information into the depth information extraction module to extract the depth information feature space of the oblique images; input the depth information feature space into the depth estimation semantic segmentation network module to obtain the depth value of each pixel point of the foreign object.
[0162] Figure 5 The display screen foreign body detection device of the illustrated embodiment can be used to implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar and will not be described in detail here.
[0163] Figure 6 The schematic diagram of the structure of the model training device provided in the embodiment of the present disclosure. The model training device may be the electronic device as described in the above embodiment, or the model training device may be a component or assembly in the electronic device. The model training device provided in the embodiment of the present disclosure may execute the processing flow provided in the embodiment of the model training method, such as Figure 6As shown, the model training device 60 includes: a construction module 61, a sample acquisition module 62, a obtaining module 63, a loss calculation module 64, and an updating module 65; wherein the construction module 61 is used to construct a display screen foreign body detection model; the sample acquisition module 62 is used to obtain multiple groups of training sample data and the depth value of the foreign body corresponding to each group of training sample data, and each group of training sample data includes two sample oblique images; the obtaining module 63 is used to train the display screen foreign body detection model to be trained based on each group of training sample data and the depth value of the foreign body corresponding to each group of training sample data, and obtain the depth prediction result of the foreign body for each group of training sample data; the loss calculation module 64 is used to perform loss calculation on the depth prediction result of the foreign body for each group of training sample data based on the depth value of the foreign body corresponding to each group of training sample data, and obtain the loss calculation result of the display screen foreign body detection model; the updating module 65 is used to update the model parameters of the display screen foreign body detection model based on the loss calculation result of the display screen foreign body detection model.
[0164] Optionally, the model training device 60 also includes: a recording module 66, a judgment module 67, and a determination module 68; the recording module 66 is used to record the number of training cycles of the display screen foreign object detection model; the judgment module 67 is used to judge whether the depth prediction result of the foreign object in each group of training sample data converges to the depth value of the foreign object corresponding to each group of training sample data; the determination module 68 is used to determine that the training of the display screen foreign object detection model is completed if the depth prediction result of the foreign object in each group of training sample data has converged to the depth value of the foreign object corresponding to each group of training sample data, or the number of training cycles of the display screen foreign object detection model is greater than a preset number threshold.
[0165] Optionally, the display screen foreign body detection model includes an image feature extraction and fusion module, a depth information extraction module, and a depth estimation semantic segmentation network module;
[0166] The image feature extraction and fusion module includes a dual-pyramid feature extraction submodule, a hybrid attention mechanism submodule, and a dual-image feature fusion submodule.
[0167] Figure 6 The display screen foreign body detection device of the illustrated embodiment can be used to implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar and will not be described in detail here.
[0168] Figure 7 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 7 , which shows a structural schematic diagram of an electronic device 500 suitable for implementing the embodiments of the present disclosure. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0169] like Figure 7 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 to a random access memory (RAM) 503 to implement the display screen foreign body detection method of the embodiment described in the present disclosure. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0170] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0171] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the display screen foreign body detection method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0172] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0173] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0174] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0175] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0176] Obtain two oblique images of the display screen to be inspected taken by dual cameras;
[0177] The two oblique images are input into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body;
[0178] Foreign object layer detection is performed based on the depth value of each pixel point of the foreign object to detect the hierarchical position of the foreign object in the display screen.
[0179] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.
[0180] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0181] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0182] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0183] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0184] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0185] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0186] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0187] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for detecting foreign matter on a display screen, characterized in that: The method comprises: Obtain two oblique images of the display screen to be inspected taken by dual cameras; The two oblique images are input into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body; Perform foreign body layer detection based on the depth value of each pixel point of the foreign body to detect the layer position of the foreign body in the display screen; After acquiring the two oblique images taken by the dual cameras, the method further includes: Preprocessing the two oblique images respectively to obtain two target oblique images; The two oblique images are input into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body, including: Inputting the two oblique target images into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body; The display screen foreign body detection model includes an image feature extraction and fusion module, a depth information extraction module, and a depth estimation semantic segmentation network module; The two oblique images are input into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body, including: Inputting the two oblique vision images into the image feature extraction and fusion module to obtain high-dimensional feature information of the oblique vision images; Inputting the high-dimensional feature information into the depth information extraction module to extract the depth information feature space of the oblique view image; Inputting the depth information feature space into the depth estimation semantic segmentation network module to obtain the depth value of each pixel point of the foreign object; In the image feature information extraction and fusion stage, the Multi-Attention mechanism based on Deformable-Attention is used to form a dual feature pyramid structure to extract and fuse the depth feature information in the two images, and align the feature vectors. In the depth information extraction stage, a multi-layer neural network based on Xception is used, and convolutions with different receptive fields are used to extract depth information from the feature map. In the depth information estimation stage, the Upsample module is used to perform semantic segmentation of the depth information, and finally the depth estimation map of each pixel of the image is obtained.
2. A model training method, characterized in that: The method comprises: Build a display screen foreign body detection model; Acquire multiple sets of training sample data and depth values of foreign objects corresponding to each set of training sample data, wherein each set of training sample data includes two sample oblique images; Based on each set of training sample data and the depth value of the foreign object corresponding to each set of training sample data, the display screen foreign object detection model to be trained is trained to obtain the depth prediction result of the foreign object of each set of training sample data; Performing loss calculation on the depth prediction result of the foreign object of each set of training sample data based on the depth value of the foreign object corresponding to each set of training sample data, to obtain the loss calculation result of the display screen foreign object detection model; Based on the loss calculation result of the display screen foreign object detection model, updating the model parameters of the display screen foreign object detection model; In the image feature information extraction and fusion stage, the Multi-Attention mechanism based on Deformable-Attention is used to form a dual feature pyramid structure to extract and fuse the depth feature information in the two images, and align the feature vectors. In the depth information extraction stage, a multi-layer neural network based on Xception is used, and convolutions with different receptive fields are used to extract depth information from the feature map. In the depth information estimation stage, the Upsample module is used to perform semantic segmentation of the depth information, and finally the depth estimation map of each pixel of the image is obtained.
3. The method according to claim 2, characterized in that After updating the model parameters of the display screen foreign body detection model based on the loss calculation result of the display screen foreign body detection model, the method further includes: Recording the number of training cycles of the display screen foreign body detection model; Determine whether the depth prediction result of the foreign object of each set of training sample data converges to the depth value of the foreign object corresponding to each set of training sample data; If the depth prediction result of the foreign object in each set of training sample data has converged to the depth value of the foreign object corresponding to each set of training sample data, or the number of training cycles of the display screen foreign object detection model is greater than a preset number threshold, it is determined that the training of the display screen foreign object detection model is completed.
4. The method according to claim 2, characterized in that: The display screen foreign body detection model includes an image feature extraction and fusion module, a depth information extraction module, and a depth estimation semantic segmentation network module; The image feature extraction and fusion module includes a dual-pyramid feature extraction submodule, a hybrid attention mechanism submodule, and a dual-image feature fusion submodule.
5. A display screen foreign body detection device, characterized in that: include: An acquisition module, used to acquire two oblique images of the display screen to be detected taken by dual cameras; A module is obtained, which is used to input the two oblique images into a display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body; A detection module, used to perform layered detection of foreign objects according to the depth value of each pixel point of the foreign object, and detect the hierarchical position of the foreign object in the display screen; After acquiring the two oblique images taken by the dual cameras, the display screen foreign body detection device further includes: A processing module, used for pre-processing the two oblique images respectively to obtain two target oblique images; The obtaining module inputs the two oblique images into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body, and is specifically used to: input the two target oblique images into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body; The display screen foreign body detection model includes an image feature extraction and fusion module, a depth information extraction module, and a depth estimation semantic segmentation network module; The obtaining module inputs two oblique images into the display screen foreign body detection model, and the display screen foreign body detection model outputs the depth value of each pixel point of the foreign body, which is specifically used for: Inputting the two oblique vision images into the image feature extraction and fusion module to obtain high-dimensional feature information of the oblique vision images; Inputting the high-dimensional feature information into the depth information extraction module to extract the depth information feature space of the oblique view image; Inputting the depth information feature space into the depth estimation semantic segmentation network module to obtain the depth value of each pixel point of the foreign object; In the image feature information extraction and fusion stage, the Multi-Attention mechanism based on Deformable-Attention is used to form a dual feature pyramid structure to extract and fuse the depth feature information in the two images, and align the feature vectors. In the depth information extraction stage, a multi-layer neural network based on Xception is used, and convolutions with different receptive fields are used to extract depth information from the feature map. In the depth information estimation stage, the Upsample module is used to perform semantic segmentation of the depth information, and finally the depth estimation map of each pixel of the image is obtained.
6. A model training device, characterized in that: include: A building module for building a display screen foreign body detection model; A sample acquisition module, used to acquire multiple sets of training sample data and the depth value of the foreign matter corresponding to each set of training sample data, wherein each set of training sample data includes two sample oblique images; An obtaining module is used to train the display screen foreign body detection model to be trained based on each set of training sample data and the depth value of the foreign body corresponding to each set of training sample data, and obtain the depth prediction result of the foreign body for each set of training sample data; A loss calculation module, used to perform loss calculation on the depth prediction result of the foreign object of each set of training sample data based on the depth value of the foreign object corresponding to each set of training sample data, so as to obtain the loss calculation result of the display screen foreign object detection model; An updating module, configured to update model parameters of the display screen foreign body detection model based on a loss calculation result of the display screen foreign body detection model; In the image feature information extraction and fusion stage, a dual feature pyramid structure is formed using the Multi-Attention mechanism based on Deformable-Attention to extract and fuse the deep feature information of the two images and align the feature vectors. In the depth information extraction stage, a multi-layer neural network based on Xception is used, and convolutions with different receptive fields are used to extract depth information from feature maps. In the depth information estimation stage, the Upsample module is used to perform semantic segmentation of depth information, and finally a depth estimation map of each pixel in the image is obtained.
7. An electronic device, characterized in that: include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 4.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
