Light guide plate defect detection method and system based on neural network
By continuously acquiring image sequences during dynamic detection of light guide plates, calculating inter-frame consistency prediction coefficients, and performing image enhancement processing, the problem of false defect misjudgment and missed detection of real defects in high-speed dynamic scenes of light guide plate defect detection system is solved, and the stability and accuracy of recognition are improved.
Patent Information
- Application Number
- CN202511568620.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2025-11-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing light guide plate defect detection systems are prone to false defect detection and missed detection of real defects in high-speed dynamic production scenarios. In particular, when dynamic blurring masks real defects, neural networks have difficulty effectively identifying them, leading to the rejection of good products or the entry of unqualified products into downstream terminals.
By continuously acquiring multiple image sequences during the dynamic transmission or rotation of the light guide plate, calculating the inter-frame consistency prediction coefficient, identifying abnormal image frames and reducing their confidence, and combining frequency domain transformation and image enhancement processing, the image detail features are restored and then input into the neural network for defect identification.
It effectively reduces the impact of interference such as light flicker and dust obstruction on detection, improves the stability and accuracy of identification, reduces false defect false alarms and missed detection of real defects, and enhances the model's adaptability and identification accuracy in complex production line environments.
Smart Images

Figure CN121033057A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision inspection technology, and more specifically, to a method and system for detecting defects in light guide plates based on neural networks. Background Technology
[0002] As a key optical component in LCD modules, automotive screens, medical imaging equipment, and high-end optical devices, the surface quality of light guide plates directly determines the optical uniformity and reliability of the entire system. To achieve real-time screening of microscopic defects such as bubbles, scratches, particles, and cracks on the surface of light guide plates, most production lines have gradually adopted automated inspection methods based on machine vision. Especially driven by the development of neural network deep learning models, intelligent image analysis for high-precision defect identification has become the mainstream direction. However, existing inspection systems still face severe challenges in high-speed dynamic production scenarios, mainly in two aspects: firstly, the problem of false defect misjudgment; and secondly, the problem of dynamic blurring masking real defects. Furthermore, these two issues often intertwine and overlap in actual production, constituting a dangerous complex failure mechanism.
[0003] Specifically, during the dynamic transmission or rotation of the light guide plate, the image acquisition device, when capturing continuous image frames, is often interfered with by external environmental factors such as vibration, lighting fluctuations, background reflection, and dust obstruction, resulting in short-term non-defect artifacts in the image. For example, image pseudo-features such as specular reflection, bright edges, low-frequency shadows, or dust residue are easily misidentified by the neural network as defects such as cracks, scratches, and bright spots on the surface of the light guide plate, leading to false defect false alarms. At the same time, real defects such as tiny cracks, linear depressions, and fine particles lose high-frequency texture information due to image blurring caused by high-speed motion, appearing as weakened details or even blended into the background in the frequency domain, causing the neural network to fail to effectively identify them and resulting in missed detection of real defects.
[0004] More seriously, in production practice, these two problems often do not occur in isolation, but rather interfere with and reinforce each other. When the system attempts to identify more potential defects in ambiguous areas by increasing model sensitivity, it may amplify the response to noise artifacts, leading to an increased false defect misjudgment rate. Conversely, if the model introduces a stronger denoising strategy, it may further erase the edge texture of real defects, reinforcing the "smoothing tendency" of the image, creating a dual risk situation of "enhanced false alarms and disappearance of real defects." Such failures will, on the one hand, lead to the wrong rejection of a large number of good products, wasting materials and production capacity; on the other hand, they may allow unqualified light guide plate products to enter downstream terminals, such as automotive displays, medical equipment, or high-precision instruments, thereby causing optical distortion, safety hazards, or system anomalies, seriously affecting user experience and corporate reputation. Therefore, this paper proposes a light guide plate defect detection method and system based on neural networks to solve the above problems. Summary of the Invention
[0005] To achieve the above objectives, the present invention provides the following technical solution: A method for detecting defects in a light guide plate based on a neural network includes the following steps: During the dynamic transmission or rotation of the light guide plate, a series of multiple frames of images on the surface of the light guide plate are continuously acquired; Based on the acquired image sequence, time domain features are extracted, the inter-frame consistency prediction coefficient between the current image frame and multiple adjacent frames is calculated, and the coefficient is compared with a preset first threshold to determine whether the current image frame is interfered with. Interfered image frames are identified as abnormal image frames. For images identified as anomalous image frames, the detection confidence of the neural network in the initial recognition stage is temporarily reduced, and the output of recognition results is paused. Then, the reduced initial confidence of the anomalous image frame is weighted and fused with the recognition confidence of adjacent frames that meet the preset conditions to generate time-series confidence correction parameters. A local sliding window is formed by selecting a group of image frames within the temporal range centered on the abnormal image frame. The frequency domain transformation is performed on the images within the window to calculate the spectral sharpness index of the image and compare it with a second threshold to identify whether there is high-frequency information attenuation due to motion blur. When the spectral clarity index is below the second threshold, image enhancement processing is performed on the corresponding image, including edge enhancement, texture refinement and local contrast enhancement, in order to restore the image detail features; The image after interference identification, modulation and fuzzy compensation processing, along with its corresponding temporal confidence correction parameters, is input into a preset neural network model to extract and classify defect features, and outputs the type, location and final confidence of defects on the light guide plate surface.
[0006] In a preferred embodiment, continuously acquiring a multi-frame image sequence of the light guide plate surface refers to: By maintaining a preset angle between the preset image acquisition device and the light guide plate transmission path, the image acquisition device can capture multiple consecutive image frames on the surface of the light guide plate in real time during the dynamic transmission or rotation of the light guide plate, and adaptively adjust the image acquisition frequency and inter-frame time interval according to the real-time speed signal of the light guide plate.
[0007] In a preferred embodiment, the step of calculating the inter-frame consistency prediction coefficients between the current image frame and multiple neighboring frames includes: The image sequence continuously acquired by the image acquisition device is arranged in chronological order. Gray-level normalization is performed on each frame of the image, and the edge gradient amplitude distribution, global brightness mean, and direction gradient angle histogram are extracted as image temporal features to describe the shape structure, light intensity, and texture direction changes of the light guide plate surface image. The differences between the three types of temporal features of the current image frame and the corresponding features of the adjacent previous and next image frames are calculated. Specifically, these include the cumulative pixel-by-pixel difference of edge gradient, the absolute difference of the mean brightness, and the intersection-union ratio of the histogram of directional gradients. The largest difference among the three is taken as the inter-frame feature change value, which is used to reflect the magnitude of image stability changes. The inter-frame feature change value is normalized by the difference between the value and the preset image stability reference value to obtain an inter-frame consistency prediction coefficient with a value between zero and one. The closer the value is to zero, the more stable the image is, and the closer it is to one, the worse the image stability is.
[0008] In a preferred embodiment, abnormal image frames are determined in the following way: After obtaining the inter-frame consistency prediction coefficient of the current image frame, the coefficient is compared with a preset first threshold. When the consistency prediction coefficient is greater than the first threshold, it is determined that the current image frame has perturbation behavior. Analyze the edge gradient change trend between the current image frame and adjacent image frames. When the edge gradient change rate of the current image frame changes abruptly compared to the previous and next frames, confirm that the perturbation behavior is a discontinuous abrupt change behavior and mark the image frame as an abnormal image frame.
[0009] In a preferred embodiment, the image frame determined to be an abnormal image frame is processed as follows: After the abnormal image frame is marked, the inter-frame consistency prediction coefficient, image texture complexity value and illumination uniformity value of the image frame are extracted, and the time distribution curves of the three parameters are constructed respectively. Extract multiple unmarked image frames from historical image sequences, calculate the average value of the corresponding parameters, and use this as the feature reference value of the current image frame. Calculate the change magnitude of each parameter and the offset ratio relative to the feature reference value. The inter-frame consistency prediction coefficient is used to reflect image stability, texture complexity is used to reflect the intensity of structural disturbance, and illumination uniformity is used to reflect the degree of optical interference. Based on the maximum value of the offset ratio among the three parameters, a disturbance level index is generated to characterize the disturbance intensity. Based on the magnitude of the perturbation level index, the perturbation level is matched with the value range of the confidence adjustment factor by looking up a table. At the same time, the confidence attenuation coefficient is calculated based on the ratio between the perturbation level and the image sharpness value of the abnormal image frame. After the confidence attenuation coefficient is calculated, it is applied to the output layer confidence function during the initial recognition stage of the neural network to attenuate the initial confidence value of the recognition result. Finally, the recognition data after confidence attenuation is temporarily stored.
[0010] In a preferred embodiment, the calculation of image texture complexity and illumination uniformity values includes the following steps: The image frame is divided into several fixed-size image blocks. The gray-level gradient magnitude and gray-level change direction are calculated for each image block. The standard deviation of the gray-level gradient magnitude and the variance of the direction change are calculated for all image blocks. The average of the two is used as the image texture complexity value of the image frame, which is used to measure the fineness and unevenness of the surface texture structure of the light guide plate. The image frame is divided into multiple regions of equal area. The average brightness of each region is calculated, and the difference between the maximum and minimum average brightness values of the regions is taken as the image brightness discrete value. The overall average brightness of the image is then compared with the brightness discrete value to form a proportional relationship. This proportional value is used as the illumination uniformity value of the image frame to measure the uniformity of the light distribution in the image.
[0011] In a preferred embodiment, the generation logic for the time series confidence correction parameter is as follows: After the abnormal image frame is marked, the frame images that are closest to it before and after it and have not been judged as abnormal image frames are obtained respectively, and set as the front fusion reference frame and the back fusion reference frame respectively. The abnormal image frame, the pre-fusion reference frame, and the post-fusion reference frame are identified as the three frames to be fused. The confidence adjustment factor corresponding to the three frames is extracted. According to the preset standard, the allocation ratio of the abnormal image frame is determined based on the perturbation level index of the abnormal image frame. The allocation ratio of the pre-fusion reference frame and the post-fusion reference frame is determined based on the time difference between each of them and the abnormal image frame. The allocation ratio of the three frames is normalized to generate their respective weight coefficients. The confidence adjustment factors of the abnormal image frames, the pre-fusion reference frames, and the post-fusion reference frames are then fused according to their respective weight coefficients to obtain the temporal confidence correction parameters.
[0012] In a preferred embodiment, the spectral clarity index refers to: Centered on the abnormal image frame, multiple consecutive image frames within its temporal proximity are selected to form a local sliding window; frequency domain transformation is performed on each image frame within the window in sequence to extract the frequency response information of the image and establish a spectral energy distribution map; In each frame of the spectrogram, the sum of the amplitudes in the high-frequency region and the attenuation slope of the spectral curve in the mid-to-high frequency band are identified as indicators of the degree of attenuation of high-frequency details and sharpness of the image, respectively. The sum of the amplitudes in the high-frequency region is standardized by logarithmic compression, and the attenuation slope is normalized by an inverse proportional function. The two normalized results are geometrically averaged to generate the spectral sharpness index of the image.
[0013] In a preferred embodiment, identifying the presence of motion blur includes the following steps: Within a local sliding window, the number of frames with a spectral sharpness index below the second threshold is counted. This number is then compared to the total number of image frames within the window. If this ratio exceeds a set blur recognition trigger threshold, and at least a number of consecutive images meet the condition that the spectral sharpness index is below the second threshold, the image within the local sliding window is determined to have overall motion blur.
[0014] In a preferred embodiment, a light guide plate defect detection system based on a neural network specifically includes: The image acquisition module is used to continuously acquire multiple frame image sequences of the light guide plate surface during the dynamic transmission or rotation of the light guide plate; The temporal feature extraction module extracts temporal features based on the acquired image sequence and calculates the inter-frame consistency prediction coefficient between the current image frame and adjacent image frames. The interference determination module is used to compare the inter-frame consistency prediction coefficient with a preset first threshold to determine whether the current image frame is interfered with, and to determine the interfered image frame as an abnormal image frame. The confidence adjustment module is used to temporarily reduce the detection confidence of the neural network in the initial recognition stage and pause the output of recognition results for images that are judged to be abnormal. The confidence fusion module is used to weight and fuse the initial confidence of the abnormal image frame with the recognition confidence of the adjacent image frames that meet the preset conditions to generate time-series confidence correction parameters. The frequency domain processing module is used to select a group of image frames within a time range of the abnormal image frame as the center to form a local sliding window, perform frequency domain transformation on the images in the window, and calculate the spectral sharpness index. The blur recognition module is used to compare the spectral clarity index with a second threshold to identify whether there is high-frequency information attenuation due to motion blur, and to perform image enhancement processing on the image. The defect identification module is used to input the image after interference identification and fuzzy compensation processing and its corresponding temporal confidence correction parameters into a preset neural network model to extract and classify defect features, and output the type, location and final confidence of defects on the light guide plate surface.
[0015] The technical effects and advantages of this invention are as follows: This invention continuously acquires multi-frame image sequences of the light guide plate surface and dynamically calculates the inter-frame consistency prediction coefficient. Based on the time-series change trends between image frames, it can promptly identify image frames affected by disturbances and make judgments based on a preset first threshold, ensuring that each image frame undergoes stability screening before entering the neural network model. This mechanism effectively reduces the impact of interference such as light flicker, dust obstruction, and mechanical vibration on the detection process, and is particularly suitable for high-speed production lines where transient image distortion is caused by environmental noise, ensuring that subsequent feature extraction processing is based on high-confidence images.
[0016] This invention employs a confidence intervention strategy on image frames identified as abnormal. Specifically, it temporarily reduces the neural network detection confidence during the initial identification phase and pauses the output of the identification result. Then, it generates temporal confidence correction parameters by performing confidence-weighted fusion with adjacent image frames that meet preset conditions, thereby achieving temporal robustness of the identification strategy. This processing effectively solves the problem of false identification and false alarms that may be caused by single-frame perturbations, fully utilizing the temporal continuity and information redundancy of consecutive frames in the image sequence, and improving the overall stability and consistency of the identification. Compared with traditional identification methods based on single-frame static input, this invention has significant error suppression capabilities when processing dynamic abnormal frames. It avoids false positives of good products caused by short-term pseudo-defects and reduces the risk of missing real defects due to dynamic blurring, greatly enhancing the model's adaptability in complex production line environments.
[0017] This invention introduces a spectral sharpness index to identify high-frequency information attenuation caused by motion blur. Image enhancement processing is triggered by frequency domain transformation and sharpness threshold comparison. The image, after interference identification and blur compensation, along with its corresponding temporal confidence correction parameters, is then input into a pre-set neural network model for defect feature extraction and classification, significantly improving the accuracy, sensitivity, and fault tolerance of defect detection. The frequency domain analysis step ensures that the system not only focuses on the spatial information of the image but also considers the changing trends of high-frequency detail information, resulting in higher recognition accuracy when detecting image quality degradation caused by motion blur. Image enhancement processes, such as edge enhancement, texture refinement, and local contrast enhancement, effectively recover image features obscured by blur, thereby improving the neural network model's ability to identify real defects such as micro-cracks, bubbles, and dents. The final output includes not only the defect type and location but also a more reliable final confidence value obtained through the confidence correction mechanism, making this invention more valuable and reliable in practical industrial light guide plate defect detection tasks. Attached Figure Description
[0018] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings; Figure 1 This is a schematic diagram of a light guide plate defect detection method based on neural networks according to the present invention.
[0019] Figure 2 This is a schematic diagram of a light guide plate defect detection system based on a neural network, as described in this invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Reference Figure 1 - Figure 2 The following examples were obtained: Example 1: A method for detecting defects in a light guide plate based on a neural network, comprising the following steps: During the dynamic transmission or rotation of the light guide plate, a series of multiple image frames on the surface of the light guide plate are continuously acquired. The purpose of this step is to capture changes in the surface state in real time under the dynamic conditions of the light guide plate's operation. By continuously acquiring image frames, it ensures that subsequent processing stages have complete and continuous visual data input, providing a temporal information basis for defect identification in dynamic scenes. The acquired image sequences will serve as the raw data source for temporal feature extraction, anomaly detection, and fuzzy analysis.
[0022] Based on the acquired image sequences, temporal features are extracted, and the inter-frame consistency prediction coefficient between the current image frame and its neighboring frames is calculated. This coefficient is then compared with a preset first threshold to determine whether the current image frame is subject to interference. Interfering image frames are classified as abnormal image frames. This step evaluates the stability of image frames in the time series by extracting multi-dimensional temporal features such as grayscale, texture, and edges, and comparing the changes between the current frame and its neighboring frames to quantify whether interference caused by factors such as illumination, vibration, and jitter exists. When the inter-frame consistency prediction coefficient exceeds the set threshold, it indicates a significant decrease in image stability, and the image frame will be classified as an abnormal frame, requiring special processing.
[0023] For images identified as anomalous frames, the detection confidence of the neural network in the initial recognition stage is temporarily reduced, and the output of recognition results is paused. Then, the reduced initial confidence of the anomalous image frame is weighted and fused with the recognition confidence of adjacent frames that meet preset conditions to generate temporal confidence correction parameters. This step is used to mitigate the risk of misjudgment caused by image perturbation. When an image frame anomaly is detected, the system does not immediately output the recognition result, but instead lowers its confidence and stores it for further processing. Subsequently, based on the stable confidence information of temporally adjacent reference image frames, the system repairs the confidence of the anomalous image frame to generate more reasonable temporal confidence correction parameters, providing robust support for the final recognition and reducing the probability of false rejection or missed detection.
[0024] A local sliding window is formed by selecting a group of image frames within a temporal range centered on the anomalous image frame. Frequency domain transformation is performed on the images within this window, and the spectral sharpness index is calculated and compared with a second threshold to identify whether high-frequency information attenuation is caused by motion blur. This step aims to identify the risk of real-world defect loss due to image blurring during high-speed transmission. The system constructs a temporal sliding window centered on the anomalous image frame, performs spectral analysis on the images within it, extracts high-frequency detail features, and quantifies their sharpness. When the spectral sharpness index is below the threshold, it indicates that the image may have high-frequency loss caused by motion blur, thus requiring subsequent image enhancement compensation to restore the discriminative structural features of the image.
[0025] When the spectral sharpness index falls below a preset second threshold, image enhancement processing is performed on the corresponding image, including edge enhancement, texture refinement, and local contrast enhancement, to restore image detail features. This step is used to compensate for the weakening or occlusion of real defect signals in blurred images. By performing targeted image enhancement operations, the texture structure and edge details of areas that were originally unclear due to motion blur are restored, thereby improving image discriminability and providing clear input for subsequent feature extraction and classification recognition by the neural network, reducing the risk of missed detections.
[0026] The image, after interference identification, modulation, and fuzz compensation processing, along with its corresponding temporal confidence correction parameters, is input into a pre-set neural network model for defect feature extraction and classification. The model outputs the type, location, and final confidence score of the defects on the light guide plate surface. This step is the final identification stage of the entire method. After completing the aforementioned interference screening and image enhancement, the system inputs the corrected image and its confidence parameters into the neural network model. The neural network utilizes learned defect feature templates to perform multi-scale feature extraction and type discrimination on the input image, while simultaneously combining the confidence correction parameters to output the defect identification result. The output includes the specific type of defect, its location range in the image, and the final confidence score after fusion, used for subsequent determination of whether to remove the light guide plate sample.
[0027] Continuously acquiring a multi-frame image sequence of the light guide plate surface refers to selecting an industrial camera with high-speed image acquisition capabilities as the image acquisition device, fixing it above the dynamic transmission path of the light guide plate, and ensuring that the optical axis of the image acquisition device maintains a preset angle α with the surface of the light guide plate. This angle is typically set between a vertical orientation and a tilt of 5 to 15 degrees to balance the overall visibility of the light guide plate surface and the suppression of edge reflections. In actual installation, this angle is precisely calibrated using the adjustable joints of the bracket structure. The relative positional relationship between the acquisition device and the light guide plate must ensure that, while covering the field of view, lens distortion and edge defocusing are avoided, thereby improving image clarity and spatial geometric reconstruction accuracy.
[0028] After the above structural layout is completed, the light guide plate transmission device (such as a high-speed roller conveyor or a precision rotating disk) is activated, causing the light guide plate to move linearly or rotary at a set speed. The image acquisition device needs to establish a real-time data connection with the light guide plate transmission device to obtain the light guide plate's operating speed signal. This speed signal generally comes from an encoder or embedded motion control unit, with a sampling frequency of no less than 100 times per second. By acquiring the instantaneous speed value of the light guide plate, the system automatically adjusts the exposure period and frame rate of the image acquisition device. For example, when the light guide plate speed is 300 mm per second and the length of the single-frame image coverage area is set to 10 mm, the system automatically sets the image acquisition frequency to 30 frames per second to ensure that the spatial overlap between adjacent image frames is no less than 50%. If the light guide plate speed fluctuates, the system provides real-time feedback and updates the acquisition frequency to ensure that the interval between acquisition frames corresponds stably to the actual displacement interval, thereby avoiding image frame skipping or redundant acquisition problems caused by speed changes.
[0029] During the dynamic operation of the light guide plate, the image acquisition device continuously captures image frames of the light guide plate surface at the aforementioned adjusted acquisition frequency, and numbers and timestamps each frame to construct a temporally ordered image sequence. It is recommended that the image resolution be set to no less than 1920×1080 pixels, with a grayscale accuracy of no less than 8 bits, to ensure the visibility of subsequent minor defects such as textures and edges. During image frame acquisition, motion blur interference must be considered; therefore, the exposure time parameter is simultaneously controlled, shortening the exposure time in real time according to the instantaneous speed of the light guide plate, for example, reducing it to less than 300 microseconds in high-speed segments, while simultaneously increasing the light source illuminance to compensate for brightness loss. A uniform cold light source or a linear array backlight can be used to achieve high-contrast uniform illumination of the light guide plate surface, and a photomask structure can be used to eliminate background stray light and improve defect discriminability. Finally, after acquiring multiple consecutive image frames, these image sequences are used as input for subsequent processing, including temporal domain feature extraction, interference detection, and frequency domain transformation.
[0030] To dynamically evaluate the stability of image frames in a light guide plate image sequence and further identify potentially disturbed abnormal image frames, an inter-frame consistency prediction coefficient is introduced as a key quantitative indicator to measure the temporal continuity and stability of the image. This prediction coefficient expresses the consistency of the current image frame with respect to multiple adjacent frames in terms of image structure, brightness, and texture direction. The calculation process is as follows: The image sequence continuously acquired by the image acquisition device is arranged chronologically to establish an image frame queue with temporal sequence characteristics. To eliminate brightness benchmark deviations caused by exposure, noise, or background reflection between different frames, each image frame undergoes grayscale normalization before processing. Normalization remaps the image pixel grayscale values to a standard range of zero to one, ensuring a unified comparison benchmark for the image under different brightness scenes. After normalization, three types of temporal features are extracted from each image frame: edge gradient magnitude distribution, global brightness mean, and orientation gradient angle histogram. Edge gradient magnitude distribution is used to capture the contour features of the light guide plate surface shape and defects; global brightness mean is used to reflect the overall exposure level of the current frame image; and orientation gradient angle histogram is used to quantify the distribution pattern of gradient directions of each pixel in the image, revealing the trend of texture arrangement direction changes. For example, for an image of size 1920 by 1080 pixels, the edge gradient distribution is generated by applying the Sobel operator to extract horizontal and vertical gradients, calculating the gradient intensity of each pixel, and generating a normalized distribution map; the global brightness mean is taken as the arithmetic mean of the gray values of the entire frame; and the orientation gradient angle histogram quantizes the pixel gradient directions in the image into thirty-six angle intervals and counts the number of pixels in each direction interval.
[0031] The three types of temporal features extracted from the current image frame are compared with their corresponding features in the previous and next frames using difference analysis to assess the temporal continuity with adjacent frames. Specifically, the comparison between edge gradient magnitude distributions uses a pixel-by-pixel difference accumulation method. First, the gradient magnitudes of corresponding pixels in the current frame and adjacent frames are calculated, and then all differences are weighted and accumulated to obtain the overall edge difference. The global brightness mean is compared using an absolute difference method; the smaller the numerical difference, the better the exposure stability. The orientation gradient angle histograms are compared using an intersection-union ratio (IUU) method. The similarity coefficient of orientation distribution is obtained by calculating the proportion of the overlapping part of the two orientation histograms. For example, when the difference in the brightness mean between the current image frame and the previous frame is 0.1, the IUU of the orientation histogram is 0.75, and the edge difference is 8,000 pixel gradient units, the degree of difference in brightness, orientation, and structure of the frame can be obtained.
[0032] The three feature difference values are comprehensively evaluated, and the one with the largest difference is taken as the inter-frame feature change value between the current image frame and its adjacent image frames. This maximum difference value is representative and can reflect the maximum fluctuation intensity between the current image frame and its adjacent frames in the time series. In actual calculation, the three difference quantities are converted to the same dimension and normalized to between zero and one, and then their values are compared and the largest term is selected as the inter-frame feature change value. The logic for selecting this maximum difference index is that the destruction of image stability often first manifests as a drastic change in a certain dimension, and it is not necessary for all dimensions to change simultaneously to constitute the initial feature of the disturbance signal. Therefore, using the maximum difference value can more sensitively capture potential interference signals. For example, if the change value of the orientation histogram of the current frame is significantly higher than that of the brightness and structure terms, it indicates a sudden change in the image texture direction, which is very likely caused by motion blur, magnification of local defects, or edge reflection. This difference should be used as the dominant parameter for stability judgment.
[0033] Finally, the inter-frame feature change value is normalized by comparing it with a preset image stability reference value to obtain the inter-frame consistency prediction coefficient, with a value range defined between zero and one. A higher inter-frame consistency prediction coefficient indicates a more stable image and better continuity between image features and adjacent frames; a coefficient closer to one indicates significant perturbation and severe feature abrupt changes in the current frame. The image stability reference value is set based on the statistical mean of stable frames in a historical image sequence. For example, if the mean of inter-frame feature change values extracted from one hundred interference-free images is 0.25, this value is used as the benchmark. Subsequent frames with feature change values significantly higher than this reference value are considered potential anomalies. The normalization function uses a linear function and a two-way truncation method to ensure the smoothness and discriminative power of the prediction coefficient value distribution. The final inter-frame consistency prediction coefficient will serve as the input for the subsequent "image interference determination" and "confidence adjustment" steps.
[0034] Abnormal image frames are determined as follows: In the previously disclosed content, temporal features between the current image frame and its neighboring image frames have been extracted, and inter-frame consistency prediction coefficients have been obtained by comparing indicators such as edge gradient magnitude distribution, global brightness mean, and directional gradient histogram. At this point, the system acquires the inter-frame consistency prediction coefficient value of the current image frame and compares it with a first threshold obtained beforehand based on large-sample statistics. The first threshold is used to classify whether an image frame is in a stable state, and its value is usually set around 0.5. For example, in a real-world high-speed transmission scenario using a light guide plate, by analyzing one thousand consecutive normal images, the median value of the inter-frame consistency prediction coefficient is 0.38, and the standard deviation is 0.06. Therefore, the first threshold is set to 0.52. When the inter-frame consistency prediction coefficient of a certain image frame is detected to be greater than this threshold, such as a frame coefficient reaching 0.65, it indicates that this frame differs significantly from its neighboring frames in any aspect such as shape, brightness, or texture direction. This allows for a preliminary determination that the image frame exhibits perturbation behavior and has an abnormal potential.
[0035] To further analyze whether this disturbance is an instantaneous interference rather than a slow, cumulative change, it is necessary to analyze the edge gradient change trend between the current image frame and adjacent image frames. Specifically, the edge gradient change rate of the current image frame is extracted from the edge gradient amplitude distribution. This involves calculating and standardizing the edge gradient differences between the current and previous frames and between the current and next frames, and then using the current frame as a reference to determine whether its gradient change in the three-frame sequence exhibits a peak abrupt change characteristic. For example, if the edge gradient differences between the current frame and the previous and next frames are 5,000 and 4,000 units respectively, while the difference between the current frame and the other frames is as high as 13,000 units, it indicates that the current frame has undergone a sharp change in structural features. By introducing a local change slope index, it is possible to further quantify whether this change rate exceeds the system's preset abrupt change judgment threshold. Generally, when this slope exceeds a set second-order change ratio (such as 1:2), it can be determined that the current image frame has undergone a discontinuous abrupt change in edge structure.
[0036] Based on the above two criteria, the system classifies the current image frame as an anomalous frame. This means the frame not only exhibits significant inconsistencies with adjacent frames in its overall characteristics but also displays marked local abrupt changes in its structural trend, exhibiting non-periodic and non-cumulative interference characteristics. Such image frames may arise from vibrations or impacts during the movement of the light guide plate, sudden adhesion of surface dust, or localized high reflectivity caused by instantaneous changes in the illumination angle. For example, in an experiment, a frame was recorded where a brief jump in the transmission device during continuous acquisition caused slight camera jitter, resulting in edge distortion. This led to a rise in the consistency prediction coefficient to 0.7, accompanied by a structural abrupt change, ultimately leading to the system successfully identifying it as an anomalous image frame.
[0037] To ensure the accuracy and robustness of abnormal image frame identification, this implementation adopts a joint identification mechanism. Specifically, a frame is only marked as an abnormal image frame when the inter-frame consistency prediction coefficient exceeds a first threshold and the edge gradient change rate exhibits a local abrupt change over time. This dual-identification strategy effectively avoids misjudgments caused by fluctuations in a single feature indicator, improving the accuracy of identifying interference behavior in complex dynamic backgrounds. Furthermore, for image frames marked as abnormal, confidence adjustment and image enhancement operations will be performed in subsequent identification stages to ensure the reliability of the final defect identification result.
[0038] Images identified as anomalous frames undergo the following processing: After the anomalous image frame is identified and marked in the preceding steps, three key interference feature parameters are immediately extracted: inter-frame consistency prediction coefficient, image texture complexity value, and illumination equalization value. These three parameters reflect image stability, the intensity of image structural disturbance, and the illumination equalization status of the image, respectively. For example, in a specific light guide plate detection scenario, an anomalous image frame might have an inter-frame consistency prediction coefficient of 0.76, an image texture complexity value of 1120, and an illumination equalization value of 0.49. These three values are recorded and their time distribution curves are constructed according to a time series. That is, the historical trajectory of each parameter is traced back in several adjacent frames to form a corresponding time trend line, which is used for subsequent analysis of abnormal changes and determination of disturbance level.
[0039] To obtain a representative reference standard, multiple frames not marked as anomalous images need to be selected from the historical image sequence as control samples. The average values of the three types of parameters mentioned above are then calculated as feature reference values for the current image frame. For example, five normal image frames are extracted from the previous time window, with an average inter-frame consistency prediction coefficient of 0.38, an image texture complexity value of 850, and an illumination equalization value of 0.33. Next, the parameter values of the current image frame are compared with their reference values to obtain the variation range of each parameter, and their relative offset ratios are further calculated. Specifically, the offset ratio of the inter-frame consistency prediction coefficient is 0.76 minus 0.38 divided by 0.38, approximately 100%; the texture complexity value offset ratio is 31.76; and the illumination equalization value offset ratio is 48.5. This calculation process reflects the degree of anomalousness of the current image in different interference dimensions, avoiding errors caused by over-reliance on a single parameter.
[0040] After obtaining the relative offset ratios of each parameter, the maximum value among the three is selected as the perturbation level index to characterize the overall perturbation intensity suffered by the abnormal image frame. Taking the example above, the offset ratio of the inter-frame consistency prediction coefficient is the highest (100%), therefore this value is set as the perturbation level index. The system performs a lookup operation based on the correspondence between the perturbation level index and preset level intervals. For example, the perturbation level is divided into five intervals, each corresponding to a different confidence adjustment range. For instance, a slight perturbation corresponds to a confidence adjustment factor between 0.95 and 1, while a very strong perturbation corresponds to between 0.5 and 0.65. Assuming the current perturbation level falls into the strongest level interval, the initial confidence adjustment factor is selected as 0.6.
[0041] To further consider the image sharpness factor at the spatial visual level of this abnormal image frame, an image sharpness value is introduced as a correction standard for the adjustment factor. For example, if the image sharpness value of this image frame is detected to be only 0.24 in the frequency domain analysis step, while the expected sharpness lower limit corresponding to this perturbation level is 0.35, then the ratio of the actual image sharpness to this lower limit is constructed. If this ratio is less than one, it indicates that the image itself has a risk of blurring. Therefore, based on the inverse proportional function relationship between the perturbation level index and the sharpness ratio, the value of the final confidence adjustment factor is further reduced, for example, from the original 0.6 to 0.54. Finally, based on the obtained confidence decay coefficient, the system performs a confidence function adjustment operation on the recognition output of the current abnormal image frame. Specifically, in the output layer of the neural network, the original recognition confidence is multiplied by the decay coefficient. For example, if the original recognition confidence is 0.88, the result after multiplying by 0.54 is 0.4752. The system temporarily stores this confidence value along with the recognition category and location data, and waits for further processing by subsequent fusion strategies to improve the overall recognition accuracy and decision stability.
[0042] The confidence decay coefficient is not a fixed value, but is dynamically generated based on the proportional relationship between the perturbation level of an abnormal image frame and the corresponding image sharpness value. The specific calculation method is as follows: Using the perturbation level index obtained in the previous steps, its value is divided into five perturbation levels, corresponding to very slight perturbation, slight perturbation, moderate perturbation, severe perturbation, and extremely severe perturbation. Each level has a preset minimum reasonable threshold for image sharpness value. For example, if the perturbation level is moderate, the corresponding minimum reasonable threshold for image sharpness is set to 0.35; if it is extremely severe, the threshold is 0.50.
[0043] The ratio of the actual detected abnormal image frame sharpness value to the corresponding preset minimum reasonable threshold for image sharpness is calculated. The ratio represents the proportion of the current image's sharpness at that level relative to the expected standard. For example, if the actual image sharpness is 0.25, and the reasonable threshold for the corresponding disturbance level is 0.50, then the ratio is 2:5. The lower this ratio, the worse the image quality, and the smaller the attenuation coefficient should be.
[0044] The aforementioned ratios are jointly mapped to confidence adjustment ranges matching the perturbation levels. For example, if the ratio is higher than 80%, it indicates that the image quality is close to or better than the standard for that level, and a higher value can be selected within the confidence adjustment range for that level. If the ratio is lower than 50%, it indicates that the image clarity is far below the expected standard, and a lower value within the adjustment range is selected. If the ratio is between 50% and 80%, a middle value is determined within the confidence adjustment range using linear interpolation. For example, if the adjustment range corresponding to a moderate perturbation level is 0.70 to 0.85, and the actual ratio is 60%, then the final confidence attenuation coefficient can be set to 0.79 using an interval linear calculation method. Finally, this confidence attenuation coefficient is directly used in the neural network recognition output stage, that is, attenuation processing is performed on the output confidence value to generate the confidence value of the initial recognition result.
[0045] The calculation of image texture complexity and illumination uniformity includes the following steps: Spatial partitioning is performed on any acquired image frame, dividing the entire image into several fixed-size image blocks. For example, an image with a resolution of 1920 x 1080 pixels can be divided into 120 image blocks, each approximately 160 x 90 pixels in size. Gray-level gradient extraction is performed on each image block to obtain its gray-level gradient magnitude and direction of change. In practice, a convolution operator is used to perform first-order derivative processing on each image block to extract its edge change intensity and direction, forming a gradient magnitude matrix and a direction angle matrix, respectively. The gray-level gradient magnitude data of all image blocks are statistically analyzed, and their standard deviation is calculated. This value reflects the dispersion of structural strength variations in the image. Simultaneously, the variance of the angle values of gray-level change directions in all image blocks is calculated to measure the complexity of texture directions. These two results reflect the non-uniformity of the image in both structural and texture dimensions.
[0046] The standard deviation of the gray-level gradient magnitude and the variance of the gray-level change direction are numerically averaged to obtain an index that comprehensively reflects the complexity of the image structure, namely the image texture complexity value. In the experimental setup, when the standard deviation of the gray-level gradient magnitude is 37.5 and the variance of the direction change is 426.8, the arithmetic mean is approximately 232.15, which is the image texture complexity value of that image frame. The higher this value, the more texture details and the more complex the direction changes in the image, and the greater the degree of structural perturbation. Conversely, if the image edge changes are simple and the direction distribution is concentrated, the value tends to be smaller.
[0047] To comprehensively evaluate the uniformity of illumination in an image, the image frame is further divided into multiple regions of equal area. Taking the image above as an example, it can be divided into sixteen regions, each with an area of approximately 480 x 270 pixels. The average grayscale brightness of each region is calculated, resulting in a list of region brightness distributions. The maximum and minimum average brightness values are selected from this list, and their difference is calculated as the image brightness dispersion value. For example, if the highest average brightness value is 180 and the lowest average brightness value is 105, then the brightness dispersion value is 75. Next, the global average brightness value of the entire image is calculated, for example, 135. A proportional relationship is established between the global average brightness value and the brightness dispersion value, i.e., the brightness dispersion value is divided by the global average brightness value. The resulting ratio is the image's illumination uniformity value. The higher this value, the more significant the difference between bright and dark areas in the image, indicating uneven illumination or background interference.
[0048] Image texture complexity and illumination evenness are used together as reference parameters for abnormal image frame perturbation analysis. These, along with the inter-frame consistency prediction coefficient, form a three-dimensional perturbation feature vector, reflecting structural perturbation, illumination perturbation, and temporal continuity perturbation, respectively. By tracking the three types of indicators over time across multiple image frames, a temporal variation curve for each parameter can be constructed, allowing for analysis of the image's dynamic stability. Furthermore, the deviation between the image texture complexity value and the average texture value of historical normal image frames is calculated to determine if the current image frame exhibits abnormal structural changes. Similarly, the illumination evenness value is compared with the historical average illumination curve to identify optical interference such as localized reflections and background unevenness. If any of these three parameters significantly deviates from the mean, it can be inferred that the image frame is subject to external perturbation. Based on this, the confidence output of the neural network during the recognition phase is dynamically adjusted to ensure the accuracy and stability of the recognition results.
[0049] The generation logic for the temporal confidence correction parameters is as follows: After an image frame is marked as an anomalous image frame, the system immediately retrieves the two closest images in its time series that were not identified as anomalous images. These are one image frame that is earlier than the anomalous image frame and one image frame that is later than the anomalous image frame. The former is set as the pre-fusion reference frame, and the latter as the post-fusion reference frame. For example, if the image numbered fifth is identified as an anomalous image frame, the system first searches backward for the image numbered fourth and determines whether it is an anomalous image frame. If it is not anomalous, it is used as the pre-fusion reference frame. Then, it searches forward for the sixth image; if it meets the criteria, it is used as the post-fusion reference frame. This operation ensures that the selected image frames are undisturbed and representative, providing a reliable confidence reference.
[0050] After successfully identifying the pre-fusion reference frame and the post-fusion reference frame, the system determines a fusion image frame group consisting of three frames: the anomalous image frame, the pre-fusion reference frame, and the post-fusion reference frame. For each image frame, its corresponding confidence adjustment factor is extracted. The confidence adjustment factor for the anomalous image frame is a decay result derived from the ratio between the aforementioned perturbation level index and the image sharpness value; while the confidence adjustment factor for the reference image frame is directly taken based on its state of not being marked as an anomalous image frame. Based on this, allocation ratios are set for the three images. The allocation ratio for the anomalous image frame is determined by its perturbation level index. For example, if the perturbation level index is seven, its corresponding allocation ratio is 0.45. For the two reference images, their time difference is calculated based on their relative positions with the anomalous image frame in the time series. Assuming the time interval between the pre-fusion reference frame and the anomalous image frame is one frame, and the time interval between the post-fusion reference frame and the anomalous image frame is two frames, their weights are assigned as 0.3 and 0.25 respectively, based on their temporal proximity.
[0051] The confidence adjustment factors of the three image frames are fused according to their respective weight coefficients: After the three images—the pre-fusion reference frame, the abnormal image frame, and the post-fusion reference frame—are determined, the confidence adjustment factors for each of the three frames need to be obtained. The confidence adjustment factor for the abnormal image frame differs from that of the reference image frame. It is a confidence attenuation coefficient calculated by the system based on the ratio between the perturbation level index and the image sharpness value of the frame after the abnormal image frame is identified. It represents the weight factor after correcting the original recognition confidence. Therefore, this value is usually lower than the normal confidence benchmark, possessing dynamic and real-time characteristics, reflecting the downward trend of the confidence of the current image frame after being affected by perturbations.
[0052] The confidence adjustment factors for the pre-fusion reference frames and post-fusion reference frames do not require perturbation correction because these two frames were not identified as abnormal images and were confirmed to have high image stability through the pre-interference identification and judgment step. The system can directly extract fixed standard confidence factor values from the initial configuration, such as setting them to 0.9 or 0.95. The specific values are based on the historical stability index of the image acquisition channel, the accuracy distribution of the neural network on the sample set, and the scene experience threshold.
[0053] To achieve weighted fusion, the confidence adjustment factors of the three image frames need to be multiplied by the normalized weight coefficients calculated using the perturbation level index and time difference, respectively. The products of these three factors are then summed to obtain the temporal confidence correction parameter after fusion. For example, assuming the confidence adjustment factor of the abnormal image frame is 0.75, the fixed confidence adjustment factors of the pre-fusion reference frame and the post-fusion reference frame are both 0.95, and the weight coefficients of the three frames are 0.4, 0.3, and 0.3 respectively, the calculation process is: 0.75 multiplied by 0.4, plus 0.95 multiplied by 0.3, plus 0.95 multiplied by 0.3, resulting in a fusion result of 0.865. The temporal confidence correction parameter generated in this way comprehensively considers the image quality perturbation of the abnormal image frame and the recognition reliability of the temporal neighbor reference frame. In the dynamic and complex light guide plate production inspection process, it effectively suppresses false alarms caused by pseudo-defects and missed detections of real defects, achieving a more robust confidence output mechanism. The obtained temporal confidence correction parameters, along with the image data processed by interference identification and fuzziness compensation, are input into a pre-defined neural network model for subsequent defect feature extraction and recognition tasks. This step ensures that the neural network receives high-quality confidence data after perturbation analysis and temporal correction during the recognition stage, further improving the robustness and accuracy of defect recognition.
[0054] The spectral clarity index refers to a fixed-length image sequence window, known as a local sliding window, constructed by selecting several temporally adjacent image frames before and after the frame marked as an anomalous image frame as the center. In practice, the window length can be dynamically set based on the image acquisition frequency and the light guide plate's movement speed. For example, when the image acquisition frequency is 50 frames per second and the light guide plate's transmission rate is 30 centimeters per second, the window length can be set to seven to eleven frames to ensure sufficient temporal continuity and content relevance within the window. This sliding window selection not only provides a sample basis for spectral calculation but also enhances the stability and continuity of blur detection in the temporal dimension.
[0055] For each frame of the image within a local sliding window, a frequency domain transformation is sequentially performed to map the image from the spatial domain to the frequency domain, thereby extracting its frequency response features. Specifically, a Fast Fourier Transform (FFT) method can be used to convert the two-dimensional grayscale matrix of each frame into a complex frequency spectrum, and its spectral amplitude information is extracted to construct a spectral energy distribution map. This spectrum visualizes the energy distribution of the image content across different frequency regions. High-frequency information such as edges, details, and textures in the image structure are typically concentrated in the mid-to-high frequency regions of the spectrum, while brightness and contrast variations are mainly concentrated in the low-frequency regions. To ensure the accuracy of the spectral features, the image can first be centered and weighted using a Hanning window to eliminate edge interference and windowing effects, enhancing the stability of the frequency domain transformation.
[0056] In each frame of the spectrum, two key frequency domain indicators are identified: the sum of amplitudes in the high-frequency region, used to quantify the degree of high-frequency detail retention in the image; and the attenuation slope of the spectrum curve in the mid-to-high frequency band, used to measure the decreasing trend of image sharpness with increasing frequency. The selection range of the high-frequency region can be defined by normalization based on the image size. For example, in a two-dimensional frequency domain coordinate system, the frequency range with a normalized distance of more than 0.6 from the frequency origin is defined as the high-frequency region. By taking the logarithm of the amplitudes of all frequency points in this region and summing them, the high-frequency detail energy index can be obtained. At the same time, by fitting the energy decrease trend curves of the mid-frequency and high-frequency bands of the spectrum and taking the inverse normalization value of their slopes, the attenuation slope index can be obtained. In this step, the two indicators represent the absolute degree of image sharpness retention and the relative degradation trend, respectively, and are complementary and different.
[0057] To achieve a unified representation of spectral sharpness, the two frequency domain indices mentioned above are standardized and combined: the sum of high-frequency amplitudes is transformed to a standard distribution between zero and one through logarithmic compression, and the attenuation slope is normalized to a decreasing function mapping through an inverse proportional function. To comprehensively evaluate the combined impact of the two indices on sharpness, a geometric mean is used for fusion to generate the final spectral sharpness index. Specifically, the two normalized values are denoted as the first sharpness component value and the second sharpness component value, respectively. The product of the two values is calculated and the square root is taken; the resulting value is the spectral sharpness index of the image frame. The higher the index value, the more complete the high-frequency information in the image is preserved and the higher the sharpness; conversely, when the index value is lower than a set second threshold, the current image frame is considered to be significantly blurred, and subsequent image enhancement processes need to be triggered. This method can effectively avoid blur recognition failures caused by subjective judgment or static thresholding, and enhance the system's adaptability in high-speed dynamic production scenarios.
[0058] Identifying motion blur involves the following steps: After an abnormal image frame is identified, a local sliding window is constructed centered on it, and the spectral sharpness index is calculated sequentially for all image frames within the window. This window typically contains five to eleven consecutive images. The number of frames should be adjusted based on the image acquisition frequency and the light guide plate transmission speed to ensure that the covered time interval can fully encompass the blurring trend within a short period. The sliding window range can be set based on three frames before and after the current abnormal image frame, i.e., the current image frame is centered, with three frames to the left and three frames to the right. For each image frame, its spectral characteristics are obtained based on frequency domain transformation, and the sum of high-frequency amplitudes and the attenuation slope of the high-frequency band in the spectral curve are extracted using the aforementioned method, ultimately generating the spectral sharpness index.
[0059] Statistical analysis is performed on the spectral sharpness index of all image frames within the sliding window to determine whether each frame falls below a preset second threshold. This second threshold serves as the dividing line for sharpness judgment and can be obtained through training with a large number of normal samples. For example, it can be set between 0.35 and 0.5, indicating a significant attenuation of high-frequency structural information and blurring of details in the image. During the statistical process, the number of frames below this threshold is included in the number of blurred frames. The blur ratio is calculated using the total number of frames in the window as the denominator and the number of blurred frames as the numerator. This ratio is used to determine whether the images within the sliding window have an overall blurring tendency. For example, in a seven-frame window, if five frames have a spectral sharpness index below the second threshold, the blur ratio is seven-fifths, approximately 0.71, which is much higher than the conventionally set blur recognition trigger threshold of 0.5.
[0060] Based on determining whether the blur ratio exceeds the blur recognition trigger threshold, further verification is conducted to confirm whether there is a continuous distribution of blurry image frames within the sliding window, in order to eliminate the influence of occasional or single-frame blur on the overall judgment result. Specifically, it involves statistically analyzing whether there are three or more consecutive images within the sliding window whose spectral sharpness index is all below the second threshold. If there is at least one consecutive blurry segment that meets this condition, the blurring phenomenon is considered to be non-random, but rather caused by the continuous movement of the light guide plate, resulting in overall image defocusing. For example, if the sharpness index of four consecutive images within three frames before and after the abnormal image frame is all below the second threshold, and the blur ratio is above 0.6, then the dual constraints of continuity and proportionality are satisfied, further enhancing the robustness and accuracy of the judgment.
[0061] Based on the combined result of two judgment conditions, if the proportion of frames with a spectral sharpness index below the second threshold in the image within a local sliding window exceeds the blur recognition trigger threshold, and there are image sequence segments within the window that meet the continuity requirement, then the entire image within the sliding window is determined to have motion blur. After this determination, all image frames below the second threshold can participate in subsequent image enhancement processing as blurred interference image frames, such as edge enhancement, texture refinement, or contrast enhancement. Simultaneously, the feature extraction method or filter kernel size used in the neural network recognition process is adjusted to improve the system's ability to identify potential defects in blurred images and prevent minor cracks or dents from being missed by the system due to blurring effects.
[0062] Image enhancement processing is a targeted compensation for blurred images. For example, it mainly includes the following steps: To address the weakened boundary information caused by image blurring, edge enhancement operations are performed. Specifically, the image frame undergoes two-dimensional convolution processing, and a high-pass filter template for edge enhancement is selected. This could be a convolution kernel with a sharpening operator at its core, such as a 3x3 structure where the central value is positive and the surrounding values are negative, to enhance the grayscale differences between pixels. Furthermore, to suppress potential noise interference during sharpening, an edge smoothing control mechanism can be introduced simultaneously, setting an upper limit threshold for edge response intensity to prevent excessive amplification of background noise. This operation makes the transition areas of the image edges clearer, which helps extract high-contrast structural features such as cracks and scratches in the subsequent defect identification stage.
[0063] To address the loss of texture details due to spectral attenuation, texture thinning is performed. The specific steps are as follows: the image is divided into multiple small regions, each region undergoes local adaptive enhancement, and the gray-level gradient distribution density of pixels within the region is calculated to determine the presence of potential texture structures. If the gradient density is lower than a set standard, it is identified as a texture-deficient region. High-frequency component interpolation compensation is then performed on this region. This involves comparing the frequency distribution differences between this region and its neighboring regions to insert missing high-frequency detail textures, restoring microscopic defects such as fine scratches and bubble outlines that may be obscured by blurring on the light guide plate surface.
[0064] After edge and texture enhancement, a local contrast enhancement operation is performed to further optimize the overall visual sharpness of the image. This step mainly includes two aspects: First, based on a sliding window-based local dynamic range stretching, pixel values within each image region are normalized to both maximum and minimum, improving the expressiveness of grayscale levels and making the brightness distribution in low-contrast areas more distinct; second, a multi-scale histogram equalization method is used to redistribute pixel value frequencies at different spatial scales, thereby enhancing the contrast between light and dark areas of the image and highlighting the light and dark boundaries of potentially defective structures. This step is particularly crucial for resolving low-contrast blurred areas caused by uneven lighting or local underexposure.
[0065] After the three enhancement processes are completed, the enhancement results are integrated and verified to ensure that the processed image does not cause artifacts or misjudgments due to over-enhancement. Specifically, an image change detection mechanism is introduced, comparing the pixel differences between the images before and after enhancement. If the local change exceeds a set threshold, a smoothing rollback process is performed on that area, reducing noise levels through a low-pass filter to restore a natural transition effect. Furthermore, by combining the spectral sharpness index before image enhancement with the spectral reconstruction quality evaluation value after enhancement, it is determined whether the image has truly achieved structural restoration and feature preservation. If the conditions are not met, a re-enhancement or alarm mechanism is triggered, prompting manual review or re-acquiring of the image. Through the above image enhancement process, this invention can address image degradation caused by dynamic blur by compensating for image detail loss while preserving effective defect information, thereby significantly improving the input quality of the neural network recognition model. This provides more reliable image data support for the final light guide plate defect identification, avoiding false detections and missed detections caused by blur.
[0066] In the process of light guide plate defect detection, to ensure high reliability and discrimination accuracy of the final output results, this invention, after completing the aforementioned interference identification and fuzziness compensation processing, combines temporal confidence correction parameters and uses a pre-set neural network model to perform defect feature extraction and classification tasks. This step constitutes a key link in the light guide plate defect identification process, mainly including the following steps: After completing image enhancement and confidence correction, the obtained image data and its corresponding temporal confidence correction parameters are jointly constructed into a feature input group, and input into the pre-set neural network model for feature encoding and parsing. This neural network model adopts a multi-channel parallel structure, consisting of a shallow edge-aware convolutional group, a mid-layer multi-scale attention feature extraction group, and a deep semantic compression classification group. The edge-aware convolutional group extracts local detail contours of surface defects such as cracks, bubbles, and stains in the light guide plate image using 3x3 and 5x5 separable convolutional kernels. The multi-scale attention feature extraction group can adaptively discriminate the importance of image regions, achieving automatic focusing on the expression intensity of defects in different regions of the light guide plate. The semantic compression classification group compresses high-dimensional feature maps into fixed-dimensional classification vectors, forming specific defect type prediction outputs. Temporal confidence correction parameters are embedded in the feature fusion stage in the middle layer channels to dynamically adjust the response weights of each channel in the feature map, enhancing the model's ability to perceive the stability of abnormal frame features and ensuring that abnormal image frames have sufficient recognition qualifications after image enhancement and confidence correction.
[0067] To differentiate the model's input mechanism from the aforementioned pause strategy in the initial recognition stage, this invention implements a "dual-stage discrimination - single-channel execution" architecture. In the model structure, the initial recognition stage executes the predictive path of the neural network's forward feed, i.e., the lightweight feature channel, generating a rapid recognition result based solely on the original image input. At this stage, output is interrupted when an image is determined to be an abnormal frame; the confidence value is only reduced to a pending range and temporarily stored, awaiting subsequent enhancement and compensation processing before re-entering the complete recognition process. The final recognition stage, on the other hand, is the fine-feature channel, fully receiving the input data stream after image enhancement and confidence correction, activating the complete convolutional path to perform in-depth defect feature analysis and accurate classification. This dual-stage mechanism ensures a balance between processing efficiency and recognition accuracy; abnormal image frames must undergo image compensation and confidence correction before entering the final recognition process, thus avoiding the risk of misjudgment directly caused by blurred images.
[0068] When the neural network model performs defect identification, it automatically generates three types of output information: first, the type label of the surface defect of the light guide plate, including typical surface defect categories such as cracks, bubbles, dirt, and indentations; second, the spatial coordinates of the defect, output as the bounding box coordinates of the target area in the image frame; and third, the final confidence score after fusion, used to characterize the credibility of the identification result. This confidence score is a fusion product of the original confidence result generated by the model's output layer and the temporal confidence correction parameter, dynamically balanced through a bidirectional adjustment function. Specifically, it increases the confidence score when the original model confidence is low but the reference frame provides strong support, and decreases it appropriately when the original confidence is low, thus avoiding false defects or missed detections. This fusion method improves the model's adaptive recognition capability for disturbed images in dynamic environments, making it particularly suitable for light guide plate inspection scenarios under high-frequency motion conditions such as high-speed production lines or mechanical turntables.
[0069] After the neural network model completes its recognition output, the results are sent to a post-processing program for quality assessment and output recording. The system performs type distribution statistics and confidence clustering analysis on all image frames identified as defects to determine if there are continuous defects or local clustering anomalies. If multiple consecutive images detect the same type of defect at adjacent locations, and the confidence levels are all higher than a set confidence threshold, the system automatically marks them as high-risk areas and triggers an alarm mechanism in the upstream process. Conversely, if the confidence level of defects identified in some image frames is low, and they do not form spatial continuity or type consistency with preceding and following frames, the system automatically places the result in a pending review state, prompting manual secondary review. Furthermore, all recognition results are archived and recorded in order of defect type, location, and time, providing data support for light guide plate quality tracking.
[0070] Example 2: A light guide plate defect detection system based on neural networks, specifically including: The image acquisition module is used to continuously acquire multiple frame image sequences of the light guide plate surface during the dynamic transmission or rotation of the light guide plate; The temporal feature extraction module extracts temporal features based on the acquired image sequence and calculates the inter-frame consistency prediction coefficient between the current image frame and adjacent image frames. The interference determination module is used to compare the inter-frame consistency prediction coefficient with a preset first threshold to determine whether the current image frame is interfered with, and to determine the interfered image frame as an abnormal image frame. The confidence adjustment module is used to temporarily reduce the detection confidence of the neural network in the initial recognition stage and pause the output of recognition results for images that are judged to be abnormal. The confidence fusion module is used to weight and fuse the initial confidence of the abnormal image frame with the recognition confidence of the adjacent image frames that meet the preset conditions to generate time-series confidence correction parameters. The frequency domain processing module is used to select a group of image frames within a time range of the abnormal image frame as the center to form a local sliding window, perform frequency domain transformation on the images in the window, and calculate the spectral sharpness index. The blur recognition module is used to compare the spectral clarity index with a second threshold to identify whether there is high-frequency information attenuation due to motion blur, and to perform image enhancement processing on the image. The defect identification module is used to input the image after interference identification and fuzzy compensation processing and its corresponding temporal confidence correction parameters into a preset neural network model to extract and classify defect features, and output the type, location and final confidence of defects on the light guide plate surface.
[0071] In this invention, the first threshold serves as a key parameter for judging image stability and is applicable to the determination step of the inter-frame consistency prediction coefficient. Its function is to distinguish between "normal frames" and "abnormal frames." In this invention, the calculation of the inter-frame consistency prediction coefficient is based on three types of temporal features: the distribution of edge gradient magnitude, the global average brightness, and the histogram of orientation gradient angles. By comparing each feature with adjacent image frames and extracting the maximum difference index, a unified normalized value is mapped to reflect the stability of the image on the time axis. The prediction coefficient ranges from zero to one; a higher value indicates worse image stability. The first threshold is set based on the following: Based on historical normal operation data statistics: Through a large amount of image sequence data collected under undisturbed conditions, a distribution curve of the inter-frame consistency prediction coefficient is constructed, and the upper limit of its 95% confidence interval during stable operation is taken as the initial threshold. Combined with production scenario debugging: Typical disturbances (such as vibration, frame skipping, and illumination changes) are introduced during actual light guide plate transmission or rotation. The resulting range of prediction coefficient changes is recorded, and the lower bound of the image frame with significant interference is used as a reference for comparison with the aforementioned initial threshold. Multi-condition fusion setting: Considering that the light guide plate may be operating under different material, surface reflectivity, or background differences, the statistical median value of multiple sample experiments is used as the final first threshold value to ensure the universality of the algorithm and control the misjudgment rate.
[0072] In this invention, the spectral sharpness index is extracted by frequency domain transformation of the image, including the sum of amplitudes in the high-frequency region and the spectral attenuation slope. These are then normalized and their geometric mean is taken to measure the preservation of high-frequency details and the balance of energy distribution in the image. A second threshold is used to determine whether motion blur causes attenuation of high-frequency details in the image. Its goal is to identify whether there is a significant decrease in sharpness in the image. The second threshold is set based on the following: Static sharp image baseline construction: Image samples of the light guide plate are acquired in a completely static state, their spectral sharpness index is calculated, and this is set as the optimal sharpness reference value. Simulated blur interference downsampling: By adjusting the acquisition shutter speed, light guide plate transmission speed, lens focal length, and other conditions, blur interference is gradually introduced, blurry image sequences are acquired, the corresponding spectral sharpness index is calculated, and its lower limit critical point is analyzed. Setting a recognition sensitivity range: The median value of the spectral index of the sharp image is used as the upper limit, and the median value of the index of the typical blurry image is used as the lower limit. A critical recognition value is selected within this range as the second threshold, typically a value at 75% of the range, to adapt to the generalization requirements under dynamic blur changes.
[0073] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0074] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0075] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0076] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0077] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for detecting defects in a light guide plate based on a neural network, characterized in that, Includes the following steps: During the dynamic transmission or rotation of the light guide plate, a series of multiple frames of images on the surface of the light guide plate are continuously acquired; Based on the acquired image sequence, time domain features are extracted, the inter-frame consistency prediction coefficient between the current image frame and multiple adjacent frames is calculated, and the coefficient is compared with a preset first threshold to determine whether the current image frame is interfered with. Interfered image frames are identified as abnormal image frames. For images identified as anomalous image frames, the detection confidence of the neural network in the initial recognition stage is temporarily reduced, and the output of recognition results is paused. Then, the reduced initial confidence of the anomalous image frame is weighted and fused with the recognition confidence of adjacent frames that meet the preset conditions to generate time-series confidence correction parameters. A local sliding window is formed by selecting a group of image frames within the temporal range centered on the abnormal image frame. The frequency domain transformation is performed on the images within the window to calculate the spectral sharpness index of the image and compare it with a second threshold to identify whether there is high-frequency information attenuation due to motion blur. When the spectral clarity index is lower than the preset second threshold, image enhancement processing is performed on the corresponding image. The image after interference identification and blur compensation processing and its corresponding temporal confidence correction parameters are input into the preset neural network model to perform defect feature extraction and classification recognition, and output the type, location and final confidence of the defects on the light guide plate surface.
2. The method for detecting defects in a light guide plate based on a neural network according to claim 1, characterized in that, Continuously acquiring a multi-frame image sequence of the light guide plate surface refers to: By maintaining a preset angle between the preset image acquisition device and the light guide plate transmission path, the image acquisition device can capture multiple consecutive image frames on the surface of the light guide plate in real time during the dynamic transmission or rotation of the light guide plate, and adaptively adjust the image acquisition frequency and inter-frame time interval according to the real-time speed signal of the light guide plate.
3. The method for detecting defects in a light guide plate based on a neural network according to claim 2, characterized in that, The steps for calculating the inter-frame consistency prediction coefficients between the current image frame and its neighboring frames include: The image sequence continuously acquired by the image acquisition device is arranged in chronological order. Gray-level normalization is performed on each frame of the image, and the edge gradient amplitude distribution, global brightness mean, and direction gradient angle histogram are extracted as image temporal features to describe the shape structure, light intensity, and texture direction changes of the light guide plate surface image. The differences between the three types of temporal features of the current image frame and the corresponding features of the adjacent previous and next image frames are calculated. Specifically, these include the cumulative pixel-by-pixel difference of edge gradient, the absolute difference of the mean brightness, and the intersection-union ratio of the histogram of directional gradients. The largest difference among the three is taken as the inter-frame feature change value, which is used to reflect the magnitude of image stability changes. The inter-frame feature change value is normalized by comparing it with the preset image stability reference value to obtain an inter-frame consistency prediction coefficient with a value between zero and one.
4. The method for detecting defects in a light guide plate based on a neural network according to claim 3, characterized in that, Abnormal image frames are determined in the following way: After obtaining the inter-frame consistency prediction coefficient of the current image frame, the coefficient is compared with a preset first threshold. When the consistency prediction coefficient is greater than the first threshold, it is determined that the current image frame has perturbation behavior. Analyze the edge gradient change trend between the current image frame and adjacent image frames. When the edge gradient change rate of the current image frame changes abruptly compared to the previous and next frames, confirm that the perturbation behavior is a discontinuous abrupt change behavior and mark the image frame as an abnormal image frame.
5. The method for detecting defects in a light guide plate based on a neural network according to claim 4, characterized in that, Images identified as abnormal image frames undergo the following processing: After the abnormal image frame is marked, the inter-frame consistency prediction coefficient, image texture complexity value and illumination uniformity value of the image frame are extracted, and the time distribution curves of the three parameters are constructed respectively. Extract multiple unmarked image frames from historical image sequences, calculate the average value of the corresponding parameters, and use this as the feature reference value of the current image frame. Calculate the change magnitude of each parameter and the offset ratio relative to the feature reference value. The inter-frame consistency prediction coefficient is used to reflect image stability, texture complexity is used to reflect the intensity of structural disturbance, and illumination uniformity is used to reflect the degree of optical interference. Based on the maximum value of the offset ratio among the three parameters, a disturbance level index is generated to characterize the disturbance intensity. Based on the magnitude of the perturbation level index, the perturbation level is matched with the value range of the confidence adjustment factor by looking up a table. At the same time, the confidence attenuation coefficient is calculated based on the ratio between the perturbation level and the image sharpness value of the abnormal image frame. After the confidence attenuation coefficient is calculated, it is applied to the output layer confidence function during the initial recognition stage of the neural network to attenuate the initial confidence value of the recognition result. Finally, the recognition data after confidence attenuation is temporarily stored.
6. The method for detecting defects in a light guide plate based on a neural network according to claim 5, characterized in that, The calculation of image texture complexity and illumination uniformity includes the following steps: The image frame is divided into several fixed-size image blocks. The gray-level gradient magnitude and gray-level change direction are calculated for each image block. The standard deviation of the gray-level gradient magnitude and the variance of the direction change are calculated for all image blocks. The average of the two is used as the image texture complexity value of the image frame, which is used to measure the fineness and unevenness of the surface texture structure of the light guide plate. The image frame is divided into multiple regions of equal area. The average brightness of each region is calculated, and the difference between the maximum and minimum average brightness values of the regions is taken as the image brightness discrete value. The overall average brightness of the image is then compared with the brightness discrete value to form a proportional relationship. This proportional value is used as the illumination uniformity value of the image frame to measure the uniformity of the light distribution in the image.
7. The method for detecting defects in a light guide plate based on a neural network according to claim 6, characterized in that, The generation logic for the time series confidence correction parameters is as follows: After the abnormal image frame is marked, the frame images that are closest to it before and after it and have not been judged as abnormal image frames are obtained respectively, and set as the front fusion reference frame and the back fusion reference frame respectively. The abnormal image frame, the pre-fusion reference frame, and the post-fusion reference frame are identified as the three frames to be fused. The confidence adjustment factor corresponding to the three frames is extracted. According to the preset standard, the allocation ratio of the abnormal image frame is determined based on the perturbation level index of the abnormal image frame. The allocation ratio of the pre-fusion reference frame and the post-fusion reference frame is determined based on the time difference between each of them and the abnormal image frame. The allocation ratio of the three frames is normalized to generate their respective weight coefficients. The confidence adjustment factors of the abnormal image frames, the pre-fusion reference frames, and the post-fusion reference frames are then fused according to their respective weight coefficients to obtain the temporal confidence correction parameters.
8. The method for detecting defects in a light guide plate based on a neural network according to claim 7, characterized in that, Spectral clarity refers to: Centered on the abnormal image frame, multiple consecutive image frames within its temporal proximity are selected to form a local sliding window; frequency domain transformation is performed on each image frame within the window in sequence to extract the frequency response information of the image and establish a spectral energy distribution map; In each frame of the spectrogram, the sum of the amplitudes in the high-frequency region and the attenuation slope of the spectral curve in the mid-to-high frequency band are identified as indicators of the degree of attenuation of high-frequency details and sharpness of the image, respectively. The sum of the amplitudes in the high-frequency region is standardized by logarithmic compression, and the attenuation slope is normalized by an inverse proportional function. The two normalized results are geometrically averaged to generate the spectral sharpness index of the image.
9. The method for detecting defects in a light guide plate based on a neural network according to claim 8, characterized in that, Identifying the presence of motion blur includes the following steps: Within a local sliding window, the number of frames with a spectral sharpness index below the second threshold is counted. This number is then compared to the total number of image frames within the window. When this ratio exceeds a set blur recognition trigger threshold, and at least a number of consecutive images meet the condition that the spectral sharpness index is below the second threshold, the image within the local sliding window is determined to have overall motion blur.
10. A light guide plate defect detection system based on a neural network, comprising the light guide plate defect detection method based on a neural network as described in any one of claims 1-9, characterized in that, Specifically, it includes: The image acquisition module is used to continuously acquire multiple frame image sequences of the light guide plate surface during the dynamic transmission or rotation of the light guide plate; The temporal feature extraction module extracts temporal features based on the acquired image sequence and calculates the inter-frame consistency prediction coefficient between the current image frame and adjacent image frames. The interference determination module is used to compare the inter-frame consistency prediction coefficient with a preset first threshold to determine whether the current image frame is interfered with, and to determine the interfered image frame as an abnormal image frame. The confidence adjustment module is used to temporarily reduce the detection confidence of the neural network in the initial recognition stage and pause the output of recognition results for images that are judged to be abnormal. The confidence fusion module is used to weight and fuse the initial confidence of the abnormal image frame with the recognition confidence of the adjacent image frames that meet the preset conditions to generate time-series confidence correction parameters. The frequency domain processing module is used to select a group of image frames within a time range of the abnormal image frame as the center to form a local sliding window, perform frequency domain transformation on the images in the window, and calculate the spectral sharpness index. The blur recognition module is used to compare the spectral clarity index with a second threshold to identify whether there is high-frequency information attenuation due to motion blur, and to perform image enhancement processing on the image. The defect identification module is used to input the image after interference identification and fuzzy compensation processing and its corresponding temporal confidence correction parameters into a preset neural network model to extract and classify defect features, and output the type, location and final confidence of defects on the light guide plate surface.
Citation Information
Cited By
Burr detection method for cutting edge of solid-state battery pole piece
CN121353291A
A burr detection method for solid-state battery electrode sheet cutting edges
CN121353291B
Image processing method based on compensation of dynamic SPECT imaging information deviation
CN121353469A
Catenary component thermal defect detection method based on space-time fusion and vehicle speed normalization
CN121456768A
Catenary component thermal defect detection method based on space-time fusion and speed normalization
CN121456768B
