Optical diffusion plate microstructure defect detection method, electronic device and storage medium
By acquiring and decoupling bright-field and dark-field images of optical diffusers, and combining adaptive calibration optimization, the problems of high false alarm rate of false defects and insufficient detection of small defects in optical diffuser detection are solved, and accurate detection in dynamic environments is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN YUHUI OPTICAL TECH CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies for optical diffuser plate inspection suffer from high false defect rates due to mechanical vibrations and microstructure reflections, making it difficult to adapt to batch variations in product texture and insufficient for detecting minute defects.
By acquiring bright-field images of the same optical diffuser plate area under high-angle vertical light and dark-field images under low-angle grazing light, image registration is performed based on common background features to decouple physical defect features from light and shadow interference features, enhance defect signals and generate candidate regions for suspected defects, determine the actual physical defects by combining geometric laws, and optimize detection parameters through adaptive calibration.
It significantly reduces the false alarm rate of defects, improves the detection capability of minor defects, can adapt to batch differences in product texture, and achieves accurate detection in dynamic environments.
Smart Images

Figure CN121595563B_ABST
Abstract
Description
A method for detecting microstructure defects in an optical diffuser plate, an electronic device, and a storage medium. Technical Field
[0001] This application relates to the field of industrial automated optical inspection technology, specifically to a method for detecting microstructure defects in an optical diffuser plate, an electronic device, and a storage medium. Background Technology
[0002] Optical diffuser plates are key components in LCD backlight modules. Their surfaces are typically precision-molded with continuous hexagonal or three-dimensional convex pyramidal microcrystalline structures to improve light uniformity and transmittance. In industrial production, automated optical inspection systems often employ a combination of high-angle vertical light sources (bright field) and low-angle grazing light sources (dark field) for imaging. By analyzing the differences in images under these two light fields, surface defects such as scratches, black spots, or foreign objects are detected.
[0003] However, in high-speed production lines, diffuser plates experience micron-level mechanical vibrations. When the incident angle of the light source is fixed and the plate vibrates, the refracted highlights within the microstructures cause nonlinear optical drift on the image sensor. Traditional image difference or rigid registration algorithms typically assume that image features only undergo physical translation or rotation, failing to effectively distinguish this optical drift caused by vibrations from pixel grayscale anomalies caused by real foreign objects. This makes the system highly susceptible to misjudging normal microstructure edge signals as defects, generating numerous false alarms and forcing frequent production line shutdowns for verification, severely impacting production efficiency and product quality stability.
[0004] Therefore, there is an urgent need for a detection scheme that can accurately distinguish between optical artifacts and real defects in dynamic environments. Summary of the Invention
[0005] The purpose of this application is to provide a method, electronic device and storage medium for detecting microstructure defects in optical diffusers, in order to overcome the problems of high false alarm rate of false defects caused by mechanical vibration and microstructure reflection in the prior art, insufficient detection capability for small defects, and difficulty in adapting to batch differences in product texture.
[0006] To achieve the above objectives, the first aspect of this application provides a method for detecting microstructure defects in an optical diffuser plate, comprising the following steps:
[0007] Bright-field images of the same optical diffuser region under high-angle vertical light and dark-field images under low-angle grazing light are acquired. Based on the common background features of the microstructure array in the two images, image registration is performed.
[0008] The registered bright-field image and dark-field image are decoupled to extract physical defect feature maps and light and shadow interference feature maps.
[0009] The physical defect feature map is enhanced and upsampled to amplify the defect signal and restore its details. Based on the processed feature map, a set of suspected defect candidate regions is generated using a preset low confidence threshold.
[0010] For each of the suspected defect candidate regions, the geometric patterns of the surrounding normal texture are analyzed, and a virtual reference image is generated when the region is defect-free, based on these patterns. By comparing the differences between the original image of the region and the virtual reference image, it is determined whether the region is a real physical defect, and the corresponding confidence level is output.
[0011] The determination confidence level is compared with a preset defect alarm threshold to determine whether to issue an alarm.
[0012] Furthermore, the method also includes optimization and adaptive calibration steps: during the detection process, samples with a judgment confidence level within a preset fuzzy range are marked as samples to be optimized, multiple preset digital perturbations are applied to the samples to be optimized, the judgment confidence level corresponding to each sample is obtained, the dispersion of multiple judgment confidence levels is calculated, the detection parameters of the method are updated based on the dispersion, and the defect alarm threshold is dynamically adjusted according to the statistical distribution of the judgment confidence levels output in historical detections.
[0013] A second aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, characterized in that the processor executes the program to implement the method described in the first aspect.
[0014] A third aspect of this application provides a computer-readable storage medium having a computer program stored thereon, characterized in that the program, when executed by a processor, implements the method described in the first aspect.
[0015] The beneficial effects of this application are as follows: Compared with the prior art, the method provided in this application acquires a bright-field image of the same optical diffuser region under high-angle vertical light and a dark-field image under low-angle grazing light; performs image registration based on the common background features of the microstructure array in the two images; decouples the registered bright-field image and dark-field image to extract physical defect feature maps and light and shadow interference feature maps; enhances and upsamples the physical defect feature maps to amplify the defect signal and restore its details; based on the processed feature maps, a set of suspected defect candidate regions is generated using a preset low confidence threshold; for each suspected defect candidate region, the geometric rules of its surrounding normal texture are analyzed, and a virtual reference image is generated when the region is defect-free; by comparing the difference between the original image of the region and the virtual reference image, it is determined whether it is a real physical defect, and the corresponding judgment confidence level is output; finally, an alarm is triggered based on the confidence level. This solution can effectively distinguish artifacts caused by mechanical vibrations and microstructure reflections from real physical defects, significantly reduce false alarm rates, and adapt to batch differences in product texture. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0017] Figure 1 is a flowchart illustrating the method for detecting microstructure defects in optical diffusers in some embodiments of this application;
[0018] Figure 2 is a flowchart illustrating the optimization and adaptive calibration steps in some embodiments of this application;
[0019] Figure 3 is a schematic diagram of the architecture of an electronic device in some embodiments of this application.
[0020] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0022] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0023] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0024] In actual production environments, defect detection of optical diffuser plates faces multiple challenges: First, the high-speed transmission of the production line inevitably causes micro-vibrations in the plate, leading to non-rigid misalignment and deformation during image acquisition; second, the micro-prism structure on the diffuser plate surface itself generates strong reflections and shadows that vary with the angle of illumination, and these optical phenomena are easily confused with real physical defects (such as black spots and scratches); third, as the production mold wears down, the microstructure texture of the product surface changes slowly, making traditional fixed template comparison methods difficult to adapt. To systematically solve these technical problems, this application constructs an intelligent detection scheme that can resist interference and self-evolve through a layered and progressive technical architecture. This overcomes the problems of high false defect rates, insufficient detection capability for minute defects, and difficulty in adapting to batch variations in product texture caused by mechanical vibrations and microstructure reflections in existing technologies. The following detailed examples illustrate these challenges.
[0025] Referring to Figure 1, Figure 1 is a flowchart illustrating the method for detecting microstructure defects in optical diffusers in some embodiments of this application.
[0026] The method includes the following steps:
[0027] S1. Acquire bright-field images of the same optical diffuser plate area under high-angle vertical light and dark-field images under low-angle grazing light. Based on the common background features of the microstructure array in the two images, perform image registration.
[0028] S2, decouple the registered bright field image and dark field image, and extract the physical defect feature map and the light and shadow interference feature map;
[0029] S3, enhance and upsample the physical defect feature map to amplify the defect signal and restore its details. Based on the processed feature map, generate a set of suspected defect candidate regions using a preset low confidence threshold.
[0030] S4. For each of the suspected defect candidate regions, analyze the geometric patterns of the surrounding normal texture, and use them as a condition to generate a virtual reference image when the region is defect-free; by comparing the difference between the original image of the region and the virtual reference image, determine whether it is a real physical defect, and output the corresponding determination confidence level.
[0031] S5. The determination confidence level is compared with the preset defect alarm threshold to determine whether to finally issue an alarm.
[0032] In step S1, to achieve synchronous acquisition of dual light field images, an industrial camera with external triggering function is typically used in conjunction with a programmable light source controller. When the diffuser plate is conveyed to the inspection station, the trigger signal controls the high-angle vertical light source (usually a coaxial light or a high-angle ring light) to light up first, and the camera acquires the first bright field image; after an interval of 1-3 milliseconds, the controller turns off the high-angle light source and lights up the low-angle grazing light source (usually a low-angle strip light or a dark field light source), and the camera acquires the second dark field image. Due to the acquisition time difference and the mechanical vibration of the conveyor belt, there is a subpixel-level nonlinear misalignment between the two images.
[0033] To achieve accurate registration, the following processing flow is adopted: First, a pre-trained deep feature extraction network (such as an improved ResNet backbone network) is used to extract deep feature points representing the topological regularity of microstructures from the two images at multiple scales, thereby obtaining feature maps containing microstructure edges, corners and topological connections.
[0034] Then, using a hierarchical attention mechanism in network design, weights are assigned to the feature points, so that the feature points representing the periodic microstructure background of the optical diffuser plate receive higher weights than the feature points deviating from the periodic microstructure background: during the feature matching stage, high weights are automatically assigned to feature points representing large areas and regularly arranged background microstructures, while low weights are assigned to isolated, abnormal, or suspected defect points.
[0035] Finally, based on high-weighted background feature points, an improved RANSAC algorithm is used for feature matching and outlier removal, selecting matching point pairs that conform to the preset overall deformation law and geometric constraints. Then, an elastic transformation model (usually a combination of thin-plate spline transformation or affine transformation) is calculated based on the matching point set. This elastic transformation model is then used to perform bilinear or cubic spline resampling on the second dark-field image, achieving sub-pixel-level spatial alignment between its microstructure background and the first bright-field image. This step effectively compensates for image displacement errors caused by production vibrations, providing a stable coordinate reference for subsequent analysis.
[0036] In step S2, a specially designed dual-channel feature decoupling network is used. This network contains two parallel feature encoding branches, which process the registered bright-field and dark-field images respectively. Each branch consists of multiple convolutional layers and attention modules to extract high-level semantic features of the image. The training process of this network is controlled by the following two constraints, namely the dual-constraint loss function applied during its training phase:
[0037] Consistency loss (L_consistency): Calculates the cosine distance or mean square error between the "shared feature vectors" output from the bright field branch and the dark field branch, forcing the network to extract common feature components that do not change with illumination in the two images, i.e., used to measure the difference between physical defect features extracted from images with different illumination.
[0038] Orthogonality loss (L_orthogonality): Calculate the inner product between the "shared feature vector" and the "unique feature vector" of each branch, and make it approach zero. This forces physical defect features and lighting interference features to be independent of each other in the vector space, achieving complete separation. That is, physical defect features and lighting interference features extracted from each image must meet the correlation requirements used to measure the relationship between the physical defect features and lighting interference features in the feature space.
[0039] After being trained with a large number of positive and negative samples, the feature decoupling network can stably output two parts of features during forward inference: a physical defect feature map (containing information on physical defects such as black spots and scratches) and a light and shadow interference feature map (containing information on changes in illumination such as prism reflections and shadows). This forced decoupling at the feature level distinguishes physical defects from optical artifacts at the data source.
[0040] In step S3, the goal is to enhance the saliency of minor defects and prevent them from being lost during downsampling. First, three statistical operations are performed in parallel along the channel dimension on the physical defect feature map output from S2: global max pooling (capturing the most salient defect response points), global average pooling (obtaining the overall background level of the feature map), and channel standard deviation calculation (evaluating texture complexity). These three statistics are fused and then input into a small fully connected network for further fusion, generating a channel attention weight vector. This weight vector is multiplied channel-by-channel with the original feature map to adaptively enhance suspected defect channels while suppressing background channels. In other words, the physical defect feature map is reweighted to enhance the feature response of the defect region.
[0041] Then, the enhanced low-resolution feature map is input into a content-aware upsampling module (such as CARAFE). This module predicts the upsampling kernel (i.e., sampling offset) at each location based on the local content of the input feature map through a lightweight sub-network, and then reconstructs features based on these dynamic kernels to restore high resolution. This approach better preserves the edge details of minor defects. Finally, on the obtained high-resolution feature map, a Region Proposal Network (RPN) or a low fixed confidence threshold (e.g., 0.2-0.3) is used to generate a large number of candidate bounding boxes covering different scales, forming a set of potential defect candidate regions. This stage employs a high recall strategy to ensure that no potential defects are missed.
[0042] In step S4, the aim is to determine whether each candidate region is a real physical defect, which is implemented as follows:
[0043] First, for each candidate region, a binary mask is generated, and its central part (such as occupying 60%-80% of the region area) is set to zero (masked), while only the outer normal texture area is retained as known conditions.
[0044] Then, the geometric arrangement of the outer texture is analyzed (using directional gradient histograms or lightweight networks) to calculate the geometric constraint field describing the arrangement direction of the hexagonal microstructure.
[0045] Subsequently, the aforementioned peripheral texture image and geometric constraint field are used as conditions and input into a pre-trained conditional generative diffusion model. During training, this model learns the distribution patterns of a large number of normal diffusion plate textures. During inference, it iteratively denoises from random noise, gradually generating images consistent with the given conditions and conforming to physical laws, ultimately outputting a virtual, defect-free reference image of the occluded area.
[0046] Finally, the pixel-by-pixel difference between the original image of the candidate region and the generated virtual reference image is calculated to obtain the residual map. Morphological analysis and connected component extraction are then performed on this residual map. The judgment logic is as follows: if there are isolated connected components with contrast higher than a threshold, area within a certain range, and sharp boundaries, they are judged as real physical defects (such as black spots or broken scratches). If the residual appears as a low-contrast, diffuse, cloud-like structure, or exhibits regular stripes / ripples blending with the surrounding light and shadow gradients, it is judged as an optical artifact (such as prism reflection drift). The judgment result, along with the confidence level, is output.
[0047] In step S5, the determination confidence level output from step S4 is received and processed, and this value is compared in real time with a pre-set and adjustable defect alarm threshold. The comparison is performed through a numerical comparison logic: if the determination confidence level is greater than or equal to the defect alarm threshold, an "alarm" signal is generated; if it is less than the threshold, a "no alarm" signal is generated.
[0048] This "alarm" signal manifests as the generation of a control command data packet with a specific format. This data packet contains at least information such as the alarm status, the corresponding defect location coordinates, and the confidence level, and is sent out through a predefined communication interface (such as an analog signal output port or a network socket following a specific industrial protocol). After receiving this data packet, the downstream production line control equipment (such as a PLC) parses it and executes the corresponding physical operation, such as triggering an audible and visual alarm, starting a marking machine to mark the location, or controlling a robotic arm to perform a rejection action.
[0049] In summary, through the close integration and synergy of the above four steps, the method of this application constructs a complete technical closed loop from image preprocessing, feature separation, defect screening to accurate authentication, realizing stable and accurate detection of microstructural defects of optical diffusers in high-speed dynamic and high-reflectivity interference environments.
[0050] In actual testing, there exists a technical gray area between "clearly normal" and "clearly defective," where the confidence level falls within a preset ambiguity range. This preset ambiguity range typically uses the aforementioned low confidence threshold as its lower bound and the aforementioned defect alarm threshold as its upper bound. Such samples are often a contributing factor to false alarms or missed detections, and their causes mainly include:
[0051] Extreme simulation of optical phenomena: The refraction or shadow produced by normal microstructures under specific mechanical vibration and light coupling may reach the visual limit of being extremely similar to real shallow scratches or foreign objects, making it difficult for the model to make a confident judgment.
[0052] Weak or blurred features of defects: such as semi-transparent foreign objects, very shallow indentations, or tiny flaws that are close to the detection limit. Their feature signal intensity is low and the contrast with the background is poor, causing the features extracted by the model to be near the classification boundary.
[0053] Natural fluctuations in the production process: batch differences in raw materials, gradual wear of molds, or changes in environmental temperature and humidity can cause a slow drift in the statistical characteristics of the product background texture, making the originally defined classification boundaries temporarily unsuitable for some areas of the new batch of products.
[0054] The existence of these fuzzy samples reflects the inherent decision-making uncertainty of a fixed model in a dynamic production line environment. To address this issue, this application also provides the following specific online optimization and adaptive calibration steps.
[0055] Referring to Figure 2, the method further includes an optimization and adaptive calibration step S6.
[0056] S6. During the detection process, samples with a judgment confidence level within a preset fuzzy range are marked as samples to be optimized. Multiple preset digital perturbations are applied to the samples to be optimized to obtain the judgment confidence level corresponding to each sample. The dispersion of multiple judgment confidence levels is calculated. The detection parameters of the method are updated based on the dispersion. The defect alarm threshold is dynamically adjusted according to the statistical distribution of the judgment confidence levels output in historical detections.
[0057] This step aims to achieve continuous self-optimization of the detection method and adaptation to the production environment. The specific implementation is as follows:
[0058] First, the system monitors the final decision confidence level of each detected sample in real time. A clear threshold for the ambiguity range is set; for example, samples with a confidence level between 40% and 60% are classified as "fuzzy decision samples" (i.e., the model's judgment on whether they belong to defects or background is unclear). These samples typically correspond to technical challenges, such as prism reflections at the limit of optical drift, shallow pressure marks with extremely faint features, or semi-transparent foreign objects. The system automatically stores these fuzzy samples, along with their corresponding multi-field original image patches, intermediate features, and current model parameter snapshots, into a dedicated circular cache queue (difficult example mining queue) without immediately triggering a final alarm, providing a data foundation for subsequent optimization.
[0059] Then, for each sample to be optimized in the queue, the system does not rely on expensive and lagging manual annotation, but instead adopts a self-supervised group relative evaluation strategy to evaluate the decision quality of the current model on that sample.
[0060] The specific method is as follows:
[0061] Generate a micro-perturbation sample group: Apply a series of preset digital perturbation transformations to the original sample image, such as: adding low-variance Gaussian noise (simulating sensor noise), performing sub-pixel-level random translation (within ±1 pixel), or applying a small amount of random fluctuation in brightness / contrast (simulating small changes in illumination). Each perturbation generates a variant, which together form a perturbation sample group containing N samples (e.g., N=16).
[0062] The following are examples of the preset digital perturbation transformation parameters:
[0063] Gaussian noise perturbation: Add Gaussian noise with a mean of 0 and a standard deviation of 0.1% to 1% of the original image's grayscale range (0-255), for example, a standard deviation of 0.5;
[0064] Geometric translation perturbation: Independent random translations are performed in the X and Y axes, with the translation amount uniformly distributed within the range of ±0.5 pixels to ±2 pixels, for example, a translation amount of ±1 pixel;
[0065] Brightness and contrast perturbation: Apply random adjustments to the image brightness within the range of -5% to +5%, and apply random adjustments to the contrast within the range of -2% to +2%.
[0066] Perform group inference and consistency analysis: Input the entire perturbation group into the current defect detection model in sequence, and record the model's output confidence for each variant in the group.
[0067] Calculate the relative advantage index: Calculate the variance of the confidence scores of the N outputs for this group. A small variance value indicates that the model's decision-making is stable for this type of sample; small input perturbations do not cause drastic fluctuations in judgment, and the decision path has a relative advantage. A large variance value indicates that the model's decision-making is unstable and easily affected by interference; it is essentially in a "guessing" state, and the decision path is at a "relative disadvantage." This variance value is the core quantitative indicator for evaluating the model's performance on this fuzzy sample.
[0068] Then, based on the variance index calculated above, a lightweight online backpropagation update is performed. Specifically, the implementation is as follows:
[0069] Construct a reinforcement loss function specifically for fuzzy samples. The core term of this function is the prediction variance penalty term, which directly minimizes the variance of the perturbation group's prediction results. Simultaneously, a confidence polarization incentive term can be incorporated to encourage the model to output confidence levels closer to 0 or 1 (e.g., using a hyperbolic tangent-based loss term).
[0070] This loss function only calculates and updates the gradients of the parameters of the classification layer (or decision head) at the very end of the model. These parameters are then fine-tuned using optimization algorithms (such as online SGD or Adam). Mathematically, this process is equivalent to "pushing" or "sharpening" the classification hyperplane in the fuzzy region of the feature space (corresponding to confidence levels of 40%-60%), forcing the feature vectors of samples that originally fell into this region to be pushed toward the clear background side (confidence levels approaching 0) or the defect side (confidence levels approaching 100%), thereby achieving local optimization of the decision boundary.
[0071] Finally, to address the overall product characteristic drift caused by different production batches (such as different mold numbers or different raw material batches), this embodiment introduces a statistically based threshold adaptive mechanism:
[0072] Distribution monitoring: Continuously calculate the final judgment confidence of all detected samples (not just fuzzy samples) within a recent period (e.g., the last 1000 or 1 hour) and plot their probability distribution histogram.
[0073] Drift detection and compensation: Analyze the central tendency (e.g., median) and shape of the distribution. For example, if the microstructure reflectivity of a batch of products is generally enhanced, it may cause the confidence distribution of a large number of normal samples to shift towards the high-value area (defect side), increasing the risk of false alarms. After detecting this shift, a dynamic safety margin is calculated based on the preset target over-rejection rate (False Rejection Rate), and the final alarm threshold is adjusted upwards accordingly (e.g., from the default 50% to 52% or 55%). Conversely, if the distribution shifts to the left, the threshold is adjusted downwards accordingly.
[0074] This closed-loop feedback mechanism ensures that the detection system can automatically adapt to long-term process fluctuations in the production line without manual recalibration or parameter adjustment, maintaining the false alarm rate and missed detection rate at a stable and controllable level.
[0075] To facilitate understanding of the overall solution, the following three typical production scenario examples illustrate how the method provided in this application is applied to the testing system of an actual production line. It should be emphasized that this application does not limit the specific structure or form of the testing system.
[0076] Example 1: Extremely high sensitivity detection of tiny black speckle foreign objects (toner).
[0077] Carbon powder particles with a diameter of less than 0.05 mm are mixed in with the raw materials of the diffuser plate. The physical size of such defects is...
[0078] They are extremely small and appear as dark absorption points in terms of optical properties, making them easily obscured by the complex shadows of the hexagonal microstructure, and traditional methods are prone to missing them.
[0079] Method application process:
[0080] High-speed conveying on the production line caused slight vibrations in the sheet metal. In the acquired bright-field and dark-field images, there was a sub-pixel misalignment between the black dots and the surrounding prism shadows. By using feature-level elastic registration, the elastic transformation field was calculated based on the large-area normal prism texture. The dark-field image was then resampled to ensure that the physical coordinates of the black dots in the two images were precisely aligned, thus eliminating positional jitter interference.
[0081] The aligned image is decoupled from the input features of the network. Since black dots are solids, they exhibit stable light absorption characteristics in both bright and dark fields (modality-invariant features); while prism shadows change significantly with the illumination angle (modality-specific features). Through built-in orthogonality constraints, the network effectively separates the light and shadow feature vectors, and the black dot signals are initially purified in the output physical defect feature map.
[0082] To address the issue of weak black spot signals, the multi-dimensional collaborative enhancement module performs parallel operations such as global maximum pooling on the physical defect feature map to lock the local grayscale extreme values caused by the black spot. Then, through content-aware dynamic upsampling, pixels are reconstructed according to texture flow when restoring high resolution, ensuring that the edges of the black spot are not blurred or divergent. Subsequently, candidate boxes are generated with a low confidence threshold (e.g., 0.15) to ensure that the black spot is 100% captured.
[0083] For this candidate region, the system masks its center while preserving the normal texture of the periphery. The conditional generative diffusion model, using the periphery texture and its geometric regularities as conditions, infers a perfect prism image that should exist at that location as a reference. Comparison reveals that the residual contour presents as an isolated, circular, high-contrast connected region.
[0084] For example, if a connected component exists that satisfies one of the following conditions, it is considered a real physical defect:
[0085] Contrast significance condition: The average gray value of the connected component is higher than the overall average gray value of the residual map.
[0086] The value is 2 to 5 times higher, or more than 3 times higher than the overall grayscale standard deviation of the residual plot;
[0087] (2) Size reasonableness condition: The pixel area of the connected region accounts for 10% to 70% of the area of the suspected defect candidate region, and the absolute number of pixels is between 4 and 500 pixels;
[0088] (3) Edge sharpness condition: The average gradient magnitude of the boundary pixels of the connected domain is more than 1.5 times the average gradient magnitude of the residual map as a whole;
[0089] (4) Spatial isolation condition: The Euclidean distance between the centroid of the connected component and the centroid of any other connected component in the image whose gray value is more than twice the overall average value is greater than three times the equivalent diameter of the connected component.
[0090] Assuming the black spot is extremely light in color, the model's output confidence level is 0.58, falling within a preset fuzzy range (e.g., 0.4-0.6). The system marks it as a sample to be optimized, without immediately triggering an alarm. During the background optimization cycle, a small noise perturbation is applied to the sample image to evaluate the stability of the model's multiple decisions, and the network parameters are fine-tuned accordingly. Simultaneously, based on the recent batch confidence distribution, the system determines that the characteristics of this type of sample are stable, and dynamically fine-tunes the defect alarm threshold from 0.6 to 0.58, enabling the sample to trigger an alarm in subsequent detections, thereby achieving accurate capture and decision optimization for extremely subtle defects.
[0091] Example 2: Adaptive detection of texture passivation caused by mold aging
[0092] As the production molds wear down, the edges of the hexagonal prisms on the surface of the pressed diffuser plate gradually become rounded, and the overall reflectivity decreases.
[0093] Darker colors and blurred textures. Traditional algorithms based on fixed templates produce a large number of false alarms, misclassifying normal products as defects.
[0094] Method application process:
[0095] Even with blunted textures, the elastic registration module can still align the image based on the overall topological arrangement of the microstructure array. The feature decoupling network has already encountered textures of different sharpness during training through cross-domain blending enhancement, so it can recognize "blunted edges" as a global domain feature (style) and suppress it as a light and shadow interference feature, rather than misjudging it as a local defect.
[0096] The feature enhancement and candidate box generation modules focus on local abrupt changes, while the overall blunted background is smoothed. A key step is the verification of authenticity: the generative model uses the actual outer texture after wear as a condition, and the generated "virtual reference image" is naturally also a "normal texture after wear." Comparing the original image of the test area with this reference image, the two are highly consistent in overall style and detail, and the residual images show no significant structural differences.
[0097] Therefore, the system outputs a very low confidence level (e.g., 0.05), far below the alarm threshold, and is thus judged as "no defect," without triggering an alarm. Simultaneously, the system monitors that the confidence level distribution of all samples in the current batch has shifted to the left (biased towards 0). Based on this, the optimization and calibration module automatically lowers the defect alarm threshold (e.g., from 0.6 to 0.55), establishing a more lenient but reasonable judgment standard that matches this stage of mold wear, thereby completely avoiding systemic false alarms caused by mold aging.
[0098] Example 3: Robust Removal of Strong Halo Artifacts under Highly Reflective Materials
[0099] Some high-enhancement-rate diffuser plates may produce strong "ghosting" or halos under certain lighting conditions.
[0100] It has an irregular shape and looks very much like water stains or oil stains to the naked eye.
[0101] Method application process:
[0102] The physical coordinates were locked through dual-field registration. During the feature decoupling stage, the network discovered that the halo signal behaved completely differently in bright and dark fields, failing to satisfy "modal invariance." Furthermore, its feature distribution was orthogonal to the actual physical defect features. Therefore, the signal was forcibly classified and separated into the "light and shadow interference feature" channel, where it was significantly suppressed in subsequent detection.
[0103] Even if some strong halo features are included in subsequent processes, during the authenticity verification stage, the generative model will "infer" the halo shape that should appear at that location under physical laws based on the surrounding lighting environment. Therefore, the generated reference image and the original image both contain similar halos, and the residual after subtracting the two is extremely small, with the residual shape being diffuse and gradually changing. Based on this, the system determines it to be an optical artifact, outputs a low confidence level (e.g., 0.10), and does not trigger an alarm.
[0104] The system records the successfully removed, high-confidence artifact samples into the optimization queue, and confirms through micro-perturbation testing that the model's judgment on this type of feature is stable and correct. This process further strengthens the model's decision boundary for distinguishing strong halos from real stains and improves the system's immunity to similar interference in the future.
[0105] The above embodiments demonstrate that the method described in this application forms an adaptive and robust intelligent detection closed loop capable of handling various complex scenarios such as minor defects, background changes, and strong interference.
[0106] Additionally, referring to Figure 3, this application also provides an electronic device 100, including a processor 101 and a memory 102. The memory stores a computer program, and when the processor executes the program, it implements the above-described method for detecting microstructure defects in optical diffusers.
[0107] Finally, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for detecting microstructure defects in optical diffusers.
[0108] Accordingly, the electronic device and computer-readable storage medium have the same technical effects as the above-described method, which will not be elaborated further here.
[0109] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0110] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0111] The above are merely optional embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made based on the inventive concept of this application and the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included within the patent protection scope of this application.
Claims
1. A method for detecting microstructural defects in an optical diffuser plate, characterized in that, Includes the following steps: Bright-field images of the same optical diffuser region under high-angle vertical light and dark-field images under low-angle grazing light are acquired. Image registration is performed based on the common background features of the microstructure array in the two images. The image registration process specifically includes: extracting deep feature points representing the topological regularity of the microstructure from the acquired images; assigning weights to the feature points, such that feature points representing the periodic microstructure background of the optical diffuser receive higher weights than feature points deviating from the periodic microstructure background; based on the high-weight feature point matching relationship, selecting matching point pairs that meet preset geometric constraints and calculating the elastic transformation model between the images; and spatially resampling the images according to the elastic transformation model. The process involves aligning the images; decoupling the registered bright-field and dark-field images to extract physical defect feature maps and light and shadow interference feature maps; enhancing and upsampling the physical defect feature maps to amplify the defect signal and restore its details; and generating a set of suspected defect candidate regions based on the processed feature maps using a preset low-confidence threshold. The enhancement and upsampling process specifically includes: performing global maximum pooling, global average pooling, and channel standard deviation calculation on the physical defect feature maps; fusing the pooling and channel standard deviation calculation results to generate a channel attention weight vector; and reweighting the physical defect feature maps accordingly. The reweighted physical defect feature map is upsampled, and the sampling offset is dynamically calculated based on the geometric flow of the microstructure texture in the physical defect feature map. The physical defect feature map is then reconstructed based on the offset. For each suspected defect candidate region, the geometric pattern of its surrounding normal texture is analyzed, and a virtual reference image is generated when the region is defect-free. By comparing the difference between the original image of the region and the virtual reference image, it is determined whether it is a real physical defect, and the corresponding determination confidence level is output. The step of determining whether it is a real physical defect specifically includes: for each region in the set of suspected defect candidate regions, masking its central part and preserving its surrounding texture. The process involves: constructing a geometric constraint field representing the geometric regularity of the outer texture; using the outer texture and the geometric constraint field together as conditions, and inferring a virtual reference image of the masked region through a generative model; calculating the residual image between the original image and the virtual reference image; if the contour of the residual meets a preset condition, it is determined to be a real defect, otherwise it is determined to be an artifact; the generative model is a conditional diffusion model; the step of using the outer texture and the geometric constraint field together as conditions specifically involves encoding both into a condition vector, inputting it into the conditional diffusion model, and generating the virtual reference image through an iterative denoising process; comparing the determination confidence with a preset defect alarm threshold to determine whether to finally trigger an alarm.
2. The method according to claim 1, characterized in that, The method further includes optimization and adaptive calibration steps: during the detection process, samples with a judgment confidence level within a preset fuzzy range are marked as samples to be optimized, various preset digital perturbations are applied to the samples to be optimized, the judgment confidence level corresponding to each sample is obtained, the dispersion of multiple judgment confidence levels is calculated, the detection parameters of the method are updated based on the dispersion, and the defect alarm threshold is dynamically adjusted according to the statistical distribution of the judgment confidence levels output in historical detections.
3. The method according to claim 1, characterized in that, The step of extracting the physical defect feature map and the light and shadow interference feature map is achieved by training a feature decoupling network. The training process of this network is controlled by the following two constraints: consistency loss, which is used to measure the difference between physical defect features extracted from images with different lighting conditions; and orthogonality loss, which is used to measure the correlation between the physical defect features and the light and shadow interference features.
4. The method according to claim 2, characterized in that, The preset fuzzy interval has the preset low confidence threshold as its lower bound and the defect alarm threshold as its upper bound.
5. An electronic device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, When the processor executes the program, it implements the method according to any one of claims 1 to 4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method described in any one of claims 1 to 4.
Citation Information
Patent Citations
EPE co-extrusion adhesive film surface defect detection system based on image recognition
CN121392548A