A method and system for identifying electrical components

CN122780930APending Publication Date: 2026-09-18STATE GRID ZHEJIANG ELECTRIC POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611241723.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-09-18

AI Technical Summary

Technical Problem

[0003]本发明提供一种电力散件物资识别方法及系统,以解决现有小型电力散件物资识别方法的识别准确度低的技术问题

Benefits of technology

[0003] This invention provides a method and system for identifying electrical components, in order to solve the technical problem of low identification accuracy in existing methods for identifying small electrical components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122780930A_ABST
    Figure CN122780930A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for identifying loose power components, applied in the field of material identification technology. The method includes: determining a target instance mask of the target image based on the selected pixel coordinates of the target image of the loose power components to be identified; segmenting the target image based on the target instance mask to obtain material sub-images; determining the target category as the category identification result of the loose power components to be identified when the material sub-image matches the category feature data of the target category; extracting the mask of the target image based on the target category to obtain multiple category instance masks; determining the quantity of materials in the target image based on the matching result of each category instance mask and the category mask data of the target category; and using the target category and the quantity of materials as the identification result of the loose power components to be identified. This invention improves the accuracy of identifying loose power storage components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of material identification technology, and in particular to a method and system for identifying electrical components. Background Technology

[0002] In the warehousing and management of power equipment, large items (e.g., transformers and cable reels) typically have nameplates for easy identification and management, while small, loose items lack nameplates and vary greatly in appearance. Existing methods for identifying small, loose items usually employ a general segmentation model (e.g., the SAM model). The specific method is as follows: the image of the loose item and its descriptive language are input into the general segmentation model. The model generates a pixel mask through visual-linguistic joint matching. Then, by recognizing the contour of the pixel mask and comparing it with the actual contour of the loose item, the identification result of the small, loose item is obtained. However, power equipment often contains many metal components, which are easily affected by ambient light, generating background noise that affects the recognition of the mask contour. Furthermore, small, loose items are usually stacked during warehousing, further impacting the recognition by the general segmentation model. Therefore, existing methods using general segmentation models to identify power equipment suffer from low accuracy. Summary of the Invention

[0003] This invention provides a method and system for identifying electrical components, in order to solve the technical problem of low identification accuracy in existing methods for identifying small electrical components.

[0004] To address the aforementioned technical problems, embodiments of the present invention provide a method for identifying electrical component materials, including: Based on sample images of electrical components of a selected category, attribute data for the selected category is obtained; the attribute data for the selected category includes category feature data and category mask data. A materials database shall be constructed based at least on the attribute data of the selected categories; During the material identification process, a target image of the electrical component material to be identified is acquired, and a target instance mask in the target image is determined based on the selected pixel coordinates of the target image. The target image is segmented based on the target instance mask to obtain material sub-images; When the material sub-image is matched with the category feature data of the target category in the material database, the category identification result of the power component material to be identified is determined to be the target category; Based on the target category, the target image is masked to obtain multiple category instance masks. Based on the matching result of each category instance mask and the category mask data of the target category, the quantity of materials in the target image is determined. Based on the target category and the quantity of materials, the identification result of the electrical component materials to be identified is obtained.

[0005] As one preferred embodiment, obtaining the attribute data of the selected category based on the sample images of the selected category of electrical component materials includes: Obtain sample images of selected categories of electrical components, including various placement postures; Semantic features are extracted from the sample images to obtain multiple semantic feature vectors; Based on the similarity between any two semantic feature vectors, a feature matching threshold value for the selected category is determined; the feature matching threshold value and multiple semantic feature vectors are used as category feature data for the selected category. Based on the pixel area of ​​multiple semantic masks in the sample image, a range of mask pixel areas including the mask pixel reference area is obtained; the mask pixel reference area and the range of mask pixel areas are used as the category mask data of the selected category.

[0006] As one preferred embodiment, constructing the materials database based at least on the attribute data of the selected category includes: Retrieve attribute data for historical categories; When the selected category belongs to the historical category, the attribute data of the historical category is updated based on the attribute data of the selected category; A materials database should be constructed based at least on the updated historical category attribute data; When the selected category does not belong to the historical category, a material database is constructed based at least on the attribute data of the selected category and the attribute data of the historical category.

[0007] As one preferred embodiment, determining the target instance mask in the target image based on the selected pixel coordinates of the target image includes: Based on the selected pixel coordinates of the target image, the pixel centers of multiple material instance masks of the target image are obtained; Based on the distance between the pixel center of each material instance mask and the coordinates of the selected pixel, a target instance mask is filtered from multiple material instance masks.

