A method for detecting dark scratches on the surface of a black chip plastic package

CN122524820APending Publication Date: 2026-08-07SHENZHEN CHENYUE STORAGE ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN CHENYUE STORAGE ELECTRONIC TECH CO LTD
Filing Date
2026-06-30
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

由于暗划痕深度极浅、对比度极低,且其表面通常覆盖有高功率激光烧蚀形成的印刷字符,导致暗划痕的几何散射弱信号极易被强字符背景的辐射光晕所掩盖,传统2D视觉算法无法在线有效分离

Benefits of technology

[0017]The beneficial effects of this application are as follows: by controlling the extremely low incident angle of 4.0 to 5.0 degrees and the complementary exposure illumination of short-wave ultraviolet and long-wave infrared dual spectra, the geometric scattering characteristics of weak dark scratches are maximized; by synthesizing a reference image under the defect-free assumption through a symmetrical scaling feature transformation model, and by performing pixel-level point-by-point subtraction and division, the physical interference of strong printed characters and spatial illumination inhomogeneity is removed; by using an optimal cost model and its hyperparameter closed-loop chord distance calibration adaptive noise reduction, isolated noise points of individual pixels are eliminated and overly smooth scratch edges are prevented; by using small grid feature retention quotas and multi-dimensional index discrimination, the detection robustness of micron-level defects is greatly improved, demonstrating significant technological advancement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122524820A_ABST
    Figure CN122524820A_ABST
Patent Text Reader

Abstract

The application discloses a method for detecting dark scratches on the surface of a black chip plastic package. The method is implemented based on a physical device, which comprises a synchronous photosensitive digital image collector perpendicular to the plane to be detected and provided with a front-end telecentric imaging lens, and an alternating ring-shaped light source with an included angle limited to 4.0-5.0 degrees. A time sequence generator controls the alternating exposure of the light source and the collector to obtain position-aligned short-wave ultraviolet and long-wave infrared images. The infrared image is input into a feature transformation model to generate a healthy ultraviolet reference image, the two images are subtracted and zero-truncated to generate a pure image, then the pure image is subjected to point-by-point division, high-pass fluctuation selector filtering and optimized cost model smoothing and denoising to generate a high-definition noise-free defect feature map, finally, the defect physical area is grouped by dividing a local small grid, applying a feature reservation quota limit and calculating a comprehensive score, and the dark scratch is determined by clustering and merging the defect physical area group, and calculating the length of the longest axis and the aspect ratio. The method realizes the accurate stripping and detection of dark scratches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of automated optical inspection (AOI) and semiconductor back-end packaging defect detection technology, specifically relating to a method for detecting dark scratches on the surface of a black chip plastic package. Background Technology

[0002] During the semiconductor packaging and testing phase, micron-sized dark scratches often appear on the surface of black chip plastic packages due to physical friction. Because these dark scratches are extremely shallow and have very low contrast, and their surfaces are usually covered with printed characters formed by high-power laser ablation, the weak geometric scattering signals of the dark scratches are easily masked by the radiation halo of the strong character background, making it impossible for traditional 2D vision algorithms to effectively separate them online.

[0003] Meanwhile, industrial online inspection faces two major challenges: First, low-angle ring light sources are prone to spatial illumination non-uniformity due to light-emitting element attenuation or installation bias during long-term operation, manifesting as low-frequency, slowly varying background interference that hinders the segmentation of low-contrast defects in images. Second, the inherent micro-roughness of the plastic packaging surface introduces a large number of high-frequency random noise points, while existing total variational smoothing denoising models rely entirely on static configuration of core hyperparameters such as the filter cutoff frequency and smoothing metric coefficients based on manual experience. In automated online inspection, as the roughness of chip batches fluctuates, static parameters are easily rendered ineffective, leading to excessive smoothing that obscures the edges of fine scratches, or insufficient denoising that causes dense false alarms. Existing technologies lack a means to perform online closed-loop adaptive optimization and accurately calibrate smoothing parameters based on the noise characteristics of the measured image.

[0004] Therefore, how to resolve the contradictions between strong text interference, uneven spatial lighting, and distortion of noise reduction parameters, and meet the online detection requirements of semiconductor industrial lines for low false alarms and low missed detections, is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] To address the aforementioned technical issues, this application provides a method for detecting dark scratches on the surface of black chip plastic packaging, which enables efficient and accurate identification and automated rejection control of subtle dark scratch defects.

[0006] The detection method is implemented based on a physical device layout, which includes: A synchronous photosensitive digital image acquisition unit is installed directly above the conveyor belt of the production line and perpendicular to the normal direction of the chip detection plane. The front end of the synchronous photosensitive digital image acquisition unit is equipped with a parallel optical path distortion-free telecentric imaging lens and employs a full-frame pixel synchronous shutter mode. An alternating annular line light source is mounted around the telecentric imaging lens. The alternating annular line light source integrates a short-wave ultraviolet light-emitting element and a long-wave infrared light-emitting element. The angle between the light emission direction of the short-wave ultraviolet light-emitting element and the long-wave infrared light-emitting element and the horizontal plane of the upper surface of the chip under test is limited to 4.0 degrees to 5.0 degrees.

[0007] The detection method includes the following collaborative processing control flow: The alternating ring-shaped line light source and the synchronous photosensitive digital image acquisition device are controlled by a microsecond-level hardware timing generator to perform alternating dual-spectral exposure, thereby acquiring short-wave ultraviolet scattering images and long-wave infrared transmission images of the same black chip under test; and spatial relative displacement compensation is performed on the short-wave ultraviolet scattering images and long-wave infrared transmission images to obtain pixel-level position-aligned dual-spectral image pairs. The long-wave infrared transmission image in the dual-spectral image pair is input into a symmetric scaling feature transformation model to obtain the theoretical healthy ultraviolet reference image under the defect-free assumption. Using the theoretical healthy ultraviolet reference image, the short-wave ultraviolet scattering image in the dual-spectral image pair is pixel-by-pixel reduced, and zero value is truncated when the difference is negative, to generate a clean scratch inspection image; The clean scratch image to be inspected is divided pixel by pixel by the long-wave infrared transmission image to generate an initial contrast image; The initial contrast image is transformed into the fluctuation frequency distribution domain. A high-pass fluctuation selector based on a set cutoff fluctuation threshold is used to filter out image components with spatial fluctuation frequencies lower than the cutoff fluctuation threshold. The image is then restored and reconstructed through inverse transformation to generate a high-fidelity contrast image. The high-fidelity contrast image is smoothed and denoised using an optimization cost model consisting of a logarithmic fidelity term and a total variational smoothing penalty term, generating a high-definition noise-free defect feature map. The high-definition noise-free defect feature map is divided into several non-overlapping local small grids. The comprehensive feature score of the candidate defect pixels is calculated in each local small grid and a feature retention quota limit is applied. The retained candidate defect pixels are merged and connected component clustering is performed to package them into independent defect physical region groups. The length-diameter value and aspect ratio of each group of defective physical regions along the longest geometric axis are calculated. When the length-diameter value and aspect ratio reach the set scratch discrimination threshold, the group of defective physical regions is determined to belong to the target surface dark scratch defect and a rejection instruction signal is output to the main control system of the production line.

[0008] As a preferred embodiment, inside the alternating annular line light source, multiple short-wave ultraviolet light-emitting elements and multiple long-wave infrared light-emitting elements are coplanarly soldered onto the same annular aluminum-based circuit board in an alternating arrangement, so that the first irradiation light field formed on the chip surface when the short-wave ultraviolet light-emitting element is lit alone, and the second irradiation light field formed on the chip surface when the long-wave infrared light-emitting element is lit alone, are axially symmetrical and uniformly overlapped in terms of spatial geometric illuminance.

