Resistor disc quality detection method and device, electronic equipment and storage medium
By updating the attention weight diagram of the external and internal detection models of the resistor chip, combined with the internal and external defect correlation, the accuracy and reliability of resistor chip quality detection are achieved.
Patent Information
- Application Number
- CN202510857001.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional resistor chip quality detection methods fail to effectively consider the correlation between internal and external defects, resulting in insufficient detection accuracy.
Through the update of the attention weight graph of the external detection model and the internal detection model, multiple detections are performed to improve accuracy.
Improve the accuracy and reliability of resistor chip quality detection, ensure that the internal and external detection models focus more on areas where defects may exist, and reduce missed detection and missed detection.
Smart Images

Figure CN120374616A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of resistance detection, and more specifically, relates to a method and device for detecting the quality of resistor chips, an electronic device, and a storage medium. Background Art
[0002] In the field of arrester manufacturing, resistor chips, as its basic components, their quality directly affects the performance and reliability of arresters.
[0003] Most traditional quality inspections of resistor chips are to input the internal image and external image of the resistor chip to be tested into a trained quality inspection model to obtain the quality inspection result of the resistor chip. However, the quality inspection model usually identifies and detects the images relatively independently, without considering the correlation between internal and external defects, resulting in insufficient accuracy of the quality inspection of resistor chips.
[0004] Therefore, an accurate and reliable method for detecting the quality of resistor chips is needed. Summary of the Invention
[0005] The purpose of this application is to provide a method and device for detecting the quality of resistor chips, an electronic device, and a storage medium to improve the accuracy and reliability of the quality inspection of resistor chips.
[0006] In the first aspect of the embodiments of this application, a method for detecting the quality of resistor chips is provided, including: Input a first image into an external detection model to perform an external detection on the appearance of the resistor chip to be tested, and obtain a first external detection result. The first image is an image collected for the appearance of the resistor chip to be tested; Input a second image into an internal detection model to perform an internal detection on the internal structure of the resistor chip to be tested, and obtain a first internal detection result. The second image is an image obtained by non-destructively collecting the internal structure of the resistor chip to be tested; In response to the first external detection result indicating that there is an external defect area on the resistor chip to be tested, update the attention weight map of the attention module in the internal detection model based on the external defect area, and input the second image into the updated internal detection model to obtain a second internal detection result; In response to the first internal detection result indicating that there is an internal defect area on the resistor chip to be tested, update the attention weight map of the attention module in the external detection model based on the internal defect area, and input the first image into the updated external detection model to obtain a second external detection result; Determine the quality of the resistor chip to be tested based on the last external detection result and the last internal detection result, where the last external detection result is the first external detection result or the second external detection result, and the last internal detection result is the first internal detection result or the second internal detection result.
[0007] In a second aspect of the embodiments of the present application, a resistor chip quality detection device is provided, including: A first external detection module, configured to input a first image into an external detection model to perform external detection on the appearance of the resistor chip to be detected, and obtain a first external detection result, where the first image is an image collected for the appearance of the resistor chip to be detected; A first internal detection module, configured to input a second image into an internal detection model to perform internal detection on the internal structure of the resistor chip to be detected, and obtain a first internal detection result, where the second image is an image obtained by non-destructively collecting the internal structure of the resistor chip to be detected; A second internal detection module, configured to, in response to the first external detection result indicating that there is an external defect area on the resistor chip to be detected, update the attention weight map of the attention module in the internal detection model based on the external defect area, and input the second image into the updated internal detection model to obtain a second internal detection result; A second external detection module, configured to, in response to the first internal detection result indicating that there is an internal defect area on the resistor chip to be detected, update the attention weight map of the attention module in the external detection model based on the internal defect area, and input the first image into the updated external detection model to obtain a second external detection result; A quality determination module, configured to determine the quality of the resistor chip to be detected based on the last external detection result and the last internal detection result, where the last external detection result is the first external detection result or the second external detection result, and the last internal detection result is the first internal detection result or the second internal detection result.
[0008] In a third aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of the above-mentioned resistor chip quality detection method are implemented.
[0009] In a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the above-mentioned resistor chip quality detection method are implemented.
[0010] The beneficial effects of the resistor chip quality detection method, device, electronic device, and storage medium provided by the embodiments of the present application are as follows: Compared with the traditional method for detecting the quality of resistor chips, in the embodiments of the present application, by updating the attention weights of the external detection model based on internal defects and updating the attention weights of the internal detection model based on external defects, the model can consider the correlation between internal and external defects when detecting the quality of resistor chips, so that the internal and external detection models are more focused on the areas where defects may exist during detection, thereby improving the accuracy of the internal and external detection models in detecting the quality of resistor chips. Further, in the embodiments of the present application, by combining the final detection results of the internal and external models, the quality of the resistor chip to be tested is comprehensively determined, thereby improving the accuracy and reliability of the resistor chip quality detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0012] Figure 1 It is a schematic flowchart of a method for detecting the quality of resistor chips provided by an embodiment of the present application; Figure 2 It is a structural block diagram of a device for detecting the quality of resistor chips provided by an embodiment of the present application; Figure 3 It is a schematic block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0013] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are presented in order to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0014] To make the objectives, technical solutions, and advantages of the present application clearer, the following will be described through specific embodiments with reference to the drawings.
[0015] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a method for detecting the quality of resistor chips provided by an embodiment of the present application. The method can be executed by an electronic device and may include: S101: Input the first image into an external detection model to perform an external detection on the appearance of the resistor chip to be tested, and obtain a first external detection result. The first image is an image collected for the appearance of the resistor chip to be tested.
[0016] In this embodiment, the first image can be obtained by photographing with an optical camera, which can present the surface condition of the resistor chip, such as details like color, shape, and whether there are scratches. The external detection model is a model for identifying surface defects of the resistor chip, which can be constructed based on a deep learning architecture, such as a convolutional neural network. An attention module can be set therein. Initially, the first image can be identified based on a preset attention weight. For example, it can be preset to pay attention to the edge area of the resistor chip in the first image because it is more likely to be scratched and have scratches, or it can be set so that the attention of each area in the first image is the same.
[0017] It should be noted that the external detection model is a model trained with a large number of image datasets of resistor chips and information such as their corresponding defect types and defect areas.
[0018] S102: Input the second image into the internal detection model to perform an internal detection on the internal structure of the resistor chip to be tested, and obtain a first internal detection result. The second image is an image obtained by non-destructively collecting the internal structure of the resistor chip to be tested.
[0019] In this embodiment, the second image can be an image of the internal structure of the resistor chip to be tested obtained by non-destructive testing technology, which can reflect information such as whether there are defects inside the resistor chip. Non-destructive collection methods include ultrasonic testing, X-ray testing, etc. For example, use an ultrasonic testing device to scan the resistor chip, convert the ultrasonic signal into a grayscale image, and obtain a grayscale image. Different grayscale values in this image correspond to different material or structural characteristics inside the resistor chip, which is the second image.
[0020] The internal detection model is a model for analyzing the internal detection image of the resistor chip and identifying internal defects (such as cracks, holes, impurities, etc.), which can be constructed based on a deep learning model. For example, it can be a convolutional neural network model. The internal detection model is a model trained with a large number of internal detection images of resistor chips and information such as their corresponding defect types and defect areas.
[0021] In this embodiment, both the internal detection model and the external detection model contain an attention module, and the attention weights of each area in the attention module of the internal detection model can be set to the same weights as those of the attention module of the external model.
[0022] S103: In response to the first external detection result indicating that there is an external defect area in the resistor chip to be tested, update the attention weight map of the attention module in the internal detection model based on the external defect area, and input the second image into the updated internal detection model to obtain a second internal detection result.
[0023] In this embodiment, considering that the formation of defects in the resistor chip is usually complex and there is usually a corresponding relationship between internal defects and external defects. For example, during the production process of the resistor chip, when there are defects such as impurities, bubbles, and cracks inside, there will also be defects such as cracks, holes, or uneven surfaces outside. Similarly, when there are defects such as cracks or holes outside, there may also be corresponding defects inside.
[0024] Therefore, in the embodiment of this application, when the external detection model detects the appearance image (the first image) of the resistor chip and concludes that there is a defective area on the surface of the resistor chip, at this time, based on the defective area detected externally, the weight map can be adjusted so that when the internal detection model processes the internal structure image (the second image), it can pay more attention to the internal area corresponding to the external defective area, improving the detection pertinence. The attention weight map can be understood as a matrix map, and each element in the matrix corresponds to a position in the image, and the numerical size represents the degree of attention of the model to this position.
[0025] In this embodiment, the internal structure image (the second image) of the resistor chip obtained through non-destructive acquisition is input into the internal detection model with the updated attention weight map, and the model analyzes and processes the image and outputs a new detection result. Compared with the first internal detection result, due to the guidance of the external defective area, this result can more accurately identify the internal defective situation related to the external defect and prevent the occurrence of the first missed detection situation.
[0026] In this embodiment, in response to the first external detection result indicating that there is no defective area in the resistor chip to be measured, there is no need to update the attention weight map of the attention module in the internal detection model, and the first internal detection result can be directly used as the detection result of the last internal detection of the resistor chip to be measured.
[0027] S104: In response to the first internal detection result indicating that there is an internal defective area in the resistor chip to be measured, update the attention weight map of the attention module in the external detection model based on the internal defective area, and input the first image into the updated external detection model to obtain a second external detection result.
[0028] In this embodiment, with the same logic as S103, when the internal detection model detects the internal structure image of the resistor chip and determines that there are defects inside the resistor chip, the attention weight map of the attention module of the external detection model is adjusted to focus on the surface area related to the internal defects.
[0029] For example, internal cracks may cause slight deformation or abnormalities on the surface. The update of the weight map is based on information such as the position and type of internal defects to enhance the weights of these potentially related areas.
[0030] In this embodiment, after the update of the aforementioned attention weight map, the appearance image of the resistor chip is reprocessed to obtain a more accurate external defect detection result. The secondary detection can detect subtle surface abnormalities that may have been overlooked during the primary detection.
[0031] In this embodiment, in response to the first internal detection result indicating that there is no defective area in the resistor chip to be tested, there is no need to update the attention weight map of the attention module in the external detection model, and the first external detection result can be directly used as the detection result of the last external detection of the resistor chip to be tested.
[0032] S105: Determine the quality of the resistor chip to be tested based on the last external detection result and the last internal detection result, where the last external detection result is the first external detection result or the second external detection result, and the last internal detection result is the first internal detection result or the second internal detection result.
[0033] In this embodiment, the last external detection result is the final result output by the external detection model during the detection of the resistor chip. This result may be the first external detection result obtained from the first detection of the appearance image of the resistor chip (the first image), or it may be the second external detection result obtained from the re-detection of the first image after updating the attention weight map based on the internal detection result. It contains information such as whether there are defects on the surface of the resistor chip, the type, location, and size of the defects.
[0034] For example, assume that when the external detection model is first used to detect the appearance image of the resistor chip, a scratch is found on the surface of the resistor chip (the first external detection result); later, because a defect is found in the internal detection, the attention weight map of the external detection model is updated based on the internal defective area, and after re-detection, it is found that in addition to the original scratch, there is also a small surface depression (the second external detection result). Then, the last external detection result here is the second external detection result obtained from the second detection, that is, there is a scratch and a small depression on the surface of the resistor chip. The last internal detection result is also the final detection result output by the internal detection model. Similar to the method of determining the final detection result output by the external detection model, it will not be elaborated in this embodiment of the present application.
[0035] In this embodiment, the quality of the resistor to be tested can be comprehensively evaluated based on the type, area, or quantity of the defects in the last external detection result and the last internal detection result. For example, a score for the type, area, and quantity is preset, and the obtained detection result is matched with each scoring standard, and the final score is used as the defect score. When the defect score reaches a certain value, it is rated as low quality; when it is less than another value, it is rated as high quality; when it is between the two, it is rated as medium quality. The thresholds for each level division can be determined based on experience and multiple experiments.
[0036] Specifically, determining the quality of the resistor chip to be measured based on the last external detection result and the last internal detection result may include: In response to the first external detection result indicating that there is an external defect area in the resistor chip to be measured, and the first internal detection result indicating that there is no defect area in the resistor chip to be measured, determining the quality of the resistor chip to be measured based on the first external detection result and the second internal detection result; In response to the first external detection result indicating that there is no defect area in the resistor chip to be measured, and the first internal detection result indicating that there is an internal defect area in the resistor chip to be measured, determining the quality of the resistor chip to be measured based on the second external detection result and the first internal detection result; In response to the first external detection result indicating that there is an external defect area, and the first internal detection result indicating that there is an internal defect area, determining the quality of the resistor chip to be measured based on the second external detection result and the second internal detection result; In response to the first external detection result indicating that there is no defect area in the resistor chip to be measured, and the first internal detection result indicating that there is no defect area in the resistor chip to be measured, determining the quality of the resistor chip to be measured based on the first external detection result and the first internal detection result.
[0037] In this embodiment, when the first detection of the appearance of the resistor chip (the first external detection) finds that there are defect areas on the surface of the resistor chip, such as scratches, deformations, etc., and the first detection of the internal structure of the resistor chip (the first internal detection) shows that there are no defects inside the resistor chip. Since external defects have been found, in order to more accurately evaluate the quality of the resistor chip, it is necessary to combine the first external detection result and the second internal detection result obtained by performing the internal detection again after updating the attention weight map to determine the quality of the resistor chip. Because no problems were found in the first internal detection, it may be because the defects are relatively small or undetected. Since there is a certain correlation between external defects and internal defects, it is necessary to refer to the updated internal detection result for comprehensive judgment.
[0038] If the first external detection result shows that there is no defect area in the resistor chip to be measured, and the first internal detection result shows that there is an internal defect area, it may be that there is a blind area in the external detection or the internal defect is independently caused by internal factors. At this time, referring to the second external detection result, if the second external detection result also shows no external defects, then it can be determined that the internal defect of the resistor chip exists independently, and it is necessary to evaluate the quality of the resistor chip according to the severity of the internal defect to determine whether it meets the usage requirements; if the second external detection result shows that there are external defects, then it is necessary to comprehensively consider the relationship between the external defect and the internal defect. It is possible that the two are related to each other and have a greater impact on the quality of the resistor chip, and it is necessary to evaluate its quality more carefully.
[0039] When the first external detection result shows the existence of an external defect area and the first internal detection result also shows the existence of an internal defect area, it indicates that the resistor chip has both internal and external defects. At this time, it is even more necessary to conduct a second detection on the inside and outside, and determine the final quality detection result based on the second external detection result and the second internal detection result.
[0040] When both the first external detection result and the first internal detection result show that there is no defect area in the resistor chip to be measured, it can be initially considered that the quality of the resistor chip is good. Therefore, it can be directly determined that the quality of the measured resistor chip is "excellent", or it can be determined based on the following determination method, and the result is also the same ("excellent").
[0041] In this embodiment, quality scoring can also be performed based on Table 1 and the quality of the measured resistor can be determined based on Table 2.
[0042]
[0043]
[0044] The first internal detection result, the first external detection result, the second internal detection result, and the second external detection result are essentially the same, all being information such as the defect type and defect area of the resistor chip to be measured. Therefore, the quality assessment methods in the embodiments of this application are the same and will not be elaborated. In addition, in this application, in order to obtain the quality detection result more accurately, all internal detection results and all external detection results can also be used together as the basis for the determination result.
[0045] It should be noted that there is no fixed sequence relationship between S101 and S102 in this application, that is, S101 can be executed before S102, can also be executed after S102, or can be executed together with S102. This application does not make a limitation. The same applies to S103 and S104, and no sequence limitation is made in the embodiments of this application either; it should be noted that Figure 1 This is only a possible example and does not limit the embodiments of this application.
[0046] It can be concluded from the above that compared with the traditional resistor chip quality detection method, in the embodiments of this application, by updating the attention weights of the external detection model based on internal defects and updating the attention weights of the internal detection model based on external defects, the model can consider the association between internal and external defects when detecting the quality of the resistor chip, so that the internal and external detection models are more focused on the areas where defects may exist when performing detection, so as to improve the accuracy of the internal and external detection models for detecting the quality of the resistor chip. Further, in the embodiments of this application, by combining the final detection results of the internal and external models, the quality of the resistor chip to be measured is comprehensively determined, thereby improving the accuracy and reliability of the resistor chip quality detection.
[0047] In an embodiment of the present application, updating the attention weight map of the attention module in the internal detection model based on the external defect region includes: In response to the shape of the external defect region being an irregular shape, updating the attention weight map of the attention module in the internal detection model based on the first mask map; wherein, the value of each mask in the first mask map is determined based on the position of the external defect region in the resistor sheet to be measured; In response to the shape of the external defect region being a regular shape, updating the attention weight map of the attention module in the internal detection model based on the first coordinate information; wherein, the first coordinate information is the position information of the external defect region in the resistor sheet to be measured.
[0048] In this embodiment, considering that there are various ways to update the attention weight map, but each has its own advantages and disadvantages. For example, in the method of updating the attention weight map based on the mask, the attention area can be accurately defined, and complex-shaped regions can also be accurately represented. However, usually, a large amount of storage space is required to store information. The method based on coordinate information can accurately determine the position and range for regular-shaped regions such as rectangles and circles. However, for complex irregular shapes, it is not precise enough to describe with coordinates, and more parameters and complex calculations are required to approximately represent, which will have a certain error. However, the storage and calculation of coordinate information are relatively simple, and the occupied storage space is small.
[0049] Therefore, in the embodiment of the present application, the update method of the attention weight map is determined according to whether the shape of the defect region is a regular shape. The attention weight map determines the degree of attention of the model to different positions when processing the internal detection image. By updating the attention weight map, the model can pay more attention to the internal regions that may be related to the external defects, improving the detection accuracy.
[0050] In this embodiment, the first mask map is a matrix map with the same size as the internal detection image, and the value of each element (the value of the mask) is determined according to the position of the external defect region in the resistor sheet to be measured. For example, in the mask map, the elements corresponding to the position of the external defect region in the internal image are set to a higher value (such as 1), and other positions are set to a lower value (such as 0). Then, this mask map is multiplied element by element with the attention weight map of the internal detection model, thereby realizing the update of the attention weight map, so that the model pays more attention to the internal part corresponding to the external irregular defect region when processing the internal image. For example, if an irregular crack is detected on the surface of the resistor sheet externally, then in the first mask map, the region corresponding to the crack in the internal image is marked as a high value, and the model will pay more attention to whether there are related defects in this region when analyzing the internal structure.
[0051] In this embodiment, the first coordinate information refers to the position information of the external regular-shaped defect area in the resistor under test, such as the center coordinates of a circular defect and any point (or radius) on the circumference, the vertex coordinates of a rectangular defect, etc. Using this coordinate information, the area that needs to be focused on in the attention weight map of the internal detection model is determined. For example, if a circular hole is detected on the surface of the resistor by external detection, through its center coordinates and radius information, in the attention weight map of the internal detection model, the weight values of the area corresponding to the position of the circular hole in the internal image and a certain range around it are increased, so that the model pays more attention to the internal structure of this area and judges whether there are internal problems related to the external hole, such as internal holes or cracks, etc.
[0052] It can be concluded from the above that the embodiment of the present application can distinguish the shape of the external defect area and adopt different methods to update the attention weight map of the internal detection model, improve the accuracy of area description, can more effectively guide the model to focus on the internal area related to the external defect, and improve the accuracy of resistor quality detection. The present application only adopts the method of updating the attention weight map based on the mask when the external defect area is an irregular shape, which avoids the waste of storage space caused by using this method in all cases, and reasonably controls the consumption of storage resources while ensuring the detection accuracy of irregular defects.
[0053] In an embodiment of the present application, the process of determining the values of each mask in the first mask map includes: Create a second mask map with the same size as the second image based on the number of pixels in the second image; each mask in the second mask map corresponds one-to-one with each pixel in the second image; Set the mask of the target area in the second mask map to the first value, and set other areas to the second value to obtain the values of each mask in the first mask map; where the first value is greater than the second value, the target area corresponds to the key attention area in the second image, and the key attention area in the second image is the internal area corresponding to the external defect area, and the external defect area is the image area in the first image.
[0054] In this embodiment, the second mask map can be a blank matrix map with the same size as the second image, which is used to mark the area that needs to be focused on. Each element (mask) corresponds to a pixel in the second image. The target area is the area in the second mask map corresponding to the key attention area in the second image, and the key attention area is the internal area corresponding to the external defect area.
[0055] It can be understood that the sizes and contours of the first image and the second image are the same, so the internal area can be directly corresponding to the external area, or the external area can be directly corresponding to the internal area. And because the second mask map and the second image have the same size, they can also be directly corresponding.
[0056] In this embodiment, the first value can be 1 and the second value can be 0. The first value is the value set in the second mask image for marking the target area, which is greater than the second value set for other areas, so as to highlight the attention to the target area. The second value is the value set for other areas in the second mask image except the target area, and its value is less than the first value, which is used to represent the relatively low degree of attention to these areas.
[0057] For example, for a resistor chip, the first image shows an irregular scratch defect area on its surface. The second image (internal structure image) is obtained through non-destructive testing, and then the second mask image is created according to the size of the second image. The external scratch defect area is mapped into the second image to determine the corresponding area, which is the key attention area in the second image. The area corresponding to the aforementioned key attention area is the target area. The mask of the target area in the second mask image is set to 1 (the first value), and other areas are set to 0 (the second value), so as to obtain the first mask image, which is used to update the attention weight map of the internal detection model, making the model pay more attention to the internal area corresponding to the external scratch defect area to judge whether there are related internal defects.
[0058] It can be concluded from the above that in the embodiment of the present application, by creating the second mask image with the same size as the second image and adjusting the second mask image based on the external defect area, the internal detection model can clearly know the internal area that needs to be focused on in the subsequent processing, improving the pertinence of detection, avoiding the undifferentiated detection of the entire internal image, saving computing resources, helping the model to more sensitively capture the possible internal defects related to the external defects, improving the discovery ability of defects in key areas, and thus improving the accuracy of the quality detection of the resistor chip.
[0059] In an embodiment of the present application, the process of determining the key attention area in the second image includes: Determine the target position information and target area corresponding to the external defect area in the first image; Based on the target position information and target area corresponding to the external defect area in the first image, in the second image, determine the first internal area, and the position information of the first internal area in the second image corresponds to the target position information, and the included area is the same as the target area; Determine the expansion direction based on the defect type of the external defect area; Expand the first internal area based on the expansion direction to obtain the internal area corresponding to the external defect area.
[0060] In this embodiment, the target position information refers to information such as the specific position coordinates of the external defect area in the first image representing the appearance of the resistor chip, and is used to locate the position of the defect in the image. For example, the start and end point coordinates of a scratch on the surface of the resistor chip in the first image are the target position information. The target area refers to the area size occupied by the external defect area in the first image. For example, the area of a circular defect on the surface of the resistor chip, or the area represented by the number of pixels covered by an irregular defect, etc., is the target area.
[0061] In this embodiment, the target position information can be determined in the form of coordinates. The first internal area refers to the internal area corresponding to the position and area of the external defect area determined in the second image according to the target position information and target area of the external defect area in the first image. It is a preliminarily determined internal area related to the external defect, but needs to be further expanded or adjusted.
[0062] In this embodiment, the size, perspective, and contour of the resistor chip in the first image and the second image can be the same. If there are differences, they can be preprocessed to be consistent. Therefore, the target position information can be directly corresponded in the second image to obtain the first internal area, and the area is also the same at this time.
[0063] Or based on the above coordinate information and the mapping relationship set based on the size and perspective of the first image and the second image, the corresponding first internal area in the second image is obtained.
[0064] In this embodiment, it is also considered that different defect types may have different expansion trends or related influence areas inside, so it is necessary to determine the expansion direction according to the defect type in order to more comprehensively detect possible internal defects.
[0065] For example, if the external defect is of the crack type, the crack may have potential expansion or related internal defects along its extension direction inside, then the expansion direction is the extension direction of the crack; if it is of the hole type, it may need to be uniformly expanded in all directions to check whether there are other defects around the hole.
[0066] In this embodiment, according to the determined expansion direction, the first internal area preliminarily determined in the second image is expanded, so as to obtain a more complete internal area corresponding to the external defect area. This area is the finally determined area in the second image that needs to be analyzed in detail, and the model will perform more detailed detection and analysis on this area to determine whether there are internal defects.
[0067] As can be seen from the above, in the embodiments of the present application, by first determining the target position information and target area of the external defect area in the first image, and then determining the first internal area corresponding to the position and area in the second image, the preliminary positioning of the internal relevant area is realized. Then, in combination with the defect type of the external defect area, the expansion direction is determined, and based on this, the first internal area is expanded to obtain the internal area corresponding to the external defect area. Considering the possible expansion trends or related influence areas of different defect types inside, it can more comprehensively cover the internal area related to the external defect, avoid missing potential internal defects due to only focusing on the initial corresponding area, and greatly improve the comprehensiveness and accuracy of the quality inspection of the resistor chip.
[0068] In an embodiment of the present application, updating the attention weight map of the attention module of the internal detection model based on the first coordinate information includes: Determining the area position information inside the resistor chip to be measured corresponding to the external defect area based on the first coordinate information; Determining the expansion direction based on the defect type of the external defect area; Expanding the area position information based on the expansion direction to obtain the target area position information; Updating the attention weight map of the attention module of the internal detection model based on the target area position information.
[0069] In this embodiment, the first coordinate information records the position-related data of the defect detected externally on the appearance or external structure of the resistor chip. Through the coordinate information, using a certain mapping relationship, the area position corresponding to the external defect inside the resistor chip is determined. That is, the position range where the external defect may affect or be associated with inside the resistor chip is found. Similarly, different types of external defects (such as cracks, holes, wear, etc.) may have different expansion or influence directions inside the resistor chip. According to the defect type detected externally, the direction that needs to be focused on during internal detection is determined, that is, the expansion direction for the already determined internal area. According to the previously determined expansion direction, the area position information already determined inside the resistor chip (i.e., the internal area position obtained according to the first coordinate information) is expanded. Through this expansion, a larger area that is more likely to contain the internal features related to the external defect is obtained, and the position information of this expanded area is the target area position information.
[0070] Specifically, updating the attention weight map of the attention module of the internal detection model with the target area position information may include: Updating the weight of the area in the attention weight map with the same coordinates as the target area position information to a third value, and updating the other areas in the attention weight map to a fourth value, where the third value is greater than the fourth value.
[0071] In this embodiment, the attention weight map is a matrix map in the internal detection model used to adjust the degree of attention of the model to different regions of the image. According to the obtained position information of the target region, a higher weight value is assigned to the corresponding region in the attention weight map, so that when the model processes the second image, it pays more attention to the internal structure part corresponding to the position information of the target region, thereby improving the detection ability of possible internal defects. The specific method may be to set the high-weight region to 1 (the third value) and the low-weight region to 0 (the fourth value).
[0072] Specifically, the process of determining the first coordinate information may include: Taking any point in the second image as the origin and any two mutually perpendicular directions as the positive directions of the two coordinate axes, a first coordinate system is established; In response to the shape of the external defect region being a polygon, the coordinates corresponding to each vertex in the polygon in the first coordinate system are used as the first coordinate information; In response to the shape of the external defect region being a circle, the coordinates of the center of the circle and any point on the circumference in the first coordinate system are used as the first coordinate information.
[0073] In this embodiment, when the shape of the external defect region is a polygon, based on each vertex and connecting them in a straight line in sequence, the shape of the external defect region can be obtained. The same applies to a circle. The purpose of any point on the circumference is to determine the radius of the circle. The purpose of this embodiment is to determine the shape of the external defect region with the fewest points.
[0074] It can be concluded from the above that in the embodiment of the present application, first, based on the first coordinate information, the corresponding region position information of the external defect region inside the resistor chip to be measured is determined, and the connection between the external defect and the internal related region is established. Subsequently, according to the type of the external defect, the expansion direction is determined, and based on this, the region position information is expanded to obtain the target region position information. Considering the expansion or influence characteristics of different defect types inside the resistor chip, the finally determined target region can more comprehensively cover the internal region related to the external defect. Based on this target region position information, the attention weight map of the internal detection model is updated, so that when the model processes the image, it can accurately focus on these key regions, improve the detection accuracy of internal defects, and reduce the possibility of missed detection and false detection.
[0075] In an embodiment of the present application, determining the expansion direction based on the defect type of the external defect region includes: In response to the defect type of the external defect region being the crack type, determine the crack direction in the external defect region and use the crack direction as the expansion direction; In response to the defect type of the external defect region being the hole type, determine all directions of the external defect region as the expansion direction.
[0076] In this embodiment, considering that a crack is a defect with directionality and will extend and expand along a certain direction. In a resistance chip, a crack may affect the material properties and structural integrity of the surrounding materials along the crack direction. If a crack on the surface of the resistance chip is detected, then inside it, the crack is very likely to extend along the same direction. Therefore, determining the crack direction as the expansion direction can enable the internal detection model to focus on the internal areas where the crack may extend, improving the accuracy of detecting potential internal defects.
[0077] A hole is a relatively uniform defect and does not have obvious directionality like a crack. A hole in a resistance chip may affect the material properties in all directions around it because the materials around the hole may have weakened strength and changed conductivity in all directions. Therefore, determining all directions of the external defect area as the expansion direction can enable the internal detection model to comprehensively focus on all areas around the hole, avoiding missing any internal defects that may be related to the hole.
[0078] From the above, it can be concluded that by determining a reasonable expansion direction according to different defect types, this embodiment realizes the optimal allocation of detection resources. For the crack type, focusing on the internal areas related to the crack direction reduces the image range that the model needs to process, avoiding wasting computing resources on irrelevant areas, thereby improving the detection efficiency. For the hole type, the expansion direction is all directions, and the model can perform detection more targeted, rather than performing undifferentiated comprehensive detection on the entire internal image, also improving the detection efficiency.
[0079] It should be noted that in the embodiment of this application, the process of "responding to the first external detection result that there is an external defect area in the resistance chip to be tested and updating the attention weight map of the attention module in the internal detection model based on the external defect area" is mainly described in detail. Another logical condition: "responding to the first internal detection result that there is an internal defect area in the resistance chip to be tested and updating the attention weight map of the attention module in the external detection model based on the internal defect area" has the same specific update method as the update method of the attention weight map in the aforementioned internal detection model. Therefore, it is not described in detail in this application. The difference between the two is only the update of the attention weight map in the external model. The expansion step can be executed or not. Because in the defect scenario of the resistance chip, most are internal defects causing external defects and the area or severity of the internal defects is greater than that of the external defects. Therefore, whether to execute the expansion step can be set based on personal preference and is not limited in this application.
[0080] Corresponding to the resistance chip quality detection method in the above embodiment, Figure 2The structural block diagram of the resistor chip quality detection device provided by an embodiment of the present application. For the sake of convenience of description, only the parts related to the embodiments of the present application are shown. Refer to Figure 2 , the resistor chip quality detection device 20 includes: a first external detection module 21, a first internal detection module 22, a second internal detection module 23, a second external detection module 24, and a quality determination module 25.
[0081] Among them, the first external detection module 21 is used to input a first image into an external detection model to perform external detection on the appearance of the resistor chip to be tested, and obtain a first external detection result. The first image is an image collected for the appearance of the resistor chip to be tested; The first internal detection module 22 is used to input a second image into an internal detection model to perform internal detection on the internal structure of the resistor chip to be tested, and obtain a first internal detection result. The second image is an image obtained by non-destructively collecting the internal structure of the resistor chip to be tested; The second internal detection module 23 is used to, in response to the first external detection result indicating that there is an external defect area on the resistor chip to be tested, update the attention weight map of the attention module in the internal detection model based on the external defect area, and input the second image into the updated internal detection model to obtain a second internal detection result; The second external detection module 24 is used to, in response to the first internal detection result indicating that there is an internal defect area on the resistor chip to be tested, update the attention weight map of the attention module in the external detection model based on the internal defect area, and input the first image into the updated external detection model to obtain a second external detection result; The quality determination module 25 is used to determine the quality of the resistor chip to be tested based on the last external detection result and the last internal detection result. Among them, the last external detection result is the first external detection result or the second external detection result, and the last internal detection result is the first internal detection result or the second internal detection result.
[0082] In an embodiment of the present application, the second internal detection module 23 is specifically used to, in response to the shape of the external defect area being an irregular shape, update the attention weight map of the attention module of the internal detection model based on the first mask map; where the values of each mask in the first mask map are determined based on the position of the external defect area in the resistor chip to be tested; In response to the shape of the external defect area being a regular shape, update the attention weight map of the attention module of the internal detection model based on the first coordinate information; where the first coordinate information is the position information of the external defect area in the resistor chip to be tested.
[0083] In an embodiment of the present application, the resistor chip quality detection device 20 further includes a first mask map determination module, which is used to create a second mask map with the same size as the second image based on the number of pixel points in the second image; each mask in the second mask map corresponds one-to-one to each pixel point in the second image; Set the mask of the target area in the second mask map to a first value, and set other areas to a second value to obtain the values of each mask in the first mask map; wherein, the first value is greater than the second value, the target area corresponds to the key area of interest in the second image, and the key area of interest in the second image is the internal area corresponding to the external defect area, and the external defect area is the image area in the first image.
[0084] In an embodiment of the present application, the resistor chip quality detection device 20 further includes a key area determination module, which is used to determine the target position information and target area corresponding to the external defect area in the first image; Based on the target position information and target area corresponding to the external defect area in the first image, in the second image, determine a first internal area, the position information of the first internal area in the second image corresponds to the target position information, and the included area is the same as the target area; Determine the expansion direction based on the defect type of the external defect area; Expand the first internal area based on the expansion direction to obtain the internal area corresponding to the external defect area.
[0085] In an embodiment of the present application, the second internal detection module 23 is specifically further used to determine the area position information corresponding to the external defect area inside the resistor chip to be tested based on the first coordinate information; Determine the expansion direction based on the defect type of the external defect area; Expand the area position information based on the expansion direction to obtain the target area position information; Update the attention weight map of the attention module of the internal detection model based on the target area position information.
[0086] In an embodiment of the present application, the second internal detection module 23 is specifically further used to, in response to the defect type of the external defect area being a crack type, determine the crack direction in the external defect area and determine the crack direction as the expansion direction; In response to the defect type of the external defect area being a hole type, determine all directions of the external defect area as the expansion direction.
[0087] In an embodiment of the present application, the quality determination module 25 is specifically configured to determine the quality of the resistor chip to be measured based on the first external detection result and the second internal detection result in response to the first external detection result indicating that there is an external defect area in the resistor chip to be measured and the first internal detection result indicating that there is no defect area in the resistor chip to be measured; In response to the first external detection result indicating that there is no defect area in the resistor chip to be measured and the first internal detection result indicating that there is an internal defect area in the resistor chip to be measured, determine the quality of the resistor chip to be measured based on the second external detection result and the first internal detection result; In response to the first external detection result indicating that there is an external defect area and the first internal detection result indicating that there is an internal defect area, determine the quality of the resistor chip to be measured based on the second external detection result and the second internal detection result; In response to the first external detection result indicating that there is no defect area in the resistor chip to be measured and the first internal detection result indicating that there is no defect area in the resistor chip to be measured, determine the quality of the resistor chip to be measured based on the first external detection result and the first internal detection result.
[0088] Refer to Figure 3 , Figure 3 which is a schematic block diagram of an electronic device provided in an embodiment of the present application. As Figure 3 shown, the electronic device 300 in this embodiment may include: one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The above-mentioned processors 301, input devices 302, output devices 303, and memories 304 communicate with each other through a communication bus 305. The memory 304 is used to store a computer program, and the computer program includes program instructions. The processor 301 is used to execute the program instructions stored in the memory 304. Among them, the processor 301 is configured to call the program instructions to execute the functions of each module in the above device embodiments, such as Figure 2 the functions of the first external detection module 21, the first internal detection module 22, the second internal detection module 23, the second external detection module 24, and the quality determination module 25 shown.
[0089] It should be understood that in the embodiments of the present application, the so-called processor 301 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0090] The input device 302 may include a touchpad, a fingerprint acquisition sensor (for acquiring the fingerprint information and the direction information of the fingerprint of the user), a microphone, etc., and the output device 303 may include a display (such as an LCD), a speaker, etc.
[0091] The memory 304 may include a read-only memory and a random access memory, and provide instructions and data to the processor 301. A part of the memory 304 may also include a non-volatile random access memory. For example, the memory 304 may also store the parameters of the external detection model.
[0092] In specific implementation, the processor 301, the input device 302, and the output device 303 described in the embodiments of the present application may implement the implementation manners described in the embodiments of the resistor sheet quality detection method provided by the embodiments of the present application, and may also implement the implementation manners of the electronic device described in the embodiments of the present application, which will not be elaborated herein.
[0093] In another embodiment of the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, all or part of the processes in the methods of the above embodiments are implemented. It can also be completed by instructing relevant hardware through the computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0094] The computer-readable storage medium can be an internal storage unit of the electronic device in any of the foregoing embodiments, such as the hard disk or memory of the electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the computer-readable storage medium can also include both the internal storage unit and the external storage device of the electronic device. The computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer-readable storage medium can also be used to temporarily store the data that has been output or will be output.
[0095] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0096] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described electronic devices and units can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0097] In several embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between each other can be an indirect coupling or communication connection through some interfaces or units, or can also be an electrical, mechanical or other form of connection.
[0098] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can also be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
[0099] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0100] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present application can easily think of various equivalent modifications or replacements, and these modifications or replacements should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for detecting the quality of a resistor chip, characterized in that, Including: Input a first image into an external detection model to perform external detection on the appearance of the resistor chip to be measured, and obtain a first external detection result, where the first image is an image collected for the appearance of the resistor chip to be measured; Input a second image into an internal detection model to perform internal detection on the internal structure of the resistor chip to be measured, and obtain a first internal detection result, where the second image is an image obtained by non-destructively collecting the internal structure of the resistor chip to be measured; In response to the first external detection result indicating that there is an external defect area in the resistor chip to be measured, update the attention weight map of the attention module in the internal detection model based on the external defect area, and input the second image into the updated internal detection model to obtain a second internal detection result; In response to the first internal detection result indicating that there is an internal defect area in the resistor chip to be measured, update the attention weight map of the attention module in the external detection model based on the internal defect area, and input the first image into the updated external detection model to obtain a second external detection result; Determine the quality of the resistor chip to be measured based on the last external detection result and the last internal detection result, where the last external detection result is the first external detection result or the second external detection result, and the last internal detection result is the first internal detection result or the second internal detection result.
2. The method for detecting the quality of the resistor chip according to claim 1, wherein The updating the attention weight map of the attention module in the internal detection model based on the external defect area includes: In response to the shape of the external defect area being an irregular shape, update the attention weight map of the attention module in the internal detection model based on a first mask map; where the values of the masks in the first mask map are determined based on the position of the external defect area in the resistor chip to be measured; In response to the shape of the external defect area being a regular shape, update the attention weight map of the attention module in the internal detection model based on first coordinate information; where the first coordinate information is the position information of the external defect area in the resistor chip to be measured.
3. The method for detecting the quality of the resistor chip according to claim 2, characterized in that, The determination process of the values of the masks in the first mask map includes: Create a second mask map with the same size as the second image based on the number of pixel points in the second image; each mask in the second mask map corresponds one-to-one with each pixel point in the second image; Set the masks of the target area in the second mask map to a first value, and set the other areas to a second value to obtain the values of the masks in the first mask map; where the first value is greater than the second value, the target area corresponds to the key attention area in the second image, and the key attention area in the second image is the internal area corresponding to the external defect area, and the external defect area is the image area in the first image.
4. The method for detecting the quality of a resistor chip according to claim 3, wherein, The determination process of the key attention area in the second image includes: Determine the target position information and target area corresponding to the external defect area in the first image; Based on the target position information and target area corresponding to the external defect area in the first image, in the second image, determine a first internal area, where the position information of the first internal area in the second image corresponds to the target position information and the included area is the same as the target area; Determine an expansion direction based on the defect type of the external defect area; Expand the first internal area based on the expansion direction to obtain the internal area corresponding to the external defect area.
5. The method for detecting the quality of the resistor chip according to claim 2, characterized in that, The updating of the attention weight map of the attention module of the internal detection model based on the first coordinate information includes: Determine the regional position information corresponding to the external defect area inside the resistance sheet to be measured based on the first coordinate information; Determine an expansion direction based on the defect type of the external defect area; Expand the regional position information based on the expansion direction to obtain target regional position information; Update the attention weight map of the attention module of the internal detection model based on the target regional position information.
6. The method for detecting the quality of resistor chips according to claim 4 or 5, characterized in that, The determining of the expansion direction based on the defect type of the external defect area includes: In response to the defect type of the external defect area being the crack type, determine the crack direction in the external defect area and determine the crack direction as the expansion direction; In response to the defect type of the external defect area being the hole type, determine all directions of the external defect area as the expansion direction.
7. The method for detecting the quality of the resistor chip according to claim 2, characterized in that, The determining of the quality of the resistance sheet to be measured based on the last external detection result and the last internal detection result includes: In response to the first external detection result indicating that there is an external defect area in the resistance sheet to be measured and the first internal detection result indicating that there is no defect area in the resistance sheet to be measured, determine the quality of the resistance sheet to be measured based on the first external detection result and the second internal detection result; In response to the first external detection result indicating that there is no defect area in the resistance sheet to be measured and the first internal detection result indicating that there is an internal defect area in the resistance sheet to be measured, determine the quality of the resistance sheet to be measured based on the second external detection result and the first internal detection result; In response to the first external detection result indicating that there is an external defect area and the first internal detection result indicating that there is an internal defect area, determine the quality of the resistance sheet to be measured based on the second external detection result and the second internal detection result; In response to the first external detection result indicating that there is no defect area in the resistance sheet to be measured and the first internal detection result indicating that there is no defect area in the resistance sheet to be measured, determine the quality of the resistance sheet to be measured based on the first external detection result and the first internal detection result.
8. A resistor chip quality detection device, characterized in that Including: A first external detection module for inputting a first image into an external detection model to perform an external detection on the appearance of the resistance sheet to be measured, and obtaining a first external detection result, where the first image is an image collected for the appearance of the resistance sheet to be measured; The first internal detection module is configured to input the second image into an internal detection model to perform internal detection on the internal structure of the resistor sheet to be measured, and obtain a first internal detection result, where the second image is an image obtained by non-destructively collecting the internal structure of the resistor sheet to be measured; The second internal detection module is configured to, in response to the first external detection result indicating that there is an external defect area in the resistor sheet to be measured, update the attention weight map of the attention module in the internal detection model based on the external defect area, and input the second image into the updated internal detection model to obtain a second internal detection result; The second external detection module is configured to, in response to the first internal detection result indicating that there is an internal defect area in the resistor sheet to be measured, update the attention weight map of the attention module in the external detection model based on the internal defect area, and input the first image into the updated external detection model to obtain a second external detection result; The quality determination module is configured to determine the quality of the resistor sheet to be measured based on the last external detection result and the last internal detection result, where the last external detection result is the first external detection result or the second external detection result, and the last internal detection result is the first internal detection result or the second internal detection result.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Whole resistor detection device and detection method
CN110132978A
Target boundary recording method and device based on target detection and computing equipment
CN113343999A
Battery cell shell detection method and device, electronic equipment and storage medium
CN118549524A
Die nondestructive testing method and system based on data analysis
CN119086608A
Crystallizer copper pipe quality detection and maintenance method, device, equipment and medium
CN119845957A