[0008] As one preferred embodiment, determining the category identification result of the power component to be identified as the target category when matching the sub-image of the material with the category feature data of the target category in the material database includes: The semantic feature vector of the material sub-image is compared with the semantic feature vector of each target category in the material database to obtain the maximum similarity between the material sub-image and the target category. When the maximum similarity is greater than or equal to the feature matching threshold of the target category, the target category is determined as the category identification result of the power component material to be identified.

[0009] As one preferred embodiment, determining the quantity of materials in the target image based on the matching result of each category instance mask and the category mask data of the target category includes: Based on the pixel area of ​​each category instance mask, a first instance mask is determined among all the category instance masks, and the pixel area of ​​each first instance mask is within the range of the mask pixel area of ​​the target category. Based on the maximum similarity between each first instance mask and the target category, filter the second instance mask from all first instance masks; Determine the main instance mask with the largest pixel area among all the second instance masks; The quantity of materials in the target image is determined based on the coverage ratio between the main instance mask and each of the second instance masks.

[0010] Another embodiment of the present invention provides a power component identification system, comprising: The attribute data acquisition module is used to obtain attribute data of the selected category based on sample images of electrical component materials of the selected category; the attribute data of the selected category includes category feature data and category mask data; The materials database construction module is used to construct a materials database based at least on the attribute data of the selected categories; The target instance mask determination module is used to acquire the target image of the power component to be identified during the material identification process, and determine the target instance mask in the target image based on the selected pixel coordinates of the target image. The target image segmentation module is used to segment the target image based on the target instance mask to obtain material sub-images; The category recognition module is used to determine the category recognition result of the power component material to be identified as the target category when the material sub-image is matched with the category feature data of the target category in the material database; The quantity recognition module is used to extract the mask of the target image based on the target category to obtain multiple category instance masks, and to determine the quantity of materials in the target image based on the matching result of each category instance mask and the category mask data of the target category. The material identification result determination module is used to obtain the identification result of the power component material to be identified based on the target category and the quantity of the material.

[0011] As one preferred embodiment, the attribute data acquisition module includes: The sample image acquisition unit is used to acquire sample images of selected categories of electrical component materials containing multiple placement postures; A semantic feature extraction unit is used to extract semantic features from the sample image to obtain multiple semantic feature vectors; The category feature data determination unit is used to determine the feature matching threshold value of the selected category based on the similarity of any two semantic feature vectors; and to use the feature matching threshold value and multiple semantic feature vectors as the category feature data of the selected category. The category mask data determination unit is used to obtain a range of mask pixel areas including the reference area of ​​mask pixels based on the pixel areas of multiple semantic masks in the sample image; and to use the reference area of ​​mask pixels and the range of mask pixel areas as the category mask data of the selected category.

[0012] As one preferred embodiment, the material database construction module includes: The historical category attribute data acquisition unit is used to acquire historical category attribute data; The historical category attribute data update unit is used to update the attribute data of the historical category based on the attribute data of the selected category when the selected category belongs to the historical category; The material database construction unit is used to construct a material database based at least on the updated historical category attribute data; when the selected category does not belong to the historical category, the material database is constructed based at least on the attribute data of the selected category and the attribute data of the historical category.

[0013] As one preferred embodiment, the category identification module includes: The maximum similarity determination unit is used to compare the semantic feature vector of the material sub-image with the semantic feature vector of each semantic feature vector of the target category in the material database to obtain the maximum similarity between the material sub-image and the target category. The category identification unit is used to determine the target category as the category identification result of the power component material to be identified when the maximum similarity is greater than or equal to the feature matching threshold of the target category. Attached Figure Description

[0014] Figure 1 This is one of the flowcharts illustrating the method for identifying electrical components provided by this invention; Figure 2 This is the second flowchart illustrating the method for identifying electrical components provided by this invention; Figure 3This is a schematic diagram of the structure of the power component identification system provided by the present invention.

[0015] Figure label: Among them, 301 is the attribute data acquisition module; 302 is the material database construction module; 303 is the target instance mask determination module; 304 is the target image segmentation module; 305 is the category recognition module; 306 is the quantity recognition module; and 307 is the material recognition result determination module. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0017] In the description of this application, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0018] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components. The terms "vertical," "horizontal," "left," "right," "upper," "lower," and similar expressions used herein are for illustrative purposes only and do not indicate or imply that the device or component referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0019] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing specific embodiments only and is not intended to limit the invention. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0020] See Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the electrical component identification method provided by the present invention, as shown below. Figure 1 As shown, this embodiment includes steps 100 to 700, and the specific steps are as follows: Step 100: Based on the sample images of the selected category of electrical components, obtain the attribute data of the selected category; the attribute data of the selected category includes category feature data and category mask data; In this embodiment, the selected category refers to the type of electrical component to be stored, such as a certain type of copper lug and a certain type of alloy fitting. The sample images in this embodiment refer to a small number of images (e.g., 5 to 10) of the selected category of electrical components acquired under standard lighting and a single background tray environment. These images cover the common placement postures of the selected category of electrical components.

