Remanufactured chip appearance defect image detection method and system

By acquiring images from multiple angles and analyzing optical features, the chip's optical characteristics are adaptively learned, solving the problem of false alarms caused by material differences in remanufactured chip inspection and achieving efficient and accurate defect identification.

CN121899137AActive Publication Date: 2026-04-21深圳市芯宇技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
深圳市芯宇技术有限公司
Filing Date
2026-01-28
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing remanufactured chip appearance inspection systems suffer from high false alarm rates and difficulty in accurately identifying real defects because they cannot effectively distinguish the optical diversity of chip materials.

Method used

By acquiring multiple images of the chip under different light source angles, the optical feature information of the local area is extracted to generate the first optical feature vector. A reference area is randomly selected to determine the second optical feature vector of the normal area. The spatial distance is calculated and the defect confidence level is set. The supplementary illumination angle is intelligently selected to re-acquire images for secondary judgment.

Benefits of technology

It significantly improves the accuracy and robustness of detecting appearance defects in remanufactured chips, reduces the false positive rate, and improves production efficiency and product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121899137A_ABST
    Figure CN121899137A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image detection, and provides a remanufactured chip appearance defect image detection method and system. A plurality of images of the chip at different light source angles are collected, multi-angle optical feature information is extracted from each local area, the first optical feature vector is generated, and the optical characteristics of the surface of the chip can be comprehensively captured. Randomly selecting a reference area and determining a second optical feature vector of a normal area as a reference; when the local area is preliminarily judged as a suspected defect and the defect confidence is relatively low, the method can intelligently select the supplementary irradiation angle to recollect the image and perform secondary judgment. Therefore, the robustness and the reliability of remanufactured chip appearance defect detection are remarkably improved, the misjudgment rate on a production line is effectively reduced, and the product quality and the production efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image detection technology, and more specifically, to a method and system for detecting appearance defects in remanufactured chips. Background Technology

[0002] In automated visual inspection of remanufactured chips, multi-angle illumination systems are typically used to enhance image features to identify subtle defects such as minor scratches or cold solder joints. However, in practical applications, due to the complex origins of remanufactured chips, the optical properties of their packaging materials (such as semi-gloss and matte surfaces) vary significantly. Inspection systems often misjudge the inherent normal optical responses of these materials as defects, leading to a significantly increased false alarm rate. For example, the normal highlights produced by a smooth surface under grazing light may be misjudged as foreign objects, while a matte surface, lacking reflectivity, may be misjudged as a cold solder joint. The root cause lies in the implicit assumption that traditional inspection models are based on the uniformity of chip materials, lacking a mechanism to understand and adapt to the inherent optical diversity of chips. Therefore, the system cannot effectively separate the overlap between material differences and actual defects in image features, making it difficult for advanced multi-angle illumination hardware to achieve the expected results in actual production, severely limiting the accuracy and efficiency of inspection.

[0003] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention

[0004] This application discloses a method and system for detecting appearance defects in remanufactured chips, aiming to solve the problem that existing remanufactured chip appearance defect detection systems are prone to misjudging normal material differences as defects when faced with complex and diverse chip packaging materials, resulting in a high false alarm rate, and it is difficult to effectively distinguish between real defects and differences in the inherent optical properties of materials.

[0005] The technical solution of this application is as follows: In a first aspect, this application discloses a method for detecting surface defects in remanufactured chips, the method comprising: Multiple chip images are acquired under different light source angles; each chip image is divided into multiple local regions, and the optical feature information of each local region in images at different angles is extracted to generate the first optical feature vector. A predetermined proportion of local area is randomly selected as a reference area, and a normal area is determined based on the first optical feature vector of the reference area. The second optical feature vector corresponding to the normal area is then calculated. Calculate the spatial distance between the first optical feature vector and the second optical feature vector of each local region, determine whether the local region is a suspected defect region based on the spatial distance, and calculate its defect confidence. When the confidence level of a defect is lower than the preset confidence threshold, the corresponding supplementary illumination angle is selected to re-acquire supplementary images, and the local area is re-determined as a defect area based on the supplementary images.

[0006] Furthermore, in the above-mentioned method for detecting surface defects in remanufactured chips, the optical feature information includes average grayscale information, gradient information, and highlight region location information; the first optical feature vector is composed of a sequence of average grayscale values ​​of the local region in images at various angles, a sequence of gradient magnitudes calculated using the Sobel operator, and a sequence of centroid coordinates of the highlight region.

[0007] Based on this, this application further proposes to determine a normal region based on the first optical feature vector of the reference region and calculate the second optical feature vector corresponding to the normal region, including: projecting the first optical feature vector of the reference region into a feature space, merging the first optical feature vector into feature groups in the feature space by clustering, determining the feature group containing the most reference regions as the normal region, and taking the average value of all feature vectors in the feature group as the second optical feature vector of the normal region.

[0008] Furthermore, in the above-mentioned method for detecting surface defects in remanufactured chips, determining whether a local area is a suspected defect area based on spatial distance and calculating its defect confidence includes: when the spatial distance between the first optical feature vector of a local area and the second optical feature vector of a normal area is greater than a distance threshold, the local area is marked as a suspected defect area; the defect confidence is calculated by the following formula: S = 1 / (d + ε); where d is the spatial distance and ε is a constant.

[0009] In some preferred embodiments, selecting a corresponding supplementary illumination angle to re-acquire a supplementary image, and re-determining whether the local area is a defective area based on the supplementary image, includes: selecting a supplementary illumination angle from different light source angles according to the first optical feature vector of the suspected defective area, and re-acquiring a supplementary image of the local area at the supplementary illumination angle; performing image enhancement processing on the local area in the supplementary image, and re-extracting optical feature information from the processed local area to generate an updated first optical feature vector; determining the spatial distance between the updated first optical feature vector and the second optical feature vector, and determining whether the local area is a defective area based on the spatial distance.

[0010] As an optional approach, after generating the first optical feature vector, the method further includes: projecting sinusoidal fringe light onto the local area and taking a picture of the corresponding fringe pattern, determining the local curvature value of the fringe center line in the fringe pattern, and adding it as a fringe curvature feature to the end of the first optical feature vector.

[0011] To enhance functionality, the local curvature value of the stripe centerline in the stripe pattern is determined and appended to the end of the first optical feature vector as a stripe curvature feature. This includes: extracting the stripe centerline of the stripe pattern, sampling every pixel along the stripe centerline, and calculating the local curvature value C=1 / R at the sampling point; where R is the radius of the fitted circle; and linearly mapping the local curvature value C to an integer range of 0-255 to obtain the stripe curvature feature value for that local region.

[0012] For specific situations, the distance threshold is dynamically set, including: dynamically setting the distance threshold based on the median value of all local curvature values ​​in the current chip image and the median absolute deviation of all local curvature values ​​relative to the median value.

[0013] To further address the problem, the spatial distance is used to determine whether the local area is a defective area, including: if the spatial distance is still greater than a distance threshold, then the local area is determined to be a defective area.