[0009] As a preferred embodiment, the step of performing spatial relative displacement compensation on the short-wave ultraviolet scattering image and the long-wave infrared transmission image to obtain a pixel-level aligned dual-spectral image pair specifically includes: controlling the synchronous photosensitive digital image acquisition device to continuously capture the image of the conveyor belt area, and opening a fixed pixel area at the geometric center of the image as a specific monitoring image window to read the average brightness change of two adjacent frames in real time; when the difference judgment value between two adjacent frames is greater than or equal to 15 brightness levels, instantaneously sending a start trigger pulse to the microsecond-level hardware timing generator; based on the microsecond-level hardware timing generator outputting a fixed-width current driving pulse to each of the short-wave ultraviolet emitting elements at a set start time, simultaneously controlling the synchronous shutter to open for exposure to acquire and buffer the generated image. The short-wave ultraviolet scattering image; after the exposure of each of the short-wave ultraviolet emitting elements is completed, the alternating ring line light source is kept completely off, maintaining a physical waiting delay of 5.0 milliseconds; after the delay time is completed, a fixed-width current driving pulse is output to each of the long-wave infrared emitting elements, and the synchronous shutter is controlled to open for exposure to acquire and buffer the long-wave infrared transmission image, and the total time for alternating illumination of each of the short-wave ultraviolet emitting elements and each of the long-wave infrared emitting elements for two exposures is controlled within 10 milliseconds; according to the set travel speed of the conveyor belt, the long-wave infrared transmission image is shifted and aligned by a pixel width of 1 pixel in the opposite direction of the chip's travel, completing the pixel-level position alignment of the dual-spectrum image pair.

[0010] As a preferred embodiment, the symmetric scaling feature transformation model includes interconnected feature level compression channels, symmetric feature recovery and reconstruction channels, and skip connection paths established between the same size levels of the feature level compression channels and the symmetric feature recovery and reconstruction channels. The step of inputting the long-wave infrared transmission image from the dual-spectrum image pair into the symmetric scaling feature transformation model to obtain the theoretical healthy ultraviolet reference image under the defect-free assumption specifically includes: performing multi-level downsampling on the input long-wave infrared transmission image through the feature level compression channels to compress and extract character contour features; performing multi-level upsampling using the symmetric feature recovery and reconstruction channels to gradually restore the image size and limit the pixel brightness level at the reconstruction output to within the normalized value range; and directly introducing the gray-scale abrupt change information of the character stroke edges that does not include multi-level downsampling loss using the skip connection paths to synthesize and output the theoretical healthy ultraviolet reference image at the reconstruction output of the symmetric feature recovery and reconstruction channels.

[0011] As a preferred embodiment, the step of dividing the clean scratch image to be inspected by the long-wave infrared transmission image pixel by pixel to generate an initial contrast image specifically refers to adding a zero-resistance constant to the numerator pixel of the clean scratch image to be inspected, and then dividing it point by point with the denominator pixel of the long-wave infrared transmission image at the corresponding coordinates.

[0012] As a preferred embodiment, the cutoff fluctuation threshold of the high-pass fluctuation selector is set to 120 cycles / mm, and the filter order of the high-pass fluctuation selector is set to 2nd order.

[0013] As a preferred embodiment, the step of using an optimization cost model composed of a logarithmic fidelity term and a total variational smoothing penalty term to smooth and denoise the high-fidelity contrast image and generate a high-definition noise-free defect feature map specifically includes: scanning the coordinates of all pixels with brightness values ​​greater than zero in the high-fidelity contrast image to define the photosensitive masking region; obtaining preliminary denoised images under each trial smoothing metric coefficient using a discrete grid iterative optimization algorithm, and combining the theoretical local gray mean and theoretical local gray variance of each pixel position calculated by a zero-truncation photon count probability distribution model to standardize and reduce the measured contrast image to output a standardized random noise residual map; and converting the standardized random noise residual map to... After frequency domain analysis, the random noise dispersion uniformity is determined by calculating the ratio of the fourth power summation to the squared power summation of the fluctuation amplitude values ​​at each frequency coordinate point. A geometric reference chord connecting the coordinates of the first and last test nodes is established, and the signed vertical distance from each coordinate point to the geometric reference chord is calculated based on the vector cross product. The smoothing metric coefficient corresponding to the maximum positive vertical distance value among the signed vertical distances is calibrated as the optimal smoothing metric coefficient. The number of test smoothing metric coefficients is set to 150. The optimal smoothing metric coefficient is introduced into the optimization cost model for reconstruction calculation to generate the high-definition noise-free defect feature map.

[0014] As a preferred embodiment, the application of feature retention quota limit means that within each local small grid with a geometric size of 128×128 pixels, all candidate defect pixels are sorted in descending order according to the comprehensive feature score, retaining only the top 15% of candidate pixels with the highest feature scores, and forcibly setting the brightness value of the remaining candidate defect pixels that exceed the quota limit to zero.

[0015] As a preferred embodiment, the step of calculating the comprehensive feature score of candidate defect pixels within each local small grid specifically refers to obtaining the score by weighting and summing the local edge direction gradient consistency value, translation stability metric value within the local sliding window, contrast value, and spatial geometric linear extension continuity prediction value of the candidate defect pixels, and then subtracting the crowding and disorder metrics of isolated noise points of individual pixels.

[0016] As a preferred embodiment, the scratch discrimination threshold is specifically defined as follows: the major diameter is greater than or equal to 20 micrometers and the aspect ratio is greater than or equal to 5.0.

[0017] The beneficial effects of this application are as follows: by controlling the extremely low incident angle of 4.0 to 5.0 degrees and the complementary exposure illumination of short-wave ultraviolet and long-wave infrared dual spectra, the geometric scattering characteristics of weak dark scratches are maximized; by synthesizing a reference image under the defect-free assumption through a symmetrical scaling feature transformation model, and by performing pixel-level point-by-point subtraction and division, the physical interference of strong printed characters and spatial illumination inhomogeneity is removed; by using an optimal cost model and its hyperparameter closed-loop chord distance calibration adaptive noise reduction, isolated noise points of individual pixels are eliminated and overly smooth scratch edges are prevented; by using small grid feature retention quotas and multi-dimensional index discrimination, the detection robustness of micron-level defects is greatly improved, demonstrating significant technological advancement. Attached Figure Description

[0018] To more clearly illustrate the solution of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram illustrating the physical device layout for a method of detecting dark scratches on the surface of a black chip encapsulation, provided in one embodiment of this application.

[0020] Figure 2 This is a flowchart illustrating a method for detecting dark scratches on the surface of a black chip plastic package, provided as an embodiment of this application.

[0021] Figure 3 This is a geometric diagram illustrating the principle of determining the curve inflection point using the chord distance positioning method in this application. Detailed Implementation

[0022] The technical solutions in this application will be clearly and completely described below. 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 protection scope of this application. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0023] The method described in this application is implemented based on a highly precise hardware spatial physical layout, such as... Figure 1 As shown, the physical device is laid out as a coaxial vertical imaging architecture consisting of three core optoelectronic layers.

[0024] Synchronous photosensitive digital image acquisition unit 110: As the top-level photoelectric signal conversion unit, it is installed directly above the conveyor belt of the production line. Its optical axis mounting line strictly coincides with the normal direction of the horizontal plane of the chip detection carried by the conveyor belt (i.e., maintaining a 0.0° vertical top-down imaging configuration), and it adopts a global shutter mode to eliminate geometric motion blur caused by line exposure time differences during high-speed movement. The acquisition unit has a pixel resolution of 2048×2048, and the physical size of the photosensitive surface of a single pixel on the photosensitive chip is 3.45 micrometers.