[0021] In this embodiment, the attribute data is a dataset describing the category features and physical scale features of the selected category of electrical component materials. Category feature data refers to feature data extracted from sample images to distinguish different categories. Category feature data may include, but is not limited to, semantic feature vectors extracted from sample images. Category feature data is used for subsequent category determination of the electrical component materials to be identified. In this embodiment, the category mask data refers to the scale data of the material mask extracted from the sample image. This category mask data may include statistical data on the area of ​​mask pixels. Category mask data is used for subsequent quantity identification of the electrical component materials to be identified.

[0022] Specifically, a pre-trained instance segmentation model can be invoked to segment each sample image, obtaining pixel-level masks for each selected category of loose power components. Based on these masks, on the one hand, category feature data characterizing the category is extracted; on the other hand, the pixel area of ​​all masks is statistically analyzed to obtain the mask area distribution information of the selected category of loose power components, thus obtaining category mask data. Through this embodiment, only a small number of image samples are needed to extract attribute data for a category of loose power components, eliminating the need for large-scale manual annotation of image samples.

[0023] Step 200: Construct a materials database based at least on the attribute data of the selected categories; The materials database in this embodiment is a structured data set that supports rapid retrieval and updating, used to store attribute data of various categories of loose power components. The construction method of the materials database includes: when there are no historical categories in the materials database, the database is constructed directly using the attribute data of the currently selected category as the initial data. When historical categories already exist in the database, if the selected category is the same as a historical category, the attribute data of the corresponding historical category is updated with the attribute data of the selected category; if the selected category is a new category, the attribute data of the selected category is incrementally added to the materials database, while retaining the attribute data of all historical categories. The materials database can be implemented using a combination of a file system and an index structure. For example, category feature data can be stored in a storage structure that facilitates retrieval, and category mask data can be stored in the form of a structured file. Through this construction method, the materials database can be continuously expanded at low cost and high efficiency to meet the needs of multi-variety and small-batch power materials warehousing.

[0024] Step 300: During the material identification process, acquire the target image of the power component material to be identified, and determine the target instance mask in the target image based on the selected pixel coordinates of the target image. The target image of the electrical components to be identified can be obtained by a worker using a mobile terminal. The target image may contain one or more electrical components to be identified. In this embodiment, the pixel coordinates refer to the coordinates of the click point in the pixel coordinate system of the target image when the worker clicks on a specific electrical component to be identified on the target image displayed on the screen. The click operation typically involves clicking the central area of ​​a specific electrical component to be identified, indicating the target to be identified.

[0025] In this embodiment, the target instance mask refers to the pixel-level region of a single material entity segmented from the target image, corresponding to the selected pixel coordinates. Specifically, the selected pixel coordinates are used as prompt information and input into an instance segmentation model. This model, combined with the image content, outputs the target instance mask corresponding to the selected pixel coordinates. The model typically generates multiple candidate masks, from which the one that best matches the selected coordinates (e.g., the one with the closest geometric center distance) can be selected. In this way, the instance mask can be quickly and accurately decoupled from the complex background of the target image using manual point selection priors, without relying on large-scale detection models.

[0026] Step 400: Segment the target image based on the target instance mask to obtain material sub-images; In this embodiment, the material sub-image refers to a sub-image that contains only the individual material corresponding to the target instance mask, with the background cleared or set to zero. The specific segmentation method for the material sub-image is as follows: A pixel-by-pixel operation is performed between the target instance mask and the target image. The original RGB values ​​of the target location within the mask are retained, while the pixel values ​​outside the mask are set to a uniform background value (e.g., 0, i.e., black), resulting in a cleaned image. Then, the minimum bounding rectangle of the target instance mask is calculated, and the cleaned image is cropped according to this minimum bounding rectangle to obtain a rectangular sub-image. In this rectangular sub-image, the area containing the material retains its original texture and color, while the area outside the rectangle is the background color. Afterward, the rectangular sub-image can be uniformly scaled to a preset size (e.g., 224×224 pixels) to meet the requirements. Through image segmentation in this embodiment, the requirement for fixed-size input for feature extraction is met, the apparent features of the target are preserved to the greatest extent, and background noise is effectively suppressed.

