A method and system for detecting abnormalities in mask fine line patterns

Through differential and logical operations within a single image, the problems of missed detection and over-detection caused by alignment errors in mask fine line pattern detection are solved, achieving efficient and accurate anomaly detection.

CN120563509BActive Publication Date: 2025-09-26ZHUHAI CHENGFENG ELECTRONIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511054374.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-09-26
Estimated Expiration
2045-07-30

AI Technical Summary

Technical Problem

Existing mask fine-line pattern anomaly detection methods are easily affected by alignment errors when dealing with tiny defects, resulting in missed detections and over-detection, making it difficult to simultaneously ensure a high detection rate and a low false alarm rate.

Method used

The method uses differential operations within a single image, grayscale processing, image vector analysis, block cropping and differential processing, combined with binarization and logical operations, to identify and filter out defects between blocks, retain the defect mask within the current block, perform boundary completion, and obtain the defect mask of the final mask image.

Benefits of technology

The pass rate is significantly reduced, the efficiency and reliability of mask inspection are improved, and the accuracy and reliability of inspection results are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120563509B_ABST
    Figure CN120563509B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for detecting anomalies in fine-line patterns on a mask, which relates to the field of pattern detection technology. After vertically cropping a fine-line image, the fine-line image is misaligned to obtain at least three image blocks. The masks of the differential image are merged through an AND operation to filter out defects between the image blocks, retaining only the defect mask within the current image block. The defect masks of the at least three image blocks are respectively expanded to the same size as the fine-line image. The completed defect masks are merged through an OR operation to obtain a defect mask for the fine-line image. The defect mask is then boundary-completed based on the endpoints of the fine-line pattern to obtain a final defect mask for the mask image. This detection method, based on differential operations within a single image, not only avoids over-detection due to image grayscale differences, but also effectively reduces false positives caused by alignment errors, thereby significantly reducing the overall over-detection rate and ultimately improving the efficiency and reliability of mask detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pattern detection, and in particular to a method and system for detecting anomalies of fine-line patterns on a mask. Background Art

[0002] In the field of semiconductor manufacturing, photolithography masks are crucial components. The accuracy of their patterns directly affects the performance and yield of the final chip. As the feature size of integrated circuits continues to shrink, the accuracy requirements of the pattern features on the mask, especially the fine-line structures, have reached unprecedented levels. Therefore, efficient and accurate anomaly (defect) detection of fine-line patterns on the mask is a key link in ensuring the yield of semiconductor production.

[0003] Currently, commonly used methods for detecting mask pattern anomalies include die-to-die (D2D) and die-to-database (D2DB). The D2DB method is widely used because it does not rely on repeated chip areas on the mask as a reference. It is suitable for detecting mask anomalies or certain special structures. The basic principle of the D2DB method is to compare the actual optical image of the mask with the design data (CAD database) and identify anomalies by detecting the difference between the two.

[0004] However, existing anomaly detection methods based on D2DB face significant challenges when processing fine-line graphics. The D2DB method first requires precise alignment of the optical image of the mask with the corresponding CAD database. For graphics with wider widths, even if there is a certain alignment error, the impact on difference detection is relatively limited. However, for fine-line graphics, since their line widths are usually very small, often only on the order of sub-micrometers or even tens of nanometers, in this case, even a tiny alignment error may have a serious impact on the detection results.

[0005] Common defects on the mask, such as pinholes and bridges, typically appear as extremely small features, perhaps only occupying a few pixels. These defects are so small that any slight alignment error during the inspection process can lead to inaccurate inspection results. Specifically, the following two issues may occur:

[0006] 1. Missed-Detection: Due to alignment errors, tiny defects that actually exist may be masked by the background or interference from normal patterns, making them impossible to detect correctly.

[0007] 2. False-Alarm / Over-inspection: Even a slight misalignment can introduce seemingly abnormal differences in normal graphic areas. This is especially true at the edges of fine lines. Minor misalignment can easily be mistaken for edge defects, causing the system to falsely report defects. This increases the burden and cost of subsequent manual review and reduces inspection efficiency.

[0008] In summary, although the D2DB-based method is feasible in principle, its performance is limited by the sensitivity to alignment errors when processing fine-line patterns with extremely high precision requirements and their tiny defects. It is difficult to simultaneously ensure a high detection rate and a low false alarm rate. This has become a key issue that needs to be urgently addressed in the current mask fine-line pattern anomaly detection technology.

[0009] Based on this, the present invention proposes a method and system for detecting anomalies in fine-line patterns on a mask. Based on differential operations within a single image, it can not only avoid over-detection due to image grayscale differences, but also effectively reduce false alarms caused by alignment errors, thereby significantly reducing the overall over-detection rate and ultimately improving the efficiency and reliability of mask detection. Summary of the Invention

[0010] The object of the present invention is to provide a method and system for detecting anomalies of fine line patterns on a mask, so as to solve the deficiencies in the background technology.

[0011] In order to achieve the above object, the present invention provides the following technical solution: a method for detecting anomalies in fine line patterns of a mask, the method comprising the following steps:

[0012] Gray-scaling the collected mask image to obtain a corresponding grayscale image, and maximizing the grayscale image in the horizontal and vertical directions to obtain at least two image vectors;

[0013] Determine the length direction of the thin line based on the image vector, and calculate the coordinates of the end points of the thin line based on the determination result;

[0014] According to the calculated coordinates of the endpoints of the thin line, the black boundary in the image is removed and the thin line area is retained to obtain the thin line image;

[0015] After offset cropping the thin line image, at least three image blocks are obtained, difference processing is performed on the obtained at least three image blocks to obtain a corresponding number of difference images, and then the difference images are binarized to obtain a corresponding number of defect mask binary images;

[0016] The masks of the difference images are merged through AND operation to filter out the defects between the tiles and only retain the defect masks within the current tile;

[0017] The defect masks of at least three blocks are expanded to the same size as the fine line image, and the completed defect masks are merged through an OR operation to obtain the defect mask of the fine line image. According to the endpoints of the fine line graphic, the boundary of the defect mask is completed to obtain the defect mask of the final mask image.

[0018] In a preferred embodiment, the thin line image is cropped to obtain at least three image blocks, comprising the following steps:

[0019] Calculate the height h_block of each cropped block;

[0020] Extract the area from 0 to h_block height from the thin line image roiImg to get the upper block ;

[0021] Extract the area from d to h_block+d height from the thin line image roiImg to get the middle block ;

[0022] Extract the area from 2d to h_block+2d height from the thin line image roiImg to get the lower block ;

[0023] The cropped thin line image roiImg is divided into three equal-height blocks: 、 and , representing the upper, middle and lower parts of the thin line image respectively.

[0024] In a preferred embodiment, performing differential processing on the obtained at least three image blocks to obtain a corresponding number of differential images includes the following steps:

[0025] Difference the upper block and the middle block to obtain the difference map diff_12, which represents the change area between the upper and middle blocks;

[0026] Difference the middle block with the lower block to obtain the difference map diff_23, which represents the change area between the middle and lower blocks;

[0027] The upper block is differentiated from the lower block to obtain a difference map diff_13, which represents the changed area between the upper and lower blocks.

[0028] In a preferred embodiment, binarization is performed on the difference image to obtain a corresponding number of defect mask binary images, including the following steps:

[0029] The pixel values ​​in the image are divided into two categories: pixels greater than the defect threshold are considered potential defect areas, and the defect mask image after binarization is 1; pixels less than or equal to the defect threshold are considered normal areas, and the defect mask image after binarization is 0;

[0030] After binarization, three defect mask binary images are obtained: mask_12, mask_23, and mask_13, which represent the difference areas between the upper and middle blocks, the middle and lower blocks, and the upper and lower blocks, respectively. The area with a pixel value of 1 in each binary image represents a detected defect, and the area with a value of 0 represents a normal part.

