Visual detection algorithm and detection system for wafer surface defects
By combining grayscale template matching and ORB algorithm for wafer surface defect detection with YOLO v5 algorithm for classification, the problem of efficient and accurate detection of complex wafer patterns is solved, achieving efficient and stable non-contact detection results.
Patent Information
- Application Number
- CN202211393335.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-08
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2042-11-08
AI Technical Summary
Existing wafer inspection technologies are insufficient to meet the requirements for efficient and accurate defect detection of complex wafer patterns, especially for micron-level positioning accuracy and stability. Furthermore, traditional visual inspection algorithms do not perform well in complex patterns.
A grayscale-based template matching algorithm is used for grain segmentation and localization. The NCC and ORB algorithms are combined for position adjustment. The difference region is calculated by the average grayscale value of the template image. The YOLO v5 algorithm is used for defect classification. A visual inspection system is built for non-contact inspection.
It achieves efficient and accurate defect detection of complex wafer patterns, meeting the real-time and high-efficiency requirements of industrial production. It has high precision and good stability, does not require setting positioning mark points on the wafer, is suitable for complex patterns, and has high detection efficiency.
Smart Images

Figure CN115791822B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision detection technology, and in particular to a visual detection algorithm for wafer surface defects. Background Art
[0002] The rapid development of the global electronics industry and the integrated circuit (IC) design and manufacturing industries has further increased the demand for semiconductor chips in a wide range of industries around the world, such as communications, computing, healthcare, the internet, and automotive manufacturing. Breakthroughs in key wafer manufacturing technologies are becoming increasingly important.
[0003] The current wafer production process includes crystal pulling, slicing, grinding, chamfering, etching, cleaning, and inspection. Wafer surface defects refer to uncontrolled structures left on the wafer surface during the semiconductor manufacturing process due to process errors, environmental factors, and human interference. These structures often cause the wafer to malfunction, and in severe cases, even circuit failure. These unintended surface structures created during the production process are called wafer surface defects. Wafer inspection involves detecting surface defects. Inspection methods include contact and non-contact methods. Contact probes are the most common. Probes are used to bring a stylus into close contact with the surface of the object being inspected, transmitting surface information to a computer processing system via the probe and sensor. However, these methods often induce stress on the surface of the object being inspected, leading to damage or scratches. Furthermore, the stylus, being extremely thin, is susceptible to wear and even damage. Furthermore, electrical signals can damage integrated circuits. Non-contact methods include automated optical inspection systems, scanning electron microscopes, and atomic force microscopes. Optical inspection systems utilize a designed lighting system to illuminate the target, employ telecentric lenses to image the wafer surface, and employ computer vision object recognition technology to detect defects. It has the advantages of fast speed, low cost, wide imaging range, high flexibility and high throughput. Scanning electron microscopes and atomic force microscopes are usually more suitable for 3D inspection needs.
[0004] Wafer AOI equipment typically uses different methods to position and inspect patterned wafers, depending on the wafer pattern. However, these methods often suffer from the following common problems:
[0005] (1) The objects to be processed are usually wafers with relatively simple pattern features in the past. Traditional wafers will have mark points specifically for positioning during the production process. The wafers have positioning straight edges or positioning angles. Each grain can be quickly located through the mark points. The grains can be positioned by visual template matching or other mechanical methods through the remaining mark points. The angle is then determined by calculating the relative position and the deviation angle. This type of method is usually not very accurate and cannot meet the current micron-level production requirements. In addition, this type of method is more suitable for production environments with relatively simple wafer patterns. In the current situation where the wafer pattern is complex, it is difficult to locate the position of the wafer through the mark point method.
[0006] (2) The objects to be processed are usually wafers with clear and distinguishable patterns and backgrounds. Traditional visual inspection algorithms detect defects through image preprocessing and image processing based on edge features, such as edge extraction using edge detection algorithms such as Sobel, Canny, and Robert. This method does not require the operator to provide a priori templates, but a suitable detection method must be designed for specific wafer defect types. The design difficulty increases with the complexity of the wafer pattern, and the stability is not very good. Summary of the Invention
[0007] The purpose of the present invention is to provide a visual detection algorithm and detection device for wafer surface defects, so as to achieve efficient detection of wafers with complex patterns. To achieve the above purpose, the present invention adopts the following technical solutions:
[0008] The present invention discloses a visual detection algorithm for wafer surface defects, which includes the following process:
[0009] a. Segmentation and localization
[0010] The original wafer image is acquired, the original wafer image is segmented into individual grain images, and the individual grain images are located.
[0011] b. Preprocessing
[0012] The image of the grain to be inspected is obtained by adjusting the position and brightness of the single grain image.
[0013] c. Surface defect detection
[0014] c1. Use multiple grain images of good quality as training samples to obtain multiple template images. Calculate the average template image by taking the grayscale average of each pixel in the template image. Calculate the difference between the grain image to be tested and the average template image.
[0015] c2. Locate the difference area and obtain the defect area.
[0016] c3. Classify the defective areas of the wafer into different types.
[0017] In process a, a grayscale-based template matching algorithm is used to segment a single grain, including the following steps:
[0018] a1. Template creation
[0019] The grains with better imaging are captured in the real-time image as template images.
[0020] a2. Template search
[0021] Input the grain image to be inspected, first scale down the corresponding ROI area, then perform sampling search on the pyramid image with a fixed number of layers. After searching the corresponding centroid area, search the upper pyramid again. If it is a complete match, it is identified as a matching area. After all ROI areas are searched, the centroid coordinates of the matching area are output for segmentation.
[0022] Preferably, when searching for a template, the NCC algorithm is used, the suffix S(x,y) is added, the center of gravity (x,y) area is searched, and the value of NCC(x,y) is calculated using the following formula:
[0023] S(x,y)=g(x,y)+S(x-1,y)+S(x,y-1)-S(x-1,y-1)
[0024] Among them, g(x,y) is the calculation formula of the grayscale mean or variance corresponding to the target point. The sum table is calculated once before calculating the NCC value. The sum of the g(x,y) area is calculated using this table. The formula is as follows:
[0025]
[0026] Among them, m and n are the length and width pixels of the template image;
[0027]
[0028] Among them, z is the number of pixels of the template image, R is the ROI area of the template image, (u, v) is a point on this area, m t is the average gray value of the template image, is the variance of the grayscale value of the template image, m o (x,y) is the average gray value of the region, is the variance of the grayscale values of all points in the candidate area centered at (x, y);
[0029] Determine whether the NCC value reaches the threshold. If not, re-search the centroid (x, y). If it reaches the threshold, determine whether upsampling search is needed. If upsampling search is needed, re-search the centroid (x, y). If upsampling search is not needed, output the centroid coordinates.
[0030] Furthermore, when selecting template images, multiple templates are selected by calculating images with different pyramid levels and different rotation angles. Using multi-angle templates helps improve segmentation accuracy.
[0031] Preferably, the method for locating a single grain image is to use spatial pose transformation to locate the world coordinates of the grain and interact with Mapping. The formula for converting pixel coordinates to world coordinates is:
[0032]
[0033] in:
[0034]
[0035]
[0036] Among them, X W 、Y W , Z W is the world coordinate, X C 、Y C , Z C is the pixel coordinate, f x and f y represents the focal length of the camera, K represents the camera internal parameter, w represents the larger value of the pixel value corresponding to the length and width of the image, h represents the smaller value of the pixel value corresponding to the length and width of the image, and D f represents the maximum visible distance of the camera, θ represents the field of view of the camera, R and t represent the rotation matrix and translation vector of the camera respectively.
[0037] Preferably, the method for adjusting the position of a single grain image is a secondary grain alignment based on the ORB algorithm, comprising the following steps:
[0038] b1. Generate a multi-layer pyramid, traverse the detection area of each layer of the pyramid, record the grayscale value of the detection point as I(x, y), and set the threshold T.
[0039] b2. With the pixel point (x, y) as the center, select N pixels on a circle with a preset radius.
[0040] b3. Check four points directly above, below, to the left, and to the right of point (x, y). If the grayscale values of three of these points are greater than I(x, y) + T or less than I(x, y) - T, go to step b4; otherwise, return to step b1.
[0041] b4. Check the remaining points. If there are N-3 points whose grayscale values are greater than I(x,y) or less than I(x,y)-T, then consider the point as a feature point. If more traversal is required, return to step b1; otherwise, go to step b5.
[0042] b5. Non-maximum suppression is used to filter out the maximum feature points, calculate the Harris response value of the maximum feature points, and use the grayscale centroid method to calculate the direction of the feature points.
[0043] b6: The feature point set is sorted by Harris response value, and the first few points with the largest response value are selected as the result point set.
[0044] b7: Make a homography matrix of the resulting point set and rotate and translate the grain image to achieve position adjustment.
[0045] Furthermore, a method for adjusting the brightness of a single grain image is a dodging process based on single-map histogram registration. The specific steps are: mapping the histogram of the grain image to be detected to the histogram of the template image, and keeping the value of the low-grayscale area unchanged during the mapping process; the formula is as follows:
[0046]
[0047]
[0048] In the above formula, G1 and G2 represent I(x,y)+T and I(x,y)-T in step b3, respectively. i Represents the location set of points with pixel gray value i, p o (o i ) means o i The average brightness value of the point; t j Represents the location set of points with pixel gray value j, p t (t j ) represents t j The average brightness value of the point.
[0049] Furthermore, the method for obtaining the average grain template image is as follows: multiple grain images with good quality are used as training samples for training, and the variation template is obtained by calculating the grayscale value variation range of each pixel of the training sample. The calculation formula of the average template image pixels and the threshold pixels is as follows:
[0050]
[0051] v(x,y)=max{o i (x,y)}-min{o i (x,y)}
[0052] tu (x,y)=i(x,y)+max{a u ,b u v(x,y)}
[0053] t l (x,y)=i(x,y)-max{a l ,b l v(x,y)}
[0054] Among them, i(x,y) is the pixel of the average template image, o i (x, y) is the pixel value of each position in the training sample, v(x, y) is the pixel of the change template, t u (x,y) is the upper threshold image pixel, t l (x,y) is the lower threshold image pixel, parameter a u 、a l Indicates the allowable range of the grayscale value difference between the image to be detected and the average template image, parameter b u 、b l Used to determine the impact factor of the changing template on the threshold image.
[0055] Preferably, defects are located and defect information is obtained through mathematical morphology, and the steps are as follows: obtain a grayscale image of the difference area and binarize the grayscale image; perform an opening operation on the binarized image to remove small noise areas; perform image contour extraction and screening; add a rectangular defect frame outside the screened contour, and traverse to see if the distance between the defect frame and other defect frames is less than a preset distance threshold; if the distance is less than the preset distance threshold, merge the traversed defect frame with other defect frames whose distance is less than the preset distance threshold, and output the merged defect frame as the target defect area.
[0056] The defective areas of the wafer are classified into types using the YOLO v5 algorithm, and the types include any one or more of scratches, chipping, ink stains, water stains, and cracks.
[0057] A visual inspection system for wafer surface defects includes: a loading platform, a motion control component, a light source, an imaging system, an image acquisition card, a motion control card and an image processing system.
[0058] The loading platform is used to hold wafers; the motion control component is connected to the loading platform and is used to control the movement of the loading platform; the light source is used to illuminate the loading platform; the imaging system is located above the loading platform and is used to obtain wafer images; the image acquisition card is used to obtain wafer images from the imaging system, digitally save them, and transmit them to the image processing system; the motion control card is connected to the image processing system, is used to receive control signals from the image processing system, and control the movement of the motion control component; the image processing system calculates and outputs the types of wafer defects through the above-mentioned visual detection algorithm for wafer surface defects.
[0059] Due to the adoption of the above solution, the present invention has the following beneficial effects:
[0060] 1. This invention is a defect classification and detection algorithm that improves traditional visual algorithms based on a variation model. By calculating the difference between the image of the grain to be detected and the average template image, the defect is identified and its location is obtained, and the grain defects are classified, meeting the industrial demand for high efficiency and real-time performance. This invention is a non-contact detection method that does not require positioning marks on the wafer. It is suitable for defect detection of complex wafer patterns and has high accuracy and good stability.
[0061] 2. The wafer defect detection algorithm designed in the present invention can meet industrial production requirements for grain segmentation accuracy, surface defect detection accuracy and detection time of local real-time images of wafers, and has high detection efficiency.
[0062] 3. To address the difficulty of segmenting complex wafer grain patterns, this invention employs an FNCC template matching algorithm based on image grayscale features to extract and segment grains. The algorithm operates stably despite changes in brightness, saturation, and gamma. A matching buffer, multi-angle templates, and image pyramids are implemented to improve segmentation accuracy and speed, and address edge interference issues.
[0063] 4. The preprocessing step of the present invention is a pre-step for wafer detection, and a series of preprocessing corrections are performed on the problems of chromaticity deviation and posture offset of the segmented grains. For the problem of uneven illumination and uneven chromaticity caused by the illumination of the grains on the wafer surface, an improved single mapping histogram matching is adopted. This method maps the histogram of the grain to be detected to the histogram of the template grain, but keeps the value of the low grayscale area unchanged during the mapping process, because the grayscale value of the defect is usually distributed in this defect. In this way, the RGB histogram of the image of the grain to be detected can be expanded to a specified range and similar to the good template grain without affecting the defect characteristics of the grain surface, which can effectively solve the problem of uneven brightness and chromaticity to a certain extent. In addition, for a small number of grains that are not accurately matched at one time, the ORB registration algorithm is adopted. Through the two steps of directional fast corner extraction and rotation feature description, the positioning and alignment of the wafer can be achieved quickly and effectively.
[0064] 5. The present invention adopts a traditional visual algorithm improved based on a change model to perform a binary classification detection algorithm for defects, extracts the substantial difference area between the grain to be detected and the template grain, and then identifies the defects through mathematical morphology and obtains specific information such as the location and area of the defects. The YOLO v5 model is used to perform N-classification detection of grain defects, which can meet the industry's requirements for high efficiency and real-time performance.
[0065] 6. The inspection system of the present invention enables wafer images to meet the required resolution for inspection, with stable brightness and exposure, ensuring clear and discernible wafer defects. During the inspection process, the system of the present invention uses a motion control assembly to control the X and Y axis movement of the stage. The imaging system is located in the same position, and the purpose of traversing the wafer grains is achieved by simply moving the wafer on the stage using the slide.
[0066] 7. The present invention adds a suffix table based on the NCC algorithm, which greatly improves the running speed of template matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a structural schematic diagram of the visual detection system for wafer surface defects of the present invention.
[0068] Figure 2 It is a flow chart of the detection algorithm of the present invention.
[0069] Figure 3 This is a flow chart of the template matching algorithm.
[0070] Figure 4 It is a defect location process based on mathematical morphology. ( Figure 4 a is a grayscale image, Figure 4 b is the difference area, Figure 4c is binarization, Figure 4 d is the opening operation, Figure 4 e is the extracted contour, Figure 4 f is the contour filter, Figure 4 g is the minimum circumscribed moment, and Figure 4h shows the defect frame merging)
[0071] Description of main component symbols:
[0072] 1: Loading platform, 2: Motion control component, 3: Light source, 4: Imaging system, 5: Image acquisition card, 6: Motion control card, 7: Image processing system, 8: Wafer. DETAILED DESCRIPTION
[0073] In order to enable those skilled in the art to better understand the technical solutions of the present invention, the present invention is described in further detail below with reference to the accompanying drawings and specific embodiments.
[0074] like Figure 1 As shown, the present invention discloses a visual inspection system for wafer surface defects, including: a loading platform 1, a motion control component 2, a light source 3, an imaging system 4, an image acquisition card 5, a motion control card 6 and an image processing system 7.
[0075] The carrier platform 1 is used to hold wafers 8. The motion control component 2 is connected to the carrier platform 1 and is used to control the movement of the carrier platform 1. The light source 3 is installed on both sides of the upper side of the carrier platform 1 to illuminate the carrier platform 1. The imaging system 4 is located above the carrier platform 1 and is used to obtain wafer images. The imaging system 4 is a camera. The image acquisition card 5 is used to obtain the wafer image of the imaging system 4, store it digitally, and transmit it to the image processing system 7. The motion control card 6 is connected to the image processing system 7 and is used to receive the control signal of the image processing system 7 and control the movement of the motion control component 2. The image processing system 7 calculates and outputs the type of wafer defects through a visual detection algorithm for wafer surface defects.
[0076] During the inspection process, the imaging system remains in the same position. The goal of traversing the wafer dies is achieved simply by moving the wafer on the stage using the slide. The motion control assembly controls the X and Y axis movement of the stage and adjusts the magnification and focal length of the imaging system lens.
[0077] like Figure 2 As shown, the present invention discloses a visual detection algorithm for wafer surface defects, including the following process:
[0078] a. Segmentation and localization
[0079] 1. Split
[0080] The original wafer image is acquired, the original wafer image is segmented into individual grain images, and the individual grain images are located.
[0081] like Figure 3 As shown, a grayscale-based template (FNCC template) matching algorithm is used to segment a single grain, including the following steps:
[0082] a1. Template creation
[0083] In the real-time image, a grain with good imaging is captured as a template image. When selecting the template image, multiple templates are selected by calculating images with different pyramid layers and different rotation angles.
[0084] When making the template, calculate the template center of gravity and the average grayscale m t , calculate the gray value variance Determine whether downsampling search is required. If so, recalculate the template center of gravity. If not, determine whether rotation is required. If rotation is required, recalculate the template center of gravity. If rotation is not required, substitute the saved data into the template search.
[0085] a2. Template search
[0086] Input the grain image to be inspected, first scale down the corresponding ROI area, then perform sampling search on the pyramid image with a fixed number of layers. After searching the corresponding centroid area, search the upper pyramid again. If it is a complete match, it is identified as a matching area. After all ROI areas are searched, the centroid coordinates of the matching area are output for segmentation.
[0087] When searching for a template, the NCC algorithm is used, and the suffix table S(x,y) is added to search the center of gravity (x,y) area and calculate the variance of the grayscale value of the area. Calculate the average gray value m of the region o (x,y), calculate the value of NCC(x,y), the calculation formula is as follows:
[0088] S(x,y)=g(x,y)+S(x-1,y)+S(x,y-1)-S(x-1,y-1)
[0089] Among them, g(x,y) is the calculation formula of the grayscale mean or variance corresponding to the target point. The sum table is calculated once before calculating the NCC value. The sum of the g(x,y) area is calculated using this table. The formula is as follows:
[0090]
[0091] Among them, m and n are the length and width of the template image in pixels; this algorithm can reduce the original time complexity from O(m·n·M·N) to O(M·N), M and N are the length and width of the image to be detected. This algorithm uses memory in exchange for time.
[0092]
[0093] Among them, z is the number of pixels of the template image, R is the ROI area of the template image, (u, v) is a point on this area, m t is the average gray value of the template image, is the variance of the grayscale value of the template image, m o (x, y) is the average gray value of the region (i.e. the average gray value of the candidate region at all points in the template), It is the regional gray value variance (i.e. the variance of the gray values of all points in the candidate area centered at (x, y).
[0094] Determine whether the NCC value reaches the threshold. If not, re-search the centroid (x, y). If it reaches the threshold, determine whether upsampling search is needed. If upsampling search is needed, re-search the centroid (x, y). If upsampling search is not needed, output the centroid coordinates.
[0095] 2. Positioning
[0096] The method for locating a single grain image is to use spatial pose transformation to locate the world coordinates of the grain and interact with Mapping. The formula for converting pixel coordinates to world coordinates is:
[0097]
[0098] in:
[0099]
[0100]
[0101] Among them, X W 、Y W , Z W is the world coordinate, X C 、Y C , Z C is the pixel coordinate, f x and f y represents the focal length of the camera, K represents the camera internal parameter, w represents the larger value of the pixel value corresponding to the length and width of the image, h represents the smaller value of the pixel value corresponding to the length and width of the image, D f represents the maximum visible distance of the camera, θ represents the field of view of the camera, R and t represent the rotation matrix and translation vector of the camera respectively.
[0102] b. Preprocessing
[0103] The image of the grain to be inspected is obtained by adjusting the brightness and position of the single grain image.
[0104] 1. Position adjustment
[0105] The method for adjusting the position of a single grain image is a secondary grain alignment based on the ORB algorithm. Input: image of the region to be detected (x, y)∈ROI, expected number of feature points N, including the following steps:
[0106] (1) Feature point extraction in ORB (i.e., directional fast corner point extraction)
[0107] b1. Generate a multi-layer pyramid, traverse the detection area of each layer of the pyramid, record the grayscale value of the detection point as I(x, y), and set the threshold T;
[0108] b2. Select N pixels on a circle with a preset radius, centered at the pixel point (x, y);
[0109] b3. Check the four points directly above, below, to the left, and to the right of point (x, y). If the grayscale values of three of these points are greater than I(x, y) + T or less than I(x, y) - T, go to step b4; otherwise, return to step b1.
[0110] b4: Detect the remaining points. If the grayscale value of N-3 points is greater than I(x,y) or less than I(x,y)-T, then the point is considered a feature point. If more points need to be traversed, return to step b1, otherwise go to step b5;
[0111] b5: Non-maximum suppression filters the maximum feature points, calculates the Harris response value of the maximum feature points, and uses the grayscale centroid method to calculate the direction of the feature points;
[0112] b6: The feature point set is sorted by Harris response value, and the first few points with the largest response value are selected as the result point set.
[0113] (2) Rotation feature description
[0114] b7: Make a homography matrix of the resulting point set and rotate and translate the grain image to achieve position adjustment.
[0115] In this step, the "Brief" section describes the vector creation algorithm. The ORB algorithm creates a feature vector consisting only of 1s and 0s, known as a binary feature vector. The order of 1s and 0s varies depending on the specific keypoint and the surrounding pixel area. This vector represents the intensity pattern around the keypoint, so multiple feature vectors can be used to identify larger areas or even specific objects in the image. Finally, matching points are screened and the image is rotated and translated using a homography matrix to achieve the desired correction.
[0116] 2. Brightness adjustment
[0117] The method for adjusting the brightness of a single grain image is a dodging process based on single-map histogram registration. The specific steps are: mapping the histogram of the grain image to be inspected to the histogram of the template image, and keeping the value of the low-grayscale area unchanged during the mapping process; the formula is as follows:
[0118]
[0119]
[0120] In the above formula, G1 and G2 represent I(x,y)+T and I(x,y)-T in step b3, respectively. i Represents the location set of points with pixel gray value i, p o (o i ) means o i The average brightness value of the point; t j Represents the location set of points with pixel gray value j, p t (t j ) represents t j The average brightness value of the point.
[0121] c. Surface defect detection
[0122] c1. A difference image algorithm based on a variation model is used to determine the difference area between the template grain and the grain to be inspected. This involves using multiple images of grains with good quality as training samples to obtain multiple template images. The average template image is obtained by taking the average grayscale value of each pixel in the template image. The difference area between the image of the grain to be inspected and the average template image is then calculated.
[0123] The method for obtaining the average grain template image is as follows: multiple grain images with good quality are used as training samples for training, and the variation template is obtained by calculating the grayscale value variation range of each pixel of the training sample. The calculation formula of the average template image pixels and the threshold pixels is as follows:
[0124]
[0125] v(x,y)=max{o i(x,y)}-min{o i (x, y)}
[0126] t u (x,y)=i(x,y)+max{a u ,b u v(x,y)}
[0127] t l (x,y)=i(x,y)-max{a l ,b l v(x,y)}
[0128] Among them, i(x,y) is the pixel of the average template image, o i (x, y) is the pixel value of each position in the training sample, v(x, y) is the pixel of the change template, t u (x,y) is the upper threshold image pixel, t l (x,y) is the lower threshold image pixel, parameter a u 、a l Indicates the allowable range of the grayscale value difference between the image to be detected and the average template image, parameter b u 、b l Used to determine the impact factor of the changing template on the threshold image.
[0129] c2. Locate the difference area and obtain the defect area
[0130] like Figure 4 As shown, the defects are located and the defect information is obtained by mathematical morphology. The steps are as follows: Get the grayscale image of the difference area ( Figure 4 a\4b), binarize the grayscale image ( Figure 4 c); Open the binary image ( Figure 4 d) to remove small noise areas; perform image contour extraction and screening ( Figure 4 e / 4f); add a rectangular defect frame outside the screened contour ( Figure 4 g) Whether the distance between the traversed defect frame and other defect frames is less than the preset distance threshold; if the distance is less than the preset distance threshold, the traversed defect frame is merged with other defect frames whose distance is less than the preset distance threshold ( Figure 4 h), output the merged defect frame as the target defect area.
[0131] c3. Classify the defective areas of the wafer into different types.
[0132] The YOLO v5 algorithm is used to categorize defective areas on wafers into any or a combination of scratches, chipped edges, ink stains, water stains, and cracks. A dataset is constructed and then fed into a network consisting of a network input, feature extraction network, path aggregation network, and output prediction layer. Finally, a predicted rectangle with a defect label is generated.
[0133] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with this technical field within the technical scope disclosed by the present invention should be covered by the scope of protection of the present invention.
Claims
1. A visual inspection algorithm for wafer surface defects, characterized by: The following processes are included: a. Segmentation and localization Acquire the original wafer image, segment the original wafer image into individual grain images, and locate the individual grain images; b. Preprocessing After adjusting the position and brightness of a single grain image, an image of the grain to be inspected is obtained; The method for adjusting the position of a single grain image is a secondary grain alignment based on the ORB algorithm, which includes the following steps: b1. Generate a multi-layer pyramid, traverse the area to be detected in each layer of the pyramid, and record the grayscale value of the detection point , set the threshold ; b2. In pixels As the center, select N pixels on a circle with a preset radius; b3. Detection If the grayscale value of three of the four points directly above, below, left, and right is greater than or less than , go to step b4; otherwise return to step b1; b4. Check the remaining points. If the grayscale value of N-3 points is greater than or less than Then consider this point as a feature point. If traversal is required, return to step b1, otherwise go to step b5; b5. Non-maximum suppression filters the maximum feature points, calculates the Harris response value of the maximum feature points, and calculates the direction of the feature points using the grayscale centroid method; b6: The feature point set is sorted by Harris response value, and the first few points with the largest response value are selected as the result point set; b7: Make a homography matrix of the result point set and rotate and translate the grain image to achieve position adjustment; The method for adjusting the brightness of a single grain image is a dodging process based on single-map histogram registration. The specific steps are: mapping the histogram of the grain image to be detected to the histogram of the template image, and keeping the value of the low-grayscale area unchanged during the mapping process. The low-grayscale area is the area with a grayscale value lower than 10. The formula is as follows: In the above formula, G1 and G2 represent the and , Represents the location set of points with pixel gray value i, express The average brightness value of the point; Represents the location set of points with pixel grayscale value j, express The average brightness value of the point; c. Surface defect detection c1. After training multiple grain images with good quality as training samples, multiple template images are obtained. The average template image is obtained by taking the grayscale average of each pixel in the template image, and the difference area between the grain image to be tested and the average template image is calculated; c2. Locate the difference area and obtain the defect area; c3. Classify the defective areas of the wafer into different types.
2. The visual detection algorithm for wafer surface defects according to claim 1, wherein: In process a, a grayscale-based template matching algorithm is used to segment a single grain, which includes the following steps: a1. Template creation Intercept the grains with better imaging in the real-time image as the template image; a2. Template search Input the grain image to be inspected, first scale down the corresponding ROI area, then perform sampling search on the pyramid image with a fixed number of layers. After searching the corresponding centroid area, search the upper pyramid again. If it is a complete match, it is identified as a matching area. After all ROI areas are searched, the centroid coordinates of the matching area are output for segmentation.
3. The visual detection algorithm for wafer surface defects according to claim 2, wherein: When searching for templates, use the NCC algorithm to add suffixes and tables , search the center of gravity (x, y) area and calculate the value of NCC (x, y). The calculation formula is as follows: Among them, g( x,y ) is the grayscale average calculation formula corresponding to the target point. The sum table is calculated once before calculating the NCC value. The table is used to calculate g( x,y ) area, the formula is as follows: Among them, m and n are the length and width pixels of the template image; Among them, z is the number of pixels of the template image, R is the ROI area of the template image, For a point in this area, is the average gray value of the template image, is the variance of the grayscale value of the template image, is the average gray value of the region, So ( x,y ) is the variance of the grayscale values of all points in the candidate area centered on ; Determine whether the NCC value reaches the threshold. If not, re-search the center of gravity (x, y). If it reaches the threshold, determine whether upsampling search is needed. If upsampling search is needed, re-search the center of gravity (x, y). If upsampling search is not needed, output the center of gravity coordinates.
4. The visual detection algorithm for wafer surface defects according to claim 2 or 3, wherein: When selecting template images, multiple templates are selected by calculating images with different pyramid levels and different rotation angles.
5. The visual detection algorithm for wafer surface defects according to claim 1, wherein: The method for locating a single grain image is to use spatial pose transformation to locate the world coordinates of the grain and interact with Mapping. The formula for converting pixel coordinates to world coordinates is: in: Among them, X W 、Y W , Z W is the world coordinate, X C 、Y C , Z C is the pixel coordinate, and represents the focal length of the camera, K represents the camera internal parameters, w Indicates the larger value of the pixel value corresponding to the length and width of the image. h Indicates the smaller value of the pixel value corresponding to the length and width of the image. Indicates the maximum viewing distance of the camera. represents the camera's field of view, R and t Represent the camera's rotation matrix and translation vector respectively.
6. The visual detection algorithm for wafer surface defects according to claim 1, wherein: The method for obtaining the average grain template image is as follows: multiple grain images with good quality are used as training samples for training, and the variation template is obtained by calculating the grayscale value variation range of each pixel of the training sample. The calculation formula of the average template image pixels and the threshold pixels is as follows: in, is the pixel of the average template image, is the pixel value at each position in the training sample, is the pixel of the changing template, is the upper threshold image pixel, is the lower threshold image pixel, parameter 、 Indicates the allowable range of the grayscale value difference between the image to be detected and the average template image. 、 Used to determine the impact factor of the changing template on the threshold image.
7. The visual detection algorithm for wafer surface defects according to claim 1, wherein: The defects are located and defect information is obtained through mathematical morphology. The steps are as follows: obtain the grayscale image of the difference area and binarize the grayscale image; perform an opening operation on the binarized image to remove small noise areas; and perform image contour extraction and screening. Add a rectangular defect frame outside the screened contour and check whether the distance between the defect frame and other defect frames is less than the preset distance threshold; If the distance is less than the preset distance threshold, the traversed defect frame is merged with other defect frames whose distance is less than the preset distance threshold, and the merged defect frame is output as the target defect area; The defective areas of the wafer are classified into types using the YOLO v5 algorithm, and the types include any one or more of scratches, chipping, ink stains, water stains, and cracks.
8. A visual inspection system for wafer surface defects, characterized in that: include: Loading platform, motion control components, light source, imaging system, image acquisition card, motion control card and image processing system; The loading platform is used to hold wafers; the motion control component is connected to the loading platform and is used to control the movement of the loading platform; the light source is used to illuminate the loading platform; The imaging system is located above the loading platform and is used to acquire wafer images; the image acquisition card is used to acquire wafer images from the imaging system, save them digitally, and transmit them to the image processing system; the motion control card is connected to the image processing system and is used to receive control signals from the image processing system and control the movement of the motion control component; the image processing system calculates and outputs the type of wafer defects through the visual detection algorithm for wafer surface defects described in any one of claims 1 to 7.
Citation Information
Patent Citations
Workpiece apparent defect detection method based on machine vision
CN106204614A