[0025] Parallel optical path distortion-free telecentric imaging lens 120: mounted at the front end of the synchronous photosensitive digital image acquisition unit 110. Utilizing the constant object-side magnification characteristic of the telecentric imaging lens, it eliminates perspective distortion ("nearer is larger, farther is smaller") caused by conveyor belt mechanical vibration and minute thickness fluctuations on the chip surface, ensuring a uniform and strictly consistent pixel spatial scale throughout the acquired digital image. The installation height is adjusted to stabilize the vertical working distance between the foremost lens element and the upper surface of the chip under test at 110 mm ± 5 mm, ensuring the detection field of view is within the lens's depth of field.

[0026] Alternating ring-shaped line light source 130: Mounted around the periphery of the telecentric imaging lens 120. To capture extremely weak and minute surface defects, this application employs a special assembly layout that is "closely aligned with the pipeline and extremely low in height" in terms of hardware space. Specifically, the angle θ (incident angle) between the physical optical axis of the emitted beam from the alternating ring-shaped line light source 130 and the horizontal plane of the chip surface is strictly limited to an ultra-low grazing incidence range of 4.0° to 5.0°, preferably 4.5°. The vertical height between the light-emitting surface of the light source and the chip surface is maintained at 15 mm ± 1 mm, ensuring that the obliquely incident light rays converge precisely in the center of the lens's field of view.

[0027] The light source integrates two independently controlled semiconductor light-emitting arrays. The first array is a short-wave ultraviolet light-emitting element 131 with a center wavelength of 365 nm ± 5 nm, and a first linear polarizer with a polarization direction perpendicular to the normal of the incident light surface is attached to the front of its light-emitting surface; the second array is a long-wave infrared light-emitting element 132 with a center wavelength of 850 nm ± 10 nm, and a second linear polarizer with the same polarization direction is attached to the front of its light-emitting surface.

[0028] like Figure 1The enlarged view shows that inside the alternating annular line light source 130, multiple short-wave ultraviolet emitting elements 131 and multiple long-wave infrared emitting elements 132 are not arranged separately, but rather in a highly symmetrical, angularly staggered arrangement, coplanarly soldered onto the same annular aluminum-based circuit board. A long-wave infrared emitting element 132 is sandwiched between any two adjacent short-wave ultraviolet emitting elements 131, forming a concentric, angularly alternating mixed-assembly structure.

[0029] As the black molded chip travels on the conveyor belt, its surface contains normal rough matte microtexture, printed character areas, and dark scratch defect areas with micron-deep and weak optical contrast.

[0030] When the exit angle θ > 10.0°, a large amount of diffuse reflection from the plastic seal surface and strong asymmetric scattering from the character edges will enter the telecentric imaging lens 120, resulting in extremely high background noise, and the weak dark scratch signal will be completely obscured by the noise. When the exit angle is limited to a grazing angle θ∈[4.0°,5.0°], the physical dark-field limiting scattering constraint is satisfied. After total internal reflection on the smooth, defect-free plastic seal surface, the incident light is directed to the outside of the optical path and cannot enter the vertically upward telecentric imaging lens 120, thus forming a pure, low-grayscale, pure black background in the image. However, once the extremely low-angle grazing beam encounters a dark scratch defect area with a micro-notch physical structure, it will excite extremely strong and symmetrical vertically scattered light (such as...) at the microscopic edge of the notch. Figure 1 (As shown in the image, "micro-scratched scattered light"). This scattered light enters the telecentric imaging lens 120 perpendicularly along the normal imaging axis, appearing as a high-brightness white line in the short-wave ultraviolet image, thus maximizing the initial physical contrast between the scratch defect and the plastic seal background.

[0031] In dark field grazing illumination, any microscopic undulations on the surface (such as character edges or protruding dust) will project an extremely long shadow envelope in the opposite direction of the incident light. This application uses a periodic, cross-spaced arrangement of short-wavelength ultraviolet light-emitting elements 131 and long-wavelength infrared light-emitting elements 132 to ensure that the first illumination field formed when the ultraviolet element is lit, and the second illumination field formed when the infrared element is lit, exhibit a highly perfect axisymmetric distribution in spatial geometric illuminance. This guarantees that when switching wavelengths for exposure, "projection spatial misalignment" and "shadow artifacts" caused by minute differences in spatial tilt angle are completely eliminated at the hardware source.

[0032] The following combination Figure 2 The detection method of this embodiment will be described in detail.

[0033] Step 101: The alternating ring-shaped line light source and the synchronous photosensitive digital image acquisition device are controlled by the microsecond-level hardware timing generator to perform alternating dual-spectral exposure to acquire short-wave ultraviolet scattering image and long-wave infrared transmission image of the same black chip under test; and spatial relative displacement compensation is performed on the short-wave ultraviolet scattering image and the long-wave infrared transmission image to obtain a pair of dual-spectral images with pixel-level position alignment.

[0034] Subsequently, a microsecond-level hardware timing generator strictly controls the execution of the following exposure and alignment timing: Instant UV Exposure: At a set start time, the timing generator outputs a 1.5-millisecond current drive pulse to the constant current drive circuit of each short-wavelength UV emitting element 131, forcing the polarized short-wavelength UV light to illuminate and continuously emit high-intensity, low-angle scattered light. Simultaneously, the timing generator sends a shutter trigger signal to the trigger input of the synchronous photosensitive digital image acquisition unit 110, controlling its entire pixel-level synchronous shutter to open for exposure. The exposure duration is set to 2.0 milliseconds to completely cover the 1.5-millisecond period of light source flicker. The synchronous photosensitive digital image acquisition unit acquires and caches the first high-resolution image in primary memory, denoted as the short-wavelength UV scattering image. In this image, the edges of the grooves with micro-scratches, under the oblique illumination of 365 nm extremely light-slight UV light, produce a faintly bright, scattered edge that is imperceptible to the naked eye but extremely noticeable on a highly sensitive sensor.

[0035] Forced Physical Waiting Delay: After the short-wave ultraviolet light-emitting element 131 is extinguished, the microsecond-level hardware timing generator controls the alternating ring light source 130 to remain completely dark, forcibly maintaining a physical waiting delay of 5.0 milliseconds. Because the organic polymer in the molding compound and printed character areas produces a weak fluorescence afterglow effect under 365 nm short-wave ultraviolet light excitation, if the next spectrum exposure is performed immediately after the ultraviolet light is extinguished, the weak fluorescence afterglow produced by the former will directly mix into the infrared channel, causing non-uniform drift in the infrared spectrum background brightness. Setting this 5.0 millisecond delay ensures complete reset of the pixel trap charge and natural decay of the organic fluorescence, eliminating physical crosstalk between spectra. Simultaneously, during this delay, the chip's physical forward displacement on the conveyor belt is only about 4 micrometers, appearing as a weak and constant linear translation in the image, completely eliminating irregular spatial misalignment caused by large-scale mechanical jitter.

[0036] Infrared instantaneous exposure: After the delay, the microsecond-level hardware timing generator outputs a 1.5-millisecond-width current drive pulse to the constant current drive circuit of each long-wave infrared emitting element 132, controlling the high-intensity illumination of polarized long-wave infrared light. Simultaneously, the shutter is triggered again for exposure, with the exposure duration set to 2.0 milliseconds. A second high-resolution image is acquired and buffered, denoted as the long-wave infrared transmission image. Due to the long wavelength of 850 nm infrared light, it directly penetrates the shallow scratches and grooves on the black resin surface and is uniformly absorbed by the deep black substrate, without producing any scratch reflection. Therefore, the long-wave infrared transmission image only retains the white printed character pattern of the chip and the macroscopic outline of the chip edge. The total time for the two exposures, alternating between illuminating the short-wave ultraviolet emitting elements and the long-wave infrared emitting elements, is controlled within 10 milliseconds.