[0031] In a preferred embodiment, the masks of the difference images are merged by an AND operation to filter out defects between blocks and retain only the defect mask within the current block, including the following steps:

[0032] The defect mask mask_2 of the middle block is obtained by performing an AND operation on the difference mask mask_12 between the upper block and the middle block and the difference mask mask_23 between the middle block and the lower block;

[0033] The defect mask mask_3 of the lower block is obtained by performing an AND operation on the difference mask mask_23 between the middle block and the lower block and the difference mask mask_13 between the upper block and the lower block;

[0034] The defect mask mask_1 of the upper block is obtained by performing an AND operation on the difference mask mask_12 between the upper block and the middle block and the difference mask mask_13 between the upper block and the lower block;

[0035] After the AND operation, the obtained mask_1, mask_2 and mask_3 represent the defect masks of the upper block, middle block and lower block respectively. Each mask image contains the defect area within the current block and removes the error influence between other blocks.

[0036] In a preferred embodiment, the defect masks of at least three image blocks are respectively expanded to the same size as the fine line image, the completed defect masks are merged through an OR operation to obtain a defect mask of the fine line image, and the defect mask is boundary-completed according to the endpoints of the fine line graphic to obtain a defect mask of the final mask image, including the following steps:

[0037] Copy the valid areas of the upper, middle and lower defect masks mask_1, mask_2 and mask_3 to the corresponding positions of the original image, and fill the remaining areas with zeros to obtain the expanded masks;

[0038] The extended masks extended_mask_1, extended_mask_2 and extended_mask_3 are combined through OR operation to obtain the defect mask finalmask of the entire fine line image roiImg. After the OR operation, all pixel areas containing defects will be marked as 1;

[0039] After completing the boundary of the defect mask according to the endpoint coordinates of the thin line graphic, the final defect mask of the thin line image is obtained.

[0040] In a preferred embodiment, the grayscale image is maximized in the horizontal and vertical directions to obtain at least two image vectors, including the following steps:

[0041] The brightness information of the grayscale image grayImg is extracted in the horizontal and vertical directions to obtain two image vectors v1 and v2 respectively, where v1 represents the brightness information vector of the grayscale image in the horizontal direction, and v2 represents the brightness information vector of the grayscale image in the vertical direction. The horizontal image vector v1 is obtained by finding the maximum value of the grayscale image in each row, and the vertical image vector v2 is obtained by finding the maximum value of each column.

[0042] In a preferred embodiment, determining the length direction of the thin line based on the image vector includes the following steps:

[0043] Sum all elements of the brightness vectors v1 and v2 respectively to obtain two scalars s1 and s2, where s1 represents the sum of the brightness information of the image in the horizontal direction and s2 represents the sum of the brightness information of the image in the vertical direction;

[0044] By comparing the sizes of s1 and s2, the arrangement direction of the thin lines can be inferred. If the total brightness information s1 in the horizontal direction is greater than the total brightness information s2 in the vertical direction, it indicates that the direction of the thin line graphic is horizontal. If the total brightness information s1 in the horizontal direction is less than the total brightness information s2 in the vertical direction, it indicates that the direction of the thin line graphic is vertical.

[0045] In a preferred embodiment, grayscale processing is performed on the collected mask image to obtain a corresponding grayscale image, including the following steps:

[0046] By converting the RGB channels of a color image into a single brightness channel, the grayscale value of the image is calculated from the pixel values ​​of the RGB channels using a weighted average method. The RGB values ​​of each pixel are combined into a brightness value, which reflects the brightness of the pixel position.

[0047] The present application also provides an anomaly detection system for mask fine line patterns, comprising an image preprocessing module, an image cropping module, and an image merging and defect detection module;

[0048] Image preprocessing module: grayscales the acquired mask image to obtain a corresponding grayscale image. The grayscale image is maximized in the horizontal and vertical directions to obtain at least two image vectors. The length direction of the thin line is determined based on the image vectors, and the coordinates of the thin line endpoints are calculated based on the determination results.

[0049] Image cropping module: Based on the calculated coordinates of the thin line endpoints, the black boundaries in the image are removed and the thin line area is retained to obtain a thin line image. The thin line image is cropped to obtain at least three blocks. The obtained at least three blocks are subjected to difference processing to obtain a corresponding number of difference images. The difference images are then binarized to obtain a corresponding number of defect mask binary images.

[0050] Image merging and defect detection module: The masks of the differential image are merged through the AND operation to filter out the defects between the blocks, and only the defect mask within the current block is retained. The defect masks of at least three blocks are expanded to the same size as the fine line image. The completed defect masks are merged through the OR operation to obtain the defect mask of the fine line image. According to the endpoints of the fine line graphic, the boundary of the defect mask is completed to obtain the defect mask of the final mask image.

[0051] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0052] The present invention judges the length direction of the thin line based on the image vector, and calculates the coordinates of the endpoints of the thin line according to the judgment result. According to the calculated coordinates of the endpoints of the thin line, the black boundary in the image is removed and the thin line area is retained to obtain a thin line image. The thin line image is offset and cropped in the vertical direction to obtain at least three blocks. The at least three blocks obtained are differentially processed to obtain a corresponding number of differential images. The differential images are then binarized to obtain a corresponding number of defect mask binary images. The masks of the differential images are merged through an AND operation to filter out defects between the blocks and only retain the defect masks within the current block. The defect masks of the at least three blocks are respectively expanded to the same size as the thin line image. The completed defect masks are merged through an OR operation to obtain a defect mask of the thin line image. The defect mask is boundary-completed according to the endpoints of the thin line graphic to obtain a defect mask of the final mask image. This detection method is based on differential operations within a single image. It can not only avoid over-inspections due to image grayscale differences, but also effectively reduce false positives caused by alignment errors, thereby significantly reducing the overall over-inspection rate and ultimately improving the efficiency and reliability of mask detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments described in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0054] Figure 1 It is a timing diagram of the detection method of the present invention.

[0055] Figure 2 2 is an architectural diagram of the detection system of the present invention.

[0056] Figure 3 Schematic diagram of the grayscale of the mask image in the present invention.

[0057] Figure 4 Schematic diagram of left, center, and right cropping of a mask image block of the present invention.

[0058] Figure 5 Schematic diagram of the difference and binarization of the left, middle and right image blocks of the present invention.

[0059] Figure 6 Schematic diagram of the defect mask logic operation of the left, middle and right blocks of the present invention.

[0060] Figure 7 Schematic diagram of the top, middle and bottom cropping of a mask image of the present invention.

[0061] Figure 8 Schematic diagram of the difference and binarization of the upper, middle and lower blocks of the present invention.

[0062] Figure 9 Schematic diagram of the logic operation of the defect mask of the upper, middle and lower blocks of the present invention. DETAILED DESCRIPTION

[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0064] Example 1: Please refer to Figure 1 As shown, the present embodiment provides a method for detecting anomalies in fine-line patterns on a mask, the method comprising the following steps:

[0065] Using a microscope with a 10x objective lens and transmitted light illumination, the camera automatically scans the preset fine line detection area through the motion mechanism to obtain the mask image testImg (the transmitted light image of the mask fine line pattern).

[0066] Grayscale the acquired mask image testImg to obtain the corresponding grayscale image grayImg. Grayscale processing can simplify the subsequent analysis process and make the fine lines in the image more clearly visible.