[0014] Secondly, this application also discloses a remanufactured chip appearance defect image detection system, which includes: an acquisition and segmentation module for acquiring multiple chip images under different light source angles; dividing each chip image into multiple local regions, extracting optical feature information of each local region in images at different angles, and generating a first optical feature vector; a reference determination module for randomly selecting a predetermined proportion of local regions as reference regions, determining a normal region based on the first optical feature vector of the reference region, and calculating a second optical feature vector corresponding to the normal region; a first determination module for calculating the spatial distance between the first optical feature vector and the second optical feature vector of each local region, determining whether the local region is a suspected defect region based on the spatial distance, and calculating its defect confidence; and a second determination module for, in response to a defect confidence lower than a preset confidence threshold, selecting a corresponding supplementary illumination angle to re-acquire supplementary images, and re-determining whether the local region is a defect region based on the supplementary images. Beneficial effects

[0015] This application discloses a method for detecting surface defects in remanufactured chips. By acquiring multiple images of the chip under different light source angles and extracting multi-angle optical feature information from each local area to generate a first optical feature vector, it can comprehensively capture the optical characteristics of the chip surface. Based on this, by randomly selecting a reference area and determining a second optical feature vector of a normal area as a benchmark, this application can effectively learn and adapt to the inherent optical diversity of remanufactured chips, thereby distinguishing between normal material differences and real defects. When a local area is initially judged as a suspected defect with low defect confidence, the method can intelligently select a supplementary illumination angle to re-acquire images and perform a secondary judgment, further improving the ability to identify subtle defects and the accuracy of detection. Compared with existing technologies, this application overcomes the problems of high false alarm rates and difficulty in distinguishing between real defects and normal optical reactions caused by differences in chip materials in traditional detection systems. It significantly improves the robustness and reliability of surface defect detection in remanufactured chips, effectively reduces the false judgment rate on the production line, and improves product quality and production efficiency. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating the steps of the remanufactured chip appearance defect image detection method disclosed in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of the remanufactured chip appearance defect image detection system disclosed in an embodiment of the present invention. Detailed Implementation

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which these embodiments belong; the terminology used herein and in the specification of the application is for the purpose of describing particular embodiments only and is not intended to limit these embodiments; the terms in the specification of these embodiments and the foregoing description of the accompanying drawings include and have, and any variations thereof, and are intended to cover non-exclusive inclusion. The terms first, second, etc., in the specification of these embodiments and the foregoing drawings are used to distinguish different objects and not to describe a particular order.

[0018] The implementation details of the technical solution in this embodiment are described in detail below: Firstly, this application discloses a method for detecting surface defects in remanufactured chips, such as... Figure 1 As shown, the method includes: S101: Acquire multiple chip images under different light source angles; divide each chip image into multiple local regions, extract the optical feature information of each local region in images at different angles, and generate the first optical feature vector; S102, randomly select a local area of ​​a predetermined proportion as a reference area, and determine a normal area based on the first optical feature vector of the reference area, and calculate the second optical feature vector corresponding to the normal area. S103, calculate the spatial distance between the first optical feature vector and the second optical feature vector of each local region, determine whether the local region is a suspected defect region based on the spatial distance and calculate its defect confidence. S104, in response to the defect confidence level being lower than the preset confidence threshold, select the corresponding supplementary illumination angle to re-acquire supplementary images, and redetermine whether the local area is a defect area based on the supplementary images.

[0019] Specifically, in step S101, acquiring multiple chip images from different light source angles refers to using multiple (e.g., 8) independently controllable strip light sources arranged in a ring above the chip to illuminate the chip surface sequentially from different angles (e.g., vertical top light, left grazing light, right grazing light, etc.) in a preset order. An industrial camera simultaneously captures an image during each illumination, thus obtaining a set (e.g., 8 images) of complete multi-angle surface images in a very short time (e.g., within 200 milliseconds). Dividing each chip image into multiple local regions means segmenting each image into several small image blocks of the same size that partially overlap (e.g., each region is 16x16 pixels). Extracting the optical feature information of each local region in images from different angles means calculating a series of quantitative indicators for a small region at the same physical location in all angle images. For example, the average brightness value of the region across eight images can be calculated, forming an 8-dimensional brightness sequence (G1, G2, …, G8); the Sobel operator can be used to calculate the gradient magnitude of the region in each image, forming an 8-dimensional gradient sequence; if highlights exist, the centroid coordinates (x, y) of the highlight region can be calculated, forming a 16-dimensional coordinate sequence. Finally, these sequences are concatenated to form the first optical feature vector representing the overall optical performance of the local region (e.g., a vector with a total dimension of 8+8+16=32).

[0020] In step S102, randomly selecting a predetermined proportion of local areas as reference areas means randomly selecting a portion (e.g., 90%) of all local areas on the chip surface, assuming these areas represent the normal surface of the current chip. Determining a normal region based on the first optical feature vector of the reference areas means projecting the feature vectors of all these reference areas into a high-dimensional feature space and grouping these vectors into several feature groups using a clustering analysis algorithm (such as K-means). The feature group containing the most reference areas is identified as the most important normal region of the current chip. Calculating the second optical feature vector corresponding to this normal region means calculating the average vector of all first optical feature vectors within this feature group. This average vector is the benchmark representing the optical characteristics of the normal surface of the current chip, or the second optical feature vector.

[0021] In step S103, calculating the spatial distance between the first and second optical feature vectors of each local region refers to calculating the Euclidean distance between the first feature vector of each local region (including reference and non-reference regions) and the reference second feature vector obtained in step S102. This distance quantifies the degree to which the optical characteristics of the local region deviate from the overall normal reference of the chip. Determining whether a local region is a suspected defect region based on the spatial distance means setting a distance threshold. When the calculated distance of a region exceeds this threshold, it is marked as a suspected defect region. Calculating its defect confidence score means introducing a confidence score negatively correlated with the distance to measure the reliability of this suspected result. For example, it can be calculated using the formula S = 1 / (d + ε), where d is the spatial distance and ε is a very small constant (such as 0.01) to prevent division by zero errors. The larger the distance d, the lower the confidence score S, indicating that it is more likely to be a real defect (because it deviates further from the normal reference).

[0022] In step S104, responding to a defect confidence score lower than a preset confidence threshold means that when the confidence score S of a suspected defect area is less than a preset threshold (e.g., 0.6), the current judgment is considered uncertain and requires further verification. Selecting a corresponding supplementary illumination angle to re-acquire a supplementary image means that the system analyzes the first optical feature vector of the suspected area and intelligently determines which illumination angle best amplifies its abnormal features. For example, if the feature indicates a possible scratch, the system selects the grazing angle that best produces a shadow; if it may be a protrusion, it selects a vertical or opposite angle. Subsequently, the control system re-illuminates and acquires a supplementary image of the area at this specific angle. Re-determining whether the local area is a defect area based on the supplementary image means performing targeted fine processing (such as local magnification and edge enhancement) on the supplementary image and re-extracting the optical features of the area based on the processing results to generate an updated feature vector. Finally, the new distance between this updated feature vector and the baseline second feature vector is calculated. If this new distance still exceeds a more stringent final judgment threshold, the area is ultimately confirmed as a defect area; otherwise, it is judged as normal.

