Film defect detection method and device, computer device and storage medium
By performing coarse positioning and angle recognition on the original images of optical thin films, the target structural parts and key points are identified, solving the problem of low accuracy in traditional manual inspection and achieving efficient and accurate thin film defect detection.
Patent Information
- Application Number
- CN202211371837.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-03
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-11-03
AI Technical Summary
Traditional manual visual inspection methods for detecting defects in optical thin films are inaccurate and inefficient.
By coarsely locating the original image, the target structural parts and key points in the target thin film image are identified, and angle recognition is performed to determine the defect detection results.
It improves the accuracy and efficiency of thin film defect detection, enables flexible detection of various types of thin films, and reduces detection costs.
Smart Images

Figure CN115760723B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of defect detection technology, and in particular to a method, apparatus, computer equipment, and storage medium for detecting defects in thin films. Background Technology
[0002] During the production of optical thin films, defects such as bubbles, wrinkles, scratches, and foreign objects can appear on the surface or inside the film due to various factors including processing technology, production environment, and operator conditions. These defects can degrade the product's performance. Therefore, defect detection of optical thin films is particularly important during the production process.
[0003] Traditional methods for detecting defects in optical thin films rely on manual visual inspection. However, the lack of standardized criteria for inspectors makes it difficult to guarantee the accuracy of the results. Summary of the Invention
[0004] This application provides a method, apparatus, computer equipment, and computer-readable storage medium for detecting thin film defects, which can improve the accuracy and efficiency of thin film defect detection.
[0005] In a first aspect, this application provides a method for detecting defects in thin films, including:
[0006] The acquired original image is coarsely located to obtain the target thin film image; wherein, the original image is an image of the dielectric thin film; the target thin film image includes the region of interest image of the dielectric thin film body;
[0007] Identify key points of target structural regions in target thin film images; target structural regions are structural regions in dielectric thin films used for defect detection.
[0008] Angle recognition results are obtained by identifying the target structural parts based on the target key points.
[0009] Based on the angle recognition results, the defect detection results of the dielectric thin film are determined.
[0010] Secondly, this application also provides a thin film defect detection device, comprising:
[0011] The coarse localization module is used to coarsely localize the acquired original image to obtain the target thin film image; wherein, the original image is an image obtained by taking pictures of the dielectric thin film; the target thin film image includes the region of interest image of the dielectric thin film body;
[0012] The first recognition module is used to identify target key points of target structural parts in the target thin film image; the target structural parts are structural parts in the dielectric thin film used for defect detection.
[0013] The second recognition module is used to perform angle recognition on the target structural parts based on the target key points and obtain the angle recognition result.
[0014] The determination module is used to determine the defect detection results of the dielectric thin film based on the angle recognition results.
[0015] Thirdly, this application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method.
[0016] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0017] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the above-described method.
[0018] The aforementioned thin film defect detection method first performs coarse localization on the original image of the dielectric thin film to obtain a target thin film image containing the region of interest (ROI) of the dielectric thin film body with fewer pixels. Then, angle recognition is performed based on the target key points of the target thin film image, and the defect detection result is determined according to the angle recognition result. The thin film defect detection method of this application not only has high accuracy and fast detection speed, but also can flexibly detect various types of dielectric thin films, thereby improving detection efficiency and reducing detection costs. Attached Figure Description
[0019] Figure 1 A schematic flowchart illustrating the first thin film defect detection method provided in this application embodiment;
[0020] Figure 2 This is a schematic diagram of the structure of a dielectric thin film provided in an embodiment of this application;
[0021] Figure 3 A schematic diagram illustrating an angle recognition result provided in an embodiment of this application;
[0022] Figure 4 A schematic flowchart illustrating the second thin film defect detection method provided in this application embodiment;
[0023] Figure 5 A schematic flowchart illustrating the third thin film defect detection method provided in this application embodiment;
[0024] Figure 6 A structural block diagram of a thin film defect detection device provided in an embodiment of this application;
[0025] Figure 7An internal structural diagram of a computer device provided in an embodiment of this application;
[0026] Figure 8 This is a structural diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0028] To facilitate understanding, the application scenarios of this invention will be described in detail below. A dielectric thin film is a functional thin film that functions by utilizing the light-gathering effect of the film. Dielectric thin films have ubiquitous applications, such as eyeglass coatings, telescope coatings, and liquid crystal display coatings. Especially in the mobile phone industry, a type of dielectric thin film for mobile phone cameras is commonly used. The main function of this dielectric thin film is to increase the light transmittance of the mobile phone camera. In other words, the quality of the dielectric thin film in a mobile phone camera is one of the determining factors in the image quality of the lens; therefore, defect detection of the dielectric thin film in mobile phone cameras is particularly important.
[0029] In some embodiments, such as Figure 1 As shown, a method for detecting thin film defects is provided. Taking the application of this method to computer equipment as an example, the method includes the following steps:
[0030] Step 101: Perform coarse localization on the acquired original image to obtain the target thin film image; wherein, the original image is an image obtained by taking pictures of the dielectric thin film; the target thin film image includes the image of the region of interest of the dielectric thin film body.
[0031] The original image is the image that has not undergone any processing. In other words, the original image contains the richest image features.
[0032] The target thin film image is obtained by coarsely locating the original image when the position of the dielectric thin film body is uncertain. That is, the target thin film image obtained by coarse localization includes the region of interest of the dielectric thin film body.
[0033] The region of interest (ROI) is a specific region where the dielectric film is located. In other words, by finding the ROI in the original image, the image of the dielectric film is located within that ROI.
[0034] Specifically, after the dielectric thin film is produced, a camera is used to capture an image of the dielectric thin film, obtaining the original image. Based on the shape of the dielectric thin film, a computer roughly locates the region of interest (ROI) of the main body of the dielectric thin film in the original image and retains the image of the ROI as the target thin film image; that is, the target thin film image includes the ROI of the main body of the dielectric thin film.
[0035] It should be noted that since the original image is a high-resolution image, it contains a large number of pixels, and processing these pixels is time-consuming. Furthermore, when the original image comprises multiple images, directly performing defect detection on the dielectric film within the original image is very time-consuming. Therefore, a coarse localization process is performed to locate the main image of the dielectric film within the region of interest (ROI) of the original image. This image of the main dielectric film within the ROI is retained as the target film image, while images outside the ROI are discarded. Therefore, compared to the original image, the target film image has a smaller area and fewer pixels, resulting in less time spent on defect detection.
[0036] In some embodiments, the shape of the dielectric film body can be circular, and the region of interest where the dielectric film body is located can be found by detecting the circular image in the original image, so that the image of the region of interest where the dielectric film body is located is used as the target film image.
[0037] In some embodiments, the shape of the dielectric film body can be rectangular. Then, by detecting the rectangular image in the original image, the region of interest where the dielectric film body is located is found, and the image of the region of interest where the dielectric film body is located is used as the target film image. It should be noted that this application does not limit the specific shape of the dielectric film body.
[0038] Step 102: Identify the key points of the target structural parts in the target thin film image; the target structural parts are the structural parts in the dielectric thin film used for defect detection.
[0039] The target structural region is one of the structural components of the dielectric thin film; that is, the structure of the target thin film image can be determined by identifying the target structural region. It can be understood that different types of dielectric thin films have different structures, and the structural region that can be identified for a particular dielectric thin film is the target structural region.
[0040] Key points are points that express the characteristics of a target structural part. That is, key points represent all points of a target structural part.
[0041] Specifically, the computer device calculates the probability that each pixel in the target thin film image belongs to the target key point, and selects the pixel as the target key point from the pixels in the target thin film image based on the probability that each pixel belongs to the target key point.
[0042] Step 103: Based on the target key points, perform angle recognition on the target structural parts to obtain the angle recognition results.
[0043] Here, angle refers to the angle formed between the various target structural parts of the dielectric thin film. It can be understood that a qualified dielectric thin film has angles between its target structural parts that meet the acceptable angle requirements; in other words, a qualified dielectric thin film has no angle defects. By identifying the angles formed between the various target structural parts, it is possible to determine whether the dielectric thin film has angle defects.
[0044] Specifically, the computer equipment finds the target key points corresponding to each target structural part, calculates the included angle between each target key point, and that is, the angle recognition result.
[0045] It should be noted that the angle recognition result is related to the type of dielectric film, so the angle recognition result will be different for different dielectric films.
[0046] Step 104: Based on the angle recognition results, determine the defect detection results of the dielectric thin film.
[0047] Specifically, the computer equipment compares the angle recognition result with the preset angle, and determines the defect detection result of the dielectric film based on the comparison result, that is, whether the dielectric film has an angle defect problem.
[0048] In some embodiments, the preset angle is a preset angle range. The angle identification result is determined to be within the preset angle range in order to determine whether there is an angle defect problem in the dielectric film.
[0049] In some embodiments, the preset angle is a preset angle value. The angle identification result is determined to be greater than the preset angle value in order to determine whether there is an angle defect problem in the dielectric film.
[0050] The aforementioned thin film defect detection method first performs coarse localization on the original image of the dielectric thin film to obtain a target thin film image containing the region of interest (ROI) of the dielectric thin film body with fewer pixels. Then, angle recognition is performed based on the target key points of the target thin film image, and the defect detection result is determined according to the angle recognition result. The thin film defect detection method of this application not only has high accuracy and fast detection speed, but also can flexibly detect various types of dielectric thin films, thereby improving detection efficiency and reducing detection costs.
[0051] In some embodiments, coarse positioning is performed on the acquired original image to obtain a target thin film image, including:
[0052] Perform circle image detection on the acquired original image according to the circle image detection conditions;
[0053] If a circular image that meets the detection conditions is detected, the coordinates of the center point of the dielectric film are determined based on the center coordinates of the detected circular image.
[0054] Based on the center point coordinates and the preset standard radius, the target thin film image is coarsely located from the original image.
[0055] The circle image detection condition is a set condition for detecting circle images in the original image that meet the specified criteria. In other words, the original image may contain multiple circle images, but only those that satisfy the circle image detection condition are considered valid circle images. It can be understood that in this embodiment, the dielectric film body includes a circular pattern; therefore, the target film image can be roughly located through processes such as circle image detection.
[0056] The center point coordinates are the coordinates of the center point of the dielectric film in the original image.
[0057] The preset standard radius is a pre-defined standard radius. The preset standard radius depends on the size of the dielectric film. Generally, the value of the preset standard radius is greater than the maximum radius of the dielectric film.
[0058] Specifically, the computer equipment uses a circle detection algorithm to detect circular images in the original image. Once a circle that meets the detection criteria is detected, the coordinates of its center are processed to obtain the coordinates of the center point of the dielectric film. Based on these coordinates and a preset standard radius, the region containing the target thin film image is determined. That is, a circle is drawn with the center point of the dielectric film as the center and the preset standard radius as the radius; the resulting circular region (i.e., the region of interest) is the region containing the target thin film image, and the image within this circular region is the target thin film image. It should be noted that after determining the region containing the target thin film image, the image of that region is retained, while images of other regions are discarded.
[0059] In the above embodiments, the target thin film image is determined by detecting the circular image in the original image and then using the center coordinates of the circular image and a preset standard radius, which is simple and efficient.
[0060] In some embodiments, the circle image detection conditions include a preset radius value and a preset standard value; the method further includes:
[0061] If there is no circle image in the original image that meets the circle image detection conditions, then reduce the preset radius value and the preset standard value to obtain the updated circle image detection conditions;
[0062] Based on the updated circle image detection conditions, the step of performing circle image detection on the acquired original image according to the circle image detection conditions is re-executed.
[0063] The preset radius value is a pre-defined radius value. The size of the preset radius value is related to the size of the dielectric film.
[0064] The preset standard value is a pre-defined threshold value. It is used to characterize the accumulator threshold at the center of the circle. When the accumulator value at the center of the circle is greater than the preset standard value, it can be determined that the center of the circle is the center of a circle image that meets the circle image detection conditions.
[0065] Specifically, the computer device uses a circle detection algorithm to detect circular images in the original image based on a preset radius value. When the accumulator value of the detected circle's center is greater than a preset standard value, it indicates that a circular image satisfying the circle image detection condition has been found. When the accumulator value of the detected circle's center is not greater than the preset standard value, it indicates that a circular image satisfying the circle image detection condition has not been found. In order to find a circular image, the preset radius value and the preset standard value are gradually reduced, and the circle detection algorithm continues to detect circular images in the original image until a circular image satisfying the reduced preset radius value and the preset standard value is found.
[0066] In some embodiments, if there is no circular image in the original image that meets the circular image detection conditions, the preset radius value and the preset standard value are reduced by a step size to obtain the updated circular image detection conditions.
[0067] In some embodiments, if a preset radius value of 180 pixels and a preset standard value of 300 are set, and no matching circular image is found in the original image, the preset radius value is decreased by 1 and the preset standard value is decreased by 10 in sequence, and the detection of circular images in the original image continues until a circular image that meets the preset radius value and the preset standard value is found.
[0068] In the above embodiments, by gradually reducing the preset radius value and the preset standard value to find the circular image in the original image, it is possible to find the circular images corresponding to various sizes of dielectric films, which is highly flexible and accurate.
[0069] In some embodiments, multiple circular images are detected; determining the center point coordinates of the dielectric film based on the center coordinates of the detected circular images includes:
[0070] Determine the coordinates of the center of each circle in the image;
[0071] The average center coordinates of multiple circular images are calculated to obtain the average center coordinates; the average center coordinates are the coordinates of the center point of the dielectric thin film.
[0072] Specifically, when the computer device detects multiple circular images that meet the circular image detection conditions in the original image, the center coordinates of each circular image are extracted, and the average center coordinates of each circular image are used as the center point coordinates of the dielectric film.
[0073] In some embodiments, the average center coordinates of multiple circular images are calculated by first averaging the center coordinates of the multiple circular images to obtain the average center coordinates, then calculating the distance difference between the center coordinates of each circular image and the average center coordinates, and averaging the center coordinates of the circular images whose distance difference is less than a distance threshold to obtain the center point coordinates of the dielectric film.
[0074] In some embodiments, the average of the center coordinates of multiple circular images is used as the average center coordinate, and the average center coordinate is used as the center point coordinate of the dielectric film.
[0075] It is understandable that when multiple circular images that meet the circular image detection conditions are detected, the average value of the center coordinates of each circular image can be used as the center point coordinates of the dielectric film, which can accurately locate the center position of the dielectric film. After finding the center point coordinates of the dielectric film, the main body of the dielectric film can be coarsely located to obtain the target film image by using a preset standard radius.
[0076] In the above embodiments, the center point coordinates of the dielectric film are determined by the average center coordinates, which is convenient and simple.
[0077] In some embodiments, the dielectric film includes a handle structure and a ring structure; the target structural portion is the handle structure; and the target key points are the two junctions between the handle structure and the ring structure. Figure 2 This is a schematic diagram of the structure of a dielectric thin film in one embodiment. Figure 2 It can be seen that the dielectric thin film includes a handle structure 201 and a ring structure 202. The key target points are the two junctions between the handle structure 201 and the ring structure 202.
[0078] In some embodiments, identifying target key points in a target structural region of a target thin film image includes:
[0079] Predict the probability that each pixel in the target thin film image belongs to an intersection point;
[0080] Select the two pixels with the highest probability of being boundary points from all pixels as the two boundary points.
[0081] Specifically, the computer device predicts the probability of each pixel in the target thin film image being a boundary point, compares the probability of each pixel belonging to a boundary point, and selects the two pixels with the highest probability of belonging to a boundary point as the two boundary points.
[0082] In some embodiments, the HRNet algorithm and PPM (Pyramid pooling module) are used to obtain the probability of each pixel in the target thin film image being a target key point.
[0083] In the above embodiments, the target key points are determined by predicting the probability of each pixel in the target thin film image being a target key point, which is simple and efficient.
[0084] In some embodiments, there are two target key points; angle recognition is performed on the target structural parts based on the target key points to obtain angle recognition results, including:
[0085] Based on the coordinates of the two target key points and the coordinates of the center point of the dielectric film, the angle between the line connecting the two target key points and the center point is obtained; the angle is the angle recognition result.
[0086] Specifically, the computer equipment marks two target key points as the first target key point and the second target key point, respectively. The line connecting the first target key point and the center point of the dielectric film is the first connecting line, and the line connecting the second target key point and the center point of the dielectric film is the second connecting line. The angle between the first connecting line and the second connecting line is calculated to obtain the angle recognition result. The size of the angle is compared with a preset angle to determine whether there is an angle defect in the dielectric film.
[0087] Figure 3 This is a schematic diagram illustrating the determination of angle recognition results in one embodiment. Figure 3 As shown, the dielectric film has two target key points, namely target key point 301 and target key point 302. These two target key points can be understood as the two boundary points between the handle structure and the ring structure. The center point of the dielectric film is 303. The line connecting target key point 301 and the center point 303 of the dielectric film is the first line, and the line connecting target key point 302 and the center point 303 of the dielectric film is the second line. The angle between these two lines is α, and the magnitude of angle α is the angle recognition result.
[0088] In some embodiments, the preset angle is a preset angle range. If the angle recognition result is within the preset angle range, it is determined that the dielectric film does not have an angle defect problem.
[0089] In some embodiments, if the angle identification result is not within the preset angle range, it is determined that the dielectric film has an angle defect problem.
[0090] In the above embodiments, the angle recognition result is determined by determining the angle between the line connecting the target key point and the center point, which is convenient and simple.
[0091] In some embodiments, before determining the defect detection result of the dielectric thin film based on the angle recognition result, the method further includes:
[0092] Determine the front and back identification results corresponding to the target thin film image;
[0093] Determine the surface defect detection results corresponding to the target thin film image;
[0094] Based on the angle recognition results, the defect detection results of the dielectric thin film are determined, including:
[0095] Based on the front and back identification results, angle identification results, and surface defect detection results, the defect detection results of the dielectric thin film are determined.
[0096] The front / back identification result is obtained by identifying the front and back sides of the dielectric film. This result indicates whether the dielectric film is the front or back side. It can be understood that due to the optical properties of the dielectric film surface, it has the ability to change the direction of a light beam, resulting in different images being formed on the front and back sides. Therefore, it is necessary to identify whether the dielectric film is the front or back side. When the front / back identification result indicates that the dielectric film is the back side, it is marked as a defective product. When the front / back identification result indicates that the dielectric film is the front side, it is marked as a qualified product.
[0097] Specifically, the front and back recognition result is obtained by training the front and back dielectric film data into the front and back dielectric film data, and then using the trained front and back recognition model to detect the target film image.
[0098] Among them, the surface defect detection result is the result obtained by detecting surface defects in the dielectric thin film. The surface defect detection result is used to characterize whether surface defects exist on the surface of the dielectric thin film.
[0099] Specifically, the surface defect detection result is obtained by training the defect detection model on sample surface defect data, and then using the trained defect detection model to detect the target thin film image to obtain the defect detection result. When the surface defect detection result indicates that the dielectric thin film has surface defects, the dielectric thin film is marked as a defective product. When the surface defect detection result indicates that the dielectric thin film has no surface defects or that the defect size is less than a specified threshold, the dielectric thin film is marked as a qualified product.
[0100] It should be noted that surface defects of dielectric films include, but are not limited to, black spots, insects, holes, crystal points, scratches, etc.
[0101] In some embodiments, when any one of the front / back identification results, angle identification results, and surface defect detection results marks the dielectric film as a non-conforming product, the defect detection result of the dielectric film is determined to be non-conforming.
[0102] In some embodiments, when the front and back identification results, angle identification results, and surface defect detection results all mark the dielectric film as a qualified product, the defect detection result of the dielectric film is determined to be a qualified product.
[0103] In some embodiments, such as Figure 4 As shown, a flowchart of the second thin film defect detection method is provided.
[0104] The following is for Figure 4 Provide specific explanations and clarifications.
[0105] The original image is coarsely localized to obtain the target thin film image. Simultaneously, front / back recognition, angle recognition, and surface defect detection are performed on the target thin film image, yielding front / back recognition results, angle recognition results, and surface defect detection results. Based on these results, the defect detection results of the dielectric thin film are determined.
[0106] If the front / back identification result indicates that the dielectric film is reversed, or the angle identification result indicates that the angle of the dielectric film is not within the preset angle range, or the surface defect detection result indicates that the dielectric film has defects, then the dielectric film is determined to be a defective product.
[0107] When the front and back identification results indicate that the dielectric film is front-side, the angle identification results indicate that the angle of the dielectric film is within the preset angle range, and the surface defect detection results indicate that the dielectric film has no defects or the defect size is less than the specified threshold, then the dielectric film is determined to be a qualified product.
[0108] In some embodiments, the target thin film image is sequentially subjected to front / back recognition, angle recognition, and surface defect detection. When a defect detection result indicates that the dielectric thin film is a defective product, the dielectric thin film is determined to be a defective product, and the remaining defect detection of the dielectric thin film is stopped.
[0109] In some embodiments, the dielectric film is first identified as having both front and back sides. If the identification result indicates that the dielectric film is the front side, then the angle of the dielectric film is identified. If the identification result indicates that the dielectric film is the back side, the dielectric film is directly determined to be a defective product, and angle identification and surface defect detection are no longer performed on the dielectric film.
[0110] In some embodiments, when the front and back identification results of the dielectric film indicate that the dielectric film is a qualified product, angle identification is performed on the dielectric film. When the angle identification result indicates that the angle of the dielectric film is within a preset angle range, i.e., the angle identification result indicates that the dielectric film is a qualified product, surface defect detection is then performed on the dielectric film. When the angle identification result indicates that the angle of the dielectric film is not within the preset angle range, the dielectric film is directly determined to be a defective product, and surface defect detection is no longer performed on the dielectric film.
[0111] In the above embodiments, the dielectric thin film is inspected from three dimensions: front and back sides, angle, and surface defects, making the defect detection results more accurate. For a wide variety of dielectric thin film products and defects, simultaneous inspection from multiple dimensions provides excellent versatility and adaptability to potential unknown defects.
[0112] In some embodiments, the surface defect detection result is obtained by a trained defect detection model; the method further includes:
[0113] When training the defect detection model, a combined loss value is calculated using the cross-entropy loss function and the similarity metric loss function.
[0114] The model parameters of the defect detection model to be trained are adjusted based on the comprehensive loss value, and the trained defect detection model is obtained through iterative training.
[0115] The cross-entropy loss function is a function that measures the difference between the true value and the model's prediction. The smaller the cross-entropy value, the better the model's prediction performance.
[0116] The similarity metric loss function is a set similarity metric function, typically used to calculate the similarity between two samples. Its value ranges from 0 to 1, with values closer to 1 indicating better model performance.
[0117] The combined loss value is obtained by combining the loss value calculated using the cross-entropy loss function and the loss value calculated using the similarity metric loss function. The combined loss value is used to characterize the predictive performance of the defect detection model.
[0118] Specifically, when training the defect detection model, the computer equipment weights the loss values calculated by the cross-entropy loss function and the loss values calculated by the similarity metric loss function to obtain a comprehensive loss value. Based on the comprehensive loss value, the model parameters of the defect detection model are adjusted, and the comprehensive loss value of the adjusted defect detection model is calculated again using the cross-entropy loss function and the similarity metric loss function. When the comprehensive loss value is less than the loss threshold, it indicates that the prediction effect of the defect detection model has reached the ideal value, and the defect detection model at this point is the trained defect detection model.
[0119] It should be noted that due to the diverse morphologies of defects in dielectric films, and the fact that the smallest defects (i.e., small defects) may only be a few pixels wide, a single loss function cannot be used to evaluate the prediction performance of a defect detection model. Using only the cross-entropy loss function fails to adequately segment small defects. Using only the similarity metric loss function results in non-convergence of the loss function. Therefore, a combination of cross-entropy and similarity metric loss functions is employed to evaluate the prediction performance of the defect detection model. This approach optimizes the detection performance for small defects while maintaining training stability.
[0120] In some embodiments, the cross-entropy loss function and the similarity metric loss function are weighted and averaged, and the weighting formula is as follows: Total loss value = a * loss value calculated by the cross-entropy loss function + b * loss value calculated by the similarity metric loss function. Where a + b = 1, and a and b are both numbers between (0, 1).
[0121] In some embodiments, a is 0.99 and b is 0.01. This embodiment is not limited here.
[0122] In the above embodiments, the prediction performance of the defect detection model is measured by combining the cross-entropy loss function and the similarity metric loss function. Compared with using a single loss function to measure the prediction performance of the defect detection model, this approach ensures the stability of training and improves the accuracy of detecting small defects.
[0123] In some embodiments, such as Figure 5 The diagram illustrates a method for detecting thin film defects. Taking the application of this method in computer equipment as an example, the specific steps include:
[0124] Step 501: Obtain the original image of the dielectric film; the dielectric film includes a handle structure and a ring structure.
[0125] Step 502: Perform circle image detection on the original image according to the circle image detection conditions.
[0126] Step 503: If multiple circular images that meet the circular image detection conditions are detected, determine the center coordinates of each circular image.
[0127] It is understandable that if there is no circular image in the original image that meets the circular image detection conditions, the preset radius value and preset standard value are reduced to obtain the updated circular image detection conditions; based on the updated circular image detection conditions, step 502 is executed again until multiple circular images are detected.
[0128] Step 504: Calculate the average center coordinates of multiple circular images to obtain the average center coordinates; the average center coordinates are the coordinates of the center point of the dielectric film.
[0129] Step 505: Based on the center point coordinates of the dielectric film and the preset standard radius, coarsely locate the target film image from the original image.
[0130] Step 506: Predict the probability that each pixel in the target thin film image belongs to an intersection point; the intersection point is the pixel at the junction of the handle structure and the ring structure.
[0131] Step 507: Select the two pixels with the highest probability of being intersection points from all pixels as the two intersection points of the handle structure and the ring structure.
[0132] Step 508: Based on the coordinates of the two boundary points and the coordinates of the center point of the dielectric film, obtain the angle between the lines connecting the two boundary points and the center point; the angle is the angle recognition result.
[0133] Step 509: Determine the front and back recognition results corresponding to the target thin film image; determine the surface defect detection results corresponding to the target thin film image.
[0134] Step 510: Determine the defect detection results of the dielectric thin film based on the front and back identification results, angle identification results, and surface defect detection results.
[0135] In the above embodiments, the dielectric thin film is inspected from three dimensions: front and back sides, angle, and surface defects, making the defect detection results more accurate. For a wide variety of dielectric thin film products and defects, simultaneous inspection from multiple dimensions provides excellent versatility and adaptability to potential unknown defects.
[0136] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.
[0137] Based on the same inventive concept, this application also provides a thin film defect detection device. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations in the embodiments of the thin film defect detection device provided below can be found in the limitations of the thin film defect detection method above, and will not be repeated here.
[0138] In some embodiments, such as Figure 6 As shown, a thin film defect detection device is provided, comprising:
[0139] The coarse positioning module 601 is used to coarsely position the acquired original image to obtain the target thin film image; wherein, the original image is an image obtained by taking pictures of the dielectric thin film; the target thin film image includes an image of the region of interest of the dielectric thin film body.
[0140] The first recognition module 602 is used to identify target key points in the target structural parts of the target thin film image; the target structural parts are the structural parts in the dielectric thin film used for defect detection.
[0141] The second recognition module 603 is used to perform angle recognition on the target structural parts based on the target key points and obtain the angle recognition result.
[0142] The determination module 604 is used to determine the defect detection results of the dielectric thin film based on the angle recognition results.
[0143] In some embodiments, in coarsely locating the acquired original image to obtain the target thin film image, the coarse positioning module 601 is specifically used for:
[0144] Perform circle image detection on the acquired original image according to the circle image detection conditions;
[0145] If a circular image that meets the detection conditions is detected, the coordinates of the center point of the dielectric film are determined based on the coordinates of the center of the detected circular image.
[0146] Based on the center point coordinates and the preset standard radius, the target thin film image is coarsely located from the original image.
[0147] In some embodiments, the coarse positioning module 601 is further configured to: if there is no circular image in the original image that meets the circular image detection conditions, reduce the preset radius value and the preset standard value to obtain updated circular image detection conditions; and re-execute the step of performing circular image detection on the acquired original image according to the updated circular image detection conditions.
[0148] In some embodiments, multiple circular images are detected. Regarding determining the center point coordinates of the dielectric film based on the center coordinates of the detected circular images, the coarse positioning module 601 is specifically used for:
[0149] Determine the coordinates of the center of each circle in the image;
[0150] The average center coordinates of multiple circular images are calculated to obtain the average center coordinates; the average center coordinates are the coordinates of the center point of the dielectric thin film.
[0151] In some embodiments, the dielectric film includes a handle structure and a ring structure; the target structural portion is the handle structure; the target key points are the two junctions between the handle structure and the ring structure.
[0152] In identifying key points of target structures in a target thin film image, the first identification module 602 is specifically used for:
[0153] Predict the probability that each pixel in the target thin film image belongs to an intersection point;
[0154] Select the two pixels with the highest probability of being boundary points from all pixels as the two boundary points.
[0155] In some embodiments, there are two target key points; in terms of performing angle recognition on the target structural parts based on the target key points to obtain the angle recognition result, the second recognition module 603 is specifically used for:
[0156] Based on the coordinates of the two target key points and the coordinates of the center point of the dielectric film, the angle between the line connecting the two target key points and the center point is obtained; the angle is the angle recognition result.
[0157] In some embodiments, the determining module 604 includes:
[0158] The first determining unit is used to determine the front and back recognition results corresponding to the target thin film image;
[0159] The second determining unit is used to determine the surface defect detection result corresponding to the target thin film image;
[0160] The third determining unit is used to determine the defect detection results of the dielectric thin film based on the front and back identification results, angle identification results, and surface defect detection results.
[0161] In some embodiments, the surface defect detection result is obtained by a trained defect detection model; the determining module 604 is further configured to: calculate a comprehensive loss value using a cross-entropy loss function and a similarity metric loss function when training the defect detection model to be trained; and adjust the model parameters of the defect detection model to be trained according to the comprehensive loss value to iteratively train and obtain a trained defect detection model.
[0162] Each module in the aforementioned thin-film defect detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0163] In some embodiments, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface is used to communicate with external terminals via a network. When the computer program is executed by the processor, it implements the steps in the above-described embodiment of the thin film defect detection method.
[0164] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0165] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0166] In some embodiments, a computer-readable storage medium 800 is provided, on which a computer program 820 is stored. When executed by a processor, the computer program 820 implements the steps in the above method embodiments. Its internal structure diagram is shown below. Figure 8 As shown.
[0167] In some embodiments, a computer program product is provided, which includes a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0168] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0169] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0170] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method of detecting defects in a thin film, characterized by, The method comprises the following steps: coarse positioning of an original picture obtained to obtain a target film image; wherein the original picture is a picture obtained by photographing a medium film; the target film image comprises an image of a region of interest of a main body of the medium film; the coarse positioning of the original picture obtained comprises the following steps: performing circle image detection on the original picture obtained according to circle image detection conditions; in the case where a circle image meeting the circle image detection conditions is detected, determining the center point coordinate of the medium film according to the center point coordinate of the detected circle image; coarsely positioning a target film image from the original picture according to the center point coordinate and a preset standard radius; identifying a target key point of a target structure part in the target film image; the target structure part is a structure part for defect detection in the medium film; the medium film comprises a handle structure and a ring structure; the target structure part is the handle structure; the target key point is two intersection points of the handle structure and the ring structure; the identifying of the target key point of the target structure part in the target film image comprises the following steps: predicting the probability of each pixel point in the target film image belonging to the intersection point; selecting two pixel points with the maximum probability of belonging to the intersection point from the pixel points as the two intersection points; the two target key points are the two intersection points of the handle structure and the ring structure; performing angle identification on the target structure part based on the target key points to obtain an angle identification result; the target key points are two; the performing of the angle identification on the target structure part based on the target key points to obtain the angle identification result comprises the following steps: obtaining an included angle between the connecting lines of the two target key points and the center point according to the coordinates of the two target key points and the center point coordinate of the medium film; the included angle is the angle identification result; determining a defect detection result of the medium film based on the angle identification result.
2. The method of claim 1, wherein, the circle image detection conditions comprise a preset radius value and a preset standard value; the method further comprises the following steps: if there is no circle image meeting the circle image detection conditions in the original picture, reducing the preset radius value and the preset standard value to obtain updated circle image detection conditions; re-executing the step of performing circle image detection on the original picture obtained according to the updated circle image detection conditions.
3. The method of claim 1, wherein, the detected circle images are multiple; the determining of the center point coordinate of the medium film according to the center point coordinates of the detected circle images comprises the following steps: determining the center point coordinates of the circle images; obtaining an average center point coordinate by averaging the center point coordinates of the multiple circle images; the average center point coordinate is the center point coordinate of the medium film.
4. The method of claim 1, wherein, before the determining of the defect detection result of the medium film based on the angle identification result, the method further comprises the following steps: determining a front-back surface identification result corresponding to the target film image; determining a surface defect detection result corresponding to the target film image; the determining of the defect detection result of the medium film based on the angle identification result comprises the following steps: According to the front-back face recognition result, the angle recognition result and the surface defect detection result, a defect detection result of the medium film is determined.
5. The method of claim 4, wherein, The surface defect detection result is detected by a trained defect detection model; and the method further comprises: When training the to-be-trained defect detection model, a comprehensive loss value is calculated by a cross-entropy loss function and a similarity measure loss function; According to the comprehensive loss value, model parameters of the to-be-trained defect detection model are adjusted to iteratively train the trained defect detection model.
6. A film defect detection apparatus characterized by comprising: Comprise: A coarse positioning module is configured to perform coarse positioning on an obtained original picture to obtain a target film image; the original picture is a picture obtained by photographing a medium film; the target film image comprises an image of a region of interest of a main body of the medium film; the coarse positioning on the obtained original picture to obtain the target film image comprises: performing circle image detection on the obtained original picture according to circle image detection conditions; in a case where a circle image meeting the circle image detection conditions is detected, center point coordinates of the medium film are determined according to center coordinates of the detected circle image; and a target film image is coarsely positioned from the original picture according to the center point coordinates and a preset standard radius; a first recognition module is configured to recognize target key points of a target structure part in the target film image; the target structure part is a structure part for defect detection in the medium film; the medium film comprises a handle structure and a ring structure; the target structure part is the handle structure; the target key points are two intersection points of the handle structure and the ring structure; the recognition of the target key points of the target structure part in the target film image comprises: predicting probabilities of each pixel point in the target film image belonging to the intersection points; and selecting two pixel points with the largest probabilities of belonging to the intersection points from the each pixel point as the two intersection points; two target key points are the two intersection points of the handle structure and the ring structure; A second recognition module is configured to perform angle recognition on the target structure part based on the target key points to obtain an angle recognition result; the target key points are two; the angle recognition on the target structure part based on the target key points to obtain the angle recognition result comprises: obtaining an included angle between connecting lines of the two target key points and a center point according to coordinates of the two target key points and the center point coordinates of the medium film; and the included angle is the angle recognition result; A determination module is configured to determine a defect detection result of the medium film based on the angle recognition result. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Watch display defect detection method and device and computer readable storage medium
CN112967258A
Object defect detection method and device, computer equipment and storage medium
CN114494260A