[0027] Step 500: When the material sub-image matches the category feature data of the target category in the material database, determine the category identification result of the power component material to be identified as the target category; In this embodiment, the target category refers to a category of electrical component materials stored in the materials database. The matching process in this embodiment is as follows: First, feature information that can characterize the category to which the material belongs is extracted from the material sub-image (this feature extraction method can be consistent with the method of extracting category feature data during database construction). Then, the extracted features are compared with the category feature data of each category in the materials database, and the similarity or distance is calculated. The comparison method can be one-to-one, one-to-many, or many-to-many, depending on the organization of the category feature data. If the feature data of a certain category meets the preset matching conditions (for example, the similarity exceeds a threshold or the distance is less than a threshold), the match is considered successful, and the target category is determined as the category identification result of the material to be identified. If multiple categories are matched successfully, the one with the highest matching degree is selected as the final result. In this way, the category confirmation of newly collected materials can be achieved using the category feature data stored during database construction.

[0028] Step 600: Extract the mask of the target image based on the target category to obtain multiple category instance masks. Based on the matching result of each category instance mask and the category mask data of the target category, determine the quantity of materials in the target image. The above embodiments have determined the target category of the electrical component materials to be identified. Instance segmentation is performed on the target image of the electrical component materials to be identified, without selecting pixel coordinates, resulting in multiple initial category instance masks. Each category instance mask is the pixel region of a candidate entity in the image. Then, for each category instance mask, its features (such as mask pixel area, mask shape, or semantic features) are extracted and matched with the category mask data of the target category. The category mask data contains prior information about the physical scale of the material in that target category. Matching conditions may include: whether the mask pixel area falls within a reasonable area range indicated by the category mask data, and whether the shape features of the mask conform to the outline shape of the category, etc. Only when a category instance mask successfully matches the category mask data is it considered a valid entity mask. If there are segmentation fragments due to adhesion or reflection (i.e., a physical entity is divided into multiple overlapping small masks), further deduplication or merging algorithms are needed to reconstruct the masks to ensure that each physical entity is counted only once. Finally, the number of valid entity masks (after deduplication) is the number of electrical component materials to be identified in the target image.

[0029] Step 700: Based on the target category and the quantity of materials, obtain the identification result of the electrical component materials to be identified.

[0030] In this embodiment, the identification result of the electrical components to be identified refers to structured data containing the category and quantity of the components. Specifically, the target category and the quantity of the components are combined to generate a complete inventory record. This inventory record can be displayed in text form on a mobile terminal screen or uploaded to a warehouse management system to automatically update the inventory accounts. In addition, the identification result can also be accompanied by a credibility score for reference.

[0031] This invention requires only a small number of sample images to extract attribute data of loose power components and construct a materials database. By combining point-selection guidance, image segmentation, and mask extraction, it achieves rapid and accurate category identification of loose components. Furthermore, based on the mask data constraints and feature constraints of the target category, it performs instance-level counting on the image to be identified, effectively overcoming the problems existing in the current methods for identifying loose power components and improving the accuracy of identifying loose power storage components.

[0032] In another embodiment of the electrical component identification method provided by the present invention, step 100 specifically includes: Step 110: Obtain sample images of selected categories of electrical component materials containing various placement postures; Step 120: Extract semantic features from the sample image to obtain multiple semantic feature vectors; Step 130: Based on the similarity between any two semantic feature vectors, determine the feature matching threshold value for the selected category; use the feature matching threshold value and multiple semantic feature vectors as the category feature data for the selected category; Step 140: Based on the pixel area of ​​multiple semantic masks in the sample image, obtain a mask pixel area range including the mask pixel reference area; use the mask pixel reference area and the mask pixel area range as the category mask data of the selected category.

[0033] Acquire sample images of selected categories of loose electrical components, including various placement postures. For example, acquire 5 to 10 images, with slight differences in the placement angle and degree of vertical rotation of the components in each sample image to cover various placement postures that may occur during actual stacking. For each sample image, generate a precise mask for the individual component, crop the target small image based on the mask edges, and uniformly scale the target small image to 224×224 pixels. Then, extract the semantic feature vector of the target small image. Repeat the above feature extraction operation for each sample image to obtain multiple semantic feature vectors. In this embodiment, the feature matching threshold is a scalar threshold used for subsequent category identification of the target image. The feature matching threshold is calculated as follows: calculate the cosine similarity between the feature vectors of each pair of samples to obtain the similarity distribution; then use statistical methods, such as taking the minimum similarity value minus a safety tolerance, or taking the mean minus twice the standard deviation, and constrain the result to a reasonable range (e.g., 0.6~0.95), as the feature matching threshold for this type of component. The calculated feature matching threshold value and all multiple semantic feature vectors are used together as the category feature data for this category.

