Electric component identification method and device, storage medium and electronic equipment
By calculating the curvature value of the arc using the ROI layer and ROI Align unit in the deep learning model, dynamically adjusting the distribution of sampling points, and combining Anchor scaling and electrical knowledge base verification, the problem of low accuracy in identifying electrical components in electrical drawings is solved, achieving high-precision identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN SHUHE INFORMATION TECH CO LTD
- Filing Date
- 2025-05-28
- Publication Date
- 2026-05-05
AI Technical Summary
Existing electrical drawing methods for identifying electrical components are difficult to use accurately due to the variety of circuit symbols and their unique size distributions, resulting in low identification accuracy.
A deep learning model is used, combining the Region of Interest (ROI) layer and the curvature-sensitive ROI Align unit. The distribution of sampling points is dynamically adjusted by calculating the curvature value of the arc to enhance the coverage of high curvature areas. Low confidence results are verified by adjusting the Anchor scaling parameters and the electrical knowledge base to improve recognition accuracy.
The accuracy of electrical component identification has been improved from 90% to 98.6%, the workload of manual verification has been reduced by 85%, and the false detection rate has been reduced from 5.2% to 1.2%.
Smart Images

Figure CN120689898B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image recognition, specifically to a method for identifying electrical components, an electrical component identification device, a storage medium, and an electronic device. Background Technology
[0002] The electrical industry has a large number of drawings, which makes data processing difficult, especially the consistency and accuracy of graphic elements and table information in electrical drawings. Therefore, it is necessary to digitize and informatize electrical drawings.
[0003] Electrical drawings contain numerous circuit symbols for different components, and their size distribution is also quite unique, making it difficult to accurately identify electrical components using conventional identification methods.
[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this disclosure is to provide an electrical component identification method, an electrical component identification device, a storage medium, and an electronic device, with the aim of improving the accuracy of electrical component identification.
[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0007] According to one aspect of this disclosure, an electrical component identification method is provided, characterized by comprising:
[0008] Acquire the image to be detected;
[0009] The image to be detected is input into a deep learning model to obtain the electrical component identification result output by the deep learning model;
[0010] The deep learning model includes a Region of Interest (ROI) layer, which includes a curvature calculation unit and a curvature-sensitive ROI Align unit. The curvature calculation unit is used to calculate the curvature value of the arc within each candidate box, and the ROI Align unit is used to determine the sampling points of the candidate boxes based on the curvature values, so as to map each candidate box to a target feature map of a fixed size based on the sampling points.
[0011] Optionally, calculating the curvature value of the arc within each recommended candidate box includes:
[0012] Extract the edge point sequence within the recommended candidate box;
[0013] Calculate the initial arc curvature value based on the edge point sequence;
[0014] The initial arc curvature value is normalized to obtain the arc curvature value.
[0015] Optionally, determining the sampling points of the recommended candidate box based on the arc curvature value includes:
[0016] The initial sampling points of the recommended candidate boxes are generated based on the initial grid parameters;
[0017] The curvature offset of each initial sampling point is calculated based on the arc curvature value to obtain the total curvature offset corresponding to the recommended candidate box;
[0018] The initial sampling point is adjusted based on the total curvature offset to obtain the sampling point.
[0019] Optionally, mapping each of the recommended candidate boxes to a fixed-size target feature map based on the sampling points includes:
[0020] Identify the four pixels adjacent to the sampling point;
[0021] The curvature weight of each pixel is determined based on the sampling points and the positions of each pixel.
[0022] The target feature map is obtained by calculating the target feature value of the sampling point based on the curvature influence factor, the curvature weight of each pixel, the arc curvature value, and the initial feature value.
[0023] Optionally, the deep learning model further includes:
[0024] The backbone layer of the network is used to extract features from the image to be detected to obtain an initial feature map;
[0025] The Region Candidate Network (RPN) layer is used to generate recommended candidate boxes based on the initial feature map;
[0026] A classifier and a regression layer are used to output the position and category of the recommended candidate box based on the target feature map;
[0027] The fully convolutional network (FCN) layer is used to predict the confidence level of each category of the recommended candidate boxes to obtain the electrical component identification result.
[0028] Optionally, the method further includes:
[0029] Configure the Anchor ratio parameters of the deep learning model; the Anchor ratio parameters are 1:1.5, 1:3, and 2.5:1.
[0030] Optionally, after obtaining the electrical component identification result, the method further includes:
[0031] Obtain low-confidence identification results with a confidence level less than a preset threshold from the electrical component identification results;
[0032] The low-confidence identification results are verified based on a preset electrical knowledge base.
[0033] According to a second aspect of this disclosure, an electrical component identification device is provided, comprising:
[0034] The acquisition module is used to acquire the image to be detected;
[0035] The recognition module is used to input the image to be detected into the deep learning model to obtain the electrical component recognition result output by the deep learning model;
[0036] The deep learning model includes a Region of Interest (ROI) layer, which includes a curvature calculation unit and a curvature-sensitive ROI Align unit. The curvature calculation unit is used to calculate the curvature value of the arc within each candidate box, and the ROI Align unit is used to determine the sampling points of the candidate boxes based on the curvature values, so as to map each candidate box to a target feature map of a fixed size based on the sampling points.
[0037] According to a third aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the electrical component identification method as described in the above embodiments.
[0038] According to a fourth aspect of the present disclosure, an electronic device is provided, characterized in that it includes: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the electrical component identification method as described in the above embodiments.
[0039] The exemplary embodiments disclosed herein may have some or all of the following beneficial effects:
[0040] In some embodiments of this disclosure, a deep learning model is used to identify electrical components in an image to be detected. The deep learning model includes a region of interest (ROI) layer, which incorporates the calculation of arc curvature values. The distribution of sampling points is then dynamically adjusted based on the arc curvature values to enhance coverage of high curvature areas and improve the accuracy of electrical component identification.
[0041] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0042] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0043] Figure 1 The schematic diagram illustrates a flowchart of an electrical component identification method according to an exemplary embodiment of the present disclosure;
[0044] Figure 2 This schematic diagram illustrates an image to be detected in an exemplary embodiment of the present disclosure;
[0045] Figure 3 This schematic diagram illustrates the structure of a deep learning model in an exemplary embodiment of the present disclosure.
[0046] Figure 4 The schematic diagram illustrates a flowchart of a method for calculating the curvature value of an arc in an exemplary embodiment of the present disclosure;
[0047] Figure 5 The illustration schematically shows a flowchart of a method for determining sampling points in an exemplary embodiment of the present disclosure;
[0048] Figure 6 The illustration schematically shows a flowchart of a method for determining a target feature map in an exemplary embodiment of the present disclosure;
[0049] Figure 7 This schematic diagram illustrates the composition of an electrical component identification device according to an exemplary embodiment of the present disclosure;
[0050] Figure 8 The schematic diagram illustrates the structure of a computer system of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0051] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.
[0052] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0053] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0054] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0055] The implementation details of the technical solutions of the embodiments of this disclosure are described in detail below.
[0056] Figure 1 This illustration schematically shows a flowchart of an electrical component identification method according to an exemplary embodiment of the present disclosure. Figure 1 As shown, the electrical component identification method includes steps S101 to S102:
[0057] Step S101: Obtain the image to be detected;
[0058] Step S102: Input the image to be detected into the deep learning model to obtain the electrical component identification result output by the deep learning model.
[0059] In some embodiments of this disclosure, a deep learning model is used to identify electrical components in an image to be detected. The deep learning model includes a region of interest (ROI) layer, which incorporates the calculation of arc curvature values. The distribution of sampling points is then dynamically adjusted based on the arc curvature values to enhance coverage of high curvature areas and improve the accuracy of electrical component identification.
[0060] The following will describe in more detail each step of the electrical component identification method in this exemplary embodiment, with reference to the accompanying drawings and embodiments.
[0061] In step S101, the image to be detected is acquired.
[0062] Specifically, the image to be detected is the image in the electrical drawing that includes graphic element information. Figure 2 The illustration is a schematic diagram of an image to be detected in an exemplary embodiment of the present disclosure.
[0063] In step S102, the image to be detected is input into a deep learning model to obtain the electrical component identification result output by the deep learning model.
[0064] Figure 3 This schematic diagram illustrates the structure of a deep learning model in an exemplary embodiment of the present disclosure, such as... Figure 3 As shown, the deep learning model is Mask R-CNN, and its structure is as follows:
[0065] The backbone layer of the network is used to extract features from the image to be detected to obtain an initial feature map;
[0066] The Region Candidate Network (RPN) layer is used to generate recommended candidate boxes based on the initial feature map;
[0067] The Region of Interest (ROI) layer is used to map each of the proposed candidate boxes to a target feature map of a fixed size.
[0068] A classifier and a regression layer are used to output the position and category of the recommended candidate box based on the target feature map;
[0069] The fully convolutional network (FCN) layer is used to predict the confidence level of each category of the recommended candidate boxes to obtain the electrical component identification result.
[0070] The following section will elaborate on each part of the deep learning model.
[0071] The backbone layer includes a preprocessing unit and a backbone network feature extraction unit. The preprocessing unit converts the image to be detected into a target image of a preset size, for example, converting a P*Q image into an M*N image, and then feeds this image into the backbone network feature extraction unit. The backbone network feature extraction unit uses the backbone network FPN (Feature Pyramid Network) to extract image features from the target image to obtain initial feature maps. This backbone network includes 13 conv layers, 13 ReLU layers, and 4 pooling layers. The output initial feature maps are shared for subsequent RPN and ROI layers.
[0072] The Region Proposal Network (RPN) layer consists of a first convolutional unit, a second convolutional unit, and a third convolutional unit. The first convolutional unit (3*3) enhances the semantic features of the initial feature map, resulting in a first feature map, which is then fed into the second and third convolutional units. The second convolutional unit performs binary classification on the first feature map, outputting a binary classification result (whether the candidate box contains an object) after passing through a softmax activation function. The second convolutional unit has a size of 1*1*18. The third convolutional unit performs bounding box regression on the first feature map, obtaining the bounding boxes of the candidate boxes. The third convolutional unit has a size of 1*1*36.
[0073] The ROI layer incorporates information such as image scaling and adds arc curvature calculation to enhance the extraction of symbolic features such as arcs. Ultimately, it maps each candidate bounding box to a fixed-size target feature map. The ROI layer includes a curvature calculation unit and a curvature-sensitive ROI Align unit. The curvature calculation unit calculates the arc curvature value within each candidate bounding box; the ROI Align unit determines the sampling points of the candidate bounding boxes based on the arc curvature values, thus mapping each candidate bounding box to a fixed-size target feature map based on these sampling points.
[0074] Figure 4 This schematically illustrates a flowchart of a method for calculating the curvature value of an arc in an exemplary embodiment of this disclosure. Figure 4 As shown, the calculation of the curvature value of the arc within each recommended candidate box includes:
[0075] Step S401: Extract the edge point sequence within the recommended candidate box;
[0076] Step S402: Calculate the initial arc curvature value based on the edge point sequence;
[0077] Step S403: Normalize the initial arc curvature value to obtain the arc curvature value.
[0078] Specifically, the Canny algorithm can be used to extract the edge point sequence P = {p} from the binary mask. i =(x i ,y i Then, the curvature is calculated using the three-point method, as follows:
[0079]
[0080] Where, p i =(x i ,y i Let p be the coordinates of the i-th point in the edge point sequence.i+1 and p i-1 The three points, namely the preceding and following adjacent edge points, are used to calculate the local curvature.
[0081] Finally, the curvature is normalized to obtain the final arc curvature value, as follows:
[0082]
[0083] Where min(k) is the minimum value of k, and max(k) is the maximum value of k.
[0084] Figure 5 The illustration schematically shows a flowchart of a method for determining sampling points according to an exemplary embodiment of this disclosure. Figure 5 As shown, determining the sampling points of the recommended candidate box based on the arc curvature value includes:
[0085] Step S501: Generate initial sampling points for the recommended candidate boxes based on the initial grid parameters;
[0086] Step S502: Calculate the curvature offset of each initial sampling point based on the arc curvature value to obtain the total curvature offset corresponding to the recommended candidate box;
[0087] Step S503: Adjust the initial sampling point according to the total curvature offset to obtain the sampling point.
[0088] Specifically, the basic mesh is first generated, and k×k uniform mesh points G are initialized. base ={g jk (e.g., a 7×7 grid), which is the initial sampling point.
[0089] Then for each grid point g jk Calculate the curvature offset, then sum the curvature offsets of all grid points to obtain the total curvature offset corresponding to the recommended candidate box, as follows:
[0090]
[0091] in, For g jk The curvature value of the arc at that point, For grid point g jk The nearest edge point p n The tangent direction at the point (calculated from the sequence of edge points), α is a learnable parameter that is automatically adjusted through backpropagation of the gradient of the loss function.
[0092] Then the initial sampling points are adjusted as follows:
[0093] G adjusted =Gbase +ΔG (4)
[0094] In this way, the adjusted sampling points cluster towards areas of high curvature, with denser sampling near the arc, while maintaining a uniform distribution in the straight sections.
[0095] Figure 6 This schematically illustrates a flowchart of a method for determining a target feature map according to an exemplary embodiment of the present disclosure, such as... Figure 6 As shown, mapping each of the recommended candidate boxes to a fixed-size target feature map based on the sampling points includes:
[0096] Step S601: Determine the four pixels adjacent to the sampling point;
[0097] Step S602: Determine the curvature weight of each pixel based on the sampling point and the position of each pixel;
[0098] Step S603: Calculate the target feature value of the sampling point based on the curvature influence factor, the curvature weight of each pixel, the arc curvature value, and the initial feature value, to obtain the target feature map.
[0099] Specifically, when performing feature map interpolation to aggregate and optimize features, a curvature weight is added during feature map interpolation for each sampling point g, and the target feature value of that point is calculated to obtain a target feature map of a fixed size, as follows:
[0100]
[0101] In the formula, Q(g) represents the four pixels adjacent to the sampling point g, and w q The curvature weights for bilinear interpolation are determined by the positions of the sampling point g and the pixel, β is the curvature influence factor, and F(q) is the initial feature value of the initial feature map at position q.
[0102] The classifier and regression layers are used to output the location and category of the recommended candidate boxes based on the target feature map. This part outputs the location (coordinates) and specific category (category) of the recommended candidate boxes based on the feature map output by the ROI pooling layer and through a fully connected layer. It should be noted that the identified category may be one or more.
[0103] The fully convolutional network (FCN) layer is used to predict the confidence level of each category of the recommended candidate boxes to obtain the electrical component identification result. This part includes some basic convolutions and transposed convolutions. This structure predicts a score for each category of each pixel, and finally obtains the probability of each category, i.e., the confidence level, through softmax.
[0104] In one embodiment of this disclosure, the method further includes: configuring the Anchor ratio parameters of the deep learning model; the Anchor ratio parameters are 1:1.5, 1:3, or 2.5:1.
[0105] Specifically, Anchor is a crucial mechanism in RPN, used to generate candidate boxes of different scales and aspect ratios. Existing Mask RCNNs typically use Anchor ratios of 1:1, 1:2, and 2:1. However, electrical symbols have domain-specific size distribution characteristics, such as aspect ratios: switch symbols are often close to squares (1:1), and bus symbols are often elongated (5:1). This leads to two problems: first, small symbols are missed because the default minimum Anchor size cannot match tiny symbols; second, large symbols are falsely detected because elongated symbols are easily split into multiple Anchor boxes.
[0106] Therefore, in order to improve the accuracy of electrical component identification, the Anchor ratio parameter was adjusted in this application. First, symbol size extraction was performed. OpenCV was used to extract the minimum bounding rectangle of all symbols, and the aspect ratio was calculated as r = w / h, retaining r ≥ 1, and symmetrically handling inverted cases. Then, cluster analysis was performed, using K-means clustering on the aspect ratio, outputting cluster centers of 1:1.5, 1:3, and 2.5:1, which were used to set the Anchorr ratio parameter. Therefore, the Anchorr size grading strategy in this application, S... Anchor =S base ×2 i / 3 i = 0, 1, 2, S base This is the baseline dimension.
[0107] In one embodiment of this disclosure, after obtaining the electrical component identification result, the method further includes:
[0108] Obtain low-confidence identification results with a confidence level less than a preset threshold from the electrical component identification results;
[0109] The low-confidence identification results are verified based on a preset electrical knowledge base.
[0110] Specifically, for identification results with low confidence, they can be re-verified using an electrical knowledge base. This electrical knowledge base is pre-built and includes a knowledge graph of the electrical field, such as symbol names, standard graphics, and parameter constraints, which can then be used to construct multiple electrical rules.
[0111] For example, if one of the electrical component identification results is low-confidence and identifies the electrical component as A, which is connected to B, but according to the electrical rules in the electrical knowledge base, B cannot be connected to A, then the identification result for A is incorrect. In this case, a reminder message can be generated for manual correction, thus completing the confidence-rule dual verification module.
[0112] Based on the above method, on the one hand, a rate modeling curvature parameter is added to ROI Align. The improved ROI Align can dynamically perceive geometric features and significantly improve the detection capability of complex shapes such as arcs and rings in electrical symbol recognition tasks. Moreover, the parameter design takes into account both theoretical rigor and engineering practicality.
[0113] On the other hand, the Anchor ratio was adjusted. Since electrical symbols have domain-specific size distribution characteristics, this can avoid the situation of small symbols being missed and large symbols being falsely detected.
[0114] On the other hand, based on the results of Mask RCNN in identifying components, by constructing an electrical domain knowledge base, the low-confidence results are verified by both graphical feature matching and electrical rules, thereby achieving knowledge base-guided assisted error correction and identification, which can further improve the accuracy of electrical component identification.
[0115] It should be noted that, based on the applicant's experimental verification, the electrical component identification method provided in this disclosure can improve the accuracy of component identification on electrical drawings from 90% to 98.6%, reduce the workload of manual review by 85%, and decrease the false detection rate from 5.2% to 1.2%. Furthermore, ambiguous contactor symbols that are misidentified as circuit breakers can be corrected to contactors through knowledge base matching.
[0116] Figure 7 This schematic diagram illustrates the composition of an electrical component identification device according to an exemplary embodiment of the present disclosure, such as... Figure 7 As shown, the electrical component identification device 700 may include an acquisition module 701 and an identification module 702. Wherein:
[0117] The acquisition module 701 is used to acquire the image to be detected;
[0118] The recognition module 702 is used to input the image to be detected into a deep learning model to obtain the electrical component recognition result output by the deep learning model;
[0119] The deep learning model includes a Region of Interest (ROI) layer, which includes a curvature calculation unit and a curvature-sensitive ROI Align unit. The curvature calculation unit is used to calculate the curvature value of the arc within each candidate box, and the ROI Align unit is used to determine the sampling points of the candidate boxes based on the curvature values, so as to map each candidate box to a target feature map of a fixed size based on the sampling points.
[0120] According to an exemplary embodiment of this disclosure, the identification module is further configured to extract the edge point sequence within the recommended candidate box; calculate an initial arc curvature value based on the edge point sequence; and normalize the initial arc curvature value to obtain the arc curvature value.
[0121] According to an exemplary embodiment of this disclosure, the recognition module is further configured to generate initial sampling points of the recommended candidate box based on initial grid parameters; calculate the curvature offset of each of the initial sampling points based on the arc curvature value to obtain the total curvature offset corresponding to the recommended candidate box; and adjust the initial sampling points according to the total curvature offset to obtain the sampling points.
[0122] According to an exemplary embodiment of this disclosure, the identification module is further configured to determine four pixels adjacent to the sampling point; determine the curvature weight of each pixel based on the position of the sampling point and each pixel; and calculate the target feature value of the sampling point based on the curvature influence factor, the curvature weight of each pixel, the arc curvature value, and the initial feature value, so as to obtain the target feature map.
[0123] According to an exemplary embodiment of this disclosure, the deep learning model further includes: a backbone layer for extracting features from the image to be detected to obtain an initial feature map; a region candidate network (RPN) layer for generating recommended candidate boxes based on the initial feature map; a classifier and regression layer for outputting the position and category of the recommended candidate boxes based on the target feature map; and a fully convolutional network (FCN) layer for predicting the confidence level corresponding to each category of the recommended candidate boxes to obtain the electrical component identification result.
[0124] According to an exemplary embodiment of this disclosure, the recognition module is further configured to configure the Anchor ratio parameters of the deep learning model; the Anchor ratio parameters are 1:1.5, 1:3, and 2.5:1.
[0125] According to an exemplary embodiment of this disclosure, the electrical component identification device 700 further includes a verification module, configured to acquire low-confidence identification results with a confidence level less than a preset threshold from the electrical component identification results; and verify the low-confidence identification results based on a preset electrical knowledge base.
[0126] The specific details of each module in the aforementioned electrical component identification device 700 have been described in detail in the corresponding electrical component identification method, so they will not be repeated here.
[0127] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0128] In exemplary embodiments of this disclosure, a storage medium capable of implementing the above-described methods is also provided. It may be a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a terminal device, such as a mobile phone. However, the program product of this disclosure is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0129] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided. Figure 8 The schematic diagram illustrates the structure of a computer system of an electronic device according to an exemplary embodiment of the present disclosure.
[0130] It should be noted that, Figure 8 The computer system 800 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0131] like Figure 8 As shown, the computer system 800 includes a Central Processing Unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 802 or programs loaded from storage section 808 into Random Access Memory (RAM) 803. The RAM 803 also stores various programs and data required for system operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An Input / Output (I / O) interface 805 is also connected to the bus 804.
[0132] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.
[0133] In particular, according to embodiments of this disclosure, the processes described below with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs various functions defined in the system of this disclosure.
[0134] It should be noted that the computer-readable medium shown in the embodiments of this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0135] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0136] The units described in the embodiments of this disclosure can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the unit itself.
[0137] In another aspect, this disclosure also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.
[0138] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0139] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this disclosure.
[0140] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.
[0141] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for identifying electrical components, characterized in that, include: Acquire the image to be detected; The image to be detected is input into a deep learning model to obtain the electrical component identification result output by the deep learning model; The deep learning model includes a Region of Interest (ROI) layer, which comprises a curvature calculation unit and a curvature-sensitive ROI Align unit. The curvature calculation unit calculates the curvature value of the arc within each candidate bounding box. The ROI Align unit determines the sampling point of the candidate bounding box based on the arc curvature value and identifies four pixels adjacent to each sampling point. Based on the positions of the sampling points and each pixel, the curvature weight of each pixel is determined. The target feature value of the sampling point is calculated based on the curvature influence factor, the curvature weight of each pixel, the arc curvature value, and the initial feature value, to obtain a target feature map. The step of determining the sampling points of the recommended candidate box based on the arc curvature value includes: generating initial sampling points of the recommended candidate box based on initial grid parameters; calculating the curvature offset of each initial sampling point based on the arc curvature value to obtain the total curvature offset corresponding to the recommended candidate box; and adjusting the initial sampling points according to the total curvature offset to obtain the sampling points.
2. The electrical component identification method according to claim 1, characterized in that, The calculation of the curvature value of the arc within each recommended candidate box includes: Extract the edge point sequence within the recommended candidate box; Calculate the initial arc curvature value based on the edge point sequence; The initial arc curvature value is normalized to obtain the arc curvature value.
3. The electrical component identification method according to claim 1, characterized in that, The deep learning model also includes: The backbone layer of the network is used to extract features from the image to be detected to obtain an initial feature map; The Region Candidate Network (RPN) layer is used to generate recommended candidate boxes based on the initial feature map; A classifier and a regression layer are used to output the position and category of the recommended candidate box based on the target feature map; The fully convolutional network (FCN) layer is used to predict the confidence level of each category of the recommended candidate boxes to obtain the electrical component identification result.
4. The electrical component identification method according to claim 3, characterized in that, The method further includes: Configure the Anchor ratio parameters of the deep learning model; the Anchor ratio parameters are 1:1.5, 1:3, and 2.5:
1.
5. The electrical component identification method according to claim 1, characterized in that, After obtaining the electrical component identification result, the method further includes: Obtain low-confidence identification results with a confidence level less than a preset threshold from the electrical component identification results; The low-confidence identification results are verified based on a preset electrical knowledge base.
6. An electrical component identification device, characterized in that, include: The acquisition module is used to acquire the image to be detected; The recognition module is used to input the image to be detected into the deep learning model to obtain the electrical component recognition result output by the deep learning model; The deep learning model includes a Region of Interest (ROI) layer, which comprises a curvature calculation unit and a curvature-sensitive ROI Align unit. The curvature calculation unit calculates the curvature value of the arc within each candidate bounding box. The ROI Align unit determines the sampling point of the candidate bounding box based on the arc curvature value and identifies four pixels adjacent to each sampling point. Based on the positions of the sampling points and each pixel, the curvature weight of each pixel is determined. The target feature value of the sampling point is calculated based on the curvature influence factor, the curvature weight of each pixel, the arc curvature value, and the initial feature value, to obtain a target feature map. The step of determining the sampling points of the recommended candidate box based on the arc curvature value includes: generating initial sampling points of the recommended candidate box based on initial grid parameters; calculating the curvature offset of each initial sampling point based on the arc curvature value to obtain the total curvature offset corresponding to the recommended candidate box; and adjusting the initial sampling points according to the total curvature offset to obtain the sampling points.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the electrical component identification method as described in any one of claims 1 to 5.
8. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the electrical component identification method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
PCB component detection method based on lightweight network
CN112102242A
Corner point detection-based element identification and positioning method and system, and storage medium
CN115511966A