[0037] Pixel-level displacement alignment: Due to the high-speed movement of the conveyor belt, the chip inevitably experiences a small physical displacement within a 10-millisecond exposure interval. The edge computing unit, based on the set travel speed of the conveyor belt, precisely calculates that the physical movement of the chip within two exposure intervals corresponds exactly to one pixel width on the digital sensor. Therefore, the subsequently acquired long-wave infrared transmission image is shifted pixel-wise in the opposite direction of the chip's movement, generating a pixel-level spatially aligned dual-spectral image pair directly in memory with zero algorithmic time consumption. After this translation compensation, the two images achieve near-absolute alignment in spatial physical coordinates, laying a solid physical and spatial coordinate foundation for subsequent printing pattern stripping and ratio difference reconstruction.

[0038] Step 102: Input the long-wave infrared transmission image from the dual-spectral image pair into the symmetric scaling feature transformation model to obtain the theoretical healthy ultraviolet reference image under the defect-free assumption.

[0039] Because black chips are typically printed with white or light-colored ink characters, these characters produce strong high-brightness reflections under ultraviolet light. Direct detection of these characters would result in severe overlap with actual micro-scratches, leading to a very high false detection rate. Simply subtracting two frames from an actual long-wave infrared image and a short-wave ultraviolet image will leave significant noise and ghosting at the character edges after subtraction, due to the completely different penetration depth, divergence range, photosensitivity of the synchronous photosensitive digital image acquisition unit, and diffuse reflection characteristics of the ink under different light wavelengths. To eliminate the aforementioned printing interference and ensure detection accuracy, this application designs an automatic stripping operation for the printed patterns on the chip surface.

[0040] First, before the formal implementation of the detection method, 1000 healthy black chips with intact surfaces, free of scratches, and bearing the same character patterns were collected as samples. At the same monitoring location, ultra-low angle ultraviolet and infrared light sources were used sequentially to capture and save paired ultraviolet and infrared images of each healthy chip. These paired image data were input into the edge computing unit to construct a historical database of defect-free samples for preliminary learning and parameter optimization.

[0041] Secondly, this embodiment deploys a symmetrical scaling feature transformation model in the edge computing unit. This model consists of two symmetrical computing channels and a jump connection in the middle, used to simulate the difference in photoelectric reflection characteristics of ink patterns in two different wavelength bands.

[0042] The feature-level compression channel comprises five sets of cascaded local feature extraction operators and downsampling reduction steps. Each operator halves the input image size while doubling the depth of the extracted printing features. When the actual infrared image is input into this channel, the macroscopic strokes of the characters, edge roughness, and microscopic details such as ink penetration and smudging on the paper are compressed layer by layer into a high-dimensional feature vector, thereby extracting the precise outline of the typeface characters. The symmetric feature recovery and reconstruction channel is structurally symmetrical with the feature compression channel and contains five sets of image size recovery operators. It receives the feature vector output from the compression channel and gradually restores the image size to its original size. The hierarchical direct connection channel establishes a direct data path between the same size levels of the compression and reconstruction channels, allowing the clearest text stroke boundary information in the infrared image to directly participate in the synthesis of the final ultraviolet band image without loss. At the final output of the reconstruction channel, a non-linear brightness limiter is added to strictly limit the brightness level of each pixel in the final output to a normalized value range of 0.0 to 1.0.

[0043] Then, on the real-time detection line, the edge computing unit inputs the aligned long-wave infrared image of the current workstation into the trained symmetrical scaling feature transformation model. The model, through internal hierarchical compression and edge recovery calculations, outputs a corresponding theoretically healthy ultraviolet image that is theoretically free of any scratch interference. This theoretically healthy ultraviolet image represents the theoretical grayscale level that the sensor should receive when the printed character pattern on the surface of the chip is irradiated with ultraviolet polarized light at an ultra-low angle, under the theoretical assumption that the chip has no mechanical damage. Since the long-wave infrared image itself does not contain any geometric features with shallow scratches, the transformed and reconstructed theoretically healthy ultraviolet image must be an absolutely healthy, scratch-free ultraviolet comparison image where the printed character pattern is indistinguishable from the chip under test.

[0044] Step 103: Using the theoretical healthy ultraviolet reference image, the short-wave ultraviolet scattering image in the dual-spectral image pair is pixel-by-pixel reduced, and zero-value truncation is performed when the difference is negative to generate a clean scratch inspection image.

[0045] The edge computing unit subtracts the pixel brightness of the short-wave ultraviolet scattering image actually captured by the chip under test from the theoretical healthy ultraviolet reference image obtained in step 102. If the measured brightness value at the corresponding pixel is less than or equal to the theoretical healthy brightness value, and the subtraction result is negative or zero, the brightness of that pixel is forcibly reset to zero, presenting a completely black background; if the measured brightness value is greater than the theoretical healthy brightness value, the positive difference after subtraction is retained.

[0046] The physical logic of this operation is as follows: If a pixel on the chip surface belongs to a normal white printed character, its measured ultraviolet brightness value is basically consistent with the theoretical healthy brightness value. After subtracting, the pixel becomes a completely non-emitting black, thus achieving adaptive stripping of the bright white character background. If a pixel on the chip surface belongs to a real dark scratch area, the scratch groove will produce strong edge oblique scattering when it encounters ultraviolet light. The corresponding pixel in the measured ultraviolet image will show a local abnormal bright spot, while the theoretical healthy ultraviolet reference image does not have this defect. After subtracting, a significantly positive brightness level greater than zero will remain. Thus, without damaging the bright details of the scratch, the complete and clean stripping of the complex text background on the chip surface is achieved, generating a clean scratch inspection image.

[0047] Step 104: Divide the clean scratch image to be inspected by the long-wave infrared transmission image pixel by pixel to generate an initial contrast image.

[0048] The edge computing unit performs a point-by-point division calculation on the brightness values ​​of corresponding coordinate points at the pixel level between the clean scratch image to be inspected obtained in step 103 and the synchronously acquired measured long-wave infrared transmission image, and adds a small zero-resistance constant (usually set to 10 to the power of negative 5) to the numerator to prevent the denominator from being zero, thereby generating an initial contrast image.

[0049] The physical logic behind this operation is as follows: In the normal, scratch-free black resin area on the chip surface, the local diffuse reflection ratio of short-wave ultraviolet light and long-wave infrared light is basically constant in space, resulting in a flat, uniform gray background after the division operation. However, at the tiny scratched grooves, the short wavelength of ultraviolet light causes strong Rayleigh edge scattering at the groove walls, leading to a local surge in ultraviolet pixel brightness. The long wavelength of infrared light, upon penetrating the bottom of the scratched groove, is completely absorbed, resulting in extremely low brightness at that point. Through pixel division, the numerator locally increases while the denominator becomes extremely small, instantly amplifying the brightness contrast at the scratch by a factor of two, forming a highly conspicuous high-contrast peak in the initial contrast image.

[0050] Step 105: The initial contrast image is transformed into the fluctuation frequency distribution domain. A high-pass fluctuation selector based on a set cutoff fluctuation threshold is used to filter out image components with spatial fluctuation frequencies lower than the cutoff fluctuation threshold. The image is then restored and reconstructed through inverse transformation to generate a high-fidelity contrast image.