[0034] For category mask data, the pixel areas of multiple semantic masks in the sample images are statistically analyzed, and the arithmetic mean of all sample mask areas is calculated as the baseline area of ​​the mask pixels. Using this baseline area as the median, a range of mask pixel areas is generated according to a preset ratio (e.g., a lower limit of 0.7 times and an upper limit of 1.3 times). This range reflects the normal fluctuation range of the projection of this type of material in the image, and is used to filter background noise (too small an area) and aggregates (too large an area) during subsequent counting. The baseline area and the range of mask pixel areas are used as the category mask data for the selected category.

[0035] This embodiment collects sample images of various placement postures and performs semantic feature extraction and pairwise similarity analysis to calculate the feature matching threshold value of this type of material, avoiding false rejection due to posture changes. At the same time, the area range is obtained based on the mask area statistics, providing a screening basis that conforms to physical scale for subsequent counting, thereby improving the robustness of identification and counting.

[0036] In another embodiment of the power component identification method provided by the present invention, step 200 specifically includes: Step 210: Obtain the attribute data of historical categories; Step 220: When the selected category belongs to the historical category, update the attribute data of the historical category based on the attribute data of the selected category; Step 230: Construct a materials database based at least on the updated historical category attribute data; Step 240: When the selected category does not belong to the historical category, construct a material database based at least on the attribute data of the selected category and the attribute data of the historical category.

[0037] In this embodiment, the material database may be empty initially, or it may already contain attribute data for multiple historical categories. When it is necessary to add the attribute data of the currently selected category to the material database, the attribute data of all historical categories in the material database is first obtained, and it is checked whether the category identifier of the currently selected category is the same as that of a certain historical category. Updating the attribute data of historical categories means that when the same category obtains new attribute data due to the addition of new samples, the latest attribute data is used to replace it, or it is merged into the original attribute data of the historical category. The merging strategy may be: appending the newly extracted semantic feature vector to the feature vector set of the category, and recalculating the feature matching threshold and mask area parameter based on this.

[0038] If the currently selected category is different from all historical categories, it is treated as a completely new category, and its attribute data is directly added to the material database, coexisting with the attribute data of the original historical categories. Finally, based on the updated historical category attribute data, or based on all historical categories plus the attribute data of the newly added selected category, the material database is constructed or reconstructed. In this embodiment, constructing the material database includes establishing a vector index and storing structured metadata. Through this embodiment, the database can be flexibly expanded incrementally without requiring a full reconstruction each time, reducing the maintenance cost of new material entry.

[0039] This embodiment distinguishes whether the selected category belongs to a historical category and adopts update or incremental addition strategies respectively, realizing low-cost dynamic maintenance of the material database. It avoids redundant data of the same category, and can quickly support the access of new materials, adapting to the characteristics of multi-variety, small-batch and frequent updates in the power material warehousing scenario.

[0040] In another embodiment of the power component identification method provided by the present invention, step 300 specifically includes: Step 310: Based on the selected pixel coordinates of the target image, obtain the pixel center of multiple material instance masks of the target image; Step 320: Based on the distance between the pixel center of each material instance mask and the coordinates of the selected pixel, filter the target instance mask from the multiple material instance masks.

[0041] In this embodiment, the selected pixel coordinates can be confirmed by the user when clicking on the component to be identified on the mobile terminal screen. First, instance segmentation with no hints or grid hints is performed on the target image to generate multiple material instance masks, each corresponding to a potential object region in the image. For each material instance mask, its pixel center is calculated, i.e., the geometric center coordinates of the pixels covered by the mask. The pixel center can be the average of all pixel coordinates of the mask, or the center point of the bounding rectangle of the mask. Then, the Euclidean distance between the pixel center of each material instance mask and the pixel coordinates selected by the user is calculated. The mask with the smallest distance is selected as the target instance mask. To avoid the user accidentally clicking on the background or the boundary between two objects, a distance threshold can be set. For example, only when the minimum distance is less than a preset value (such as 50 pixels) is the selection accepted; otherwise, the user is prompted to click again. In addition, for multiple candidate masks, the candidate mask with the highest confidence among the closest candidates can be selected as the final result. In this way, by utilizing the user's prior selection, the target individual that the user intends to identify is accurately located from multiple candidate instances, avoiding the risk of selecting the wrong object in fully automatic segmentation.

