Chip defect detection method and system based on Gaussian attention mechanism
The enhanced image generated by the Gaussian attention mechanism, combined with distance transformation and local color change analysis, solves the problem of small and low-contrast defect detection in existing technologies and achieves high-precision and high-efficiency defect detection.
Patent Information
- Application Number
- CN202510779107.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-23
AI Technical Summary
Existing defect detection technologies are difficult to effectively identify tiny and low-contrast chip defects, and have problems such as high false alarm rate and high computational complexity, which cannot meet the practical application requirements of high precision and high efficiency.
A chip defect detection method based on the Gaussian attention mechanism is adopted. By generating a Gaussian attention channel and combining distance transformation and local color change analysis, an enhanced image is generated to guide the defect detection algorithm to focus on defective areas that are easily overlooked, thereby improving detection sensitivity and reducing false alarm rate.
It significantly improves the ability to perceive tiny and low-contrast defects, reduces the false alarm rate, and improves detection accuracy without increasing computational complexity, solving the shortcomings of traditional methods in detection sensitivity and efficiency.
Smart Images

Figure CN120689302A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of defect detection technology, and in particular to a chip defect detection method and system based on a Gaussian attention mechanism. Background Art
[0002] As semiconductor manufacturing processes continue to move toward smaller process nodes, the internal structure of chips becomes increasingly complex, placing higher demands on quality control during the manufacturing process. Defect detection, as a vital step in ensuring chip yield and reliability, has become a key component of the semiconductor manufacturing process. The defect detection systems currently used in the industry primarily rely on image acquisition and analysis. Through automated processing of wafer or chip images, they identify various potential manufacturing defects, thereby assisting in process optimization and finished product screening.
[0003] Existing defect detection solutions are mostly based on optical or electron beam inspection, combined with traditional image processing or deep learning algorithms. While optical inspection offers significant speed advantages, it is limited by optical resolution and struggles to detect smaller, lower-contrast defects. While electron beam inspection can achieve nanometer-level resolution, it suffers from slow scanning speeds, high equipment costs, and potential damage to the chip surface. Rule-based image processing methods, such as edge extraction and template matching, can identify some defects. However, complex backgrounds and varying textures often make it difficult to distinguish small or low-contrast anomalies, significantly limiting their recognition capabilities. Furthermore, while the recent introduction of deep learning has improved detection accuracy to some extent, model training requires extremely high quality and quantity of labeled data, resulting in significant training costs. Furthermore, the inherent computational complexity of deep learning models makes real-time deployment on high-volume production lines difficult. In summary, existing technologies often struggle to balance detection sensitivity and false positive rates for small and low-contrast defects, making them even more difficult to meet the practical application requirements of both high accuracy and high efficiency. Therefore, how to improve the detection system's sensitivity to tiny and low-contrast defects, thereby reducing the false alarm rate, while effectively improving defect detection accuracy without significantly increasing computational complexity is the current challenge. Summary of the Invention
[0004] This application provides a chip defect detection method and system based on the Gaussian attention mechanism, which can improve the detection system's sensitivity to tiny and low-contrast defects, thereby reducing the false alarm rate and effectively improving defect detection accuracy without significantly increasing computational complexity. This application provides the following technical solutions:
[0005] In a first aspect, the present application provides a chip defect detection method based on a Gaussian attention mechanism, the method comprising:
[0006] Acquire chip images, pre-process the acquired chip images, mark defect areas in the chip images, and generate a binary mask image reflecting defect distribution;
[0007] Based on the binary mask image, a Gaussian attention channel is generated by combining distance transformation and local color change analysis;
[0008] Connecting the Gaussian attention channel with the chip image in the channel dimension to generate an enhanced image;
[0009] A defect detection algorithm is executed based on the enhanced image to identify defective areas in the chip image.
[0010] In a specific embodiment, generating a Gaussian attention channel based on the binary mask image in combination with distance transformation and local color change analysis includes:
[0011] Generate a distance transform attention weight map based on the obtained binary mask image;
[0012] Analyzing local color changes of the binary mask image and obtaining a local color change information map;
[0013] The distance transformation attention weight map and the local color change information map are weightedly fused and processed by Gaussian filtering to form a Gaussian attention channel that can effectively highlight the defect area.
[0014] In a specific embodiment, generating a distance transformation attention weight map based on the obtained binary mask image includes:
[0015] Perform Euclidean distance transformation on the binary mask image, and calculate the minimum Euclidean distance from each foreground pixel to the background pixel in the binary mask image as follows:
[0016]
[0017] Where DT(x,y) represents the minimum Euclidean distance of the current foreground pixel (x,y), and B is the set of all background pixels (x′,y′);
[0018] After performing the Euclidean distance transformation operation, a distance map having the same size as the binary mask image is generated.
[0019] In a specific embodiment, after generating a distance map having the same size as the binary mask image, the method further includes:
[0020] A negative transformation mechanism is introduced to invert the distance value, thus achieving a positive correlation mapping between the distance value and the actual attention intensity;
[0021] The basic form of the negative transform is:
[0022] D′ (x,y) =D max -DT(x,y);
[0023] Among them, D′ (x,y) To introduce the distance value after negative transformation inversion, D max is the maximum distance value among all foreground pixels in the current image, and DT(x,y) represents the original distance value of pixel (x,y).
[0024] In a specific embodiment, after introducing the negative transformation mechanism to invert the distance value, the method further includes:
[0025] Set the preset percentile threshold D in the negative transformation results clip , all pixels exceeding the preset percentile threshold are clipped to this value, and the clipping result is expressed as:
[0026] D”(x,y)=min(D′ (x,y) ,D clip );
[0027] After cropping, the value range is normalized and compressed to the interval [0,1] to obtain the distance transformation attention weight map W(x,y):
[0028]
[0029] Among them, D min is the minimum value among the negative transformation results.
[0030] In a specific embodiment, analyzing the local color change of the binary mask image and obtaining the local color change information map includes:
[0031] Traverse each pixel marked as a defect and build a local sliding window in the chip image with it as the center;
[0032] Within the sliding window, the color difference between each neighboring pixel and the central pixel is analyzed, and the pixel with the largest color difference with the central pixel in the window is selected as a reference to obtain the local color change value representing the degree of color disturbance at that position;
[0033] Assign the corresponding local color change value to each pixel in the defect mask and generate a local color change information map.
[0034] In a specific embodiment, connecting the Gaussian attention channel with the chip image in the channel dimension to generate an enhanced image includes:
[0035] The chip image collected is in RGB format;
[0036] Keeping the three channels of the chip image in RGB format unchanged, the Gaussian attention channel is added to the chip image as the alpha channel in the fourth channel;
[0037] Generates an enhanced image in RGBA format.
[0038] In a second aspect, the present application provides a chip defect detection system based on the Gaussian attention mechanism, which adopts the following technical solutions:
[0039] A chip defect detection system based on Gaussian attention mechanism, comprising:
[0040] Image acquisition module, used for acquiring chip images;
[0041] An image preprocessing module is used to preprocess the collected chip image, mark the defect area in the chip image, and generate a binary mask image reflecting the defect distribution;
[0042] An attention channel generation module, configured to generate a Gaussian attention channel based on the binary mask image in combination with distance transformation and local color change analysis;
[0043] An image enhancement module, configured to connect the Gaussian attention channel with the chip image in the channel dimension to generate an enhanced image;
[0044] A defect detection module is used to execute a defect detection algorithm based on the enhanced image to identify defect areas in the chip image.
[0045] In a third aspect, the present application provides an electronic device comprising a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement a chip defect detection method based on a Gaussian attention mechanism as described in the first aspect.
[0046] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a program. When the program is executed by a processor, it is used to implement a chip defect detection method based on a Gaussian attention mechanism as described in the first aspect.
[0047] In summary, the beneficial effects of this application include at least:
[0048] (1) By constructing a Gaussian attention channel and fusing it into the original RGB image as an alpha channel to form an enhanced image, the system's ability to perceive tiny defects and low-contrast defects is significantly improved. In the process of generating the Gaussian attention channel, the distance transformation is used to emphasize the area near the center of the defect mask, and the local color change analysis is combined to capture the color mutation information, so that the enhanced image can highlight the defect area in terms of spatial position and local visual features. This attention mechanism effectively guides the subsequent detection model to focus on defect areas that are easily overlooked, fundamentally solving the problem that traditional algorithms have weak responses to defects with blurred edges, small size or low contrast, and improving the sensitivity and reliability of overall detection.
[0049] (2) A modular attention channel generation approach is adopted, which only introduces lightweight computational steps in the image preprocessing stage, avoiding major changes to the downstream defect detection algorithm structure. Without changing the core framework of the detection model, the prior enhancement of potential defect areas is achieved by introducing structured attention information into the input image. This approach not only avoids the computational burden brought by complex model stacking, but also significantly improves the accuracy of defect detection.
[0050] By capturing chip images and generating a binary mask image reflecting the defect distribution, this approach combines distance transformation and local color change analysis to construct a Gaussian attention channel. This channel is then fused with the original chip image in the channel dimension to generate an enhanced image. This effectively improves the saliency of defect areas without significantly increasing computational complexity. By guiding subsequent defect detection algorithms to focus on areas more likely to contain defects, this solution significantly enhances the system's ability to perceive small and low-contrast defects, reduces false alarm rates, and addresses the technical issues of insufficient defect detection sensitivity and low detection accuracy in existing technologies.
[0051] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application and to implement it in accordance with the contents of the specification, the following is a detailed description of the preferred embodiments of the present application in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a flow chart of the chip defect detection method based on the Gaussian attention mechanism in an embodiment of the present application.
[0053] Figure 2 This is a flow chart of generating a Gaussian attention channel by combining distance transformation and local color change analysis in an embodiment of the present application.
[0054] Figure 3 This is a structural block diagram of a chip defect detection system based on the Gaussian attention mechanism in an embodiment of the present application.
[0055] Figure 4 It is a block diagram of an electronic device for chip defect detection based on the Gaussian attention mechanism in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0057] Optionally, the present application uses the chip defect detection method based on the Gaussian attention mechanism provided in each embodiment as an example for explanation in an electronic device, where the electronic device is a terminal or a server. The terminal may be a computer, a tablet computer, etc. This embodiment does not limit the type of electronic device.
[0058] Reference Figure 1 , is a flow chart of a chip defect detection method based on a Gaussian attention mechanism provided by an embodiment of the present application. The method includes at least the following steps:
[0059] Step S101: Acquire chip images.
[0060] In step S101, an RGB image of the chip to be inspected is acquired. The acquired RGB image should cover the area to be inspected on the surface of the chip to be inspected and have appropriate resolution and clarity to ensure that all kinds of details in the image are completely preserved, thereby meeting the image requirements of subsequent processing.
[0061] In practice, image acquisition can be completed through conventional image acquisition means. This application does not limit the specific method of image acquisition. It only requires that the acquired image is a color image and contains channel information of the three colors R, G, and B.
[0062] Step S102 : pre-processing the collected chip image, marking the defective areas in the chip image, and generating a binary mask image reflecting the defect distribution.
[0063] In step S102, the collected chip image is first preprocessed. The preprocessing operations include, but are not limited to, image resizing, color channel normalization, edge filling, noise suppression, and other conventional image processing methods to improve the overall image quality and consistency.
[0064] After the chip image is preprocessed, the defective areas in the image are labeled. This operation results in a binary mask image of the same size as the original chip image, where the foreground area of the binary mask represents the defective area of the chip and the background area represents the non-defective area.
[0065] Optionally, the present application does not limit the specific method of marking defect areas, and can be based on manual marking, semi-automatic auxiliary tools or any other image analysis methods. It only requires that a binary mask image that accurately reflects the defect distribution can be obtained.
[0066] Step S103: Based on the binary mask image, a Gaussian attention channel is generated by combining distance transformation and local color change analysis.
[0067] Reference Figure 2 , which is a flow chart illustrating the process of generating a Gaussian attention channel by combining distance transform and local color change analysis in an embodiment of the present application. In step S103, a distance transform attention weight map is generated based on the obtained binary mask image. Simultaneously, the local color changes of the binary mask image are analyzed to obtain a local color change information map. Finally, the distance transform attention weight map and the local color change information map are weightedly fused and processed through Gaussian filtering to form a Gaussian attention channel that effectively highlights defect areas. The Gaussian attention channel is intended to provide spatial attention guidance for subsequent image enhancement and defect detection, thereby improving detection sensitivity to small, low-contrast defects.
[0068] Specifically, in the process of generating the distance transform attention weight map based on the binary mask image, the Euclidean distance transform is first performed on the entire binary mask image, and the minimum Euclidean distance from each foreground pixel to the background pixel in the binary mask image is calculated as follows:
[0069]
[0070] Here, DT(x,y) represents the minimum Euclidean distance of the current foreground pixel (x,y), and B is the set of all background pixels (x′,y′). Since the foreground region of the binary mask image represents the defective chip area, and the background region represents the non-defective area, for each pixel within the defective area, a smaller distance value indicates that the pixel is closer to the defect boundary; a larger distance value indicates that the pixel is deeper within the defective area. After performing the Euclidean distance transform, a grayscale image with the same size as the binary mask image is generated, where the value of each pixel represents its distance to the defect boundary. The resulting grayscale image is therefore called a distance map.
[0071] However, the distance map is negatively correlated with the attention intensity, that is, the pixel distance value in the core area of the defect is larger, and its corresponding attention intensity is lower, while the pixel distance value in the edge area is smaller, and its corresponding attention intensity is higher. However, this is inconsistent with the expected attention distribution logic, because in the defect detection task, the core area is often more able to reflect the essential characteristics of the defect and should receive higher attention. The ideal attention intensity distribution should make the defect center area have a higher attention intensity, while the attention intensity of the edge area is lower. To this end, this application introduces a negative transformation mechanism to invert the distance value, thereby achieving a positive correlation mapping between the distance value and the actual attention intensity.
[0072] In one possible embodiment, the basic form of the negative transform is:
[0073] D′ (x,y) =D max -DT(x,y);
[0074] Among them, D′ (x,y) To introduce the distance value after negative transformation inversion, D max is the maximum distance value among all foreground pixels in the current image, and DT(x,y) represents the original distance value of the pixel (x,y). This negative transformation process gives the defect center area a higher initial attention value, while the attention to the edge area gradually decreases, forming a spatial focus structure that conforms to the Gaussian distribution trend.
[0075] In addition, as a preferred embodiment, since there may be a small number of extreme values in the actual chip image, for example, the internal pixels of the isolated defect area have a distance much larger than the overall distribution, which will cause imbalance in the subsequent numerical normalization. This application adopts a percentile threshold clipping strategy to suppress it. Specifically, first set a preset percentile threshold in the negative transformation result, and forcibly clip all pixels exceeding the preset percentile threshold to this value to prevent individual pixels from amplifying the overall dynamic range. Assume that the preset percentile threshold is D clip , then the clipping result is expressed as:
[0076] D”(x,y)=min(D′ (x,y) ,D clip );
[0077] After cropping, the value range is linearly normalized and compressed to the interval [0, 1], and the distance transformation attention weight map W(x, y) is finally obtained:
[0078]
[0079] Among them, D minis the minimum value in the negative transformation result. This normalization process ensures that the final generated attention weight map has a uniform numerical range, facilitating subsequent fusion with other attention information. The distance transformation attention weight map constructed through the above process can effectively characterize the internal structural saliency of defect areas in the image, achieving weight enhancement in the defect center area and gradual attenuation in the edge areas. This provides spatial prior support for the construction of subsequent attention channels, improving the focusing ability and recognition accuracy of the entire defect detection process.
[0080] In implementation, in the process of analyzing local color changes of the binary mask image, the local color change analysis aims to identify the degree of color abnormality of the area corresponding to the binary mask image in the original chip image, thereby further enhancing the ability to distinguish defective areas.
[0081] Specifically, the analysis process begins with the original RGB chip image, combined with a binary mask image of the same size. Color change analysis is performed only on pixels marked as defective areas within the binary mask image. Furthermore, to ensure the integrity of boundary pixels, the original chip image is edge-filled before analysis.
[0082] Furthermore, each pixel marked as a defect is traversed, and a local sliding window is constructed in the original chip image with it as the center. The window size is usually 2×2 or 3×3. Within the sliding window, the degree of difference in color between each neighborhood pixel and the center pixel is analyzed. By examining the fluctuation amplitude of the neighborhood color value, it is determined whether there is obvious color anomaly in the area. In order to simplify processing efficiency, this application uses the maximum color difference as the evaluation index of local color change, that is, the pixel with the largest color difference from the center pixel in the sliding window is selected as a reference to obtain the local color change value representing the degree of color disturbance at that position.
[0083] After the above operations are completed, each pixel within the defect mask is assigned a numerical value representing the degree of its color perturbation, that is, the local color change value corresponding to each pixel, thereby generating a local color change information map. This information map represents the distribution of color anomalies in grayscale form. The higher the grayscale value, the more drastic the color change at the corresponding location, which usually also means that the defect boundary features are more prominent. To achieve subsequent fusion processing, the image must also be normalized to uniformly map the grayscale values of all pixels to the range of [0,1]. Through the above analysis, the local color change information map can effectively highlight the subtle perturbation features within the defect area, and is particularly suitable for identifying potential defect areas with blurred boundaries and low contrast, thereby providing stable and discriminative supplementary information for generating Gaussian attention channels.
[0084] Finally, after completing the generation of the distance transformation attention weight map and the local color change information map, the two are further weightedly fused to comprehensively consider the spatial position characteristics of the defect and the local color disturbance characteristics, thereby forming a more robust Gaussian attention channel.
[0085] During the fusion phase, an adjustable fusion coefficient is set to perform a weighted superposition of the distance transform attention weight map and the local color change information map. This fusion coefficient can be flexibly set based on the specific chip type, defect morphology, or application scenario to control the relative contributions of spatial and color factors in the final attention channel. For example, for small defects such as microcracks, the weight of color change information can be appropriately increased; while for large, concentrated defects, a higher weight can be given to distance transform information to enhance the attention response of the internal area.
[0086] After completing weighted fusion, the weighted result is Gaussian filtered to further improve the coherence and robustness of the fused image. As a smoothing operation, Gaussian filtering effectively suppresses local noise in the image while preserving the strong response characteristics of key areas. This makes the spatial distribution of the attention channel more continuous and smooth, and enhances the ability to depict the overall morphology of the defect area. The resulting Gaussian attention channel is essentially a grayscale image, whose pixel intensity reflects the model's attention to that location, with high-value areas corresponding to locations more likely to contain defects.
[0087] Step S104: Connect the Gaussian attention channel and the chip image in the channel dimension to generate an enhanced image.
[0088] In step S104, the generated single-channel Gaussian attention channel is sequentially spliced with the original three-channel RGB chip image in the channel dimension to obtain an enhanced image containing four channel information.
[0089] Specifically, the three channels of the original RGB chip image remain unchanged. A Gaussian attention channel is then added as the fourth channel, the alpha channel, to generate an enhanced image in RGBA format. This operation preserves the color and texture information of the original chip image while embedding the values from the attention channel that reflect the spatial significance of the defect area. In the resulting four-channel enhanced image, the first three channels still represent the chip's pixel values in the red, green, and blue color dimensions, while the fourth attention channel indicates the attention level of each pixel in grayscale. Higher values indicate a higher probability of a defect at that location.
[0090] Step S105 : executing a defect detection algorithm based on the enhanced image to identify defective areas in the chip image.
[0091] In step S105, the generated four-channel enhanced image is used as input to execute a defect detection algorithm to identify defective areas. It should be noted that this application does not limit the type of defect detection algorithm used to perform defect detection.
[0092] In practice, the alpha channel in the enhanced image, also known as the Gaussian attention channel, acts as explicit spatial guidance information, providing critical prior clues to the connected defect detection algorithm. This attention channel reflects the spatial distribution of possible defects in the chip image, enabling the detection algorithm to prioritize areas with higher response values in the image during training or inference, improving the model's ability to focus on the target area. This guidance mechanism is particularly effective in processing images with tiny defects, blurred boundaries, or low contrast, significantly improving detection recall and precision while reducing false positives.
[0093] In summary, the method captures the chip's raw RGB image, preprocesses it, and then annotates the defect areas to generate a binary mask image reflecting the defect distribution. Based on this, a distance transform technique is used to calculate the distance from each foreground pixel to the nearest background pixel. Through negative transformation and normalization, a distance transform attention weight map is generated that highlights the interior of the defect. Simultaneously, a sliding window approach is used to analyze local color changes in the original image, extracting the color change amplitude of each pixel's neighborhood and generating a local color change information map reflecting the degree of color anomaly. Furthermore, these two attention information are weightedly fused and smoothed using a Gaussian filter, ultimately forming a Gaussian attention channel with a continuous attention intensity distribution. This attention channel is concatenated with the original RGB image in the channel dimension to generate a four-channel RGBA image, which serves as the input data for the defect detection algorithm. During the detection process, the attention channel serves as an explicit spatial guidance mechanism, guiding the model to focus on possible defect locations, thereby improving the model's ability to detect small and low-contrast defects in complex backgrounds. Because this method generates and fuses attention weights during the preprocessing phase, it does not significantly increase the computational complexity of subsequent detection models, ensuring good scalability and engineering feasibility. Furthermore, by introducing the Gaussian attention mechanism, it achieves an effective balance between precision improvement and computational efficiency, resolving technical challenges such as low sensitivity and high false alarm rates in existing technologies for detecting small defects.
[0094] Figure 3 This is a block diagram of a chip defect detection system based on the Gaussian attention mechanism provided by an embodiment of the present application. The system includes at least the following modules:
[0095] Image acquisition module, used for acquiring chip images;
[0096] The image preprocessing module is used to preprocess the collected chip image, mark the defect area in the chip image, and generate a binary mask image reflecting the defect distribution;
[0097] Attention channel generation module, which is used to generate Gaussian attention channels based on binary mask images by combining distance transformation and local color change analysis;
[0098] Image enhancement module, used to connect the Gaussian attention channel with the chip image in the channel dimension to generate an enhanced image;
[0099] The defect detection module is used to execute a defect detection algorithm based on the enhanced image and identify defect areas in the chip image.
[0100] For relevant details, please refer to the above method embodiment.
[0101] Figure 4 4 is a block diagram of an electronic device provided in one embodiment of the present application. The device includes at least a processor 401 and a memory 402.
[0102] The processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0103] Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in memory 402 is used to store at least one instruction, which is executed by processor 401 to implement the chip defect detection method based on the Gaussian attention mechanism provided in the method embodiment of the present application.
[0104] In some embodiments, the electronic device may optionally include a peripheral device interface and at least one peripheral device. The processor 401, memory 402, and peripheral device interface may be connected via a bus or signal lines. Each peripheral device may be connected to the peripheral device interface via a bus, signal lines, or circuit boards. Illustratively, the peripheral devices include, but are not limited to, radio frequency circuitry, a touchscreen display, audio circuitry, and a power supply.
[0105] Of course, the electronic device may also include fewer or more components, which is not limited in this embodiment.
[0106] Optionally, the present application also provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the chip defect detection method based on the Gaussian attention mechanism of the above method embodiment.
[0107] Optionally, the present application also provides a computer product, which includes a computer-readable storage medium, in which a program is stored. The program is loaded and executed by a processor to implement the chip defect detection method based on the Gaussian attention mechanism of the above-mentioned method embodiment.
[0108] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0109] The above embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A chip defect detection method based on Gaussian attention mechanism, characterized in that: The method comprises: Acquire chip images, pre-process the acquired chip images, mark defect areas in the chip images, and generate a binary mask image reflecting defect distribution; Based on the binary mask image, a Gaussian attention channel is generated by combining distance transformation and local color change analysis; Connecting the Gaussian attention channel with the chip image in the channel dimension to generate an enhanced image; A defect detection algorithm is executed based on the enhanced image to identify defective areas in the chip image.
2. The chip defect detection method based on Gaussian attention mechanism according to claim 1, characterized in that: The generating of the Gaussian attention channel based on the binary mask image and combining distance transformation and local color change analysis includes: Generate a distance transform attention weight map based on the obtained binary mask image; Analyzing local color changes of the binary mask image and obtaining a local color change information map; The distance transformation attention weight map and the local color change information map are weightedly fused and processed by Gaussian filtering to form a Gaussian attention channel that can effectively highlight the defect area.
3. The chip defect detection method based on Gaussian attention mechanism according to claim 2, characterized in that: Generating a distance transformation attention weight map based on the obtained binary mask image includes: Perform Euclidean distance transformation on the binary mask image, and calculate the minimum Euclidean distance from each foreground pixel to the background pixel in the binary mask image as follows: Where DT(x,y) represents the minimum Euclidean distance of the current foreground pixel (x,y), and B is the set of all background pixels (x',y'); After performing the Euclidean distance transformation operation, a distance map having the same size as the binary mask image is generated.
4. The chip defect detection method based on Gaussian attention mechanism according to claim 3 is characterized in that: After generating the distance map having the same size as the binary mask image, the method further includes: A negative transformation mechanism is introduced to invert the distance value, thus achieving a positive correlation mapping between the distance value and the actual attention intensity; The basic form of the negative transform is: D'(x,y)=D max -DT(x,y); Among them, D'(x,y) is the distance value after the negative transformation is introduced, D max is the maximum distance value among all foreground pixels in the current image, and DT(x,y) represents the original distance value of pixel (x,y).
5. The chip defect detection method based on Gaussian attention mechanism according to claim 4, characterized in that: After introducing the negative transformation mechanism to reverse the distance value, the following steps are further included: Set the preset percentile threshold D in the negative transformation results clip , all pixels exceeding the preset percentile threshold are clipped to this value, and the clipping result is expressed as: D”(x,y)=min(D'(x,y),D clip ); After cropping, the value range is normalized and compressed to the interval [0,1] to obtain the distance transformation attention weight map W(x,y): Among them, D min is the minimum value among the negative transformation results.
6. The chip defect detection method based on Gaussian attention mechanism according to claim 2, characterized in that: The analyzing the local color change of the binary mask image and obtaining the local color change information map includes: Traverse each pixel marked as a defect and build a local sliding window in the chip image with it as the center; Within the sliding window, the color difference between each neighboring pixel and the central pixel is analyzed, and the pixel with the largest color difference with the central pixel in the window is selected as a reference to obtain the local color change value representing the degree of color disturbance at that position; Assign the corresponding local color change value to each pixel in the defect mask and generate a local color change information map.
7. The chip defect detection method based on Gaussian attention mechanism according to claim 1, characterized in that: Connecting the Gaussian attention channel with the chip image in the channel dimension to generate an enhanced image includes: The chip image collected is in RGB format; Keeping the three channels of the chip image in RGB format unchanged, the Gaussian attention channel is added to the chip image as the alpha channel in the fourth channel; Generates an enhanced image in RGBA format.
8. A chip defect detection system based on Gaussian attention mechanism, characterized in that: include: Image acquisition module, used for acquiring chip images; An image preprocessing module is used to preprocess the collected chip image, mark the defect area in the chip image, and generate a binary mask image reflecting the defect distribution; An attention channel generation module, configured to generate a Gaussian attention channel based on the binary mask image in combination with distance transformation and local color change analysis; An image enhancement module, configured to connect the Gaussian attention channel with the chip image in the channel dimension to generate an enhanced image; A defect detection module is used to execute a defect detection algorithm based on the enhanced image to identify defect areas in the chip image.
9. An electronic device, characterized in that: The device includes a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement a chip defect detection method based on a Gaussian attention mechanism as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The storage medium stores a program, which, when executed by a processor, is used to implement a chip defect detection method based on a Gaussian attention mechanism as described in any one of claims 1 to 7.
Citation Information
Cited By
Tongue image enhancement system and method based on deep learning
CN120953107A
A tongue image enhancement system and method based on deep learning
CN120953107B