[0051] Because ultra-low-angle lighting inevitably creates a gradually fading shadow across the entire chip surface, gradually diminishing from one side to the other, the edge computing unit performs a Fast Fourier Transform on the initial contrast image to map it from the pixel spatial domain to the fluctuation frequency domain in order to completely eliminate this shadow without damaging scratch details. In the fluctuation frequency distribution domain, large-scale non-uniform lighting shadows correspond to low-frequency background components with extremely low fluctuation frequencies, while tiny scratch grooves correspond to high-frequency fluctuation features with extremely high fluctuation frequencies. To completely remove the low-frequency background, this embodiment deploys a Butterworth stepped high-frequency fluctuation selector in the fluctuation frequency domain. The cutoff fluctuation threshold of this selector is stably set to 120 cycles / mm, and the filtering order is preferably 2nd order. This means that slow, gradual components with brightness alternations less than 120 times per millimeter in space will be blocked and filtered out, while steep components with brightness alternations faster than 120 times per millimeter will be preserved without loss. The edge computing unit performs point-by-point multiplication operations on this selector and the spectral data.

[0052] Finally, the edge computing unit performs an inverse fast Fourier transform on the filtered high-frequency fluctuation spectrum data to reconstruct the image back to pixel location space. The reconstructed high-fidelity contrast image undergoes the following physical transformations: the large-scale gradual illumination shadows on the chip surface are extracted, and the background of the entire image is uniformly normalized to a perfectly deep black with extremely uniform brightness and flatness; while the edge features of tiny shallow scratches are completely preserved, presenting clear and sharp line contours with high contrast against the uniform background. This achieves the goal of decoupling the high-frequency edges of micro-defects from the large-scale slowly varying non-uniform background at the physical level.

[0053] Step 106: Using an optimization cost model consisting of a logarithmic fidelity term and a total variational smoothing penalty term, smooth and denoise the high-fidelity contrast image to generate a high-definition noise-free defect feature map.

[0054] After the fluctuation frequency filtering in step 105, although the large-scale illumination gradient shadows have been eliminated from the image, the extremely low number of photons reflected at ultra-low incident angles still results in strong random noise generated by random photon counting fluctuations. If these pinpoint-like random noises are not suppressed, they will be mistaken for tiny scratches in subsequent edge detection. However, using traditional denoising methods such as mean filtering or median filtering, while smoothing the noise, will also indiscriminately obscure and blur the edges of extremely fine scratches with widths of only a few micrometers, leading to missed detections. To smooth these photon fluctuation noises without damaging the boundaries of extremely fine scratches, this application designs an adaptive smoothing and denoising operation using residual white noise.

[0055] First, in the extremely dark areas of the chip casing, a large number of pixels have brightness values ​​of zero. These zero-value pixels contain no valid physical laws governing noise, and if they are not distinguished during calculation, the noise reduction model will severely skew its estimation of the global noise level. Therefore, the edge computing unit first performs a pixel-by-pixel scan of the high-fidelity contrast image to be detected, automatically identifying the coordinates of all pixels with brightness values ​​greater than zero and defining them as photosensitive masking regions. All subsequent statistical calculations regarding noise levels are strictly confined to this photosensitive masking region.

[0056] Secondly, to prevent scratch edges from being blurred while removing random noise, this embodiment constructs an optimized cost model for reconstructing high-resolution noise-free images. This model consists of two parts: the first part is a logarithmic fidelity metric that conforms to photon count fluctuation characteristics, used to constrain the reconstructed image from deviating from the original physical measured values; the second part is a total variation-based penalty term for adjacent pixel brightness fluctuations, which, by summing the brightness differences in the horizontal and vertical directions, is specifically used to suppress irregular random brightness jumps, i.e., smoothing random noise. The model includes a smoothing metric coefficient to be determined, the magnitude of which directly determines the strength of the noise reduction.

[0057] To automatically calculate the optimal smoothing metric online, the edge computing unit needs to quantify the thoroughness of noise removal under the current metric. For any tentative smoothing metric, the edge computing unit first solves the aforementioned optimal cost model using a discrete grid iterative optimization algorithm to obtain a preliminary denoised image under the current smoothing intensity. Subsequently, due to the removal of some zero-photon pixels, the noise distribution deviates from the standard Poisson distribution. The edge computing unit introduces a zero-truncation photon count probability distribution model to calculate the theoretical local gray mean and theoretical local gray variance for each pixel location. Then, it standardizes and subtracts from the input measured contrast image to reconstruct a standardized random noise residual image.

[0058] In terms of physical laws, if the smoothing metric is chosen appropriately, all random noise in the measured image should be perfectly stripped away and retained in the residual map. These residuals should spatially exhibit a completely chaotic, directionless, and unconnected state of pure random white noise. If the smoothing metric is too small, unremoved noise will still be present in the residual map; if the smoothing metric is too large, forcibly smoothed geometric edges will be mixed in. Both of these situations will disrupt the pure random white noise state of the residuals. To measure the randomness of the residuals, the edge computing unit performs a spatial fluctuation frequency transformation on the residual map and calculates the uniformity of random noise distribution in the fluctuation frequency domain. According to mathematical statistics, when the residual map infinitely approaches pure random white noise, its distribution across frequencies is extremely uniform, and the calculated uniformity reaches its theoretical minimum.

[0059] To achieve adaptive adjustment without human intervention in industrial settings, the edge computing unit quickly locates the optimal smoothing metric coefficient using the following method: 150 trial nodes are uniformly selected on the logarithmic axis, ranging from 10 to 1.0, and the uniformity of random noise distribution corresponding to each trial node is calculated sequentially.

[0060] Subsequently, the trial nodes are logarithmically transformed to obtain a two-dimensional coordinate space where the horizontal axis represents the logarithmic smoothness coefficient and the vertical axis represents the uniformity of random noise dispersion. All data points are normalized to their maximum and minimum values, mapping them to a unit geometric interval of 0 to 1, and the theoretical reference value for uniformity is marked on the vertical axis, i.e., the calibrated uniformity. In the two-dimensional geometric space, a geometric reference chord L is formed by connecting the first trial node A and the last trial node B, as shown below. Figure 3 As shown. Figure 3 The diagram illustrates the distribution of 150 discrete trial coefficient sampling points in a two-dimensional coordinate space. For each trial node on the curve, the signed vertical distance to the reference chord L is calculated using the vector cross product. The physical and geometric significance of this signed vertical distance lies in its ability to precisely filter out peak fluctuations caused by minor local perturbations (where the distance is negative), and only filter out the geometric valleys caused by the change in the noise reduction mechanism (where the distance is positive). By traversing all trial nodes, the index position where the signed vertical distance reaches its maximum value d_max is found. The curve inflection point P corresponding to this position is the location of the optimal smoothness metric coefficient. Physically, this inflection point P marks the critical equilibrium point where image reconstruction has just crossed the "noise residue stage" and entered the "image edge degradation and blurring stage." Furthermore, the uniformity value at this point is closest to the calibrated uniformity, demonstrating strong physical scientific validity.

[0061] Finally, the edge computing unit uses the determined optimal smoothness metric coefficients to substitute into the optimization cost model for the final reconstruction calculation. The final reconstructed image removes all irregular pinpoint Poisson noise, suppressing background noise fluctuations to an extremely low range; simultaneously, the steep contrast of the tiny scratch boundaries is perfectly locked and preserved. This outputs a high-resolution, noise-free defect feature map with a completely deep black background, extremely bright scratch features, and extremely sharp edges.

[0062] Step 107: Divide the high-definition noise-free defect feature map into several non-overlapping local small grids, calculate the comprehensive feature score of candidate defect pixels in each local small grid and apply a feature retention quota limit, merge the retained candidate defect pixels and perform connected component clustering and merging, and package them to generate independent defect physical region groups.

[0063] The edge computing unit divides the high-resolution noise-free defect feature map obtained in step 106 into several non-overlapping local small grids of the same geometric size. Each local small grid is 128×128 pixels in size, corresponding to a micro-region of 0.4 mm × 0.4 mm on the chip surface. For each local small grid, an independent feature candidate point set is established, which includes all candidate pixels within that small grid whose brightness level is greater than a preset noise floor threshold (set to 10 brightness levels).