[0023] This application's solution constructs a first optical feature vector that meticulously characterizes the surface optical response through multi-angle image acquisition and local feature extraction. By learning from most regions of the current chip itself and generating a normal benchmark (second optical feature vector) representing its individual characteristics, the detection standard is adapted to a single chip, effectively overcoming misjudgments caused by material differences. Preliminary judgments are made by calculating spatial distance and setting thresholds, combined with distance-based defect confidence assessment, achieving quantification of the reliability of suspected results. Finally, for ambiguous cases with low confidence, an intelligent supplementary lighting verification mechanism based on feature analysis is introduced to make a final decision by acquiring more targeted image information, forming a complete closed loop from coarse screening to fine judgment. This progressive, adaptive, and self-verifying detection process significantly improves the accuracy and reliability of identifying complex appearance defects in remanufactured chips.

[0024] Furthermore, in the above-mentioned method for detecting surface defects in remanufactured chips, in step S101, the optical feature information includes average grayscale information, gradient information, and highlight region location information. The first optical feature vector is composed of a sequence of average gray values ​​of the local region in images at various angles, a sequence of gradient magnitudes calculated using the Sobel operator, and a sequence of centroid coordinates of the highlight region.

[0025] Specifically, in this embodiment, extracting optical feature information to generate a first optical feature vector means that for each local region (e.g., a 16x16 pixel square) in the image, the system calculates and extracts three core optical quantization indicators from the corresponding images acquired under all different light source angles, and combines them sequentially into a multi-dimensional mathematical vector. Extracting average grayscale information means calculating the average brightness of all pixels within the local region for each image under specific lighting angles. For example, if the system acquires images from eight angles, then for the same physical location area in the images, eight average grayscale values ​​will be calculated: G1, G2, …, G8. These eight values ​​are arranged in order of lighting angle, forming an eight-dimensional sequence of average grayscale values. This sequence reflects the overall brightness variation of the area under different directional light illumination. For example, a smooth slope may be very bright (high G value) under grazing light and darker (low G value) under perpendicular light; while a rough plane may have relatively similar G values ​​at various angles.

[0026] Gradient information extraction refers to using edge detection methods such as the Sobel operator to calculate the texture sharpness or edge intensity of a local region in each image. Specifically, the system performs gradient convolution calculations in the horizontal and vertical directions for this region in each image, then synthesizes the gradient magnitudes in the two directions, typically taking the square root of the sum of squares as the gradient magnitude for that pixel. Finally, the average (or maximum) gradient magnitude of all pixels in the region is calculated as a single value representing the gradient intensity of that region under that angle of the image. Similarly, for eight angles, eight gradient magnitudes are obtained: Mag1, Mag2, …, Mag8, forming an 8-dimensional gradient magnitude sequence. This sequence reflects the degree to which the micro-texture or geometric edges of the region's surface are highlighted under different lighting conditions. For example, a fine scratch will produce a strong light and dark edge under grazing light at a specific angle, resulting in a significantly higher Mag value at that angle than at other angles.

[0027] To extract the location information of highlight regions, it is first necessary to identify whether there is a highlight in the local area in the image from each angle. The system usually sets a brightness threshold (for example, more than twice the standard deviation of the average gray value of the region), and determines the set of pixels in the region whose brightness exceeds this threshold as highlight regions. If a highlight region exists, its centroid position coordinates are calculated. The centroid coordinates (Xc, Yc) are calculated as follows: Xc = (Σ xi * Ii) / Σ Ii, Yc = (Σ yi * Ii) / Σ Ii, where (xi, yi) are the coordinates of the highlight pixel, and Ii is its gray value. Thus, for each illumination angle, if a highlight exists, a pair of coordinates (Xc_k, Yc_k) is recorded; if it does not exist, a pair of predefined invalid values ​​(such as -1, -1) are recorded. For 8 angles, a maximum of 16 coordinate values ​​(Xc1, Yc1, Xc2, Yc2, …, Xc8, Yc8) can be obtained, forming a maximum 16-dimensional sequence of highlight region centroid position coordinates. This sequence precisely depicts the location of the specular reflection spot within the region and its trajectory as the illumination angle changes.

[0028] Finally, the first optical feature vector is formed by concatenating the aforementioned average gray value sequence, gradient magnitude sequence, and specular region centroid position coordinate sequence. For example, concatenating the 8-dimensional gray value sequence, 8-dimensional gradient sequence, and 16-dimensional coordinate sequence end-to-end results in a 32-dimensional feature vector. This vector comprehensively and quantitatively describes the integrated optical response characteristics of the local region under multi-angle illumination from three complementary dimensions: brightness distribution, texture edges, and specular reflection spot positions.

[0029] This application's scheme constructs a feature representation rich in information and with clear physical meaning by carefully designing and extracting three types of features: average gray level, gradient magnitude, and specular centroid position. The average gray level sequence macroscopically characterizes brightness changes, the gradient sequence captures microscopic texture and edge details, and the specular centroid coordinate sequence accurately records specular reflection, an optical phenomenon extremely sensitive to surface geometry. These are concatenated into a unified first optical feature vector, enabling subsequent processing algorithms to simultaneously utilize this three aspects of information for comprehensive judgment. For example, a tiny pit defect may exhibit a sudden drop in gray level at the grazing light angle, a peak in the gradient sequence at that angle, and, because the pit disrupts the smooth surface, an abnormal or missing specular sequence. This multi-feature fusion description method provides a solid data foundation for accurately distinguishing material differences from genuine defects.

[0030] Furthermore, this application proposes that, in S102, determining a normal region based on the first optical feature vector of the reference region and calculating the second optical feature vector corresponding to the normal region includes: The first optical feature vector of the reference region is projected into the feature space. In the feature space, the first optical feature vector is clustered into feature groups. The feature group containing the most reference regions is determined as the normal region. The average value of all feature vectors in the feature group is taken as the second optical feature vector of the normal region.

[0031] Specifically, in this embodiment, projecting the first optical feature vector of the reference region into the feature space is a mathematical conceptual transformation process. The first optical feature vector of each local region (e.g., a 32-dimensional vector) can be considered as a point existing in a high-dimensional mathematical space. Putting together the feature vectors of all randomly selected reference regions (e.g., regions covering 90% of the chip surface, assuming 1000 regions) is equivalent to placing 1000 points in this high-dimensional feature space, forming a point cloud. The dimensions in this space correspond to the various optical features extracted previously (such as grayscale, gradient, and specular coordinates), and the distance between points (e.g., Euclidean distance) reflects the degree of similarity or difference in optical properties of the local regions they represent.

[0032] In this context, clustering the first optical feature vector into feature groups in the feature space refers to using an algorithm called clustering analysis (such as the K-means algorithm) to automatically divide the 1000 points in the high-dimensional space into several clusters or feature groups with compact internal point sets and separate from each other, based on their proximity to each other. The purpose of clustering is to discover inherent natural groupings in the data. For example, the algorithm might automatically divide these 1000 points into 3 feature groups: group A contains 500 points, group B contains 300 points, and group C contains 200 points. This typically means that there may be three main optical performance modes on the surface of the current chip.

[0033] In practical applications, identifying the feature group containing the most reference areas as the normal region means selecting the group with the most points from multiple feature groups obtained through clustering and recognizing it as representing the most dominant and normal surface state of the current chip. Continuing the example above, group A contains 500 points, the most, and is therefore identified as the normal region. The core logic of this step is: assuming most of the chip surface is normal, then the feature points in the normal region should be the most densely packed and numerous in the feature space. By identifying the largest cluster, the system can adaptively learn and lock onto the mainstream normal optical feature patterns of the current specific chip (regardless of whether it is semi-gloss or matte) without any pre-defined material labels.