[0042] This embodiment calculates the distance between the pixel center of each material instance mask and the selected coordinates, which enables the quick and accurate location of the user-specified target instance from multiple objects in the target image, improving the accuracy of interactive recognition and reducing interference from subsequent feature matching.

[0043] In another embodiment of the power component identification method provided by the present invention, step 500 specifically includes: Step 510: Compare the semantic feature vector of the material sub-image with the semantic feature vector of each target category in the material database to obtain the maximum similarity between the material sub-image and the target category; Step 520: When the maximum similarity is greater than or equal to the feature matching threshold of the target category, the target category is determined as the category identification result of the power component material to be identified.

[0044] In this embodiment, feature extraction is performed on each material sub-image to obtain at least one semantic feature vector for querying. The category feature data of the target category stored in the material database includes: multiple standard semantic feature vectors of the target category and the feature matching threshold value of the target category. In this embodiment, the maximum similarity refers to the maximum value of the cosine similarity between the query vector and all standard feature vectors of the target category. The maximum cosine similarity value is compared with the feature matching threshold value of the target category. If the maximum similarity value is greater than or equal to the feature matching threshold value of the target category, the match is considered successful, and the category identification result of the power component material to be identified is determined to be the target category.

[0045] If the materials database contains multiple categories, calculate the maximum cosine similarity for each category. Then, select the category with the maximum cosine similarity value that meets the threshold condition as the final category identification result. If the maximum cosine similarity value of all categories is less than their respective feature matching threshold values, the identification is considered a failure.

[0046] This embodiment compares the query feature vector of the electrical component to be identified with all standard feature vectors of the target category one by one and takes the maximum similarity. Then it compares it with the feature matching threshold value of the target category. This fully considers the feature changes of the same component in different postures, avoids missed identification due to poor matching of a single template, and at the same time uses threshold conditions to exclude dissimilar categories, ensuring the reliability of identification.

[0047] See Figure 2 , Figure 2 This is a flowchart illustrating another embodiment of the electrical component identification method provided by the present invention, as shown below. Figure 2 As shown, this embodiment includes steps 610 to 640, and the specific steps are as follows: Step 610: Based on the pixel area of ​​each category instance mask, determine the first instance mask among all the category instance masks, wherein the pixel area of ​​each first instance mask is within the range of the mask pixel area of ​​the target category. Step 620: Based on the maximum similarity between each first instance mask and the target category, filter the second instance mask from all first instance masks; Step 630: Determine the main instance mask with the largest pixel area among all the second instance masks; Step 640: Determine the quantity of materials in the target image based on the coverage ratio of the main instance mask and each of the second instance masks.

[0048] After determining the target category, full-image instance segmentation is performed on the target image to obtain multiple category instance masks. For each category instance mask, firstly, the pixel area value of each category instance mask is calculated, and then the image patch of the bounding rectangle region of each category instance mask is extracted to obtain the semantic feature vector of the mask. Next, the maximum similarity value between this semantic feature vector and multiple standard feature vectors of the target category is calculated. The category mask data includes the range of mask pixel areas, which has a minimum area threshold and a maximum area threshold.

[0049] In this embodiment, the first instance mask refers to an instance mask whose pixel area value falls between the minimum and maximum area thresholds. These first instance masks physically conform to the normal projection size of the target category material, filtering out excessively small background noise and excessively large adhering objects. Then, masks that meet the semantic similarity condition (i.e., the maximum similarity value is greater than or equal to the feature matching threshold of the target category) are further selected from multiple first instance masks. These masks are called second instance masks. The second instance masks satisfy both area and semantic constraints and are considered highly likely candidates for real entities.

[0050] Then, among all the second instance masks, the mask with the largest pixel area is determined as the main instance mask in this embodiment. The coverage ratio in this embodiment refers to the ratio by which the main instance mask covers another second instance mask (called the mask to be determined), specifically calculated as follows: the pixel area of ​​the intersection region of the main instance mask and the mask to be determined, divided by the pixel area of ​​the mask to be determined itself. This ratio reflects the probability that the mask to be determined is a fragment of the main instance mask. A preset merging threshold is set. If the coverage ratio is greater than or equal to the merging threshold, the mask to be determined is identified as a redundant fragment and removed from the count; if the coverage ratio is less than the merging threshold, the mask to be determined is identified as another independent entity. Then, from the remaining unprocessed second instance masks, the mask with the largest pixel area is selected again as the new main instance mask, and the above merging process is repeated until all masks have been processed. Finally, the number of masks that have not been removed is the number of materials in the target image.