[0067] The grayscale image grayImg is maximized in both the horizontal and vertical directions to obtain two image vectors, v1 and v2, representing the horizontal and vertical brightness information, respectively. These two image vectors are summed to obtain s1 and s2, where s1 represents the horizontal brightness sum and s2 represents the vertical brightness sum. By comparing s1 and s2, the length direction of the thin line is determined. If s1 > s2, the thin line is horizontal; otherwise, the thin line is vertical.

[0068] If the line is vertical, the upper and lower ordinates y1 and y2 of the line are calculated using the image vector v1. If the line is horizontal, the left and right ordinates x1 and x2 of the line are calculated using the image vector v2.

[0069] According to the calculated coordinates of the thin line endpoints, the black boundaries in the image are removed, and the thin line image is retained to obtain the thin line image roiImg. This thin line image only contains the thin line part and removes the irrelevant background part.

[0070] To further refine detection and improve accuracy, the thin line image roiImg is cropped. A cropping period d (32 pixels in this case) is preset, and three tiles are cropped vertically with offsets. During cropping, the height is set to the height of the thin line image roiImg minus two periods (i.e., 64 pixels), ensuring that each tile completely covers the thin line image. This results in three tiles: top, middle, and bottom.

[0071] Perform differential processing on the three resulting image blocks. The specific operation is as follows: Difference the upper and middle image blocks to obtain differential image diff_12. Difference the middle and lower image blocks to obtain differential image diff_23. Difference the upper and lower image blocks to obtain differential image diff_13. Binarize these three differential images using the preset defect threshold thresh to obtain the corresponding defect mask binary images: mask_12, mask_23, and mask_13.

[0072] Combine the masks of the difference image using an AND operation to filter out defects between the left and right tiles or between the upper and lower tiles, retaining only the defects within the current tile: Perform the AND operation on mask_12 and mask_23 to obtain the defect mask mask_2 for the middle tile. Perform the AND operation on mask_23 and mask_13 to obtain the defect mask mask_3 for the lower tile. Perform the AND operation on mask_12 and mask_13 to obtain the defect mask mask_1 for the upper tile.

[0073] The resulting defect masks for the top, middle, and bottom tiles are each expanded to the same size as the thin line image roiImg (the expanded portion is filled with zeros). These three completed masks are then combined using an OR operation to obtain the defect mask for the entire thin line image roiImg. Finally, the defect mask is boundary-completed based on the endpoints of the thin line pattern to obtain the final defect mask for the mask image, completing anomaly detection for the thin line pattern. Through these steps, abnormal defects in thin line patterns can be effectively identified while reducing the impact of alignment errors, ensuring high accuracy and low false positive rates in anomaly detection results.

[0074] The present application determines the length direction of the thin line based on the image vector, and calculates the coordinates of the endpoints of the thin line according to the determination result. According to the calculated coordinates of the endpoints of the thin line, the black boundary in the image is removed and the thin line area is retained to obtain a thin line image. The thin line image is cropped in the vertical direction to obtain at least three blocks. The at least three blocks obtained are differentially processed to obtain a corresponding number of differential images. The differential images are then binarized to obtain a corresponding number of defect mask binary images. The masks of the differential images are merged through an AND operation to filter out defects between the blocks and only retain the defect mask within the current block. The defect masks of the at least three blocks are respectively expanded to the same size as the thin line image. The completed defect masks are merged through an OR operation to obtain a defect mask of the thin line image. The defect mask is boundary-completed according to the endpoints of the thin line graphic to obtain the defect mask of the final mask image. This detection method is based on differential operations within a single image. It can not only avoid over-inspections due to image grayscale differences, but also effectively reduce false positives caused by alignment errors, thereby significantly reducing the overall over-inspection rate and ultimately improving the efficiency and reliability of mask detection.

[0075] Grayscale the acquired mask image testImg to obtain the corresponding grayscale image grayImg. Grayscale processing can simplify the subsequent analysis process and make the fine lines in the image more clearly visible.

[0076] Grayscaling the captured mask image testImg is a key step in image preprocessing. Grayscaling converts the original color image into a single-channel image, where the brightness of each pixel is represented as a grayscale value. This simplifies subsequent analysis, particularly for anomaly detection in fine line patterns. Grayscale images eliminate color complexity, making details and textures clearer while preserving the key image feature: the brightness variations of fine lines.

[0077] The basic principle of grayscale processing is to convert the three RGB channels (red, green, and blue) of a color image into a single brightness channel. Usually, the grayscale value of the image is calculated from the pixel values ​​of the three RGB channels using a weighted average method. The most commonly used grayscale formula is:

[0078] ,in, is the grayscale value of the pixel (x, y) in the image, R(x, y), G(x, y) and B(x, y) are the pixel values ​​of the red, green and blue channels of the image at (x, y) respectively. After grayscale processing, the RGB value of each pixel is combined into a brightness value, which reflects the brightness of the location. Here, the weights of the red, green and blue channels are and 0.1140, indicating the sensitivity of the human eye to different colors, with green contributing the most to brightness.

[0079] Grayscale images typically have pixel values ​​ranging from 0 to 255, with 0 representing black, 255 representing white, and other values ​​representing varying shades of gray. After grayscaling, fine lines within an image typically appear as brighter areas, while the background appears darker. This effectively emphasizes fine lines, making them easier to identify and analyze in subsequent processing steps.

[0080] Grayscaling significantly simplifies the complexity of an image. Images originally consisting of three RGB color channels are converted to a single grayscale channel. This process not only reduces image storage space but also reduces the computational burden of subsequent algorithms. When detecting thin line anomalies, grayscale images provide clearer details, especially when there is a significant brightness difference between the thin line and the background in the image. Grayscaling effectively enhances the visibility of the thin line, ensuring that the detection algorithm can more easily identify subtle defects in the thin line.

[0081] The primary function of grayscale processing is to make image details (such as fine lines) clearer by simplifying the image's color information. This step provides a more concise input for subsequent image processing, avoiding interference caused by the complexity of color information. Fine lines in grayscale images often differ significantly in brightness from the background, making subsequent edge detection and feature extraction operations more efficient in identifying anomalies.

[0082] The grayscale image grayImg is maximized in both the horizontal and vertical directions to obtain two image vectors, v1 and v2, representing the horizontal and vertical brightness information, respectively. These two image vectors are summed to obtain s1 and s2, where s1 represents the horizontal brightness sum and s2 represents the vertical brightness sum. By comparing s1 and s2, the length direction of the thin line is determined. If s1 > s2, the thin line is horizontal; otherwise, the thin line is vertical.

[0083] During image processing, the length direction of the thin line pattern can be further determined by analyzing the horizontal and vertical brightness information of the grayscale image grayImg. The core idea of ​​this step is to infer the arrangement direction of the thin lines based on the brightness distribution of the image in different directions. Specifically, by obtaining the brightness information vectors in the horizontal and vertical directions and summing them, a directional feature can be obtained to determine the direction of the thin line.

[0084] The brightness information of the grayscale image grayImg is extracted in the horizontal and vertical directions to obtain two image vectors v1 and v2 respectively. Among them, v1 represents the brightness information vector of the grayscale image in the horizontal direction, and v2 represents the brightness information vector of the grayscale image in the vertical direction. Specifically, the horizontal image vector v1 is obtained by finding the maximum value in each row (horizontally) of the grayscale image. That is: , where w is the width of the image, and v1(x) is the maximum brightness value of the x-th row, indicating the brightness information of that row. Similarly, the vertical image vector v2 is obtained by taking the maximum value of each column (vertical direction). That is: , where h is the height of the image, and v2(y) is the maximum brightness value of the y-th column, indicating the brightness information of the column.