[0034] Taking the average of all feature vectors within a feature group as the second optical feature vector of the normal region means calculating the element-wise (dimension-wise) arithmetic mean of all 500 first optical feature vectors contained in the feature group identified as the normal region (e.g., group A). ​​For example, for a 32-dimensional feature vector, the calculation is performed in each of these 32 dimensions: the first dimension of the new vector = (the sum of the first dimensions of all vectors in group A) / 500, the second dimension = (the sum of the second dimensions of all vectors in group A) / 500, ..., up to the 32nd dimension. The final result is a new 32-dimensional vector, which is the second optical feature vector. This vector is the center or centroid of all points in group A, and it statistically most strongly represents the average or baseline state of the current normal surface optical properties of the chip. Therefore, it can be used as a stable reference benchmark for comparison in subsequent defect judgment.

[0035] This application's scheme projects the feature vectors of a large number of reference regions into a high-dimensional space and performs cluster analysis, enabling unsupervised discovery and quantification of the dominant optical patterns on the chip surface based on the data itself. The largest cluster is identified as the normal region, cleverly achieving adaptive learning of the detection standard to the individual characteristics (material, gloss) of a single chip, fundamentally avoiding the problem of misjudging material differences as defects due to preset fixed standards. Finally, a second optical feature vector is generated by calculating the average of the feature vectors of this normal region, obtaining a stable and reliable quantification benchmark. This benchmark is not derived from an ideal template, but from the actual performance of most normal regions of the tested chip itself, making the subsequent calculation of the spatial distance between each region and this benchmark highly targeted and comparable, laying a solid foundation for accurately identifying real defects that deviate from this normal state.

[0036] Furthermore, in the above-mentioned method for detecting surface defects in remanufactured chips, step S103, determining whether a local area is a suspected defect area based on spatial distance and calculating its defect confidence level, includes: When the spatial distance between the first optical feature vector of a local area and the second optical feature vector of the normal area is greater than a distance threshold, the local area is marked as a suspected defect area; the defect confidence is calculated by the following formula: S = 1 / (d + ε); where d is the spatial distance and ε is a constant.

[0037] Specifically, in this embodiment, determining whether a local area is a suspected defect area based on spatial distance is a decision-making process based on the degree of deviation. First, the system calculates the spatial distance between the first optical feature vector of each local area on the chip (obtained in step S101) and the second optical feature vector (i.e., the reference vector) of the normal area established in step S102. This distance is usually calculated using Euclidean distance. For example, for a 32-dimensional feature vector, its first optical feature vector is V_local = [v1, v2, …, v32], and its second optical feature vector (reference vector) is V_benchmark = [b1, b2, …, b32], then the formula for calculating the spatial distance d between the two is: d = sqrt[(v1-b1)² + (v2-b2)² + … + (v32-b32)²]. This scalar value d intuitively and quantitatively expresses the degree to which the local area deviates from the normal reference of the entire chip in terms of overall optical characteristics. The larger the value d, the greater the difference between the region and the mainstream normal performance of the chip in terms of brightness, texture, and specular behavior.

[0038] The core of the judgment lies in comparing the spatial distance *d* with a distance threshold. This distance threshold is not a fixed value but is dynamically set based on the specific characteristics of the current chip. In practical applications, this distance threshold can be set based on the statistical distribution of distances from all first optical feature vectors (i.e., those vectors grouped into the largest feature group) within the normal region determined in step S102 to their own centers (second optical feature vectors). For example, the system can calculate the average μ and standard deviation σ of the distances between all feature vectors and the reference vector within the normal region, and then set the distance threshold as μ + k * σ, where k is a preset coefficient (e.g., k = 3). This means that the threshold is set outside the statistical boundary of the normal feature fluctuation range. If the calculated distance *d* of a local region is greater than this dynamic threshold (μ + 3σ), it is determined to have significantly deviated from the normal pattern and is therefore marked as a suspected defect region. For example: Suppose that the calculated average distance distribution of the normal area of ​​the current chip is μ = 1.5, the standard deviation is σ = 0.8, and k = 3, then the distance threshold is 1.5 + 3 * 0.8 = 3.9. For a specific local area, if its calculated distance is d = 5.2, since 5.2 > 3.9, this area is marked as a suspected defect.

[0039] The formula for calculating the defect confidence score S is S = 1 / (d + ε), which aims to assign a quantified reliability score to each marked suspected defect area. In this formula, d is the spatial distance calculated above. ε is a very small normal number (e.g., 0.001 or 0.01), whose main mathematical function is to prevent the denominator from being zero or causing S value overflow when d is 0 or extremely small, ensuring the numerical stability of the formula. As can be seen from the functional relationship, the confidence score S is inversely proportional to the spatial distance d. The larger d is, the smaller the S value. The physical meaning of this design is that the farther a region's characteristics deviate from the normal benchmark (the larger d is), the more abnormal it appears, but the smaller the S value calculated by this formula. Here, S does not directly represent the probability of being a defect, but rather, in the specific procedural context of this application, represents the uncertainty of the current judgment or the urgency of needing further verification. A very low S value (e.g., d is very large, causing S to approach 0) means that the region exhibits extreme anomalies and is highly likely to be a typical defect, but at the same time, the system's uncertainty in judging it is very low (i.e., it is almost certain that it is anomaly). Conversely, a region with a d value slightly above the threshold, resulting in an S value at a moderate level (e.g., 0.3-0.6), belongs to the ambiguous signal category—it is outside the normal range but not extreme enough, so the system's uncertainty in judging it is higher, requiring further verification for confirmation. Continuing with the previous example, for the region with d = 5.2, taking ε = 0.01, its defect confidence S = 1 / (5.2+0.01) ≈ 0.192, which is a relatively low S value.

[0040] This application's solution achieves objective and adaptive initial screening of suspected defective areas by calculating quantified spatial distance and comparing it with a threshold dynamically set based on the chip's own normal statistical characteristics. The defect confidence score S = 1 / (d + ε) is introduced, creatively transforming a simple distance scalar into a score with clear process guidance. This score goes beyond a binary judgment of whether something is abnormal; it further characterizes the degree of suspicion or the confidence level of the judgment. This allows subsequent processes (step S104) to intelligently triage based on this confidence score: typical anomalies with high confidence (low S value) can be quickly confirmed; for ambiguous cases with low confidence (S value in the middle range), a more rigorous supplementary verification step is triggered. This two-level judgment mechanism based on distance quantification and confidence assessment significantly improves the detection system's ability to distinguish and make rational decisions when dealing with the complex and ever-changing appearance of remanufactured chips, reducing the false negative rate while providing a key control node for effectively controlling the false positive rate.

[0041] Furthermore, in S104, a supplementary illumination angle is selected to re-acquire a supplementary image, and based on the supplementary image, it is re-determined whether the local area is a defect area, including: Based on the first optical feature vector of the suspected defect area, a supplementary illumination angle is selected from different light source angles, and a supplementary image of the local area is re-acquired at the supplementary illumination angle; image enhancement processing is performed on the local area in the supplementary image, and optical feature information is re-extracted from the processed local area to generate an updated first optical feature vector; the spatial distance between the updated first optical feature vector and the second optical feature vector is determined, and whether the local area is a defect area is determined based on the spatial distance.