[0064] To quantitatively evaluate the feature attributes of candidate defective pixels within each grid, this embodiment designs a scoring model based on the fusion of multidimensional geometric and physical contrast features. This scoring model is obtained by weighted summation of the local edge direction gradient consistency value, translational stability metric within the local sliding window, contrast value, and spatial geometric linear extension continuity prediction value of the candidate pixels, and then subtracting the crowding and clutter metrics of isolated noise points in individual pixels. Among them, the gradient consistency value assesses the parallelism of the edge direction. The direction of change of the continuous scratch groove wall is highly similar, while the direction of scattered dust is extremely random. The translation stability value assesses whether the edge information maintains geometric consistency under slight image translation, in order to eliminate the interference of random high-contrast points. The contrast value assesses the contrast intensity between the pixel and the average brightness of the local background. The greater the contrast, the more likely it is to be realistic. The linear extensibility value assesses whether there are connected bright structures along the tangent direction. A continuous straight line represents a scratch, while isolated points score very low. The noise crowding value assesses the density of bright noise in the surrounding 5×5 pixel neighborhood. This value is extremely high when there is a large area of ​​dust accumulation, while the value is extremely low for a single scratch line because the surrounding background is clean.

[0065] The edge computing unit calculates the final feature score of each candidate defect pixel within the current local small grid, and quickly sorts all candidate points within the current small grid according to their scores from highest to lowest. Within each 128×128 pixel local small grid, only the top 15% of high-scoring candidate points are retained; the rest are discarded, and their brightness values ​​are forcibly reduced to zero. This limitation forcibly filters out low-scoring impurity points caused by large-area spot-like dust in each grid, ensuring that the algorithm always locks onto highly consistent scratch line segment skeletons in the local space.

[0066] Next, the edge computing unit merges all the high-resolution pixels retained in the grid back into the global canvas and uses the eight-neighbor connected component labeling method to classify and group spatially adjacent, directly contacting bright pixels. If two pixels are in contact in the horizontal, vertical, or diagonal direction, they are determined to belong to the same defect entity and are merged into the same defect group. This merging calculation is repeated until all bright pixels in the image have been divided into specific, independent defect physical region groups.

[0067] Step 108: Calculate the length-diameter value and aspect ratio of each group of defective physical regions along the longest geometric axis. When the length-diameter value and aspect ratio reach the set scratch discrimination threshold, determine that the group of defective physical regions belongs to the target surface dark scratch defect and output a rejection instruction signal to the production line main control system.

[0068] For each grouped defective physical regions, the edge computing unit calculates its macroscopic geometric dimensions using the minimum bounding rectangle method. The maximum geometric major axis refers to the maximum geometric physical span of the highlighted region along the principal axis extension direction. Multiplying this pixel span by the physical resolution of the synchronous photosensitive digital image acquisition device (3.45 micrometers) yields the actual spatial length, in micrometers. The minimum geometric minor axis refers to the maximum width of the highlighted region perpendicular to the principal axis direction, also multiplied by the resolution to obtain the actual physical width. Then, the geometric aspect ratio is calculated, which is the ratio of the maximum major axis to the minimum minor axis.

[0069] The edge computing unit inputs the calculated geometric and physical parameters into the judgment logic. If the maximum major diameter of a defective physical region is greater than or equal to 20 micrometers, and its aspect ratio is greater than or equal to 5.0, then the region is judged to be a fatal surface dark scratch defect. The edge computing unit highlights it in red, records its defect center coordinates, and immediately sends a rejection command signal to the main control equipment of the production line via the detection card. If the maximum major diameter of the defective region is less than 20 micrometers, or its aspect ratio is less than 5.0, meaning its length and width are close and it has a circular, square, or scattered spot-like structure, mostly consisting of extremely fine dust or harmless resin debris, then the edge computing unit judges the region to be harmless noise or micro-dust, automatically removes it from the feature map and blacks it out, without sending an alarm signal.

[0070] Through the above steps 101 to 108, this application effectively achieves the engineering goal of adaptively resisting dust particle interference and accurately locking and removing extremely fine shallow scratches on the black packaging surface in a real high-speed production environment.

[0071] To facilitate understanding, the implementation of this method will be explained through two specific application scenarios below.

[0072] Example 1: Detection of mechanical scratches on the plastic packaging surface of LPDDR5 memory chips Industrial Site Background and Defect Causes: In high-density multi-chip stacking packages for mobile devices, LPDDR5 double data rate memory chips are encapsulated in black epoxy molding compound, resulting in a matte, dark black finish with minimal roughness. The surface is laser-engraved with white contrast markings (e.g., "LPDDR5 16GB"). During high-speed testing and sorting, friction from the mechanical nozzle or hard impacts from the clamps can easily create extremely shallow mechanical scratches on the resin surface—less than 0.5 micrometers deep and approximately 12 micrometers wide. While these scratches are difficult to detect with the naked eye, they can cause the chips to crack due to uneven stress during later use or fail due to moisture infiltration.

[0073] Method implementation process: The chip travels at a high speed of 1.0 m / s on the sorting machine conveyor belt. According to step 101, the synchronous photosensitive digital image acquisition unit captures empty frames of the monitoring window at a frame rate of 200 frames per second. When the difference judgment value between two adjacent frames reaches level 15, it determines that the leading edge of the chip has reached the detection position and instantly sends a trigger signal to the microsecond-level hardware timing generator.

[0074] Subsequently, a microsecond-level hardware timing generator executes a strictly controlled exposure timing sequence: at time t1, a low-angle (4.5 degrees) polarized short-wave ultraviolet light source is driven to flash for 1.5 milliseconds, simultaneously exposing and acquiring the measured ultraviolet image using a photosensitive digital image acquisition unit; a hardware-forced delay of 5.0 milliseconds is applied, during which the chip's forward displacement is only 5 micrometers, far less than half the physical size of a pixel; at time t2, a polarized long-wave infrared light source at the same position is driven to flash for 1.5 milliseconds, simultaneously exposing and acquiring the measured infrared image using a photosensitive digital image acquisition unit. The total time for the entire alternating exposure is controlled within 10 milliseconds. Finally, the infrared image is shifted one pixel in the opposite direction of the chip's movement, generating a spatially highly overlapping dual-spectral image pair in memory.

[0075] Following step 102, the aligned long-wave infrared image is input into a symmetric scaling feature transformation model. This model extracts character contour features through 5-layer downsampling compression, then restores the image size through 5-layer upsampling, while using skip connections to preserve the details of character stroke edges, reconstructing and outputting a theoretical healthy ultraviolet reference image of the current chip in a defect-free state.

[0076] Following step 103, the measured ultraviolet image is subtracted pixel by pixel from the theoretical healthy ultraviolet reference image, and the difference is forcibly reset to zero when it is negative or zero. The white characters "LPDDR5 16GB" engraved by laser are completely removed because the measured value is consistent with the theoretical value, leaving only the positive difference value corresponding to the scratch, thus generating a clean scratch inspection image.

[0077] Following step 104, the clean scratch image to be inspected is divided point by point with the measured infrared image. At the scratch, ultraviolet scattering causes the numerator to increase dramatically, while infrared absorption makes the denominator extremely small, thus amplifying the scratch contrast many times over and generating an initial contrast image.

[0078] Following step 105, the initial contrast image is converted to the frequency domain, and a Butterworth high-pass filter with a cutoff frequency of 120 cycles / mm is used to filter out low-frequency gradual shadows. After inverse transformation, a high-fidelity contrast image with a uniform, deep black background is reconstructed and output.