[0085] For the obtained horizontal and vertical brightness vectors v1 and v2, sum all the elements of the brightness vectors v1 and v2 respectively to obtain two scalars s1 and s2. Among them, s1 represents the sum of the brightness information of the image in the horizontal direction, and s2 represents the sum of the brightness information of the image in the vertical direction. The specific calculation method is as follows: , where s1 is the sum of the maximum brightness values of all rows in the horizontal direction, and s2 is the sum of the maximum brightness values of all columns in the vertical direction.

[0086] By comparing the magnitudes of s1 and s2, the arrangement direction of the thin lines can be inferred. If the sum of the brightness information s1 in the horizontal direction is greater than the sum of the brightness information s2 in the vertical direction, it indicates that the main direction of the thin line pattern is horizontal. At this time, the distribution of the thin line pattern in the horizontal direction is relatively concentrated, and the length direction of the thin lines is also horizontal; conversely, if s1 < s2, the main direction of the thin lines is the vertical direction.

[0087] If the direction of the thin lines is horizontal, the abscissas x1 and x2 of the left and right endpoints of the thin lines are calculated through the image vector v1. If the direction of the thin lines is the vertical direction, the ordinates y1 and y2 of the upper and lower endpoints of the thin lines are calculated through the image vector v2.

[0088] In the process of image processing, accurately calculating the endpoint coordinates of the thin line pattern is one of the key steps for thin line anomaly detection. According to the direction of the thin lines (vertical or horizontal direction), different methods are required to calculate the endpoint coordinates of the thin lines. The goal of this process is to extract the effective area of the thin lines for subsequent finer processing and defect detection.

[0089] When the direction of the thin lines is horizontal, the abscissas x1 and x2 of the left and right endpoints of the thin lines are calculated through the image vector v1. In the horizontal direction, the thin line pattern usually presents a continuous brightness value area, and the endpoints can be determined by finding the starting and ending positions of the brightness change in the image vector v1.

[0090] Specifically, the image vector v1 represents the maximum brightness value of each row in the grayscale image. By traversing v1, the area where the brightness value is greater than the set threshold can be found, which is the horizontal area where the thin lines are located. The upper and lower endpoints of the thin lines respectively correspond to the starting and ending positions of the brightness area.

[0091] Assume that the value of v1(x) at a certain position in the image vector v1 is greater than the set brightness threshold T, then this position represents a part of the thin line pattern. The endpoints can be calculated as follows:

[0092] The ordinate x1 of the upper endpoint: Find the first brightness position greater than the threshold T in the image vector v1, which is the ordinate of the left endpoint of the thin line: ; The ordinate x2 of the right endpoint: Find the last brightness position greater than the threshold T in the image vector v1, which is the ordinate of the right endpoint of the thin line: ; Here, x1 and x2 are respectively the ordinates of the left and right ends of the thin line, and T is the set brightness threshold used to distinguish the thin line from the background.

[0093] When the thin line is oriented vertically, the horizontal coordinates y1 and y2 of the upper and lower endpoints of the thin line are calculated using the image vector v2. In the vertical direction, thin lines typically appear as continuous brightness regions within certain columns. The endpoints can be determined by finding the starting and ending locations of the brightness change in the image vector v2.

[0094] Image vector v2 represents the maximum brightness value in each column of the grayscale image. By traversing v2, we can find the region where the brightness value exceeds the set threshold T, that is, the vertical region where the thin line is located. The upper and lower endpoints of the thin line correspond to the starting and ending positions of the brightness region, respectively. Image vector v2 represents the maximum brightness value in each column of the grayscale image. By traversing v2, we can find the region where the brightness value exceeds the set threshold T, that is, the vertical region where the thin line is located. The upper and lower endpoints of the thin line correspond to the starting and ending positions of the brightness region, respectively.

[0095] Upper endpoint horizontal coordinate y1: Find the first brightness position greater than the threshold T from the image vector v2, which is the upper endpoint horizontal coordinate of the thin line: ; Lower endpoint horizontal coordinate y2: Find the last brightness position greater than the threshold T from the image vector v2, which is the lower endpoint horizontal coordinate of the thin line: Here, y1 and y2 are the horizontal coordinates of the upper and lower ends of the thin line, respectively, and T is the set brightness threshold used to distinguish the thin line from the background.

[0096] By analyzing the image vectors v1 and v2, the endpoint coordinates of the thin line can be accurately calculated. Vertically, the upper and lower endpoints are determined by finding the starting and ending positions of the maximum brightness. Horizontally, the left and right endpoints are determined by solving the brightness information of the column vectors. This endpoint detection provides an accurate foundation for subsequent thin line image extraction, defect analysis, and other image processing operations.

[0097] According to the calculated coordinates of the thin line endpoints, the black boundaries in the image are removed, and the thin line image is retained to obtain the thin line image roiImg. This thin line image only contains the thin line part and removes the irrelevant background part.

[0098] Based on the previous steps, the endpoint coordinates of the thin line have been calculated. These coordinates provide the precise location of the thin line image. Next, the goal is to remove the black boundaries in the image based on these endpoint coordinates, retaining only the thin line image, thereby obtaining an image roiImg containing only the thin line portion. This process is an important step in image preprocessing, as it effectively removes irrelevant background and ensures that subsequent anomaly detection focuses only on the thin line image itself.

[0099] In an image, a thin line typically appears as a continuous region of brightness within a certain range, with the brightness of these regions significantly higher than the background. The calculated endpoint coordinates y1, y2 (vertical) or x1, x2 (horizontal) can be used to determine the position of the thin line in the image. Specifically, the endpoint coordinates define the upper and lower or left and right boundaries of the thin line, respectively. The effective area of ​​the thin line is the rectangular area bounded by these endpoint coordinates.

[0100] Based on the calculated line endpoint coordinates y1 and y2 (vertical), or x1 and x2 (horizontal), you can crop the image to remove the black border. If the line is vertical, you can extract a vertical slice of the image based on y1 and y2; if the line is horizontal, you can extract a horizontal slice of the image based on x1 and x2.

[0101] If the thin line is vertical, the vertical coordinate range of the cropping area is determined by the endpoint coordinates y1 and y2. Specifically, the area from y1 to y2 is extracted from the grayscale image grayImg to obtain the thin line image region roiImg: , where y1:y2 represents the pixel area from y1 to y2 in the vertical direction, This operation removes the upper and lower parts of the image that do not belong to the thin line, and only keeps the area where the thin line is located.

[0102] If the thin line is horizontal, the horizontal coordinate range of the cropping area is determined by the endpoint coordinates x1 and x2. Extract the area from x1 to x2 from the grayscale image grayImg to obtain the thin line image area roiImg: , where x1:x2 represents the pixel area from x1 to x2 in the horizontal direction, This operation removes the left and right parts of the image that do not belong to the thin line, leaving only the area where the thin line is located.

[0103] After the cropping operation, roiImg is the final thin line image. This image contains only the thin line portion, removing the black border and other irrelevant background areas. This image provides more accurate input for subsequent thin line anomaly detection, reducing interference from irrelevant areas and ensuring that detection focuses solely on thin line anomalies.

[0104] By precisely calculating the endpoint coordinates of the thin line, the image is cropped to remove unnecessary black boundaries, retaining only the thin line image. This operation effectively reduces irrelevant background in the image, improving the efficiency and accuracy of subsequent anomaly detection. The resulting roiImg image contains only the brightness information of the thin line, effectively removing other components (such as black background and noise), providing clearer input data for the anomaly detection algorithm.

[0105] To further refine detection and improve accuracy, the thin line image roiImg is cropped. A cropping period d (32 pixels in this case) is preset, and three tiles are cropped vertically with offsets. During cropping, the height is set to the height of the thin line image roiImg minus two periods (i.e., 64 pixels), ensuring that each tile completely covers the thin line image. This results in three tiles: top, middle, and bottom.