[0042] Specifically, in this embodiment, step S104 is an enhanced verification process for handling ambiguous cases identified as suspected defects in step S103 but with low defect confidence S values ​​(i.e., high uncertainty). When the confidence S of a certain local area is lower than a preset confidence threshold (e.g., S_threshold = 0.6), it indicates that although the area exceeds the normal fluctuation range, its abnormal characteristics are not typical enough, and there is a risk of confusing it with complex material behavior or minor normal fluctuations. To avoid misjudgment, the system will activate this on-demand verification mechanism.

[0043] The process of selecting a supplementary illumination angle from different light source angles based on the first optical feature vector of the suspected defect area is an intelligent decision-making process. The system analyzes the first optical feature vector (i.e., the initial 32-dimensional vector) of the area to identify the physical nature most likely corresponding to its abnormal pattern, and then selects the illumination angle that best highlights or clarifies this nature. For example, the system can analyze its gradient amplitude sequence and highlight centroid sequence: if the anomaly in the area is mainly manifested as an abnormal increase in gradient amplitude at specific grazing angles (such as angles 5 and 6), while the highlight behavior is normal, the system may infer that it is a suspected scratch-type defect (the edge contrast of the scratch is enhanced under grazing light). Then, the system will select another grazing angle (such as angle 7) perpendicular to the scratch direction or at a large angle as the supplementary illumination angle, because this angle may make the shadow or bright line features produced by the scratch most obvious. Conversely, if the anomaly is mainly manifested as irregular jumping of the highlight centroid position at multiple angles, while the gradient change is not significant, it may be suspected to be a small protrusion or foreign object. The system may select a vertical or near-vertical illumination angle (such as angle 1) as a supplementary angle to observe its surface contour more clearly.

[0044] In practical applications, re-acquiring a supplementary image of a local area at this supplementary illumination angle means that the control system illuminates only the selected specific strip light source, keeping the chip position unchanged, and the industrial camera takes another highly targeted image under illumination only at that specific angle. This supplementary image focuses on the suspicious area, and its imaging conditions are optimized to expose the characteristics of potential defects to the greatest extent.

[0045] Image enhancement processing of local regions in the supplementary image refers to performing more refined digital processing on this newly acquired, targeted image to extract subtle information that may have been masked by averaging or noise during the initial multi-angle batch acquisition. Typical image enhancement processing includes: 1) Region of Interest (ROI) Zoom: Interpolating and enlarging the corresponding part of the local region in the image, for example, displaying and analyzing a 16x16 pixel region in a 32x32 pixel view to observe more subtle grayscale changes. 2) Edge Enhancement Filtering: Applying filters such as the Laplacian operator or Unsharp Mask to highlight any weak edges that may exist within the region. 3) Contrast Stretching: Adjusting the grayscale histogram of the local region to fill the entire dynamic range to enhance the visibility of low-contrast features. Re-extracting optical feature information from the processed local region to generate an updated first optical feature vector means recalculating the optical features of the region based on the enhanced supplementary image, following a similar principle to step S101, but possibly using more refined parameters. For example, by recalculating the average grayscale value on a magnified view, using a more sensitive gradient operator to calculate the gradient magnitude, and more accurately locating the highlight region, these newly calculated feature values ​​(which may be a vector of the same dimension but with more precise values ​​and less noise) constitute an updated first optical feature vector.

[0046] The final decision-making step involves determining the spatial distance between the updated first and second optical feature vectors, and then using this spatial distance to determine whether the local region is a defective area. The system calculates the Euclidean distance between this updated feature vector and the previously determined second optical feature vector, which represents the overall normal baseline of the chip, resulting in a new spatial distance d_new. This judgment uses a more stringent and absolute final decision threshold than the initial screening. For example, this threshold could be a preset fixed empirical value, or a more stringent multiple based on the distance distribution of normal areas (such as μ + 5σ). If d_new is greater than this final decision threshold, the region is confirmed as a defective area; if d_new is less than or equal to this threshold, it is considered that after targeted verification, the abnormal features of the region are not significant, and it is judged as a normal region. For example: a blurry region with an initial distance d_initial = 4.5 (threshold = 4.0) and a confidence level S = 0.22 triggers verification. The system selects a 7-second re-enhanced angle, obtains an updated vector after enhancement processing, and calculates d_new = 5.8. If the final judgment threshold is 5.0, since 5.8 > 5.0, it is ultimately confirmed as a defect.

[0047] This application's solution introduces an intelligent verification triggering mechanism based on confidence assessment, concentrating valuable computational and acquisition resources on the most uncertain and ambiguous cases. It intelligently selects the illumination angle that best reveals the essence of the problem based on initial features, maximizing the information content of secondary acquisition. Local enhancement and fine feature re-extraction are performed on single targeted images, overcoming the averaging limitations that may exist in initial batch processing. The updated features are calculated to have a new distance from the original normal benchmark, and a stricter threshold is used for final decision-making. This method significantly improves the ability to identify subtle defects or easily confused false defects, ensuring a high detection rate while effectively filtering out false alarms caused by the special optical properties of local materials. This achieves a dual improvement in detection accuracy and reliability, enabling the system to adapt to the extremely complex surface conditions of remanufactured chips.

[0048] As an optional approach, after generating the first optical feature vector, the method further includes: projecting sinusoidal fringe light onto the local area and taking a picture of the corresponding fringe pattern, determining the local curvature value of the fringe center line in the fringe pattern, and adding it as a fringe curvature feature to the end of the first optical feature vector.

[0049] Specifically, in this embodiment, projecting sinusoidal fringe light onto a local area and capturing the corresponding fringe pattern is an active optical detection step designed to enhance sensitivity to surface micro-geometry. After completing conventional multi-angle LED illumination image acquisition, the system controls a dedicated projection module (e.g., a digital micromirror device (DMD) projector or a laser interference fringe generator) to project a set of sinusoidal light intensity distribution patterns with a stable spatial period, i.e., sinusoidal fringe light, onto the same detection area on the chip surface. Simultaneously, an industrial camera remains stationary and synchronously captures an image of the chip surface carrying this fringe pattern, i.e., the fringe pattern. Because the phase and shape of the fringe light are modulated by changes in surface micro-height, a straight fringe on a flat surface will undergo observable bending, shifting, or periodic changes when encountering minute depressions, protrusions, or tilts.

[0050] The core processing step of determining the local curvature value of the stripe centerline in the stripe pattern is to extract quantitative geometric information from the acquired stripe pattern. First, for each pre-defined local region (e.g., 16x16 pixels), the system precisely extracts the centerline of one or more stripes within its corresponding stripe pattern area. This is typically achieved by calculating the grayscale centroid of each pixel row or applying a stripe skeletonization algorithm. Next, the extracted stripe centerline is modeled as a planar curve y=f(x). To quantify its local curvature, the system calculates the local curvature values ​​of this curve at multiple sampling points. The mathematical definition of curvature K is the rate of change of the tangent direction angle of a curve relative to the arc length. For discrete pixel sequences, an approximate formula is often used for calculation. For example, for three adjacent points P_{i-1}(x1,y1), P_i(x2,y2), and P_{i+1}(x3,y3) on a curve, the curvature K_i ≈ 2 * |(x3-x1)*(y2-y1) - (x2-x1)*(y3-y1)| / {[(x3-x1)^2+ (y3-y1)^2]^(3 / 2)}. The system calculates the absolute value of curvature of all sampled points on the center line of the stripes within this local area and calculates their average (or maximum) value as a single scalar value representing the stripe deformation intensity of this area, i.e., the stripe curvature feature. For example, the curvatures of 10 sampling points within a local area are calculated as follows: 0.001, 0.005, 0.012, 0.003, 0.020, …, and the average value is taken to obtain the fringe curvature characteristic value C = 0.0092 for this area.