[0051] This embodiment applies a multi-level filtering and reconstruction strategy, which sequentially employs area range filtering, semantic similarity filtering, area descending anchor point selection, and coverage merging. This strategy can eliminate the interference of background noise, adhering bodies, and semantic overcutting fragments on the counting results, making the final output of material quantity more realistic and reliable.

[0052] The following describes the power component identification system provided by the present invention. The power component identification system described below can be referred to in correspondence with the power component identification method described above.

[0053] Please refer to Figure 3 The present invention also provides a power component identification system, comprising: The attribute data acquisition module 301 is used to obtain the attribute data of the selected category based on the sample image of the selected category of electrical component materials; the attribute data of the selected category includes category feature data and category mask data; The materials database construction module 302 is used to construct a materials database based at least on the attribute data of the selected categories; The target instance mask determination module 303 is used to acquire a target image of the power component material to be identified during the material identification process, and determine the target instance mask in the target image based on the selected pixel coordinates of the target image. The target image segmentation module 304 is used to segment the target image based on the target instance mask to obtain material sub-images; The category identification module 305 is used to determine the category identification result of the power component material to be identified as the target category when the material sub-image is matched with the category feature data of the target category in the material database; The quantity recognition module 306 is used to extract the mask of the target image based on the target category to obtain multiple category instance masks, and to determine the quantity of materials in the target image based on the matching result of each category instance mask and the category mask data of the target category. The material identification result determination module 307 is used to obtain the identification result of the power component material to be identified based on the target category and the quantity of the material.

[0054] Optionally, the attribute data acquisition module includes: The sample image acquisition unit is used to acquire sample images of selected categories of electrical component materials containing multiple placement postures; A semantic feature extraction unit is used to extract semantic features from the sample image to obtain multiple semantic feature vectors; The category feature data determination unit is used to determine the feature matching threshold value of the selected category based on the similarity of any two semantic feature vectors; and to use the feature matching threshold value and multiple semantic feature vectors as the category feature data of the selected category. The category mask data determination unit is used to obtain a range of mask pixel areas including the reference area of ​​mask pixels based on the pixel areas of multiple semantic masks in the sample image; and to use the reference area of ​​mask pixels and the range of mask pixel areas as the category mask data of the selected category.

[0055] Optionally, the material database construction module includes: The historical category attribute data acquisition unit is used to acquire historical category attribute data; The historical category attribute data update unit is used to update the attribute data of the historical category based on the attribute data of the selected category when the selected category belongs to the historical category; The material database construction unit is used to construct a material database based at least on the updated historical category attribute data; when the selected category does not belong to the historical category, the material database is constructed based at least on the attribute data of the selected category and the attribute data of the historical category.

[0056] Optionally, the category identification module includes: The maximum similarity determination unit is used to compare the semantic feature vector of the material sub-image with the semantic feature vector of each semantic feature vector of the target category in the material database to obtain the maximum similarity between the material sub-image and the target category. The category identification unit is used to determine the target category as the category identification result of the power component material to be identified when the maximum similarity is greater than or equal to the feature matching threshold of the target category.

[0057] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method of identifying an electric power component, characterized by, include: Based on sample images of electrical component materials of a selected category, the attribute data of the selected category is obtained; The attribute data of the selected category includes category feature data and category mask data; A materials database shall be constructed based at least on the attribute data of the selected categories; During the material identification process, a target image of the electrical component material to be identified is acquired, and a target instance mask in the target image is determined based on the selected pixel coordinates of the target image. The target image is segmented based on the target instance mask to obtain material sub-images; When the material sub-image is matched with the category feature data of the target category in the material database, the category identification result of the power component material to be identified is determined to be the target category; Based on the target category, the target image is masked to obtain multiple category instance masks. Based on the matching result of each category instance mask and the category mask data of the target category, the quantity of materials in the target image is determined. Based on the target category and the quantity of materials, the identification result of the electrical component materials to be identified is obtained.

2. The method for identifying electrical components as described in claim 1, characterized in that, The attribute data for the selected category of electrical component materials obtained from the sample images of the selected category includes: Obtain sample images of selected categories of electrical components, including various placement postures; Semantic features are extracted from the sample images to obtain multiple semantic feature vectors; Based on the similarity between any two semantic feature vectors, a feature matching threshold value for the selected category is determined; the feature matching threshold value and multiple semantic feature vectors are used as category feature data for the selected category. Based on the pixel area of ​​multiple semantic masks in the sample image, a range of mask pixel areas including the mask pixel reference area is obtained; the mask pixel reference area and the range of mask pixel areas are used as the category mask data of the selected category.