[0106] To further refine anomaly detection for fine line patterns and improve detection accuracy, the extracted fine line image roiImg is tiled. This cropping step periodically segments the image to ensure local analysis within the fine line image, thereby better capturing subtle defects in the fine line. To achieve this, a cropping period d is set (this time set to 32 pixels), and three tiles are cropped with vertical offsets. The resulting image is then divided into three tiles: top, middle, and bottom. Each tile is of equal size, covering different parts of the fine line image.

[0107] When cropping the thin line image roiImg, you first need to set a cropping period d, which defines the vertical height of each crop (i.e., the amount of offset for each crop). In this step, a cropping period d = 32 pixels is selected, meaning that each cropped area is offset vertically by 32 pixels. This offset ensures that each cropped area covers a different portion of the thin line image, avoiding duplicate areas and improving the accuracy of subsequent defect detection.

[0108] To ensure that each tile completely covers the thin line image, the cropping height is set to the height of the thin line image roiImg minus two cropping cycles (i.e. 64 pixels). This is done to prevent the upper and lower parts of the image from exceeding the thin line image during cropping, while also ensuring that each tile contains valid image information. The height of each cropped tile can be calculated using the following formula: , where d=32 is the cropping period, h_roi is the height of the thin line image, and h_block is the height of each block.

[0109] In the vertical direction, three tiles are cropped by offsetting. The specific cropping method is as follows:

[0110] Upper block: Extract the area from 0 to h_block height from the thin line image roiImg to get the upper block , expressed as: ;

[0111] Middle block: Extract the area from d to h_block+d height from the thin line image roiImg to get the middle block , expressed as: ;

[0112] Lower block: Extract the area from 2d to h_block+2d height from the fine line image roiImg to obtain the lower block , expressed as: ;

[0113] This staggered cropping method ensures that each tile contains sufficient information within the fine line image while avoiding duplication and omission of cropped areas. Each tile covers a portion of the fine line image and is staggered vertically, allowing subsequent analysis to capture fine line details from different local areas.

[0114] Finally, the cropped thin line image roiImg is divided into three equal-height blocks: 、 and , which represent the upper, middle, and lower parts of the thin line image respectively. Each tile has the same height and contains the valid area of ​​the thin line image, providing suitable input for subsequent anomaly detection.

[0115] The thin line image roiImg is segmented into multiple tiles through periodic cropping. Each tile covers a different region of the thin line image. Staggered cropping avoids duplication while ensuring the integrity of the thin line image. This tile cropping method improves the local sensitivity of anomaly detection, capturing subtle defects in the thin line pattern, thereby improving the precision and accuracy of subsequent detection.

[0116] Perform differential processing on the three resulting image blocks. The specific operation is as follows: Difference the upper and middle image blocks to obtain differential image diff_12. Difference the middle and lower image blocks to obtain differential image diff_23. Difference the upper and lower image blocks to obtain differential image diff_13. Binarize these three differential images using the preset defect threshold thresh to obtain the corresponding defect mask binary images: mask_12, mask_23, and mask_13.

[0117] During anomaly detection in fine line images, the three resulting tiles are subjected to differential processing to further analyze the differences between tiles and identify potential defects. Generating a differential map effectively highlights the areas of variation between adjacent tiles, thereby assisting in detecting possible anomalies in the image. The differential map helps emphasize subtle variations in fine lines, which may be caused by image noise or anomalies in the fine line pattern itself. The specific steps include differential operations between tiles, binarization, and generation of a binary defect mask map.

[0118] First, calculate the differences between the three tiles and get three difference maps respectively:

[0119] Difference map diff_12: By taking the difference between the upper block and the middle block, the difference map diff_12 is obtained. The difference map represents the change area between the upper and middle blocks. Specifically, the difference map diff_12 can be calculated using the following formula: ,in, and denote the pixel values ​​of the upper and middle tiles at position (i, j), respectively, and diff_12(i, j) is the difference between the two tiles at that position.

[0120] Difference map diff_23: By taking the difference between the middle block and the lower block, we get the difference map diff_23, which represents the change area between the middle and lower blocks. The formula is:

[0121] ,in, and Represent the pixel values ​​of the middle block and the lower block at position (i, j) respectively;

[0122] Difference map diff_13: By taking the difference between the upper block and the lower block, the difference map diff_13 is obtained. This difference map represents the change area between the upper and lower blocks. The formula is:

[0123] ,in, and Represent the pixel values ​​of the upper and lower blocks at position (i, j) respectively.

[0124] The generated difference images diff_12, diff_23, and diff_13 may contain a significant amount of noise and background information. Therefore, to highlight defective areas in the image, these difference images need to be binarized. Binarization involves setting a defect threshold, thresh, to classify image pixels into two categories: pixels greater than the threshold are considered potential defects, while pixels less than or equal to the threshold are considered normal.

[0125] Specifically, the binarization operation can be performed by the following formula:

[0126]

[0127] Here, mask_12 is the defect mask after binarization, and thresh is the preset defect threshold used to distinguish normal areas from abnormal areas. Similar binarization processing is used for the difference images diff23 and diff13 to obtain mask_23 and mask_13.

[0128] After binarization, three defect mask binary images are obtained: mask_12, mask_23, and mask_13. These binary images represent the difference between the upper and middle blocks, the middle and lower blocks, and the upper and lower blocks, respectively. In each binary image, areas with a pixel value of 1 represent detected defects, while areas with a value of 0 represent normal areas.

[0129] mask_12 corresponds to the binarization result of the difference image diff_12, which represents the difference between the upper and middle tiles. mask_23 corresponds to the binarization result of the difference image diff_23, which represents the difference between the middle and lower tiles. mask_13 corresponds to the binarization result of the difference image diff_13, which represents the difference between the upper and lower tiles.

[0130] By calculating the differences between image tiles, generating a difference map and performing binarization, we effectively extract potential defect areas within the fine line image. The difference map highlights variations between image tiles, which may indicate defects within the fine line pattern. Binarization then converts these variations into binary masks, facilitating subsequent defect location and analysis. This step enables effective detection of fine line pattern anomalies and improves defect identification accuracy.

[0131] Combine the masks of the difference image using an AND operation to filter out defects between the left and right tiles or between the upper and lower tiles, retaining only the defects within the current tile: Perform the AND operation on mask_12 and mask_23 to obtain the defect mask mask_2 for the middle tile. Perform the AND operation on mask_23 and mask_13 to obtain the defect mask mask_3 for the lower tile. Perform the AND operation on mask_12 and mask_13 to obtain the defect mask mask_1 for the upper tile.

[0132] To further optimize defect detection and ensure that only defects within each tile are detected, the difference image masks are merged using an AND operation. This effectively filters out defects between tiles, retaining only the defective area within the current tile. The AND operation can be used to extract the common area between the two binary mask images, thus eliminating errors caused by misalignment or noise between tiles and ensuring the accuracy of the defect area.

[0133] The AND operation is a binary image operation that compares each pixel in two binary images. If the pixel at that location in both images is 1, the output at that location is 1; otherwise, the output is 0. In defect detection, using the AND operation can help retain defect areas within a specific tile while ignoring differences caused by errors or misalignment between different tiles.

[0134] Perform AND operation on the three generated difference image masks mask_12, mask_23 and mask_13 to obtain the defect mask of each block. The specific operation is as follows:

[0135] Defect mask mask2 for the middle block: The defect mask mask2 for the middle block is obtained by performing an AND operation on the difference mask mask_12 between the upper block and the middle block and the difference mask mask_23 between the middle block and the lower block. The purpose of the AND operation is to retain the defect area within the middle block while removing the intersection with other blocks. The formula is:

[0136] , where mask_{12}(i, j) and mask_{23}(i, j) represent the difference areas between the upper and middle patches, and the middle and lower patches at position (i, j), respectively, and mask_2(i, j) represents the defect mask of the middle patch.

[0137] Defect mask mask_3 for the lower block: The defect mask mask_3 for the lower block is obtained by performing an AND operation on the difference mask mask_23 between the middle block and the lower block and the difference mask mask_13 between the upper block and the lower block. The formula is:

[0138] , where mask_23(i, j) and mask_13(i, j) represent the difference areas between the middle and lower patches and the upper and lower patches at position (i, j), respectively, and mask_3(i, j) represents the defect mask of the lower patch.

[0139] Upper block defect mask mask_1: The upper block defect mask mask_1 is obtained by performing an AND operation on the difference mask mask_12 between the upper block and the middle block and the difference mask mask_13 between the upper block and the lower block. The formula is:

[0140] , where mask_{12}(i, j) and mask_{13}(i, j) represent the difference areas between the upper and middle patches and the upper and lower patches at position (i, j), respectively, and mask_1(i, j) represents the defect mask of the upper patch.

[0141] After the AND operation, the resulting mask_1, mask_2, and mask_3 represent the defect masks for the upper, middle, and lower tiles, respectively. Each mask image only contains the defect area within the current tile, eliminating the influence of errors between other tiles. These defect mask images are used to accurately locate the defect area in subsequent anomaly detection.

[0142] By merging differential masks, we remove inter-tile errors and irrelevant defects, retaining only the valid defect areas within the current tile. This reduces false positives caused by tile misalignment or noise, ensuring more accurate and reliable defect detection. This approach allows for greater focus on abnormal features within each tile, improving the accuracy of subsequent anomaly detection and analysis.

[0143] The resulting defect masks for the top, middle, and bottom tiles are each expanded to the same size as the thin line image roiImg (the expanded portion is filled with zeros). These three completed masks are then combined using an OR operation to obtain the defect mask for the entire thin line image roiImg. Finally, the defect mask is boundary-completed based on the endpoints of the thin line pattern to obtain the final defect mask for the mask image, completing anomaly detection for the thin line pattern. Through these steps, abnormal defects in thin line patterns can be effectively identified while reducing the impact of alignment errors, ensuring high accuracy and low false positive rates in anomaly detection results.

[0144] To further ensure the accuracy and robustness of detection results during anomaly detection of fine line patterns, the defect mask for each tile is expanded to the same size as the fine line image roiImg and these masks are merged through logical operations. The resulting mask is used to precisely locate anomalies within the fine line pattern. This process not only ensures local detection accuracy but also effectively mitigates the impact of image alignment errors, thereby improving overall detection accuracy and reducing false positives.

[0145] First, the defect masks mask_1, mask_2, and mask_3 for the top, middle, and bottom tiles are expanded to the same size as the thin line image roiImg. This expansion is done by copying the valid area of ​​each mask image to the corresponding position in the original image and padding the remaining area with zeros to ensure that the expanded masks are the same size as the thin line image.

[0146] Assume that the size of the thin line image roiImg is (h_roi, w_roi), and the size of the masks mask_1, mask_2 and mask_3 of each block is (h_block, w_roi), where h_block is the height of each cropped block.

[0147] The sizes of the extended masks extended_mask_1, extended_mask_2, and extended_mask_3 are (h_roi, w_roi), and their extension methods are:

[0148] resize , mode='zero-padding');

[0149] resize , mode='zero-padding');

[0150] resize , mode='zero-padding'); the resize function is used to adjust the size of the mask image, and mode='zero-padding' means to fill the extended area with zeros.

[0151] The extended masks extended_mask_1, extended_mask_2, and extended_mask_3 are merged through an OR operation to obtain the defect mask finalmask of the entire fine line image roiImg. The OR operation is used to ensure that the defects detected in any block will be retained and no potential abnormal areas will be missed. The merging operation can be expressed as:

[0152] , where final_mask(i, j) is the combined defect mask, and extended_mask_1(i, j), extended_mask_2(i, j), and extended_mask_3(i, j) are the extended masks. Through the OR operation, all pixel areas containing defects will be marked as 1.

[0153] After obtaining the merged defect mask, the defect mask is then border-filled based on the endpoint coordinates y1 and y2 (vertical direction) or x1 and x2 (horizontal direction) of the thin line image. This step ensures that the defect mask is aligned with the upper and lower or left and right boundaries of the thin line image and fills in any missing boundaries that may be caused by image alignment errors.

[0154] If the line direction is vertical, the upper and lower boundaries are filled in the mask according to the endpoint coordinates y1 and y2. The completed mask final_mask_corrected can be calculated using the following formula:

[0155] Here, final_mask_corrected(i, j) represents the defect mask after boundary completion, y1 and y2 are the vertical coordinates of the upper and lower endpoints of the thin line, respectively. For horizontal thin line images, similarly, the horizontal coordinates x1 and x2 are used to complete the left and right boundaries.

[0156] Ultimately, the resulting final_mask_corrected is the final defect mask for the fine line image, encompassing all defect areas. This allows for precise location of defects within the fine line pattern, minimizing interference from alignment errors and background noise. These steps effectively improve the accuracy of anomaly detection, ensuring high precision and a low false positive rate.

[0157] By expanding and merging defect masks, every part of the fine line image is effectively detected for anomalies. Furthermore, boundary completion effectively reduces the impact of image alignment errors, making detection results more accurate and reliable. These processing steps enable precise identification of anomalies in fine line patterns, significantly improving detection efficiency and accuracy.

[0158] See also Figure 2 As shown, the anomaly detection system for mask fine line patterns described in this embodiment includes an image preprocessing module, an image cropping module, and an image merging and defect detection module;

[0159] Image preprocessing module: grayscales the collected mask image to obtain the corresponding grayscale image, maximizes the grayscale image in the horizontal and vertical directions, and obtains at least two image vectors. The length direction of the thin line is determined based on the image vectors, and the coordinates of the thin line endpoints are calculated based on the determination results. The mask image is sent to the image cropping module and the image merging and defect detection module, and the coordinates of the thin line endpoints are sent to the image cropping module;

[0160] Image cropping module: Based on the calculated coordinates of the thin line endpoints, the black boundaries in the image are removed and the thin line area is retained to obtain a thin line image. The thin line image is cropped vertically to obtain at least three blocks. The at least three blocks are subjected to differential processing to obtain a corresponding number of differential images. The differential images are then binarized to obtain a corresponding number of defect mask binary images. The differential images are sent to the image merging and defect detection module.

[0161] Image merging and defect detection module: The masks of the differential image are merged through the AND operation to filter out the defects between the blocks, and only the defect mask within the current block is retained. The defect masks of at least three blocks are expanded to the same size as the fine line image. The completed defect masks are merged through the OR operation to obtain the defect mask of the fine line image. According to the endpoints of the fine line graphic, the boundary of the defect mask is completed to obtain the defect mask of the final mask image.

[0162] Example 2: This example proposes a novel method for detecting anomalies in thin-line patterns on a mask. The core of this method is to utilize the information of the optical image itself and perform differential processing of specified pixels (such as a period width) along the length of the thin line to achieve effective identification of abnormal areas on the thin line without relying on an external reference image. The principle of this method is similar to the die-to-die algorithm, that is, by differentiating the current die from its left and right neighboring dies, and binarizing them according to a set threshold, two defect masks are generated. Subsequently, the two defect masks are ANDed to obtain the defect mask of the current die. Experimental results show that this method is suitable for image defect detection with periodic patterns and has good detection performance. The specific implementation steps of this method are as follows:

[0163] Step 1: Test image acquisition and analysis

