Detection method, device and equipment of liquid crystal display screen and storage medium
This LCD detection method, which combines a multi-level object pyramid structure and a contrastive coding algorithm with coordinate convolution positioning branches and dynamic serpentine convolution classification branches, solves the problem of low detection accuracy in existing technologies and achieves accurate positioning and classification of complex and diverse defect types.
Patent Information
- Application Number
- CN202510747401.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-09-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing LCD screen defect detection technologies suffer from low accuracy, high false negative and false positive rates, and difficulty in accurately locating and classifying defects when faced with a wide variety of complex defect types.
A multi-level object pyramid structure is used for hierarchical scale feature extraction. The feature vectors are encoded into a unified high-dimensional space through a contrastive coding algorithm. Task-specific activation is achieved by combining coordinate convolution localization branch and dynamic snake convolution classification branch, thereby realizing decoupled detection and classification of contrastive encoded feature vectors.
It improves the positioning accuracy and classification accuracy of LCD screen defect detection, enhances the ability to capture defects of different sizes, and improves the robustness and accuracy of detection.
Smart Images

Figure CN120689287A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of equipment detection, and in particular to a method, device, equipment and storage medium for detecting a liquid crystal display screen. Background Art
[0002] With the widespread adoption of liquid crystal display (LCD) technology, quality inspection of LCD screens has become a critical step in the manufacturing process. Traditional methods for detecting defects in LCD screens rely primarily on manual visual inspection or automated inspection systems based on simple image processing. Manual inspection methods suffer from low efficiency, high subjectivity, and susceptibility to fatigue. Automated inspection methods based on traditional image processing typically employ single-scale feature extraction and fixed detection algorithms.
[0003] Existing automated inspection technologies often suffer from low accuracy, high rates of missed and false detections when dealing with the complex and diverse defect types found in LCD screens. In particular, existing technologies struggle to accurately locate and classify defects of varying sizes and shapes, failing to meet the inspection requirements of high-quality LCD production. Summary of the Invention
[0004] The main purpose of the present invention is to solve the technical problems of low detection accuracy and insufficient ability to identify complex and diverse defect types in existing liquid crystal display defect detection technologies; A first aspect of the present invention provides a method for detecting a liquid crystal display screen, the method comprising: Through the preset multi-level object pyramid structure, the corresponding feature layers at different scale levels of the LCD screen image are selected to perform hierarchical scale feature extraction to obtain multi-scale defect feature representation; The multi-scale defect feature representation is encoded into a unified high-dimensional feature space using a multi-layer perceptron through a contrastive coding algorithm and the distance relationship between feature vectors is calculated to obtain a contrastive coding feature vector; Inputting the contrast coding feature vector into a preset LCD defect detection model, performing task-specific activation through the coordinate convolution positioning branch and the dynamic snake convolution classification branch in the LCD defect detection model, and obtaining a decoupled detection result; According to the decoupling detection result, the defect type of the liquid crystal display screen is identified and classified by the detection head of the liquid crystal display screen defect detection model to obtain a defect detection output result.
[0005] Optionally, in a first implementation of the first aspect of the present invention, the step of selecting corresponding feature layers at different scale levels of an image captured by a liquid crystal display screen through a preset multi-level object pyramid structure to perform hierarchical scale feature extraction to obtain a multi-scale defect feature representation includes: Controlling the LCD screen to switch to a monochrome display mode, a grid test display mode, and a brightness gradient display mode, respectively, and collecting corresponding LCD display images; The LCD display image in each display mode is processed at multiple scales of 32², 64², 128², 256², 512², and 800² pixels using a preset multi-level object pyramid structure; For 32² and 64² pixels, a shallow feature layer in the multi-level object pyramid structure is selected to perform detail texture feature extraction, for 128² pixels, a feature layer in the multi-level object pyramid structure is selected to perform medium defect feature extraction, and for 256², 512², and 800² pixels, a deep feature layer in the multi-level object pyramid structure is selected to perform semantic feature extraction; The multi-scale features extracted under different display modes are spliced and fused to obtain a multi-scale defect feature representation containing multi-scale spatial information and multi-modal semantic information.
[0006] Optionally, in a second implementation of the first aspect of the present invention, encoding the multi-scale defect feature representation into a unified high-dimensional feature space using a multi-layer perceptron through a contrastive coding algorithm and calculating the distance relationship between feature vectors to obtain a contrastive coding feature vector includes: Performing fast Fourier transform processing on the multi-scale defect feature representation to obtain frequency domain features containing frequency component information; The frequency domain features and the multi-scale defect feature representation are mapped to a unified high-dimensional feature space using a multi-layer perceptron through a contrast coding algorithm to obtain a normalized high-dimensional feature vector; Calculating the Euclidean distance and cosine similarity between the high-dimensional feature vector and various defect feature templates in a preset feature template library to obtain a distance similarity calculation result; Perform time series difference calculation on the high-dimensional feature vectors of the LCD display images collected continuously for multiple time frames, perform stability verification based on the amplitude of time series changes, and obtain the time series stability verification results; According to the distance similarity calculation results and the temporal stability verification results, a contrast coding feature vector with discriminative ability is obtained.
[0007] Optionally, in a third implementation of the first aspect of the present invention, inputting the contrast coding feature vector into a preset liquid crystal display defect detection model, performing task-specific activation through the coordinate convolution positioning branch and the dynamic serpentine convolution classification branch in the liquid crystal display defect detection model, and obtaining a decoupled detection result includes: Inputting the contrast coding feature vector into a preset LCD defect detection model, and performing a joint convolution operation on the contrast coding feature vector and two-dimensional pixel grid coordinate information through a coordinate convolution positioning branch in the LCD defect detection model to obtain a positioning feature map containing spatial position coding; The contrast coding feature vector is subjected to nonlinear convolution scanning processing according to a preset serpentine path template by using the dynamic serpentine convolution classification branch in the LCD defect detection model to obtain a morphologically perceived classification feature map; Performing a nonlinear transformation on the positioning feature map, extracting boundary coordinate regression information from the comparison coding feature vector, and performing a probability normalization transformation on the classification feature map, extracting defect category probability information from the comparison coding feature vector; The extracted boundary coordinate information and category probability information are task-decoupled to obtain a decoupled detection result containing spatial positioning information and category confidence.
[0008] Optionally, in a fourth implementation of the first aspect of the present invention, inputting the contrast coding feature vector into a preset liquid crystal display defect detection model, and performing a joint convolution operation on the contrast coding feature vector and two-dimensional pixel grid coordinate information through a coordinate convolution positioning branch in the liquid crystal display defect detection model to obtain a positioning feature map containing a spatial position code includes: The contrast coding feature vector is input into the coordinate convolution positioning branch in the LCD defect detection model, and the coordinate convolution positioning branch generates a corresponding two-dimensional pixel grid coordinate matrix according to the spatial dimension of the contrast coding feature vector. Normalizing the coordinate matrix to construct an x-coordinate channel and a y-coordinate channel to obtain a standardized coordinate information tensor; The contrast coding feature vector and the coordinate information tensor are spliced and fused in the channel dimension through the coordinate convolution positioning branch, and information interaction between channels is processed to obtain an enhanced feature representation containing position information; Applying a multi-scale convolution kernel group to the enhanced feature representation to perform parallel convolution operations, and combining a spatial attention mechanism to perform weighted processing on feature responses at different positions to obtain a position-sensitive convolution feature map; The convolution feature map is subjected to nonlinear transformation and dimensionality reconstruction to extract spatial position coding information and obtain a positioning feature map containing spatial position coding.
[0009] Optionally, in a fifth implementation of the first aspect of the present invention, the dynamic serpentine convolution classification branch in the liquid crystal display defect detection model performs nonlinear convolution scanning processing on the contrast coding feature vector according to a preset serpentine path template to obtain a morphologically perceived classification feature map, including: Selecting a matching scanning path from a preset serpentine path template library based on the gradient distribution characteristics of the contrast coding feature vector through the dynamic serpentine convolution classification branch in the LCD defect detection model to obtain a target serpentine trajectory coordinate sequence; Performing a point-by-point feature sampling operation on the comparison coded feature vector according to the target serpentine trajectory coordinate sequence to obtain a one-dimensional feature vector sequence distributed along the serpentine path, and calculating path curvature information based on the direction changes of adjacent coordinate points; Applying a deformable convolution kernel to the one-dimensional feature vector sequence to perform a sequential convolution operation, and performing weight modulation processing in combination with path curvature information to obtain a morphologically adaptive convolution response result; The convolution response result is reconstructed into a two-dimensional feature map according to the inverse spatial mapping relationship of the target serpentine trajectory coordinate sequence, and the reconstruction results of multiple paths are fused at the channel level to obtain a morphologically perceived classification feature map.
[0010] Optionally, in a sixth implementation of the first aspect of the present invention, the defect detection output result obtained by identifying and classifying the defect type of the LCD screen by the detection head of the LCD screen defect detection model based on the decoupling detection result includes: Extract the RGB color histogram distribution, pixel brightness mean and variance, and image gradient change frequency of the current LCD display content, and determine the corresponding mode perception weight coefficient based on the preset display mode lookup table; Performing a linear transformation on the spatial positioning information in the decoupled detection result through a first fully connected layer, and performing a linear transformation on the defect category probability information through a second fully connected layer; Performing weighted summing and fusion of the transformed positioning information and category information according to the pattern perception weight coefficient to obtain a comprehensive feature representation; Performing ReLU activation and Dropout regularization processing on the comprehensive feature representation, and performing dimension mapping through an output fully connected layer to obtain a mapping result; The softmax function is applied to the mapping results to perform multi-category probability normalization, and a confidence threshold is set to filter the results to obtain the defect detection output results including defect type identification, confidence score, and bounding box coordinates.
[0011] A second aspect of the present invention provides a detection device for a liquid crystal display screen, the detection device for a liquid crystal display screen comprising: A feature extraction module is used to select corresponding feature layers at different scale levels of the LCD screen captured image through a preset multi-level object pyramid structure to perform hierarchical scale feature extraction to obtain a multi-scale defect feature representation; An encoding processing module is used to encode the multi-scale defect feature representation into a unified high-dimensional feature space using a contrast encoding algorithm and a multi-layer perceptron and calculate the distance relationship between feature vectors to obtain a contrast encoding feature vector; a decoupled detection module, configured to input the contrast coding feature vector into a preset LCD defect detection model, and perform task-specific activation via a coordinate convolution positioning branch and a dynamic serpentine convolution classification branch in the LCD defect detection model to obtain a decoupled detection result; The classification output module is used to identify and classify the defect types of the liquid crystal display screen through the detection head of the liquid crystal display screen defect detection model according to the decoupling detection result to obtain a defect detection output result.
[0012] A third aspect of the present invention provides a liquid crystal display detection device, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor calls the instructions in the memory so that the liquid crystal display detection device executes the steps of the above-mentioned liquid crystal display detection method.
[0013] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, enable the computer to execute the steps of the above-mentioned method for detecting a liquid crystal display screen.
[0014] The above-mentioned detection method, device, equipment and storage medium for liquid crystal display screens perform hierarchical scale feature extraction on the captured image of the liquid crystal display screen through a multi-level object pyramid structure to obtain a multi-scale defect feature representation; a contrast coding algorithm is used to encode the multi-scale features into a unified high-dimensional space, and the feature vector distance relationship is calculated to obtain a contrast coding feature vector; the feature vector is input into the defect detection model, and task-specific activation is performed through the coordinate convolution positioning branch and the dynamic snake convolution classification branch to obtain a decoupled detection result; based on the decoupled detection result, the defect type is identified and classified by the detection head, and the detection result is output. The present invention realizes the capture of defects of different scales through multi-level pyramid structure extraction, realizes the enhanced discriminability of feature representation through the high-dimensional space mapping of the contrast coding algorithm, and improves the positioning accuracy and classification accuracy through the decoupling processing of coordinate convolution and dynamic snake convolution.
[0015] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purposes and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0016] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 Schematic diagram of a first embodiment of a method for detecting a liquid crystal display screen according to an embodiment of the present invention; Figure 2 Schematic diagram of an embodiment of a detection device for a liquid crystal display screen according to an embodiment of the present invention; Figure 3 FIG. 1 is a schematic diagram of an embodiment of a detection device for a liquid crystal display screen according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0019] The terms "including," "having," and any variations thereof, as used in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or device.
[0020] To facilitate understanding of this embodiment, a method for detecting a liquid crystal display screen disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, this method includes the following steps: 101. Select corresponding feature layers at different scale levels of the image captured by the liquid crystal display screen through a preset multi-level object pyramid structure to perform hierarchical scale feature extraction to obtain a multi-scale defect feature representation; In one embodiment of the present invention, selecting corresponding feature layers at different scale levels of an image captured by a liquid crystal display screen using a preset multi-level object pyramid structure to perform hierarchical scale feature extraction to obtain a multi-scale defect feature representation includes: controlling the liquid crystal display screen to switch to a monochrome display mode, a grid test display mode, and a brightness gradient display mode, respectively, and capturing corresponding liquid crystal display images; performing multi-scale processing of 32², 64², 128², 256², 512², and 800² pixels on the liquid crystal display images in each display mode using the preset multi-level object pyramid structure; extracting detail texture features from shallow feature layers in the multi-level object pyramid structure for 32² and 64² pixels, extracting medium defect features from feature layers in the multi-level object pyramid structure for 128² pixels, and extracting semantic features from deep feature layers in the multi-level object pyramid structure for 256², 512², and 800² pixels; and performing splicing and fusion processing on the multi-scale features extracted in different display modes to obtain a multi-scale defect feature representation containing multi-scale spatial information and multi-modal semantic information.
[0021] Specifically, multi-mode image acquisition on an LCD screen is achieved through driver circuit control. In monochrome display mode, a uniform RGB value signal is sent to the LCD screen's driver circuit. For example, in red mode, the RGB value is set to (255, 0, 0), causing all pixels to display the same color. The grid test display mode uses programming to generate a specific pixel matrix. Based on preset grid spacing and line width parameters, a regular black and white or color grid pattern is formed on the screen. The grid size is typically set to 8×8 or 16×16 square pixels. The brightness gradient display mode is achieved by calculating the brightness value of each pixel position, increasing the brightness from the left to the right of the screen according to a linear function. The left edge is set to 0 (black) and the right edge is set to 255 (white). The brightness value of the intermediate pixels is calculated proportionally to their horizontal position. The industrial camera acquires images in each display mode. The camera's exposure time, gain, and white balance parameters are kept fixed to ensure consistent grayscale distribution and color reproduction in the captured image.
[0022] Specifically, the construction process of the multi-level object pyramid structure involves the step-by-step scaling of the image and the hierarchical design of the feature layers. The original captured image is first scaled using a bilinear interpolation algorithm. The grayscale value of the target pixel location is calculated by finding its corresponding floating-point coordinate in the original image and then taking the weighted average of the four integer-coordinate pixels surrounding that location. Specifically, generating a 32²-pixel image requires compressing the original image to 1024 pixels. 64² pixels correspond to 4096 pixels, 128² pixels correspond to 16,384 pixels, 256² pixels correspond to 65,536 pixels, 512² pixels correspond to 262,144 pixels, and 800² pixels correspond to 640,000 pixels. The feature layer design of the pyramid structure adopts a convolutional neural network architecture. The shallow feature layer consists of three to five convolutional layers, each using a 3×3 convolution kernel with a stride of 1 and padding of 1. The activation function is the ReLU function. The middle feature layer adds 2 to 3 convolutional layers on top of the shallow layer, and adds a maximum pooling layer after the 3rd and 5th layers, with a pooling window size of 2×2 and a stride of 2. The deep feature layer contains 8 to 12 convolutional layers, with an average pooling layer added after the 6th, 9th, and 12th layers, respectively, with the same pooling parameters as the maximum pooling layer.
[0023] Specifically, feature extraction is implemented in layers based on the characteristics of images of different scales. For 32² and 64² pixel images, the shallow feature layer first performs a first convolution operation on the input image. The convolution kernel weights are trained using the backpropagation algorithm. The convolution output is element-wise applied with the ReLU activation function, which sets negative values to zero and retains positive values. The second convolution layer continues the convolution operation on the output feature map of the first layer, extracting more complex edge combinations and texture patterns. The third and fourth convolution layers gradually increase the receptive field of view, capturing spatial relationships within a larger area. The feature map after each convolution layer maintains the original spatial resolution, and padding operations are used to ensure that the feature map size remains unchanged. For 128² pixel images, the middle feature layer adds deeper network layers based on the shallow feature layer. The fifth and sixth convolution layers are able to capture visual patterns of moderate complexity. The introduction of pooling layers reduces the spatial dimensionality of the feature map while enhancing the feature's translation invariance. For large-scale images of 256², 512², and 800² pixels, the deep feature layer gradually abstracts high-level semantic features through a combination of more convolutional layers and pooling layers. The deep layers of the network are able to understand complex spatial layouts and global context information.
[0024] Specifically, the feature concatenation and fusion process first aligns the dimensions of features at different scales. Because feature maps of different scales may have different sizes and numbers of channels after passing through their respective feature layers, all feature maps need to be resized to a uniform spatial size through upsampling or downsampling, typically 128×128. Bilinear interpolation is used for upsampling, and average pooling is used for downsampling. Channel-wise alignment is achieved through 1×1 convolutions, mapping feature maps with different channel counts to a uniform number of channels, for example, 256 channels. After dimensional alignment, feature maps from different scales are concatenated in the channel dimension to form a high-dimensional feature representation with 768 channels (assuming three different scales, each with 256 channels). Feature fusion for different display modes is achieved through weighted summation, with weight coefficients automatically learned through the attention mechanism during training. Attention weights are calculated using the softmax function to ensure that the sum of the weights is 1. The final multi-scale defect feature representation undergoes dimensionality reduction through a fully connected layer, compressing the high-dimensional features to a fixed-length vector of 512 or 1024 dimensions, which serves as input for subsequent processing steps.
[0025] 102. Using a contrastive coding algorithm, a multi-layer perceptron is used to encode the multi-scale defect feature representation into a unified high-dimensional feature space and calculate the distance relationship between feature vectors to obtain a contrastive coding feature vector; In one embodiment of the present invention, the method of encoding the multi-scale defect feature representation into a unified high-dimensional feature space using a multi-layer perceptron through a contrast coding algorithm and calculating the distance relationship between feature vectors to obtain a contrast coding feature vector includes: performing fast Fourier transform processing on the multi-scale defect feature representation to obtain frequency domain features containing frequency component information; mapping the frequency domain features and the multi-scale defect feature representation into a unified high-dimensional feature space using a multi-layer perceptron through a contrast coding algorithm to obtain a normalized high-dimensional feature vector; calculating the Euclidean distance and cosine similarity between the high-dimensional feature vector and various defect feature templates in a preset feature template library to obtain a distance similarity calculation result; performing time series difference calculation on the high-dimensional feature vector of the liquid crystal display image continuously collected for multiple time frames, performing stability verification based on the amplitude of the time series change, and obtaining a time series stability verification result; and obtaining a contrast coding feature vector with discriminative ability based on the distance similarity calculation result and the time series stability verification result.
[0026] Specifically, when implementing the contrast coding algorithm, the multi-scale defect feature representation must first be subjected to a Fast Fourier Transform (FFT). The FFT is an efficient frequency-domain analysis algorithm that converts time-domain or spatial-domain signals into the frequency domain for analysis. For two-dimensional defect feature representations, the FFT implementation involves complex number operations and recursive decomposition. During execution, the input multi-scale defect feature representation is treated as a two-dimensional complex matrix, where the real part is the original eigenvalue and the imaginary part is initialized to zero. The transformation process first performs a one-dimensional FFT on each row of the feature matrix. The calculation employs a butterfly operation structure, recursively decomposing the sequence of length N into two subsequences of length N / 2 until it is decomposed into a basic unit of length 1. Each butterfly operation involves complex number addition and multiplication operations, where the multiplication operation uses pre-calculated rotation factors. The rotation factors are calculated based on Euler's formula and involve a combination of sine and cosine functions. After the row transform is completed, the same one-dimensional FFT is performed on each column of the transform result, ultimately obtaining the complete two-dimensional frequency-domain transform result. The transformed frequency domain features contain information about the distribution of the original features across different frequency components. Low-frequency components reflect the overall trend and large-scale variations of the features, while high-frequency components contain detailed variations and edge information. The amplitude spectrum of the frequency domain features is obtained by calculating the modulus of the complex number, and the phase spectrum is obtained by calculating the argument of the complex number. Together, these two pieces of information constitute a complete frequency domain feature representation that includes frequency component information.
[0027] Specifically, after obtaining the frequency domain features, the contrastive coding algorithm begins feature mapping, mapping the frequency domain features and the original multi-scale defect feature representations to a unified high-dimensional feature space using a multilayer perceptron (MLP). The MLP is a feedforward neural network structure consisting of multiple fully connected layers, each connected by a nonlinear activation function. In its implementation, the MLP contains three to four hidden layers, with the number of neurons in each layer being 512, 1024, 2048, and 1024, respectively. The final output layer is set to the same high-dimensional feature space, typically 512 or 1024. The frequency domain features are first linearly transformed in the first fully connected layer. This transformation involves matrix multiplication, where the input feature vector is multiplied by a weight matrix and then a bias vector is added. The transformed result is then nonlinearly processed using the ReLU activation function, which sets all negative values to zero and leaves positive values unchanged. The second and third layers repeat the same linear transformation and nonlinear activation process, gradually increasing the abstraction and expressive power of the features. The final layer maps features to the target dimension through a linear transformation, followed by L2 normalization to ensure the Euclidean norm of the output vector is 1. Multi-scale defect feature representation undergoes the same mapping process through another multi-layer perceptron with identical structure but independent parameters. The weight parameters of the two networks are jointly trained. After the mapping is completed, two normalized high-dimensional feature vectors are obtained. These vectors have the same dimension and value range in a unified feature space, facilitating subsequent distance calculation and similarity analysis.
[0028] Specifically, the distance similarity calculation process involves constructing a pre-set feature template library and calculating multiple distance metrics. The feature template library contains standard feature vectors for various known defect types. These template vectors are obtained through feature extraction and cluster analysis of a large number of annotated samples. Each defect type corresponds to multiple feature templates, reflecting the range of characteristic variations of that defect type under different conditions. The Euclidean distance calculation process first calculates the dimension-by-dimension difference between the high-dimensional feature vector and each template vector. Then, the squares of the differences across all dimensions are summed, and the square root of the summed results is taken to obtain the Euclidean distance value. This calculation process is performed on all templates in the template library, generating a vector containing all distance values. The cosine similarity calculation is based on the inner product operation of vectors, performing a dot product between the high-dimensional feature vector and the template vector. Since the vectors are normalized, the dot product result is directly equivalent to the cosine similarity value. Cosine similarity reflects the angular relationship between vectors and is unaffected by vector length, making it more suitable for measuring the directional similarity of high-dimensional features. After the calculation is completed, each high-dimensional feature vector is associated with a set of Euclidean distance values and a set of cosine similarity values, which together constitute the distance similarity calculation result. By setting a threshold, the matching degree between the feature vector and various defect templates can be determined. The smaller the distance value or the larger the similarity value, the higher the matching degree.
[0029] Specifically, the temporal stability verification process requires processing LCD image data spanning multiple consecutive time frames. In practical applications, defect detection for LCD displays typically requires the continuous acquisition of 5 to 10 frames to ensure the stability and reliability of the inspection results. Each frame undergoes the aforementioned feature extraction and encoding process to generate a corresponding high-dimensional feature vector. Temporal difference calculation is performed by comparing the differences in feature vectors between adjacent frames. The specific calculation process involves vector subtraction and norm calculation. For the feature vectors of frame t and frame t+1, the difference vector is obtained by dimension-by-dimension subtraction. The L2 norm of the difference vector is then calculated as a measure of the temporal variation. Stability verification is based on statistical analysis of the temporal variation. The mean and standard deviation of the variation for all pairs of adjacent frames are calculated. When the standard deviation of the variation is less than a preset threshold, the feature vector is considered temporally stable. Furthermore, abnormal frames with sudden changes must be detected. By comparing the deviation of the variation of a single frame from the overall mean, unstable frames can be identified and eliminated. The results of timing stability verification include stability scores and stable frame screening results. The stability score reflects the consistency of the entire timing sequence, and stable frame screening ensures that reliable feature data is used in subsequent analysis.
[0030] Specifically, the final comparative coding feature vector generation process comprehensively considers the distance similarity calculation results and the temporal stability verification results. This integration process uses a weighted fusion approach, combining distance similarity information and temporal stability information to form a discriminative feature representation. In implementation, the distance similarity calculation results are first normalized. The Euclidean distance value is converted to a similarity score using an exponential function, and the cosine similarity value is directly used as the similarity score. The two similarity scores are then weighted averaged, with the weight coefficient determined based on experimental data. The temporal stability verification results are quantified using a stability score, with higher stability scores indicating more reliable features. The fusion process multiplies the normalized distance similarity information with the stability score to produce a comprehensive feature quality evaluation metric. Based on this quality evaluation, the system automatically selects the optimal feature vector as the final comparative coding feature vector, or performs a weighted average of multiple high-quality feature vectors to generate a comprehensive feature vector. The resulting comparative coding feature vector not only contains rich defect discrimination information but also ensures temporal consistency and stability, accurately reflecting LCD defect characteristics while suppressing interference from noise and instability. This comprehensive feature encoding method significantly enhances the robustness and accuracy of the defect detection system.
[0031] 103. Input the comparison coding feature vector into a preset LCD defect detection model, perform task-specific activation through the coordinate convolution positioning branch and the dynamic snake convolution classification branch in the LCD defect detection model, and obtain a decoupled detection result; In one embodiment of the present invention, inputting the contrast coding feature vector into a preset LCD defect detection model, and performing task-specific activation through a coordinate convolution positioning branch and a dynamic serpentine convolution classification branch in the LCD defect detection model to obtain a decoupled detection result includes: inputting the contrast coding feature vector into the preset LCD defect detection model, and performing a joint convolution operation on the contrast coding feature vector and two-dimensional pixel grid coordinate information through the coordinate convolution positioning branch in the LCD defect detection model to obtain a positioning feature map containing spatial position coding; performing nonlinear convolution scanning processing on the contrast coding feature vector according to a preset serpentine path template through the dynamic serpentine convolution classification branch in the LCD defect detection model to obtain a morphologically perceived classification feature map; performing a nonlinear transformation on the positioning feature map to extract boundary coordinate regression information from the contrast coding feature vector, and performing a probability normalization transformation on the classification feature map to extract defect category probability information from the contrast coding feature vector; and performing task decoupling processing on the extracted boundary coordinate information and category probability information to obtain a decoupled detection result containing spatial positioning information and category confidence.
[0032] Specifically, when inputting the contrast-coded feature vector into the LCD defect detection model, the coordinate convolution localization branch first performs a fusion operation on the feature vector and coordinate information. Upon receiving the contrast-coded feature vector, the coordinate convolution localization branch immediately generates a corresponding two-dimensional pixel grid coordinate matrix based on the spatial dimensions of the feature vector. This generation process is implemented using a coordinate grid function, which creates two independent coordinate matrices. Each row of the x-coordinate matrix contains an increasing sequence of integers from 0 to the width minus 1, and each column of the y-coordinate matrix contains an increasing sequence of integers from 0 to the height minus 1. After generation, the coordinate matrices need to be normalized to map the coordinate values to the range of -1 to +1. This normalization is achieved by subtracting half of the maximum value from the original coordinate value and then dividing it by half of the maximum value. The normalized x- and y-coordinate matrices are each added to the original feature vector as independent channels to form an expanded feature representation containing position information. A joint convolution operation is performed on this expanded feature representation. The convolution kernel design takes into account the interaction between the coordinate information and the original features, processing different types of feature channels separately through multiple parallel convolution branches. The first convolutional branch processes the original feature channel, extracting spatial feature patterns using a traditional 3×3 convolution kernel. The second convolutional branch processes the x-coordinate channel, capturing features related to horizontal position using a 1×3 convolution kernel in the horizontal direction. The third convolutional branch processes the y-coordinate channel, capturing features related to vertical position using a 3×1 convolution kernel in the vertical direction. The convolution results of the three branches are combined through a channel-by-channel concatenation operation and then passed through a fusion convolution layer for cross-channel information exchange, ultimately generating a localization feature map containing spatial position encoding.
[0033] Specifically, the implementation of the dynamic serpentine convolution classification branch involves constructing preset serpentine path templates and performing nonlinear convolution scanning. Serpentine path templates are a series of predefined curved paths that simulate the geometric morphology of common defects in LCDs, including straight lines, arcs, spirals, and irregular curves. Each serpentine path is defined by a series of coordinate points, with the spacing and curvature between the points reflecting the morphological characteristics of different defect types. Path templates are generated using parameterized curve equations. By adjusting the curve parameters, paths of varying shapes and scales can be generated. Straight paths are generated using linear equations, arcs using circular equations, spirals using polar coordinate equations, and irregular curves using spline interpolation. After the path templates are determined, the dynamic serpentine convolution branch samples the contrast encoding feature vectors based on these templates. The sampling process extracts feature values point by point along each serpentine path, forming a one-dimensional path feature sequence. Nonlinear convolution scanning is performed on these one-dimensional sequences, convolving the sequences with a deformable convolution kernel. The shape and weight of the deformable convolution kernel are dynamically adjusted based on the local curvature of the path. Regions with greater curvature use more concentrated kernels, while regions with less curvature use more dispersed kernels. Nonlinear activation functions are also introduced during the convolution process, using ReLU or Swish activation functions to enhance feature representation. After scanning, the convolution results of different paths are weighted and fused using an attention mechanism. The calculation of attention weights is based on the statistical properties and importance assessment of path features, ultimately forming a morphologically aware classification feature map.
[0034] Specifically, the feature information extraction process performs different processing steps for the localization feature map and the classification feature map. For the localization feature map, nonlinear transformation is first implemented using a multi-layer fully connected network. The network consists of three hidden layers, with 512, 256, and 128 neurons in each layer, respectively. LeakyReLU is used as the activation function to maintain gradient stability. The fully connected network input is the flattened vector of the localization feature map. After the first layer of transformation, a 512-dimensional intermediate feature is generated, which contains high-level, abstract information about the spatial location. The second layer of transformation maps the intermediate feature to 256 dimensions, further compressing and refining the location information. The third layer of transformation outputs a compact 128-dimensional feature representation, which is specifically used for regression prediction of boundary coordinates. Boundary coordinate regression information is extracted using a regression head network consisting of two parallel output branches: the first branch predicts the center coordinate of the defect region, and the second branch predicts the width and height of the defect region. Center coordinate prediction is achieved through two independent fully connected layers, which output regression values for the x and y coordinates, respectively. Width and height predictions are also achieved using a similar structure. A linear activation function is used on the regression output to ensure that the coordinate values cover the entire image range. For processing the classification feature map, probability normalization is achieved through the softmax function. The softmax calculation process first calculates an exponential value for each position in the classification feature map, then sums the exponential values for all categories as a normalization factor. Finally, the exponential value for each category is divided by the normalization factor to obtain a probability value. Defect category probability information is extracted through the classification head network. The classification head adopts a fully convolutional structure and maps the classification feature map to the number of channels corresponding to the number of categories through 1×1 convolution. Each channel corresponds to the probability prediction of a defect category.
[0035] Specifically, the implementation of task decoupling involves the independent optimization and joint integration of boundary coordinate information and class probability information. Decoupling begins with independent post-processing of both types of information. Boundary coordinate information is refined using a coordinate correction algorithm. This correction takes into account the actual image size and the coordinate system transformation relationship, converting normalized coordinate values into pixel-level absolute coordinates. The correction process also includes a bounding box plausibility check to ensure that the predicted width and height are positive and the center coordinates fall within the image bounds. Class probability information is filtered using confidence filtering, retaining only detection results with probability values exceeding a preset threshold. This threshold is typically set at 0.5 or 0.7, but can be adjusted based on specific application requirements. After confidence filtering, the results are sorted by probability, prioritizing high-confidence detection results. Decoupled detection results are generated through structured data organization. Each detection result contains four basic elements: bounding box coordinates, defect category label, category confidence score, and detection quality assessment. Bounding box coordinates are stored as top-left and bottom-right corner coordinates. Defect category labels are encoded using integers to represent different defect types. Category confidence scores retain probability-normalized output values. Detection quality assessment combines the accuracy of coordinate predictions with the confidence of category predictions. The final decoupled detection results are output as a list or array, with each element corresponding to an independent defect detection result. This decoupled data structure facilitates subsequent result analysis, visualization, and quality assessment, while ensuring the independence and specialization of the localization and classification tasks.
[0036] Furthermore, the step of inputting the contrast coding feature vector into a preset liquid crystal display defect detection model, and performing a joint convolution operation on the contrast coding feature vector and the two-dimensional pixel grid coordinate information through a coordinate convolution positioning branch in the liquid crystal display defect detection model to obtain a positioning feature map containing spatial position coding includes: inputting the contrast coding feature vector into the coordinate convolution positioning branch in the liquid crystal display defect detection model, generating a corresponding two-dimensional pixel grid coordinate matrix according to the spatial dimension of the contrast coding feature vector through the coordinate convolution positioning branch, normalizing the coordinate matrix to construct an x-coordinate channel and a y-coordinate channel, and obtaining a standardized coordinate information tensor; performing a splicing and fusing operation on the contrast coding feature vector and the coordinate information tensor in the channel dimension through the coordinate convolution positioning branch, and performing information interaction processing between channels to obtain an enhanced feature representation containing position information; applying a multi-scale convolution kernel group to the enhanced feature representation for parallel convolution operation, and combining a spatial attention mechanism to perform weighted processing on feature responses at different positions to obtain a position-sensitive convolution feature map; performing nonlinear transformation and dimensional reconstruction on the convolution feature map to extract spatial position coding information and obtain a positioning feature map containing spatial position coding.
[0037] Specifically, during the implementation of the coordinate convolution localization branch, the contrast-encoded feature vector is first transmitted to the branch's input interface. The coordinate generation module within the branch immediately analyzes the spatial dimensionality of the feature vector. The coordinate generation module obtains the height H and width W values by reading the feature vector's shape parameters, and then constructs the coordinate matrix. The generation process for the two-dimensional pixel grid coordinate matrix employs a dual loop structure: the outer loop traverses all pixel positions in the height direction, and the inner loop traverses all pixel positions in the width direction. During the loop execution, the x-coordinate matrix is constructed by padding row by row, with each row value incrementing from 0 to the width minus 1, forming a coordinate sequence that matches the width of the feature vector. The y-coordinate matrix is constructed by padding column by column, with each column value incrementing from 0 to the height minus 1, forming a coordinate sequence that matches the height of the feature vector. The resulting x- and y-coordinate matrices have the same spatial dimensions as the contrast-encoded feature vector, laying the foundation for subsequent coordinate information fusion. After the coordinate matrix is generated, the normalization processing module performs a numerical range conversion operation on the two coordinate matrices respectively. The normalization calculation is implemented through a linear mapping function, mapping the original coordinate values from the integer range to the floating-point range from negative 1 to positive 1. The normalization of the x-coordinate is calculated by subtracting half the width of each coordinate value and then dividing it by half the width. The normalization of the y-coordinate uses the same calculation method but uses a height parameter. The normalization process ensures that the coordinate information matches the numerical range of the eigenvector to avoid interference with subsequent calculations caused by differences in numerical scale. The standardized x-coordinate channel and y-coordinate channel are stored as independent feature channels respectively. The two channels are combined with the channel dimension of the original eigenvector to form a coordinate information tensor containing spatial position information.
[0038] Specifically, the feature fusion operation is performed in the fusion module of the coordinate convolution localization branch. This module receives the contrast-encoded feature vector and the coordinate information tensor as input. Channel-wise concatenation is achieved through a tensor concatenation operation, which combines the two tensors into a higher-dimensional tensor along the channel axis. In practice, if the contrast-encoded feature vector contains C channels and the coordinate information tensor contains 2 channels, the concatenated tensor will contain C plus 2 channels. The concatenation operation uses memory-contiguous data arrangement to ensure efficient data access and computational stability. Inter-channel information exchange is implemented through a cross-channel convolution layer, which uses a 1×1 convolution kernel to perform a pixel-by-pixel linear transformation on the concatenated tensor. Although the 1×1 convolution kernel has a single-pixel spatial receptive field, it enables fully connected information exchange in the channel dimension, enabling the full fusion of original feature information with coordinate position information. The weight matrix of the convolution layer is trained using the backpropagation algorithm. During training, the network learns how to optimally combine spatial coordinate information with feature information. Information exchange processing also includes batch normalization, which standardizes features by calculating the mean and variance of the current batch of data, accelerating the convergence of network training and enhancing numerical stability. After inter-channel information exchange, the resulting enhanced feature representation retains the semantic information of the original features while incorporating precise spatial position encoding, providing rich input information for subsequent position-sensitive processing.
[0039] Specifically, parallel convolution operations within a multi-scale convolution kernel group are performed simultaneously on the enhanced feature representation. This process involves the parallel computation of multiple convolution kernels of different sizes. The multi-scale convolution kernel group includes three different sizes: 3×3, 5×5, and 7×7. Each convolution kernel is designed to capture spatial feature patterns at a different scale. The 3×3 convolution kernel specializes in processing local details, with a smaller receptive field, but accurately capturing pixel-level variations. The 5×5 convolution kernel processes medium-scale feature patterns, with a moderate receptive field, capable of capturing spatial relationships within a small area. The 7×7 convolution kernel processes larger-scale feature patterns, with a larger receptive field, capable of understanding broader spatial context. Parallel convolution operations are performed simultaneously through independent computational channels, with each convolution kernel performing a complete convolution operation on the enhanced feature representation, generating a feature response map of the corresponding scale. The convolution computation uses a sliding window approach, with the convolution kernel moving position by position across the feature map, performing an element-wise sum-of-products operation at each position. The spatial attention mechanism performs weighted processing based on the parallel convolutions. The attention mechanism first calculates an importance score for each spatial position in the feature map. Importance scores are calculated using a combination of global average pooling and global max pooling. Global average pooling computes the average value of each channel across the spatial dimension, while global max pooling computes the maximum value across each channel across the spatial dimension. The two pooling results are combined using a concatenation operation and then passed through a small multilayer perceptron network for nonlinear transformation, ultimately outputting a spatial attention weight map. This attention weight map is element-wise multiplied with the results of the parallel convolution to adaptively weight the response to features at different locations. This weighting ensures that features at important spatial locations are enhanced while features at less important locations are suppressed, resulting in a position-sensitive convolutional feature map.
[0040] Specifically, positional encoding information is extracted via a specially designed encoding extraction module, which performs nonlinear transformations and redimensionality on the convolutional feature maps. The nonlinear transformation first processes the feature maps using a depthwise separable convolution layer. Depthwise separable convolution decomposes standard convolution into two steps: depthwise convolution and pointwise convolution. Depthwise convolution applies a spatial convolution kernel independently to each input channel, capturing spatial feature patterns within each channel. Pointwise convolution uses a 1×1 convolution kernel to linearly combine the outputs of the depthwise convolution across channels, achieving information fusion between channels. Depthwise separable convolution has significantly lower computational complexity than standard convolution while maintaining similar feature extraction capabilities. The nonlinear transformation also involves the application of an activation function. The Swish activation function is used to perform nonlinear processing on the convolution outputs. The Swish function combines the smoothness of the sigmoid function with the computational efficiency of the ReLU function. Redimensionality is achieved through tensor reshaping and channel reshuffling. The reshaping operation converts the two-dimensional feature maps into one-dimensional feature vectors, making them easier to process in fully connected layers. The channel reshuffling operation rearranges the feature channels according to the importance of spatial position information, ensuring that position-dependent feature channels are processed collectively. Spatial position encoding information is extracted using a position encoder, which uses the position encoding method from the Transformer architecture to convert spatial coordinate information into a high-dimensional position vector. The encoding process uses a combination of sine and cosine functions to generate different dimensions of the position vector, ensuring that each spatial position has a unique encoding representation. The resulting positioning feature map contains rich spatial position encoding information. Each pixel position corresponds to a high-dimensional position feature vector. These vectors can accurately represent the absolute and relative position of pixels in two-dimensional space, providing strong feature support for accurate defect localization.
[0041] Furthermore, the dynamic serpentine convolution classification branch in the liquid crystal display defect detection model performs nonlinear convolution scanning processing on the contrast coding feature vector according to a preset serpentine path template to obtain a morphologically aware classification feature map, including: selecting a matching scanning path from a preset serpentine path template library according to the gradient distribution characteristics of the contrast coding feature vector through the dynamic serpentine convolution classification branch in the liquid crystal display defect detection model to obtain a target serpentine trajectory coordinate sequence; performing a point-by-point feature sampling operation on the contrast coding feature vector according to the target serpentine trajectory coordinate sequence to obtain a one-dimensional feature vector sequence distributed along the serpentine path, and calculating the path curvature information based on the direction change of adjacent coordinate points; applying a deformable convolution kernel to the one-dimensional feature vector sequence to perform a sequence convolution operation, and performing weight modulation processing in combination with the path curvature information to obtain a morphologically adaptive convolution response result; reconstructing the convolution response result into a two-dimensional feature map according to the inverse spatial mapping relationship of the target serpentine trajectory coordinate sequence, and performing channel-level fusion on the reconstruction results of multiple paths to obtain a morphologically aware classification feature map.
[0042] Specifically, during the implementation of the dynamic snake convolution classification branch, the path selection module first performs a gradient distribution analysis on the contrast-encoded feature vector. The gradient distribution characteristics are calculated using a combination of the Sobel and Laplacian operators. The Sobel operator detects gradient changes in the horizontal and vertical directions of the feature vector. A 3×3 Sobel convolution kernel is applied to each channel of the feature vector, generating gradient components in the x and y directions. The x-direction Sobel kernel emphasizes vertical edges, while the y-direction Sobel kernel emphasizes horizontal edges. The gradient components in both directions are combined using square root operations to form a gradient magnitude map. The Laplacian operator detects the sharpness of feature changes by approximating second-order partial derivatives. The Laplacian convolution kernel is convolved with the feature vector to generate an edge response map. The gradient magnitude map and edge response map are weighted fused to generate a comprehensive gradient distribution characteristic map. The fusion weights were experimentally determined to be 0.7 and 0.3. The preset serpentine path template library contains path templates of various geometric shapes. Straight line templates are defined by the coordinates of the starting and ending points, arc templates are defined by the center, radius and angle range, spiral templates are defined by the parameters of the polar coordinate equation, and irregular curve templates are defined by control points and spline interpolation. The path matching algorithm calculates the similarity between the gradient distribution characteristic map and each template. The similarity calculation uses a normalized cross-correlation function to sample the gradient distribution characteristic map along each candidate path to obtain a one-dimensional gradient sequence. The cross-correlation coefficient between this sequence and the template standard gradient sequence is then calculated. The path with the highest matching degree is selected as the target serpentine trajectory. The target trajectory is represented by a coordinate sequence, and each element in the sequence contains the exact numerical values of the x-coordinate and y-coordinate.
[0043] Specifically, feature sampling is performed immediately after the target serpentine trajectory coordinate sequence is determined. The sampling module extracts data point by point along the path from the compared encoded feature vectors. This point-by-point feature sampling utilizes bilinear interpolation for non-integer coordinate positions. When the trajectory coordinates are non-integer, the algorithm locates the four nearest integer coordinate points around the location, extracts the eigenvalues of each of these four points, and then calculates a weighted average based on the distance between the target location and the four neighboring points as the interpolation result. The interpolation weight coefficient is determined by the inverse of the distance, with closer points receiving greater weights and farther points receiving smaller weights. The sampling process proceeds sequentially along the serpentine trajectory from its starting point to its end point. Each coordinate point corresponds to one or more eigenvalues in the eigenvector, resulting in a one-dimensional sequence of feature vectors that matches the trajectory length. Path curvature information is calculated based on an analysis of directional changes between adjacent coordinate points. Curvature is calculated using the three-point method: for any point in the trajectory, a three-point combination is constructed by selecting that point and its two adjacent points before and after it. The curvature of a three-point combination is calculated using a geometric method. First, the vector from the previous point to the current point and the vector from the current point to the next point are calculated. Then, the angle between the two vectors is calculated. The cosine of the angle is obtained by dividing the dot product of the vectors by the product of the vector moduli. The curvature value is defined as the ratio of the rate of change of the angle to the arc length. The arc length is approximately calculated by the Euclidean distance between adjacent points. Each point on the trajectory corresponds to a curvature value. The sign of the curvature value indicates the direction of the curvature. A positive value indicates a leftward curvature, a negative value indicates a rightward curvature, and the absolute value indicates the degree of curvature. The curvature information corresponds one-to-one with the sequence of sampled feature vectors, forming an enhanced feature representation containing geometric morphological information.
[0044] Specifically, a deformable convolution kernel performs sequential convolution on a sequence of one-dimensional feature vectors, with the kernel's shape and parameters dynamically adjusted based on the path's local geometric characteristics. The deformable convolution kernel is an extension of the standard convolution kernel, adding an offset parameter to the conventional weight parameter. The offset parameter controls the kernel's sampling position, enabling the convolution operation to adapt to irregular data distributions. In one-dimensional sequential convolution, the length of the deformable kernel is determined based on local curvature information. Regions with large curvature use shorter kernels to capture sharp changes, while regions with small curvature use longer kernels to capture gradual changes. The kernel weights are dynamically generated through an attention mechanism, where attention weights are calculated based on the similarity analysis between the features at the current position and those at adjacent positions. Sequential convolution is performed using a sliding window approach, with the kernel moving along the one-dimensional feature sequence and performing a weighted summation operation at each position. Weight modulation incorporates path curvature information as a modulation signal into the convolution calculation. Modulation is implemented via element-wise multiplication, where the curvature value is normalized using a sigmoid function and then multiplied with the convolution output. This modulation mechanism enables the convolutional response to adapt to the path's geometry, resulting in a stronger response in more curved areas and a weaker response in straight areas. The modulated convolutional response retains both the path's geometric features and the semantic information of the feature sequence, forming a morphologically adaptive one-dimensional response sequence.
[0045] Specifically, the spatial reconstruction process maps the one-dimensional convolution response back into the two-dimensional feature map space. This reconstruction operation is based on the inverse mapping of the target serpentine trajectory coordinate sequence. This inverse spatial mapping is achieved through coordinate lookup and value assignment. For each element in the response sequence, the algorithm finds the corresponding two-dimensional coordinate based on its position index in the sequence and then assigns the element's value to the corresponding position in the two-dimensional feature map. Since serpentine paths typically do not cover the entire two-dimensional space, the reconstructed feature map contains significant blank areas, which are filled using interpolation. This interpolation employs a radial basis function (RBF) approach, which uses known points on the path as a basis and estimates the blank locations based on distance weights. The RBF is a Gaussian function, with its bandwidth parameter adaptively adjusted based on the density and distribution of the paths. Processing multiple paths involves parallel processing and result fusion of multiple serpentine trajectories. Each path undergoes the same sampling, convolution, and reconstruction process to generate a corresponding two-dimensional feature map. Channel-level fusion combines the reconstructed results of multiple paths in the channel dimension using a weighted average, with the weight coefficients determined based on the matching degree and response strength of each path. The fusion process also includes a conflict resolution mechanism. When multiple paths produce different response values at the same location, the algorithm selects the value with the strongest response as the final result, or performs a weighted average based on the path's credibility. The resulting morphologically perceptual classification feature map integrates information from multiple serpentine paths, preserving the semantic content of the original features while incorporating rich geometric morphological characteristics. Each location in the feature map encodes both morphological perceptual information and classification discriminant information for the corresponding area, providing a specifically optimized feature representation for subsequent defect classification tasks.
[0046] 104. According to the decoupling detection result, the defect type of the LCD screen is identified and classified by the detection head of the LCD screen defect detection model to obtain a defect detection output result.
[0047] In one embodiment of the present invention, according to the decoupling detection result, the detection head of the LCD defect detection model identifies and classifies the defect type of the LCD screen to obtain a defect detection output result, including: extracting the RGB color histogram distribution, pixel brightness mean and variance, and image gradient change frequency of the current LCD display content, and determining the corresponding mode perception weight coefficient according to a preset display mode lookup table; linearly transforming the spatial positioning information in the decoupling detection result through a first fully connected layer, and linearly transforming the defect category probability information through a second fully connected layer; weighted summing and fusing the transformed positioning information and category information according to the mode perception weight coefficient to obtain a comprehensive feature representation; performing ReLU activation and Dropout regularization processing on the comprehensive feature representation, and performing dimensional mapping through the output fully connected layer to obtain a mapping result; applying a softmax function to the mapping result to perform multi-category probability normalization, and setting a confidence threshold to filter the result to obtain a defect detection output result including a defect type identifier, a confidence score, and bounding box coordinates.
[0048] Specifically, during the generation of defect detection output, the inspection head module first performs a comprehensive statistical analysis of the current LCD display content. The RGB color histogram distribution is extracted by counting pixel values for each color channel of the displayed image. The algorithm divides the pixel value range of each channel from 0 to 255 into 256 bins. The number of pixels within each bin is then counted, forming three independent one-dimensional histogram arrays. The red channel histogram records the distribution of the red component of all pixels, the green channel histogram records the distribution of the green component, and the blue channel histogram records the distribution of the blue component. The histograms are normalized by dividing the pixel counts in each bin by the total number of pixels to obtain a probability density distribution. To calculate the mean and variance of pixel brightness, the RGB image is first converted to grayscale using a weighted average method with weight coefficients of 0.299, 0.587, and 0.114, respectively, corresponding to the human eye's sensitivity to different colors. The brightness mean is obtained by taking the arithmetic mean of the grayscale values of all pixels, while the variance is calculated by averaging the squared differences between each pixel and the mean. The frequency of image gradient changes is calculated using a second-order difference method. The algorithm first calculates the first-order gradient of the image in the horizontal and vertical directions, then calculates the second-order derivative of the gradient. The gradient change frequency is determined by counting the number of pixels whose second-order derivative exceeds a preset threshold. A preset display mode lookup table contains characteristic parameter ranges for various typical display modes. Monochrome display modes are characterized by a concentrated distribution of color histograms in a single color channel, grid modes are characterized by high-frequency gradient changes and periodic brightness distribution, and gradient modes are characterized by monotonic brightness changes and low-frequency gradient distribution. The pattern recognition algorithm matches the extracted statistical features with the parameter ranges in the lookup table, calculates the matching score for each mode, and selects the mode with the highest score as the current display mode. The pattern perception weight coefficient is derived from a predefined weight matrix based on the identified display mode. Different display modes correspond to different weight combinations, which are used to adjust the importance of various types of information in the subsequent feature fusion process.
[0049] Specifically, the feature transformation process of the decoupled detection results uses two independent fully-connected layers to process spatial positioning information and defect category probability information, respectively. The first fully-connected layer specifically processes spatial positioning information. It receives as input a four-dimensional vector containing bounding box coordinates. The four components of the vector represent the x-coordinate of the upper left corner, the y-coordinate of the upper left corner, the width of the bounding box, and the height of the bounding box, respectively. The linear transformation calculation involves matrix multiplication. The input vector is multiplied by a weight matrix with a dimension of 4×128 and then added to a bias vector. This maps the four-dimensional positioning information into a 128-dimensional feature space. The parameters of the weight matrix are trained using a gradient descent algorithm. During training, the network learns how to convert spatial coordinate information into a feature representation that is useful for subsequent processing. The second fully-connected layer processes defect category probability information. This layer receives a multi-dimensional vector containing the probabilities of each defect category. The dimension of the vector is equal to the total number of defect categories, and each component represents the probability value of the corresponding category. The linear transformation maps the probability vector to the same 128-dimensional space as the positioning features. The dimension of the weight matrix is determined by the number of defect categories. For example, for five defect categories, the weight matrix is 5×128. The outputs of both fully connected layers undergo batch normalization, which normalizes features by calculating the mean and standard deviation of the current batch, accelerating training convergence and improving numerical stability. The transformed location features and categorical features have the same dimensions and numerical range, facilitating subsequent feature fusion.
[0050] Specifically, the feature fusion process utilizes a pattern-aware weighted summation mechanism to organically combine the transformed location information and category information. Weighted summation fusion is performed via element-wise multiplication and addition: the location feature vector is multiplied by the corresponding weight coefficient, and the category feature vector is multiplied by the corresponding weight coefficient. The two weighted results are then summed to produce the fused feature. The application of pattern-aware weight coefficients ensures that the fusion process can adapt to the characteristics of the current display mode. For example, in monochrome display mode, location information is given a higher weight, while in grid display mode, category information is given a higher weight. The resulting fused composite feature representation preserves both spatial location and category discrimination information while also accounting for the impact of display mode on defect detection. The composite feature representation is then nonlinearly processed using the ReLU activation function. The ReLU function sets all negative values to zero and leaves positive values unchanged. This process enhances the sparsity and nonlinear representation of the features. Dropout regularization is applied after the ReLU activation. Dropout prevents overfitting by randomly setting the outputs of some neurons to zero. The random selection ratio is typically set to 0.2 to 0.5. During training, each forward pass randomly selects different neurons for dropout. During inference, all neurons are retained but their outputs are scaled by the dropout ratio. The output fully connected layer performs dimension mapping on the regularized features. The number of neurons in this layer is equal to the number of categories in the final output plus the dimension of the bounding box regression, typically 4 plus the number of categories. Dimension mapping also uses a linear transformation to map the 128-dimensional composite features to the final output dimension.
[0051] Specifically, generating the final output involves two key steps: multi-class probability normalization and result filtering. The Softmax function is applied to normalize the class predictions in the mapping results. The softmax calculation first applies an exponential function to the predicted value for each class. The sum of the exponential values for all classes is then used as a normalization factor. Finally, the exponential value for each class is divided by the normalization factor to obtain the probability value. Probability normalization ensures that the probabilities of all classes are between 0 and 1, and that the sum of all probabilities equals 1. The bounding box coordinates are processed using a sigmoid activation function, constraining the predicted coordinates to be between 0 and 1. They are then denormalized based on the actual image size to obtain pixel-level absolute coordinates. Confidence threshold filtering filters the normalized probabilities, retaining only those detections whose maximum probability exceeds a preset threshold. The threshold is typically set to 0.5 or 0.7, but can be adjusted based on the accuracy requirements of the application. The filtering process also includes non-maximum suppression. When the bounding boxes of multiple detection results overlap significantly, the algorithm retains the highest-confidence result and suppresses other overlapping low-confidence results. The overlap determination for non-maximum suppression is calculated using the Intersection over Union (IoU) ratio. When the IoU value of two bounding boxes exceeds 0.3, significant overlap is considered. The final defect detection output results are organized as structured data. Each detection result contains three core elements: the defect type identifier represents different defect categories through integer encoding, the confidence score retains the maximum probability value after softmax normalization, and the bounding box coordinates record the spatial location of the defect area in the form of a quad. The output results also include auxiliary information such as the detection timestamp, image identifier, and mode identifier. This information facilitates result traceability and quality assessment. All detection results are sorted in descending order by confidence score to ensure that high-confidence detection results are processed and displayed first.
[0052] In this embodiment, hierarchical scale feature extraction is performed on the image captured by the liquid crystal display screen through a multi-level object pyramid structure to obtain a multi-scale defect feature representation; a contrast coding algorithm is used to encode the multi-scale features into a unified high-dimensional space, and the feature vector distance relationship is calculated to obtain a contrast coding feature vector; the feature vector is input into the defect detection model, and task-specific activation is performed through the coordinate convolution positioning branch and the dynamic snake convolution classification branch to obtain a decoupled detection result; based on the decoupled detection result, the defect type is identified and classified by the detection head, and the detection result is output. The present invention achieves the capture of defects of different scales through multi-level pyramid structure extraction, enhances the discriminability of feature representation through high-dimensional space mapping of the contrast coding algorithm, and improves positioning accuracy and classification accuracy through the decoupling processing of coordinate convolution and dynamic snake convolution.
[0053] The above describes the detection method of the liquid crystal display screen in the embodiment of the present invention. The following describes the detection device of the liquid crystal display screen in the embodiment of the present invention. Figure 2 In one embodiment of the present invention, a device for detecting a liquid crystal display screen includes: A feature extraction module 201 is configured to select corresponding feature layers at different scale levels of the image captured by the liquid crystal display screen through a preset multi-level object pyramid structure to perform hierarchical scale feature extraction to obtain a multi-scale defect feature representation; The encoding processing module 202 is configured to encode the multi-scale defect feature representation into a unified high-dimensional feature space using a contrast encoding algorithm and a multi-layer perceptron and calculate the distance relationship between feature vectors to obtain a contrast encoding feature vector; a decoupled detection module 203 for inputting the contrast coding feature vector into a preset LCD defect detection model, performing task-specific activation on the coordinate convolution positioning branch and the dynamic serpentine convolution classification branch in the LCD defect detection model, and obtaining a decoupled detection result; The classification output module 204 is configured to identify and classify the defect types of the LCD screen using the detection head of the LCD screen defect detection model according to the decoupling detection result, and obtain a defect detection output result.
[0054] In an embodiment of the present invention, the detection device for the liquid crystal display screen runs the above-mentioned detection method for the liquid crystal display screen, and the detection device for the liquid crystal display screen performs hierarchical scale feature extraction on the captured image of the liquid crystal display screen through a multi-level object pyramid structure to obtain a multi-scale defect feature representation; a contrast coding algorithm is used to encode the multi-scale features into a unified high-dimensional space, and the feature vector distance relationship is calculated to obtain a contrast coding feature vector; the feature vector is input into the defect detection model, and task-specific activation is performed through the coordinate convolution positioning branch and the dynamic snake convolution classification branch to obtain a decoupled detection result; based on the decoupled detection result, the defect type is identified and classified by the detection head, and the detection result is output. The present invention realizes the capture of defects of different scales through multi-level pyramid structure extraction, realizes the enhanced discriminability of feature representation through the high-dimensional space mapping of the contrast coding algorithm, and improves the positioning accuracy and classification accuracy through the decoupling processing of coordinate convolution and dynamic snake convolution.
[0055] above Figure 2 The detection device for the liquid crystal display screen in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The detection device for the liquid crystal display screen in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0056] Figure 3This is a schematic diagram of the structure of a liquid crystal display testing device provided by an embodiment of the present invention. The liquid crystal display testing device 300 may vary significantly depending on configuration or performance. It may include one or more central processing units (CPUs) 310 (e.g., one or more processors), memory 320, and one or more storage media 330 (e.g., one or more mass storage devices) storing application programs 333 or data 332. The memory 320 and storage medium 330 may be either transient or persistent storage. The program stored in the storage medium 330 may include one or more modules (not shown), each of which may include a series of instructions for operating on the liquid crystal display testing device 300. Furthermore, the processor 310 may be configured to communicate with the storage medium 330, executing the series of instructions stored in the storage medium 330 on the liquid crystal display testing device 300 to implement the steps of the above-described liquid crystal display testing method.
[0057] The LCD detection device 300 may further include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input and output interfaces 360, and / or one or more operating systems 331, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 3 The structure of the liquid crystal display detection device shown does not constitute a limitation on the liquid crystal display detection device provided by the present invention, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0058] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions, and when the instructions are run on a computer, the computer executes the steps of the liquid crystal display detection method.
[0059] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0060] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0061] As described above, 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 above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can 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 method for detecting a liquid crystal display screen, characterized in that: The detection method of the liquid crystal display screen includes: Through the preset multi-level object pyramid structure, the corresponding feature layers at different scale levels of the LCD screen image are selected to perform hierarchical scale feature extraction to obtain multi-scale defect feature representation; The multi-scale defect feature representation is encoded into a unified high-dimensional feature space using a multi-layer perceptron through a contrastive coding algorithm and the distance relationship between feature vectors is calculated to obtain a contrastive coding feature vector; Inputting the contrast coding feature vector into a preset LCD defect detection model, performing task-specific activation through the coordinate convolution positioning branch and the dynamic snake convolution classification branch in the LCD defect detection model, and obtaining a decoupled detection result; According to the decoupling detection result, the defect type of the liquid crystal display screen is identified and classified by the detection head of the liquid crystal display screen defect detection model to obtain a defect detection output result.
2. The method for detecting a liquid crystal display screen according to claim 1, wherein: The method of extracting hierarchical scale features by selecting corresponding feature layers at different scale levels of the image captured by the liquid crystal display screen through a preset multi-level object pyramid structure to obtain a multi-scale defect feature representation includes: Controlling the LCD screen to switch to a monochrome display mode, a grid test display mode, and a brightness gradient display mode, respectively, and collecting corresponding LCD display images; The LCD display image in each display mode is processed at multiple scales of 32², 64², 128², 256², 512², and 800² pixels using a preset multi-level object pyramid structure; For 32² and 64² pixels, a shallow feature layer in the multi-level object pyramid structure is selected to perform detail texture feature extraction, for 128² pixels, a feature layer in the multi-level object pyramid structure is selected to perform medium defect feature extraction, and for 256², 512², and 800² pixels, a deep feature layer in the multi-level object pyramid structure is selected to perform semantic feature extraction; The multi-scale features extracted under different display modes are spliced and fused to obtain a multi-scale defect feature representation containing multi-scale spatial information and multi-modal semantic information.
3. The method for detecting a liquid crystal display screen according to claim 1, wherein: The contrast coding algorithm is used to encode the multi-scale defect feature representation into a unified high-dimensional feature space using a multi-layer perceptron and calculate the distance relationship between feature vectors to obtain the contrast coding feature vector. Performing fast Fourier transform processing on the multi-scale defect feature representation to obtain frequency domain features containing frequency component information; The frequency domain features and the multi-scale defect feature representation are mapped to a unified high-dimensional feature space using a multi-layer perceptron through a contrast coding algorithm to obtain a normalized high-dimensional feature vector; Calculating the Euclidean distance and cosine similarity between the high-dimensional feature vector and various defect feature templates in a preset feature template library to obtain a distance similarity calculation result; Perform time series difference calculation on the high-dimensional feature vectors of the LCD display images collected continuously for multiple time frames, perform stability verification based on the amplitude of time series changes, and obtain the time series stability verification results; According to the distance similarity calculation results and the temporal stability verification results, a contrast coding feature vector with discriminative ability is obtained.
4. The method for detecting a liquid crystal display screen according to claim 1, wherein: Inputting the contrast coding feature vector into a preset LCD defect detection model, performing task-specific activation through the coordinate convolution positioning branch and the dynamic snake convolution classification branch in the LCD defect detection model, and obtaining a decoupled detection result includes: Inputting the contrast coding feature vector into a preset LCD defect detection model, and performing a joint convolution operation on the contrast coding feature vector and two-dimensional pixel grid coordinate information through a coordinate convolution positioning branch in the LCD defect detection model to obtain a positioning feature map containing spatial position coding; The contrast coding feature vector is subjected to nonlinear convolution scanning processing according to a preset serpentine path template by using the dynamic serpentine convolution classification branch in the LCD defect detection model to obtain a morphologically perceived classification feature map; Performing a nonlinear transformation on the positioning feature map, extracting boundary coordinate regression information from the comparison coding feature vector, and performing a probability normalization transformation on the classification feature map, extracting defect category probability information from the comparison coding feature vector; The extracted boundary coordinate information and category probability information are task-decoupled to obtain a decoupled detection result containing spatial positioning information and category confidence.
5. The method for detecting a liquid crystal display screen according to claim 4, wherein: The step of inputting the contrast coding feature vector into a preset LCD defect detection model and performing a joint convolution operation on the contrast coding feature vector and two-dimensional pixel grid coordinate information through a coordinate convolution positioning branch in the LCD defect detection model to obtain a positioning feature map containing a spatial position code includes: The contrast coding feature vector is input into the coordinate convolution positioning branch in the LCD defect detection model, and the coordinate convolution positioning branch generates a corresponding two-dimensional pixel grid coordinate matrix according to the spatial dimension of the contrast coding feature vector. Normalizing the coordinate matrix to construct an x-coordinate channel and a y-coordinate channel to obtain a standardized coordinate information tensor; The contrast coding feature vector and the coordinate information tensor are spliced and fused in the channel dimension through the coordinate convolution positioning branch, and information interaction between channels is processed to obtain an enhanced feature representation containing position information; Applying a multi-scale convolution kernel group to the enhanced feature representation to perform parallel convolution operations, and combining a spatial attention mechanism to perform weighted processing on feature responses at different positions to obtain a position-sensitive convolution feature map; The convolution feature map is subjected to nonlinear transformation and dimensionality reconstruction to extract spatial position coding information and obtain a positioning feature map containing spatial position coding.
6. The method for detecting a liquid crystal display screen according to claim 4, wherein: The dynamic serpentine convolution classification branch in the LCD defect detection model performs nonlinear convolution scanning processing on the contrast coding feature vector according to a preset serpentine path template to obtain a morphologically perceived classification feature map, including: Selecting a matching scanning path from a preset serpentine path template library based on the gradient distribution characteristics of the contrast coding feature vector through the dynamic serpentine convolution classification branch in the LCD defect detection model to obtain a target serpentine trajectory coordinate sequence; Performing a point-by-point feature sampling operation on the comparison coded feature vector according to the target serpentine trajectory coordinate sequence to obtain a one-dimensional feature vector sequence distributed along the serpentine path, and calculating path curvature information based on the direction changes of adjacent coordinate points; Applying a deformable convolution kernel to the one-dimensional feature vector sequence to perform a sequential convolution operation, and performing weight modulation processing in combination with path curvature information to obtain a morphologically adaptive convolution response result; The convolution response result is reconstructed into a two-dimensional feature map according to the inverse spatial mapping relationship of the target serpentine trajectory coordinate sequence, and the reconstruction results of multiple paths are fused at the channel level to obtain a morphologically perceived classification feature map.
7. The method for detecting a liquid crystal display screen according to claim 1, wherein: According to the decoupling detection result, the defect type of the LCD screen is identified and classified by the detection head of the LCD screen defect detection model to obtain the defect detection output result including: Extract the RGB color histogram distribution, pixel brightness mean and variance, and image gradient change frequency of the current LCD display content, and determine the corresponding mode perception weight coefficient based on the preset display mode lookup table; Performing a linear transformation on the spatial positioning information in the decoupled detection result through a first fully connected layer, and performing a linear transformation on the defect category probability information through a second fully connected layer; Performing weighted summing and fusion of the transformed positioning information and category information according to the pattern perception weight coefficient to obtain a comprehensive feature representation; Performing ReLU activation and Dropout regularization processing on the comprehensive feature representation, and performing dimension mapping through an output fully connected layer to obtain a mapping result; The softmax function is applied to the mapping results to perform multi-category probability normalization, and a confidence threshold is set to filter the results to obtain the defect detection output results including defect type identification, confidence score, and bounding box coordinates.
8. A detection device for a liquid crystal display screen, characterized in that: The detection device of the liquid crystal display screen comprises: A feature extraction module is used to select corresponding feature layers at different scale levels of the LCD screen captured image through a preset multi-level object pyramid structure to perform hierarchical scale feature extraction to obtain a multi-scale defect feature representation; An encoding processing module is used to encode the multi-scale defect feature representation into a unified high-dimensional feature space using a contrast encoding algorithm and a multi-layer perceptron and calculate the distance relationship between feature vectors to obtain a contrast encoding feature vector; a decoupled detection module, configured to input the contrast coding feature vector into a preset LCD defect detection model, and perform task-specific activation via a coordinate convolution positioning branch and a dynamic serpentine convolution classification branch in the LCD defect detection model to obtain a decoupled detection result; The classification output module is used to identify and classify the defect types of the liquid crystal display screen through the detection head of the liquid crystal display screen defect detection model according to the decoupling detection result to obtain a defect detection output result.
9. A liquid crystal display screen detection device, characterized in that: The liquid crystal display detection device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor calls the instructions in the memory to enable the liquid crystal display screen detection device to perform the steps of the liquid crystal display screen detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the steps of the liquid crystal display detection method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Irregular product intelligent visual identification method and system based on few-sample learning
CN121505342A
X-ray weld defect detection method based on structure degradation correction and parallel response recombination
CN121981993A