[0051] In practical applications, appending the stripe curvature feature to the end of the first optical feature vector means adding (sponging) the calculated scalar value C as a new, independent dimension to the end of the original first optical feature vector, which is composed of the average grayscale sequence, gradient sequence, and specular coordinate sequence. Assuming the original first optical feature vector is 32-dimensional, after appending it becomes a 33-dimensional vector: [original 32-dimensional feature, C]. This extended feature vector, with its first 32 dimensions comprehensively reflecting the multi-angle reflection, scattering, and specular properties of the surface, while the newly added 33rd dimension (C) directly encodes the modulation response of the surface's micro-geometry to structured light, providing a complementary information channel that is highly sensitive to minute physical fluctuations.

[0052] This application introduces sinusoidal fringe projection and fringe curvature analysis, adding a novel quantitative dimension to chip surface defect detection based on active structured light inspection. The principle is that even defects (such as scratches with nanometer-deep depths or protrusions with micrometer-high heights) with extremely low contrast under conventional diffuse or specular reflection light can easily cause measurable local curvature of the projected fringes. Adding the extracted curvature features as supplementary information to the original optical feature vector essentially fuses geometric shape-sensitive features with optical reflection characteristics. This fusion allows subsequent clustering analysis, benchmark establishment, and distance determination to make decisions based on both surface appearance (optical performance) and shape (micro-geometry). For example, a very shallow scratch may only slightly increase the gradient under grazing light, resulting in a weak change in optical features, but it could significantly increase the local curvature of the fringes above it. By examining both optical and geometric features simultaneously, the system can more reliably capture such subtle defects and more accurately distinguish between surface states with similar optical properties but different geometric shapes (e.g., differentiating material gloss variations from real physical defects), thereby achieving higher precision and robustness in defect identification under complex conditions.

[0053] To enhance functionality, the local curvature value of the stripe centerline in the stripe pattern is determined and appended to the end of the first optical feature vector as a stripe curvature feature. This includes: extracting the stripe centerline of the stripe pattern, sampling every pixel along the stripe centerline, and calculating the local curvature value C=1 / R at the sampling point; where R is the radius of the fitted circle; and linearly mapping the local curvature value C to an integer range of 0-255 to obtain the stripe curvature feature value for that local region.

[0054] Specifically, in this embodiment, extracting the stripe center line of the stripe pattern refers to preprocessing and analyzing the captured sinusoidal stripe image to accurately locate the central trajectory line of each black and white stripe. First, the system filters and denoises the original stripe pattern to enhance its contrast. Then, a sub-pixel-level center line extraction algorithm, such as the gray-level centroid method or the Steger algorithm, is used. For example, for each row of pixels in the image, the system finds the peak point on the gray-level value distribution curve or locates the stripe center by calculating the point where the first derivative is zero. Connecting these points forms a continuous stripe center line with sub-pixel accuracy.

[0055] The process involves sampling along the center line of the stripes at every other pixel and calculating the local curvature value C = 1 / R at each sampling point; where R is the radius of the fitted circle, representing a quantified geometric feature calculation. The system selects a series of sampling points P_i (i = 1, 2, 3…) at fixed spatial intervals (e.g., the projection distance every other pixel) along each extracted stripe center line. To calculate the local curvature at a given sampling point P_i, the system takes that point and its N adjacent points (e.g., P_{i-2}, P_{i-1}, P_i, P_{i+1}, P_{i+2}, a total of 5 points), and performs circular fitting using the coordinates of these points. The goal of circular fitting is to find a circle that minimizes the sum of the squared distances from these points to the circumference of the circle. The radius of the fitted circle is denoted as R. According to the definition of differential geometry, the curvature C of a curve at a point is equal to the reciprocal of the radius R of the osculating circle at that point, i.e., C = 1 / R. Therefore, by calculating the radius R of the fitted circle, the local curvature value C_i of the sampling point P_i can be obtained. For example, suppose a circular fit is performed on a sampling point and five points before and after it, resulting in an optimal fitted circle with a radius R = 125.3 pixels. Then, the local curvature value C_i at that point is approximately 1 / 125.3 ≈ 0.00798 (1 / pixel). If the fringes near this point are straight, the radius R of the fitted circle will be very large (theoretically infinite), and C_i will approach 0. If the fringes are sharply curved due to surface defects (such as tiny pits), the radius R of the fitted circle will be very small, and the value of C_i will increase significantly.

[0056] In practical applications, the step of linearly mapping the local curvature value C to the integer range of 0-255 and using it as the stripe curvature feature value of that local region is a data normalization and feature encoding step. Since the original curvature values ​​C_i at different locations and for different stripes may have different dimensions and numerical ranges, directly using them is not conducive to unified modeling of the subsequent feature space. Therefore, the system presets a reasonable curvature value range [C_min, C_max] and transforms all calculated original curvature values ​​C_i to the standard 0-255 integer range using a linear mapping formula. The mapping formula is: Feature value = round(255 * (C_i - C_min) / (C_max - C_min)), and the result is limited to 0-255. For example, C_min = 0 (1 / pixel), C_max = 0.02 (1 / pixel). For the calculated C_i = 0.00798 in the example above, substituting it into the formula, we get: Feature value = round(255 * (0.00798 - 0) / (0.02 - 0)) = round(255 * 0.399) ≈ 102. Finally, for a local region (such as a 16x16 pixel region), the system will count the integer feature values ​​obtained after mapping all stripes and all sampling points within its coverage area, and take their average (or maximum) value as a single scalar representing the curvature of the stripes in the entire local region, i.e., the stripe curvature feature value. For example, if a total of 15 sampling points are calculated in this region, and their mapped feature values ​​are 98, 105, 110, 85, … 102, the final stripe curvature feature value of this region is obtained by averaging = 100.

[0057] This application's solution implements a rigorous process, from sub-pixel-level centerline extraction and precise local curvature calculation based on circular fitting to normalized integer encoding, transforming the geometric deformation information of stripes into a stable, comparable, and dimensionally uniform numerical feature. By employing sampling every other pixel, both computational accuracy and processing efficiency are ensured. Calculating curvature by finding the radius through circular fitting and then taking its reciprocal is more robust and geometrically sound than simple difference approximation. Finally, the curvature is linearly mapped to a general range of 0-255, ensuring that the stripe curvature feature value is numerically consistent with other features in the first optical feature vector (such as grayscale values ​​in the 0-255 range), facilitating vector concatenation and subsequent distance measurement analysis. This refined processing ensures that the added features can reflect surface micro-geometric anomalies with high fidelity. For example, a tiny scratch may only cause a slight change in conventional optical features, but it is enough to cause the local curvature feature value of the stripe above it to suddenly change from the normal value of around 50 to more than 150, so that it can be sensitively captured by the system, greatly enhancing the ability to detect hidden physical defects.