[0164] In order to more concisely explain the algorithm principle, this section uses a manually drawn image with a periodic pattern as a test image. One rectangular unit represents one period. The test image has 8 complete rectangular units in the horizontal direction and less than 2 units in the vertical direction. Therefore, the offset difference is performed in the horizontal direction.

[0165] Step 2: Cropping of offset blocks

[0166] In order to fully identify the defects of the entire image, it is necessary to Figure 3 (as shown) to obtain three blocks of the same size, which is convenient for using the die-to-die algorithm. Here, one image block is cropped for each horizontal offset of one cell (one cycle), and cropping is done three times. To ensure that the image block is within the test image, the cropping width is set to the number of cells in the horizontal direction of the test image minus 2 image blocks (see the specific operation process for details). Figure 4 ), so that we get three blocks on the left, middle and right.

[0167] Step 3: Block Difference and Binarization

[0168] After obtaining the three blocks, perform image difference on each of them. For example, the left block is differentiated from the middle block to obtain the difference image diff_12, the middle block is differentiated from the right block to obtain the difference image diff_23, and the left block is differentiated from the right block to obtain the difference image diff_13. Then, the three difference images are binarized using the preset defect threshold thresh to obtain three corresponding defect mask binary images, which are mask_12, mask_23, and mask_13 respectively (see the specific operation for details). Figure 5 ).

[0169] Step 4: Obtain the final defect mask through AND and OR operations

[0170] After obtaining the defect mask binary images corresponding to the three differential results, AND operations are performed on each of them. This is consistent with the logic of the die-to-die algorithm, that is, the defects on the left and right (or top and bottom) dies can be filtered out through the AND operation, and only the defects on the current die are retained. Specifically, the defect mask binary images mask_12 and mask_23 are ANDed to obtain the defect mask mask_2 of the middle block; the defect mask binary images mask_23 and mask_13 are ANDed to obtain the defect mask mask_3 of the right block; the defect mask binary images mask_12 and mask_13 are ANDed to obtain the defect mask mask_1 of the left block. For the convenience of subsequent operations, the defect masks of the three left, middle and right blocks are respectively supplemented to the test image size (the supplementary part is filled with 0). Finally, the defect mask of the entire test image is obtained by performing an OR operation on the three supplemented block defect masks (see the specific operation). Figure 6 ).

[0171] Example 3: In order to more clearly illustrate the technical solution of the present invention, the following is a detailed description through a specific embodiment. This embodiment uses a transmitted light image of a real reticle fine line pattern as a test pattern and uses the invented offset difference method to detect abnormal areas of the reticle fine line pattern. The specific implementation steps are as follows:

[0172] Step 1: Image acquisition

[0173] In order to obtain the transmitted light image of the fine line pattern of the mask, a microscope with a 10x objective lens is used and transmitted light illumination is used. The camera automatically scans the preset fine line detection area through the motion mechanism to complete the image acquisition, such as Figure 3 As shown;

[0174] Step 2: Preprocessing and tile offset cropping

[0175] In the mask image usually collected, the graphic area appears as a bright transparent area, and the background chrome area appears as a dark non-transparent area. Since the graphic thin line cannot run through the entire image, the collected thin line image does not have complete periodicity in the length direction. Therefore, it is necessary to remove the black boundaries at both ends of the thin line and only retain the thin line image. Specifically, the test image testImg is first grayscaled to obtain the corresponding grayscale image grayImg, and then the maximum value of the grayscale image in the horizontal direction is obtained to obtain the image vector v1, and the maximum value of the grayscale image in the vertical direction is obtained to obtain the image vector v2. Then, all pixels of the image vector v1 are summed to obtain s1, and all pixels of the image vector v2 are summed to obtain s2, where s1 can represent the sum of the brightness information of the image in the horizontal direction, and s2 can represent the sum of the brightness information of the image in the vertical direction. When s1 is greater than s2, it indicates that the length direction of the thin line is in the horizontal direction, and when s1 is less than s2, it indicates that the length direction of the thin line is in the vertical direction. When the thin line's length is horizontal, the horizontal coordinates x1 and x2 of the thin line's two endpoints are calculated using the image vector v1 (the first bright pixel is the vertical coordinate of the thin line's left endpoint, and the last bright pixel is the vertical coordinate of the thin line's right endpoint). When the thin line's length is vertical, the horizontal coordinates y1 and y2 of the thin line's two endpoints are calculated using the image vector v2 (the first bright pixel is the horizontal coordinate of the thin line's upper endpoint, and the last bright pixel is the horizontal coordinate of the thin line's lower endpoint). Based on the coordinates of the thin line's two endpoints, the black border of the image is removed, retaining only the thin line image roiImg. To fully identify defects in the entire image, three uniformly sized tiles are cropped from the roiImg image to facilitate the die-to-die algorithm. The thin line pattern in this test image is oriented vertically, and its lengthwise period can be any value smaller than the length of the thin line. Therefore, a small period d can be set as needed (d should be significantly smaller than the thin line length and larger than the maximum possible defect width along the thin line's lengthwise direction; in this case, it is set to 32 pixels). Then, we crop one image block every time we shift one cycle (32 pixels) in the vertical direction, and crop three times. To ensure that the image block is within the test image, we set the crop height to the height of the image roiImg minus 2 cycles (i.e. 64 pixels), so that we get the top, middle and bottom blocks (see the specific operation for details). Figure 7 ).

[0176] Step 3: Block Difference and Binarization

[0177] After obtaining the three image blocks, perform image difference on each of them. For example, the upper image block is differentiated from the middle image block to obtain the difference image diff_12, the middle image block is differentiated from the lower image block to obtain the difference image diff_23, and the upper image block is differentiated from the lower image block to obtain the difference image diff_13. Then, the three difference images are binarized using the preset defect threshold thresh to obtain three corresponding defect mask binary images, which are mask_12, mask_23, and mask_13 respectively (see the specific operation for details). Figure 8 ).

[0178] Step 4: Obtain the final defect mask through AND and OR operations

[0179] After obtaining the binary defect mask images corresponding to the three differential results, an AND operation is performed on each of them. This is consistent with the logic of the die-to-die algorithm: this AND operation filters out defects on the left and right (or top and bottom) dies, retaining only the defects on the current die. Specifically, the binary defect mask images mask_12 and mask_23 are ANDed together to obtain the defect mask mask_2 for the middle block; the binary defect mask images mask_23 and mask_13 are ANDed together to obtain the defect mask mask_3 for the lower block; and the binary defect mask images mask_12 and mask_13 are ANDed together to obtain the defect mask mask_1 for the upper block. For the convenience of subsequent operations, the defect masks of the upper, middle and lower blocks are respectively filled to the size of the roiImg image (the supplementary part is filled with 0). Finally, the defect mask of the entire roiImg image is obtained by performing an OR operation on the three completed block defect masks. Then, the upper and lower boundaries of the roiImg image are filled according to the upper and lower endpoints y1 and y2 of the thin line graphic to obtain the defect mask of the final test image (see the specific operation). Figure 9 ).

[0180] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application.