3. The method for identifying electrical components as described in claim 1, characterized in that, The construction of the materials database based at least on the attribute data of the selected categories includes: Retrieve attribute data for historical categories; When the selected category belongs to the historical category, the attribute data of the historical category is updated based on the attribute data of the selected category; A materials database should be constructed based at least on the updated historical category attribute data; When the selected category does not belong to the historical category, a material database is constructed based at least on the attribute data of the selected category and the attribute data of the historical category.

4. The method for identifying electrical components as described in claim 1, characterized in that, Determining the target instance mask in the target image based on the selected pixel coordinates of the target image includes: Based on the selected pixel coordinates of the target image, the pixel centers of multiple material instance masks of the target image are obtained; Based on the distance between the pixel center of each material instance mask and the coordinates of the selected pixel, a target instance mask is filtered from multiple material instance masks.

5. The method for identifying electrical components as described in claim 2, characterized in that, When matching the sub-image of the material with the category feature data of the target category in the material database, determining the category identification result of the power component material to be identified as the target category includes: The semantic feature vector of the material sub-image is compared with the semantic feature vector of each target category in the material database to obtain the maximum similarity between the material sub-image and the target category. When the maximum similarity is greater than or equal to the feature matching threshold of the target category, the target category is determined as the category identification result of the power component material to be identified.

6. The method for identifying electrical components as described in claim 5, characterized in that, Determining the quantity of materials in the target image based on the matching result of each category instance mask and the category mask data of the target category includes: Based on the pixel area of ​​each category instance mask, a first instance mask is determined among all the category instance masks, and the pixel area of ​​each first instance mask is within the range of the mask pixel area of ​​the target category. Based on the maximum similarity between each first instance mask and the target category, filter the second instance mask from all first instance masks; Determine the main instance mask with the largest pixel area among all the second instance masks; The quantity of materials in the target image is determined based on the coverage ratio between the main instance mask and each of the second instance masks.

7. A power component identification system, characterized in that, include: The attribute data acquisition module is used to obtain attribute data of the selected category of electrical component materials based on sample images of the selected category. The attribute data of the selected category includes category feature data and category mask data; The materials database construction module is used to construct a materials database based at least on the attribute data of the selected categories; The target instance mask determination module is used to acquire the target image of the power component to be identified during the material identification process, and determine the target instance mask in the target image based on the selected pixel coordinates of the target image. The target image segmentation module is used to segment the target image based on the target instance mask to obtain material sub-images; The category recognition module is used to determine the category recognition result of the power component material to be identified as the target category when the material sub-image is matched with the category feature data of the target category in the material database; The quantity recognition module is used to extract the mask of the target image based on the target category to obtain multiple category instance masks, and to determine the quantity of materials in the target image based on the matching result of each category instance mask and the category mask data of the target category. The material identification result determination module is used to obtain the identification result of the power component material to be identified based on the target category and the quantity of the material.

8. The electrical component identification system as described in claim 7, characterized in that, The attribute data acquisition module includes: The sample image acquisition unit is used to acquire sample images of selected categories of electrical component materials containing multiple placement postures; A semantic feature extraction unit is used to extract semantic features from the sample image to obtain multiple semantic feature vectors; The category feature data determination unit is used to determine the feature matching threshold value of the selected category based on the similarity of any two semantic feature vectors; and to use the feature matching threshold value and multiple semantic feature vectors as the category feature data of the selected category. The category mask data determination unit is used to obtain a range of mask pixel areas including the reference area of ​​mask pixels based on the pixel areas of multiple semantic masks in the sample image; and to use the reference area of ​​mask pixels and the range of mask pixel areas as the category mask data of the selected category.

9. The electrical component identification system as described in claim 7, characterized in that, The material database construction module includes: The historical category attribute data acquisition unit is used to acquire historical category attribute data; The historical category attribute data update unit is used to update the attribute data of the historical category based on the attribute data of the selected category when the selected category belongs to the historical category; The material database construction unit is used to construct a material database based at least on the updated historical category attribute data; when the selected category does not belong to the historical category, the material database is constructed based at least on the attribute data of the selected category and the attribute data of the historical category.

10. The electrical component identification system as described in claim 8, characterized in that, The category identification module includes: The maximum similarity determination unit is used to compare the semantic feature vector of the material sub-image with the semantic feature vector of each semantic feature vector of the target category in the material database to obtain the maximum similarity between the material sub-image and the target category. The category identification unit is used to determine the target category as the category identification result of the power component material to be identified when the maximum similarity is greater than or equal to the feature matching threshold of the target category.