[0058] Furthermore, in this embodiment, the distance threshold is dynamically set, including: dynamically setting the distance threshold based on the median value of all local curvature values ​​in the current chip image and the median absolute deviation of all local curvature values ​​relative to the median value.

[0059] Specifically, the phrase "based on all local curvature values ​​in the current chip image" refers to the stripe curvature feature values ​​calculated and normalized for each predefined local region on the chip surface using the aforementioned steps. These feature values ​​constitute a dataset reflecting the overall statistical distribution of the microscopic geometric morphology of the entire chip surface. For example, if a chip is divided into 1000 local regions, there will be 1000 stripe curvature feature values. Most of these values ​​are concentrated within a certain range, representing the smoothness of the chip's main surface, while a few outliers may correspond to areas with physical deformation.

[0060] The median and median absolute deviation are two robust statistics used to describe the central tendency and dispersion of this data set. Calculating the median involves arranging the 1000 curvature feature values ​​in ascending order and taking the middle value (the average of the 500th and 501st values) as the median M. The median is insensitive to extreme outliers and better represents the typical geometric flatness of most areas on the chip surface. Calculating the median absolute deviation (MAD) involves two steps: first, calculating the absolute difference between each curvature feature value c_i and the median M, i.e., |c_i - M|, resulting in 1000 absolute differences; then, taking the median of these 1000 absolute differences to obtain the median absolute deviation MAD. MAD is also a robust measure of dispersion, measuring the normal range of curvature values ​​around the median in a typical region. For example, suppose the median value M after sorting 1000 curvature values ​​is 120 (within the range of 0-255). After calculating the absolute difference between each value and 120, the median value MAD of these differences is 15. This means that for this chip, the typical local curvature characteristic value of its surface is around 120, and the typical normal fluctuation range is about 15 units.

[0061] In practical applications, dynamically setting the distance threshold based on the median and median absolute deviation means using these two statistics as core parameters and calculating the chip-specific defect judgment distance threshold T using a preset formula. A typical dynamic setting formula is: T = M + k * MAD, where k is a preset sensitivity coefficient (e.g., k=3). This formula means that the judgment threshold is set above the typical curvature level (M) and allows a tolerance range of k times the typical normal fluctuation (MAD). Any local region whose comprehensive feature vector (including curvature features) is spatially distancing from the normal reference vector by more than this threshold T is considered significantly abnormal. Continuing with the example above, M=120, MAD=15, k=3, then the dynamic distance threshold T = 120 + 3*15 = 165. This means that for the current chip, the system sets its defect judgment distance threshold to 165. If another chip has a rougher surface (generally higher curvature value) and greater fluctuations, the calculated M might be 150 and MAD might be 25. Then its corresponding dynamic threshold T will be automatically adjusted to 150 + 3*25 = 225 to adapt to its different surface characteristics.

[0062] This application's solution achieves chip-level personalized adaptive defect judgment criteria by introducing a dynamic threshold setting mechanism based on local curvature statistical characteristics (median value M and median absolute deviation MAD). Its core advantage lies in its dual robustness: First, using the median value M instead of the average value as the central benchmark avoids the distortion of the overall benchmark by a few real defects or extreme anomalies, ensuring the reliability of the represented normal level; second, using the median absolute deviation MAD instead of the standard deviation to measure fluctuations is also insensitive to outliers, enabling a more robust estimation of the inherent normal geometric fluctuation range of the surface. By dynamically setting the threshold using the formula T = M + k * MAD, the system can intelligently distinguish between normal geometric fluctuations caused by the chip's own surface characteristics and real defect signals exceeding these normal fluctuations. For example, for a chip with an overall flat surface, its MAD is small, and the threshold T will be set more strictly to capture weak anomalies; for a chip with large surface undulations, its MAD is large, and the threshold T will automatically be relaxed to prevent normal roughness from being misjudged as a defect. This method fundamentally solves the problem that fixed thresholds cannot adapt to the differences in surface morphology between different individual chips, enabling the detection system to have stronger generalization ability and lower false alarm rate.

[0063] Furthermore, determining whether the local area is a defective area based on the spatial distance includes: if the spatial distance is still greater than the distance threshold, then the local area is determined to be a defective area.

[0064] Specifically, in this embodiment, determining whether a local area is a defective area based on the spatial distance is a crucial decision-making step in the detection method to make a final and decisive classification of each local area. This step is applicable to two scenarios: first, in the preliminary screening in step S103, each local area is initially judged; second, in the supplementary verification process in step S104, suspected defective areas that have been re-collected and processed are finally confirmed. Regardless of the scenario, the core logic is to directly compare the calculated spatial distance with a preset distance threshold and perform binary classification based on the comparison result.

[0065] The spatial distance refers to a quantified scalar value calculated at a specific stage, characterizing the degree to which the optical features (or extended features incorporating stripe curvature features) of a local region deviate from the normal reference of the chip. In the initial screening, it refers to the Euclidean distance between the first optical feature vector and the second optical feature vector (reference vector) of each local region calculated in step S103. In the verification process, it specifically refers to the newly calculated Euclidean distance between the first optical feature vector re-extracted and updated based on the supplementary image in step S104 and the same reference vector. This distance value (denoted as d) is a non-negative real number, and its magnitude directly reflects the degree of difference between the features of the region and the normal. For example, a scratched area with obvious shadows under grazing light will have significantly abnormal gradient features and possible curvature features, resulting in a large calculated d value, such as d = 5.8 (assuming the units have been normalized). The distance threshold is a critical value used to distinguish between normal fluctuations and significant anomalies. As described in the aforementioned scheme, this threshold is preferably dynamically set, for example, calculated using the formula T = M + k * MAD based on the overall chip fringe curvature statistics (median value M and median absolute deviation MAD), where k is a preset coefficient. This allows the threshold T to adapt to the surface characteristics of different chips. For example, for a chip with a smooth surface, T = 5.0 might be calculated; for a chip with a rough surface, T = 7.0 might be calculated. This threshold represents the upper limit of feature deviation allowed by the system in the current chip context.

[0066] In practical applications, executing the decision logic of classifying a local area as a defective region if the spatial distance is still greater than the distance threshold is a direct numerical comparison and decision-making process. The system compares the spatial distance d calculated in real time or recalculated with the currently effective distance threshold T: if d > T, the judgment condition is met. The system then classifies the local area as a defective region. This means that the feature deviation of the region has exceeded the normal range defined based on the current chip's own characteristics, and therefore it is classified as having an appearance defect. For example, for a local area, the calculated d = 5.8, while the dynamic threshold T = 5.0, since 5.8 > 5.0, the region is ultimately marked as a defect.

[0067] Conversely, if d ≤ T, the judgment condition is not met. In the initial screening, this area will be considered a normal area (unless it is marked as suspected in subsequent processes for other reasons). In the verification process, this means that even after targeted verification, the degree of abnormality of this area does not exceed the acceptable range, so the initial suspected judgment is rejected, and it is ultimately confirmed as a normal area.