[0181] Throughout this specification, references to terms such as "one embodiment," "example," or "specific example" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0182] The preferred embodiments of the present invention disclosed above are intended only to help illustrate the present invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the present invention to specific embodiments. Obviously, many modifications and variations are possible based on the contents of this specification. These embodiments are selected and described in detail in this specification to better explain the principles and practical applications of the present invention, thereby enabling those skilled in the art to better understand and utilize the present invention. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A method for detecting anomalies in fine-line patterns on a mask, characterized by: The detection method comprises the following steps: Gray-scaling the collected mask image to obtain a corresponding grayscale image, and maximizing the grayscale image in the horizontal and vertical directions to obtain at least two image vectors; Determine the length direction of the thin line based on the image vector, and calculate the coordinates of the end points of the thin line based on the determination result; According to the calculated coordinates of the endpoints of the thin line, the black boundary in the image is removed and the thin line area is retained to obtain the thin line image; After offset cropping the thin line image, at least three image blocks are obtained, difference processing is performed on the obtained at least three image blocks to obtain a corresponding number of difference images, and then the difference images are binarized to obtain a corresponding number of defect mask binary images; The masks of the difference images are merged through AND operation to filter out the defects between the tiles and only retain the defect masks within the current tile; The defect masks of at least three blocks are expanded to the same size as the fine line image, and the completed defect masks are merged through an OR operation to obtain the defect mask of the fine line image. According to the endpoints of the fine line graphic, the boundary of the defect mask is completed to obtain the defect mask of the final mask image.

2. The method for detecting anomalies in a mask fine line pattern according to claim 1, wherein: The thin line image is cropped to obtain at least three blocks, including the following steps: Calculate the height h_block of each cropped block; Extract the area from 0 to h_block height from the thin line image roiImg to get the upper block ; Extract the area from d to h_block+d height from the thin line image roiImg to get the middle block ; Extract the area from 2d to h_block+2d height from the thin line image roiImg to get the lower block ; The cropped thin line image roiImg is divided into three equal-height blocks: 、 and , representing the upper, middle and lower parts of the thin line image respectively.

3. The method for detecting anomalies in a mask fine line pattern according to claim 2, wherein: Performing differential processing on the obtained at least three image blocks to obtain a corresponding number of differential images includes the following steps: Difference the upper block and the middle block to obtain the difference map diff_12, which represents the change area between the upper and middle blocks; Difference the middle block with the lower block to obtain the difference map diff_23, which represents the change area between the middle and lower blocks; The upper block is differentiated from the lower block to obtain a difference map diff_13, which represents the changed area between the upper and lower blocks.

4. The method for detecting anomalies in thin-line patterns on a mask according to claim 3, wherein: The difference image is binarized to obtain a corresponding number of defect mask binary images, including the following steps: The pixel values ​​in the image are divided into two categories: pixels greater than the defect threshold are considered potential defect areas, and the defect mask image after binarization is 1; pixels less than or equal to the defect threshold are considered normal areas, and the defect mask image after binarization is 0; After binarization, three defect mask binary images are obtained: mask_12, mask_23, and mask_13, which represent the difference areas between the upper and middle blocks, the middle and lower blocks, and the upper and lower blocks, respectively. The area with a pixel value of 1 in each binary image represents a detected defect, and the area with a value of 0 represents a normal part.

5. The method for detecting anomalies in thin-line patterns on a mask according to claim 4, wherein: The masks of the difference images are merged through an AND operation to filter out defects between tiles, retaining only the defect masks within the current tile. This includes the following steps: The defect mask mask_2 of the middle block is obtained by performing an AND operation on the difference mask mask_12 between the upper block and the middle block and the difference mask mask_23 between the middle block and the lower block; The defect mask mask_3 of the lower block is obtained by performing an AND operation on the difference mask mask_23 between the middle block and the lower block and the difference mask mask_13 between the upper block and the lower block; The defect mask mask_1 of the upper block is obtained by performing an AND operation on the difference mask mask_12 between the upper block and the middle block and the difference mask mask_13 between the upper block and the lower block; After the AND operation, the obtained mask_1, mask_2 and mask_3 represent the defect masks of the upper block, middle block and lower block respectively. Each mask image contains the defect area within the current block and removes the error influence between other blocks.

6. The method for detecting anomalies in a mask fine line pattern according to claim 5, wherein: The defect masks of at least three image blocks are respectively expanded to the same size as the thin line image, the completed defect masks are merged through an OR operation to obtain a defect mask of the thin line image, and the boundary of the defect mask is completed according to the endpoints of the thin line pattern to obtain a defect mask of the final mask image, including the following steps: Copy the valid areas of the upper, middle and lower defect masks mask_1, mask_2 and mask_3 to the corresponding positions of the original image, and fill the remaining areas with zeros to obtain the expanded masks; The extended masks extended_mask_1, extended_mask_2 and extended_mask_3 are combined through OR operation to obtain the defect mask finalmask of the entire fine line image roiImg. After the OR operation, all pixel areas containing defects will be marked as 1; After completing the boundary of the defect mask according to the endpoint coordinates of the thin line graphic, the final defect mask of the thin line image is obtained.

7. The method for detecting anomalies in thin-line patterns on a mask according to claim 6, wherein: The method of maximizing the grayscale image in the horizontal and vertical directions to obtain at least two image vectors includes the following steps: The brightness information of the grayscale image grayImg is extracted in the horizontal and vertical directions to obtain two image vectors v1 and v2 respectively, where v1 represents the brightness information vector of the grayscale image in the horizontal direction, and v2 represents the brightness information vector of the grayscale image in the vertical direction. The horizontal image vector v1 is obtained by finding the maximum value of the grayscale image in each row, and the vertical image vector v2 is obtained by finding the maximum value of each column.

8. The method for detecting anomalies in thin-line patterns on a mask according to claim 7, wherein: Determining the length direction of the thin line based on the image vector includes the following steps: Sum all elements of the brightness vectors v1 and v2 respectively to obtain two scalars s1 and s2, where s1 represents the sum of the brightness information of the image in the horizontal direction and s2 represents the sum of the brightness information of the image in the vertical direction; By comparing the sizes of s1 and s2, the arrangement direction of the thin lines can be inferred. If the total brightness information s1 in the horizontal direction is greater than the total brightness information s2 in the vertical direction, it indicates that the direction of the thin line graphic is horizontal. If the total brightness information s1 in the horizontal direction is less than the total brightness information s2 in the vertical direction, it indicates that the direction of the thin line graphic is vertical.

9. The method for detecting anomalies in thin-line patterns on a mask according to claim 8, wherein: Grayscale processing is performed on the collected mask image to obtain a corresponding grayscale image, including the following steps: By converting the RGB channels of a color image into a single brightness channel, the grayscale value of the image is calculated from the pixel values ​​of the RGB channels using a weighted average method. The RGB values ​​of each pixel are combined into a brightness value, which reflects the brightness of the pixel position.

10. A system for detecting anomalies of fine line patterns on a mask, for implementing the detection method according to any one of claims 1 to 9, characterized in that: It includes image preprocessing module, image cropping module, and image merging and defect detection module; Image preprocessing module: grayscales the acquired mask image to obtain a corresponding grayscale image. The grayscale image is maximized in the horizontal and vertical directions to obtain at least two image vectors. The length direction of the thin line is determined based on the image vectors, and the coordinates of the thin line endpoints are calculated based on the determination results. Image cropping module: Based on the calculated coordinates of the thin line endpoints, the black boundaries in the image are removed and the thin line area is retained to obtain a thin line image. The thin line image is cropped to obtain at least three blocks. The obtained at least three blocks are subjected to difference processing to obtain a corresponding number of difference images. The difference images are then binarized to obtain a corresponding number of defect mask binary images. Image merging and defect detection module: The masks of the differential image are merged through the AND operation to filter out the defects between the blocks, and only the defect mask within the current block is retained. The defect masks of at least three blocks are expanded to the same size as the fine line image. The completed defect masks are merged through the OR operation to obtain the defect mask of the fine line image. According to the endpoints of the fine line graphic, the boundary of the defect mask is completed to obtain the defect mask of the final mask image.

Citation Information

Patent Citations

  • Reticle inspection apparatus and reticle inspection method

    JP2004333386A

  • Exposure method and method of making a semiconductor device

    US20110207053A1