[0079] Following step 106, construct a total variational optimization cost model, uniformly select 150 trial nodes on the logarithmic axis to calculate the random noise dispersion uniformity, find the optimal smoothness metric coefficient through the chordal distance positioning method, and output a high-definition defect feature map with no noise and sharp edges.

[0080] Following step 107, the defect feature map is divided into local small grids of 128×128 pixels. A comprehensive feature score (weighted sum of gradient consistency, translation stability, contrast, and linear extensibility, minus noise congestion) is calculated for the bright pixels within each grid. Only the top 15% of high-scoring pixels are retained, while the remaining low-scoring impurity points are forcibly blackened. After merging the retained pixels, eight-neighbor connected domains are merged, and the resulting packages generate independent defect physical region groups.

[0081] According to step 108, the geometric maximum major diameter of a certain defect group is calculated to be 35 micrometers, the minimum minor diameter is 4.1 micrometers, and the aspect ratio is 8.54, which meets the judgment condition that the major diameter is ≥20 micrometers and the aspect ratio is ≥5.0.

[0082] Test results: The system determined the defect to be a fatal surface scratch, highlighted it in red, recorded the center coordinates of the defect, and immediately sent a rejection command signal to the sorting machine's main control equipment via the detection card, classifying the LPDDR5 chip into the defective product slot. What was originally an extremely faint scratch with a grayscale difference of less than 2 levels under traditional white light illumination was transformed into a bright stripe with a grayscale difference of greater than 150 levels on the final feature map.

[0083] Example 2: High-Reliability Sealing Scratch Detection of Vehicle-Mounted UFS Chips Industrial Site Background and Defect Causes: Automotive-grade general-purpose flash memory chips have extremely high requirements for operational stability and casing sealing. Their packages are typically made of high-strength, high-density matte resin material, with high-temperature resistant white ink characters printed on the surface (e.g., "AUTO-UFS256G"). During transportation across factory areas on metal pallets, chips are easily scratched on their casings due to friction and collisions caused by bumps and knocks. If the scratches penetrate the internal sealing leads, they can seriously threaten the driving safety of the vehicle system. Unlike consumer-grade chips, the white ink characters on automotive chips are extremely thick and have very strong edge reflectivity, causing greater interference to optical inspection.

[0084] Method implementation process: The vehicle-mounted UFS chip moves smoothly at a speed of 0.8 m / s on the visual inspection track. Following step 101, the synchronous photosensitive digital image acquisition unit captures and monitors empty frames. When the chip edge cuts in, causing a sudden change in the brightness difference judgment value to reach level 15, the timing controller triggers dual-band ultra-high-speed exposure: at time t1, a low-angle ultraviolet light source is activated to capture a measured ultraviolet image; after a precise delay of 5.0 milliseconds, at time t2, an infrared light source is activated to capture a measured infrared image; the infrared image is then shifted and aligned in the opposite direction of the chip's movement to eliminate pipeline vibration displacement errors, generating a highly aligned dual-band comparison original image.

[0085] Following step 102, the measured infrared image (in which the white ink characters “AUTO-UFS 256G” have clear edges) is input into the symmetrical scaling feature transformation model. This model uses 5 layers of downsampling compression to extract the character's outline skeleton, retains the high-frequency contour information of the ink edges through skip connections, and then restores the size through 5 layers of upsampling, outputting a theoretically healthy ultraviolet reference image without defects in the ultraviolet band.

[0086] Following step 103, the measured ultraviolet image is subtracted pixel by pixel from the theoretical healthy ultraviolet reference image. Since the edges of the thick ink characters are precisely aligned in the two images, the strong reflective edges of the ink characters are completely eliminated to zero after subtraction, resulting in a clean scratch inspection image without ink character interference.

[0087] Following step 104, the clean scratch image to be inspected is divided point by point with the measured infrared image. At the metal scratch, ultraviolet light is brightened due to Rayleigh scattering, while infrared light is absorbed by the bottom of the scratch groove, resulting in dark spots. After the division, the contrast of the scratch is amplified exponentially, generating an initial contrast image.

[0088] Following step 105, the initial contrast image is converted to the frequency domain, and a high-pass filter with a cutoff frequency of 120 cycles / mm is used to truncate the low-frequency fluctuation component (to eliminate the large-scale light intensity gradient shadow caused by the aging of the reflectors on both sides of the track). After inverse transformation reconstruction, a high-fidelity contrast image with a uniformly dark background and bright scratch edges is output.

[0089] Following step 106, for photon counting fluctuation noise under weak scattering, a standardized residual map is calculated using a zero-truncation Poisson statistical model. 150 smoothing adjustment coefficients are uniformly searched on the logarithmic axis to calculate the residual frequency domain dispersion uniformity for each parameter. The curve inflection point is precisely located using the chord distance localization method to obtain the optimal noise reduction adjustment coefficient. A total variational smoothing reconstruction is performed, effectively filtering extremely weak light shot noise while firmly capturing the subtle physical edges of scratches on the automotive chip surface, outputting a high-definition, noise-free defect feature map.

[0090] Following step 107, the high-resolution image is divided into 128×128 pixel local small grids. The gradient direction consistency, translation stability, contrast, linear extensibility, and noise congestion of pixels within each grid are calculated to achieve a comprehensive feature score. A mandatory quota of retaining the top 15% of high-resolution pixels in each grid is enforced, directly eliminating scattered noise interference caused by rough, protruding particles on the automotive-grade resin surface. High-resolution pixels are then merged and clustered into eight-neighbor connected domains.

[0091] According to step 108, the maximum major diameter of a certain connected entity is measured to be 55 micrometers, the minimum minor diameter is 4.5 micrometers, and the aspect ratio is 12.2, which meets the criteria of major diameter ≥ 20 micrometers and aspect ratio ≥ 5.0.

[0092] Test results: The system determined that the entity had a fatal metal scratch defect and immediately sent a rejection signal to the shunt solenoid valve of the detection track to remove the defective automotive UFS chip from the production line, effectively preventing the chip with sealing risks from entering the automotive electronics assembly process.

[0093] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0094] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0095] In this application, unless otherwise stated, directional terms such as "up" and "down" are generally used in relation to the direction shown in the accompanying drawings, or in relation to the vertical, perpendicular, or gravitational direction; similarly, for ease of understanding and description, "left" and "right" are generally used in relation to the left and right shown in the accompanying drawings; "inner" and "outer" refer to the inner and outer contours of each component itself, but the above directional terms are not intended to limit this application.