[0068] This application's solution provides a clear and repeatable decision endpoint for the entire adaptive detection process by setting a clear and objective final decision rule: if the spatial distance exceeds a distance threshold, it is considered a defect. Its technical advantages are: First, it reduces complex image feature differences to a simple comparison of a scalar distance and a scalar threshold, making the decision logic extremely transparent and efficient, and easy to implement and verify. Second, by combining it with dynamically set thresholds, this rule possesses context-aware capabilities. For chips with smooth surfaces, a strict threshold (e.g., T=5.0) is used, and even slight anomalies (d=5.8) are detected; for chips with inherent roughness, a more lenient threshold (e.g., T=7.0) is used, and the same d=5.8 is considered normal fluctuation, thus effectively avoiding misjudging individual differences as defects.

[0069] Secondly, this application proposes an image detection system for surface defects in remanufactured chips, such as... Figure 2 As shown, the system includes: The acquisition and segmentation module 201 is used to acquire multiple chip images of the chip under different light source angles; divide each chip image into multiple local regions; extract the optical feature information of each local region in images at different angles; and generate a first optical feature vector. The reference determination module 202 is used to randomly select a local area of ​​a predetermined proportion as a reference area, determine a normal area based on the first optical feature vector of the reference area, and calculate the second optical feature vector corresponding to the normal area. The first determining module 203 is used to calculate the spatial distance between the first optical feature vector and the second optical feature vector of each local region, determine whether the local region is a suspected defect region based on the spatial distance, and calculate its defect confidence. The second determining module 204, in response to the defect confidence level being lower than a preset confidence threshold, selects a corresponding supplementary illumination angle to re-acquire a supplementary image, and re-determines whether the local area is a defect area based on the supplementary image.

[0070] The remanufactured chip appearance defect image detection system of this application, through the collaborative work of its acquisition and segmentation module, benchmark determination module, first determination module, and second determination module, can effectively cope with the complex optical characteristic differences of remanufactured chips, improving the accuracy and robustness of defect detection. Specifically, the acquisition and segmentation module is responsible for acquiring multi-angle images and performing preliminary feature extraction, providing a data foundation for subsequent analysis. The benchmark determination module establishes a benchmark that can adapt to the inherent optical diversity of chips by adaptively learning the optical characteristics of normal areas. Based on this, the first determination module preliminarily identifies suspected defects and assesses their confidence level by comparing the area to be detected with the benchmark. When the confidence level is insufficient, the second determination module initiates a supplementary detection process to make a final judgment by acquiring more information. This systematic design enables this application to effectively distinguish between real defects and normal material reactions, significantly reducing the false alarm rate, thereby solving the challenges faced by traditional detection methods in remanufactured chip detection.

[0071] This system can be used to perform the image detection method for remanufactured chip appearance defects as described in the first aspect, which will not be elaborated further here.

[0072] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for detecting surface defects in remanufactured chips, characterized in that, The method includes: Multiple chip images are acquired under different light source angles; each chip image is divided into multiple local regions, and the optical feature information of each local region in images at different angles is extracted to generate a first optical feature vector. A predetermined proportion of local areas is randomly selected as a reference area, and a normal area is determined based on the first optical feature vector of the reference area. The second optical feature vector corresponding to the normal area is then calculated. Calculate the spatial distance between the first optical feature vector and the second optical feature vector of each local region, determine whether the local region is a suspected defect region based on the spatial distance, and calculate its defect confidence. When the confidence level of the defect is lower than the preset confidence threshold, a corresponding supplementary illumination angle is selected to re-acquire a supplementary image, and the local area is re-determined as a defect area based on the supplementary image.

2. The method for detecting surface defects in remanufactured chips according to claim 1, characterized in that, The optical feature information includes average grayscale information, gradient information, and highlight region location information; The first optical feature vector is composed of a sequence of average gray values ​​of the local region in images at various angles, a sequence of gradient magnitudes calculated using the Sobel operator, and a sequence of centroid coordinates of the highlight region.

3. The method for detecting surface defects in remanufactured chips according to claim 2, characterized in that, The step of determining a normal region based on the first optical feature vector of the reference region and calculating the second optical feature vector corresponding to the normal region includes: The first optical feature vector of the reference region is projected into the feature space. In the feature space, the first optical feature vector is clustered into feature groups. The feature group containing the most reference regions is determined as the normal region. The average value of all feature vectors in the feature group is taken as the second optical feature vector of the normal region.

4. The method for detecting surface defects in remanufactured chips according to claim 3, characterized in that, Determining whether a local area is a suspected defect area based on the spatial distance and calculating its defect confidence score includes: When the spatial distance between the first optical feature vector of a local region and the second optical feature vector of a normal region is greater than a distance threshold, the local region is marked as a suspected defect region; the defect confidence level is calculated using the following formula: S = 1 / (d + ε); Where d is the spatial distance and ε is a constant.

5. The method for detecting surface defects in remanufactured chips according to claim 4, characterized in that, Select the corresponding supplementary illumination angle to re-acquire supplementary images, and re-determine whether the local area is a defect area based on the supplementary images, including: Based on the first optical feature vector of the suspected defect area, a supplementary illumination angle is selected from the different light source angles, and a supplementary image of the local area is re-acquired at the supplementary illumination angle. Image enhancement processing is performed on the local region in the supplementary image, and optical feature information is re-extracted from the processed local region to generate an updated first optical feature vector; The spatial distance between the updated first optical feature vector and the second optical feature vector is determined, and the local region is determined to be a defect region based on the spatial distance.

6. The method for detecting surface defects in remanufactured chips according to claim 4, characterized in that, After generating the first optical feature vector, the method further includes: Sinusoidal fringe light is projected onto the local area and the corresponding fringe pattern is captured. The local curvature value of the fringe center line in the fringe pattern is determined and added to the end of the first optical feature vector as a fringe curvature feature.

7. The method for detecting surface defects in remanufactured chips according to claim 6, characterized in that, Determining the local curvature value of the center line of the stripe pattern and appending it as a stripe curvature feature to the end of the first optical feature vector includes: Extract the center line of the stripe pattern, sample every pixel along the center line, and calculate the local curvature value C=1 / R at the sampling point; where R is the radius of the fitted circle. The local curvature value C is linearly mapped to the integer range of 0-255 and then used as the stripe curvature characteristic value of the local region.

8. The method for detecting surface defects in remanufactured chips according to claim 7, characterized in that, The distance threshold is dynamically set, including: The distance threshold is dynamically set based on the median value of all local curvature values ​​in the current chip image and the median absolute deviation of all local curvature values ​​relative to the median value.

9. The method for detecting surface defects in remanufactured chips according to claim 5, characterized in that, Determining whether a local area is a defect area based on this spatial distance includes: If the spatial distance is still greater than the distance threshold, then the local area is determined to be a defect area.

10. A remanufactured chip appearance defect image detection system, characterized in that, The system includes: The acquisition and segmentation module is used to acquire multiple chip images of the chip under different light source angles; divide each chip image into multiple local regions, extract the optical feature information of each local region in images at different angles, and generate a first optical feature vector. The reference determination module is used to randomly select a local area of ​​a predetermined proportion as a reference area, determine a normal area based on the first optical feature vector of the reference area, and calculate the second optical feature vector corresponding to the normal area. The first determining module is used to calculate the spatial distance between the first optical feature vector and the second optical feature vector of each local region, determine whether the local region is a suspected defect region based on the spatial distance, and calculate its defect confidence. The second determining module, in response to the defect confidence level being lower than a preset confidence threshold, selects a corresponding supplementary illumination angle to re-acquire a supplementary image, and re-determines whether the local area is a defect area based on the supplementary image.