[0096] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope described in this application, and these should all 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 dark scratches on the surface of a black chip plastic package, characterized in that, The detection method is implemented based on a physical device layout, which includes: A synchronous photosensitive digital image acquisition unit is installed directly above the conveyor belt of the production line and perpendicular to the normal direction of the chip detection plane. The front end of the synchronous photosensitive digital image acquisition unit is equipped with a parallel optical path distortion-free telecentric imaging lens and employs a full-frame pixel synchronous shutter mode. An alternating annular line light source is mounted around the telecentric imaging lens. The alternating annular line light source integrates a short-wave ultraviolet light-emitting element and a long-wave infrared light-emitting element. The angle between the light emission direction of the short-wave ultraviolet light-emitting element and the long-wave infrared light-emitting element and the horizontal plane of the upper surface of the chip under test is limited to 4.0 degrees to 5.0 degrees. The detection method includes: The alternating ring-shaped line light source and the synchronous photosensitive digital image acquisition device are controlled by a microsecond-level hardware timing generator to perform alternating dual-spectral exposure, thereby acquiring short-wave ultraviolet scattering images and long-wave infrared transmission images of the same black chip under test; and spatial relative displacement compensation is performed on the short-wave ultraviolet scattering images and long-wave infrared transmission images to obtain pixel-level position-aligned dual-spectral image pairs. The long-wave infrared transmission image in the dual-spectral image pair is input into a symmetric scaling feature transformation model to obtain the theoretical healthy ultraviolet reference image under the defect-free assumption. Using the theoretical healthy ultraviolet reference image, the short-wave ultraviolet scattering image in the dual-spectral image pair is pixel-by-pixel reduced, and zero value is truncated when the difference is negative, to generate a clean scratch inspection image; The clean scratch image to be inspected is divided pixel by pixel by the long-wave infrared transmission image to generate an initial contrast image; The initial contrast image is transformed into the fluctuation frequency distribution domain. A high-pass fluctuation selector based on a set cutoff fluctuation threshold is used to filter out image components with spatial fluctuation frequencies lower than the cutoff fluctuation threshold. The image is then restored and reconstructed through inverse transformation to generate a high-fidelity contrast image. An optimization cost model consisting of a logarithmic fidelity term and a total variational smoothing penalty term is used to smooth and denoise the high-fidelity contrast image, generating a high-definition noise-free defect feature map. The high-definition noise-free defect feature map is divided into several non-overlapping local small grids. The comprehensive feature score of the candidate defect pixels is calculated in each local small grid and a feature retention quota limit is applied. The retained candidate defect pixels are merged and connected component clustering is performed to package them into independent defect physical region groups. The length-diameter value and aspect ratio of each group of defective physical regions along the longest geometric axis are calculated. When the length-diameter value and aspect ratio reach the set scratch discrimination threshold, the group of defective physical regions is determined to belong to the target surface dark scratch defect and a rejection instruction signal is output to the main control system of the production line.

2. The detection method according to claim 1, characterized in that, Inside the alternating annular line light source, multiple short-wave ultraviolet light-emitting elements and multiple long-wave infrared light-emitting elements are coplanarly soldered onto the same annular aluminum-based circuit board in an alternating arrangement, so that the first irradiation light field formed on the chip surface when the short-wave ultraviolet light-emitting element is lit alone and the second irradiation light field formed on the chip surface when the long-wave infrared light-emitting element is lit alone are axially symmetrical and uniformly overlapped in terms of spatial geometric illuminance.

3. The detection method according to claim 1, characterized in that, The step of performing spatial relative displacement compensation on the short-wave ultraviolet scattering image and the long-wave infrared transmission image to obtain a pixel-level aligned dual-spectral image pair specifically includes: The synchronous photosensitive digital image acquisition device is controlled to continuously capture images of the conveyor belt area, and a fixed pixel area is opened at the geometric center of the image as a specific monitoring image window to read the average brightness change of two adjacent frames in real time. When the difference between two adjacent frames is greater than or equal to 15 brightness levels, a start trigger pulse is instantaneously sent to the microsecond-level hardware timing generator. Based on the microsecond-level hardware timing generator, a fixed-width current driving pulse is output to each of the short-wave ultraviolet light-emitting elements at a set start time, while controlling the synchronous shutter to open for exposure to acquire and buffer the short-wave ultraviolet scattering image; After the exposure of each of the short-wave ultraviolet light-emitting elements is completed, the alternating annular line light source is kept completely off, maintaining a physical waiting delay of 5.0 milliseconds. After the delay state ends, a current driving pulse of fixed width is output to each of the long-wave infrared light-emitting elements, and the synchronous shutter is controlled to open for exposure to acquire and buffer the long-wave infrared transmission image. The total time for alternating the illumination of the short-wave ultraviolet light-emitting element and the long-wave infrared light-emitting element for two exposures is controlled within 10 milliseconds. According to the set travel speed of the conveyor belt, the long-wave infrared transmission image is shifted and aligned by a pixel width of 1 pixel in the opposite direction of the chip's travel, thus completing the pixel-level alignment of the dual-spectral image pair.

4. The detection method according to claim 1, characterized in that, The symmetric scaling feature transformation model includes interconnected feature level compression channels, symmetric feature recovery and reconstruction channels, and skip connection straight paths established between the same size levels of the feature level compression channels and the symmetric feature recovery and reconstruction channels. The step of inputting the long-wave infrared transmission image from the dual-spectral image pair into a symmetric scaling feature transformation model to obtain the theoretical healthy ultraviolet reference image under the defect-free assumption specifically includes: The input long-wave infrared transmission image is downsampled at multiple levels through the feature-level compression channel to compress and extract character contour features; The symmetry feature is used to restore the reconstruction channel for multi-level upsampling to gradually restore the image size, and the pixel brightness level at the reconstruction output is limited to the normalized value range. The skip connection direct path is used to directly introduce the gray-scale abrupt change information of the character stroke edges that does not include multi-level downsampling loss, so as to synthesize and output the theoretical healthy ultraviolet reference image at the reconstruction output end of the symmetry feature recovery reconstruction channel.

5. The detection method according to claim 1, characterized in that, The step of dividing the clean scratch image to be inspected by the long-wave infrared transmission image pixel by pixel to generate an initial contrast image specifically refers to adding a zero-resistance constant to the numerator pixel of the clean scratch image to be inspected, and then dividing it point by point with the denominator pixel of the long-wave infrared transmission image at the corresponding coordinates.

6. The detection method according to claim 1, characterized in that, The cutoff fluctuation threshold of the high-pass fluctuation selector is set to 120 cycles / mm, and the filter order of the high-pass fluctuation selector is set to 2nd order.

7. The detection method according to claim 1, characterized in that, The step of using an optimization cost model composed of a logarithmic fidelity term and a total variational smoothing penalty term to smooth and denoise the high-fidelity contrast image and generate a high-definition noise-free defect feature map specifically includes: Scan the coordinates of all pixels with a brightness value greater than zero in the high-fidelity contrast image to define the photosensitive masking area; The discrete grid iterative optimization algorithm is used to obtain the preliminary denoised image under each trial smoothing metric coefficient. The theoretical local gray mean and theoretical local gray variance of each pixel position are calculated by the zero-truncation photon count probability distribution model. The measured contrast image is then standardized and reduced to output a standardized random noise residual map. After converting the standardized random noise residual map to the frequency domain, the random noise dispersion uniformity is determined by calculating the ratio of the fourth power summation to the squared power summation of the fluctuation amplitude values ​​at each frequency coordinate point. Establish a geometric reference chord connecting the coordinates of the first and last trial nodes, and calculate the signed vertical distance from each coordinate point to the geometric reference chord based on the vector cross product. The smoothing metric coefficient corresponding to the maximum positive vertical distance value among the signed vertical distances is calibrated as the optimal smoothing metric coefficient. The number of trial smoothing metric coefficients is set to 150. The optimal smoothness metric coefficient is introduced into the optimal cost model for reconstruction calculation to generate the high-definition noise-free defect feature map.

8. The detection method according to claim 1, characterized in that, The application of the feature retention quota limit means that within each local small grid with a geometric size of 128×128 pixels, all candidate defect pixels are sorted in descending order according to the comprehensive feature score, retaining only the top 15% of candidate pixels with the highest feature scores, and forcibly setting the brightness value of the remaining candidate defect pixels that exceed the quota limit to zero.

9. The detection method according to claim 1 or 8, characterized in that, The step of calculating the comprehensive feature score of candidate defect pixels in each local small grid specifically refers to the weighted summation of the local edge direction gradient consistency value, translation stability metric value, contrast value, and spatial geometric linear extension continuity prediction value of the candidate defect pixels, and the result is obtained after deducting the crowding and disorder metrics of isolated noise points of individual pixels.

10. The detection method according to claim 1, characterized in that, The specified scratch discrimination threshold is specifically defined as follows: the major diameter value is greater than or equal to 20 micrometers and the aspect ratio is greater than or equal to 5.0.