Information extraction method and device for nameplate image of power equipment, equipment and medium
By employing edge detection, semantic segmentation, and template matching technologies, the problems of deformation and glare interference in power equipment nameplate images have been solved, enabling automated conversion from nameplate images to structured data and improving recognition accuracy and processing efficiency.
Patent Information
- Application Number
- CN202511552258.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-01-23
AI Technical Summary
Existing technologies for power equipment nameplate image recognition suffer from image distortion and glare interference, resulting in low recognition accuracy and an inability to adapt to the diversity of nameplate designs from different manufacturers, making it difficult to achieve automated structured data conversion.
Image correction is performed using edge detection and contour analysis, and reflective areas are identified and repaired using a semantic segmentation network. Text blocks are identified using OCR and query combination tags are generated. Structured parsing templates are generated by matching template libraries or user interaction, and finally, data comparison is performed.
It improves the accuracy and automation of nameplate image recognition, realizes the intelligent conversion of unstructured text into standardized data, and reduces the workload of manual verification.
Smart Images

Figure CN121388005A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of digital management of power equipment, and particularly relates to a power equipment nameplate image information extraction method and device, equipment and medium. BACKGROUND
[0002] Power equipment asset management is a core link of power grid operation and maintenance, and the accurate identification and acceptance of the equipment nameplate as a carrier of key parameter information directly affect the reliability of the whole life cycle management of the equipment.
[0003] The current power industry generally adopts the mode of manually transcribing nameplate information, and the on-site shooting link is limited by the working environment, so it is difficult for workers to maintain a vertical shooting angle, resulting in that the obtained nameplate images generally have trapezoidal distortion and rotation offset, and the recognition accuracy of traditional OCR technology directly processing such distorted images drops sharply. SUMMARY
[0004] The purpose of the present application is to provide a power equipment nameplate image information extraction method, device, equipment and medium, which has the advantages of improving the recognition accuracy of the nameplate image, automatically processing the reflection interference, and realizing the intelligent conversion of unstructured text to standardized data.
[0005] In order to achieve the above purpose, the technical scheme is as follows: In a first aspect, the application provides a power equipment nameplate image information extraction method, comprising: An original power equipment nameplate image is obtained, edge extraction based on edge detection is performed on the original image to obtain an edge image, contour analysis is performed on the edge image to obtain a candidate contour set representing the boundary of the nameplate, a transformation matrix of perspective transformation is calculated based on the candidate contour set, image correction is performed on the original power equipment nameplate image by using the transformation matrix to obtain a perspective correction image, the reflection area of the perspective correction image is identified by using a pre-trained semantic segmentation network to obtain a reflection area mask, and the reflection area in the perspective correction image is repaired based on the reflection area mask to obtain an enhanced image. OCR recognition is performed on the enhanced image to generate a preliminary recognized text block set, each text block in the preliminary recognized text block set includes text content, confidence and boundary box coordinates. From the preliminary recognized text block set, a preset manufacturer field value and a device name field value are located and extracted, and the manufacturer field value and the device name field value are combined to generate a query combined label. The query combination label is matched with a template library; if the matching is successful, a corresponding structured analysis template is acquired; if the matching fails, a graphical template configuration process is started, field mapping instructions input by a user based on the preliminary identified text block set are received, a new template is generated, and the new template is associated with the query combination label and stored in the template library; The structured analysis template acquired or generated is used to analyze and map fields of the preliminary identified text block set, and standardized key-value pair structured data is output. The key-value pair structured data is compared with standard parameters in a database, and a difference comparison report is generated.
[0006] The above scheme solves the problems of image deformation and glare interference commonly existing in on-site shooting through integrated robust image preprocessing, lays a foundation for subsequent high-precision OCR recognition, solves the problem of being unable to uniformly analyze due to various types of nameplates through query combination label generation and template adaptive matching, and realizes intelligent conversion from unstructured text to structured data. Finally, through automatic comparison with standard parameters, manual acceptance work is converted into automatic data verification, and the efficiency and accuracy of power equipment asset information input and acceptance are improved, forming a complete digital closed loop.
[0007] Further, an original power equipment nameplate image is acquired, edge extraction based on edge detection is performed on the original image to obtain an edge image, contour analysis is performed on the edge image to obtain a candidate contour set representing the boundary of the nameplate, a transformation matrix of perspective transformation is calculated based on the candidate contour set, image correction is performed on the original power equipment nameplate image by using the transformation matrix to obtain a perspective corrected image, the perspective corrected image is subjected to glare region identification by using a pre-trained semantic segmentation network to obtain a glare region mask, and image inpainting is performed on the glare region in the perspective corrected image based on the glare region mask to obtain an enhanced image, including the following specific steps: An edge image is obtained by performing edge detection on the original power equipment nameplate image by using a Canny operator or a Sobel operator; The edge image is processed by using a contour finding algorithm to find the largest quadrilateral contour to obtain the candidate contour set; Based on the candidate contour set, when a quadrilateral contour is successfully located, a transformation matrix of perspective transformation is calculated according to four vertices of the quadrilateral contour; when the quadrilateral contour is not located, the edge of a text line in the image is detected by using a Hough line transformation, the inclination angle of a dominant line is calculated, and a transformation matrix of affine rotation is calculated based on the inclination angle; The original power equipment nameplate image is subjected to perspective transformation or affine rotation by using the transformation matrix to obtain a perspective corrected image; The pre-trained convolutional neural network is used for semantic segmentation of the anti-reflection area of the perspective correction image, and a binary anti-reflection area mask is output, wherein the convolutional neural network is a binary classification segmentation network for distinguishing the anti-reflection area and the normal area. Based on the anti-reflection area mask, the anti-reflection area in the perspective correction image is repaired: for the anti-reflection area with an area less than a preset threshold, a neighborhood pixel-based image repair algorithm is used for repair; for the anti-reflection area with an area greater than or equal to the preset threshold, a generative adversarial network is used for repair.
[0008] The above scheme combines contour and text line detection to ensure that the correction can be performed when the nameplate boundary is not obvious, and improves the robustness and applicability of the preprocessing link. By distinguishing the area of the anti-reflection area and using different repair strategies, the best balance between repair effect and calculation efficiency is achieved: small areas are repaired quickly, and large areas of serious anti-reflection are used to generate more reasonable character content using GAN, which improves the ability to obtain clear and regular nameplate images in complex field environments.
[0009] Further, the enhanced image is subjected to OCR recognition to generate a preliminary recognized text block set; each text block in the preliminary recognized text block set includes text content, confidence and boundary box coordinates, including the following specific steps: The text detection network integrated with the attention mechanism module is used to process the enhanced image, to strengthen the text region features and suppress the background interference, and to output a text region coordinate set; Based on the text region coordinate set, each text line image is cropped from the enhanced image; Each text line image is subjected to vertical projection analysis to find the trough to determine the initial segmentation point, and a candidate character image set is obtained; A pre-trained character classifier is used to classify and recognize each candidate character image in the candidate character image set, and calculate the character confidence thereof; when the character confidence of a candidate character image is lower than a first preset threshold, it is determined as a connected character, and adaptive segmentation is started; the adaptive segmentation includes: backtracking to the text line image, adjusting the segmentation point position or inputting it into a dedicated connected character segmentation model for fine segmentation, until the character confidence of all segmented character images is higher than the first preset threshold or cannot be further improved through segmentation, to obtain an optimized character recognition result and the corresponding character confidence; The optimized character recognition result is combined according to the text line order to form the original recognized text content; The original recognized text content is input into a context correction module based on a power industry dictionary and a pre-trained language model: for a character whose confidence is lower than a second preset threshold, a set of candidate characters similar in shape is generated; in combination with the context semantics, a character combination is selected from the set of candidate characters that enables the entire word or field to have the highest matching degree in the power industry dictionary, and the final text content after correction is output; The text region coordinates are integrated as the bounding box coordinates, the final text content is taken as the text content, and the confidence of the entire text block is calculated based on the confidence of each character to generate a set of preliminary recognized text blocks.
[0010] The above scheme improves the character recognition accuracy in complex scenarios through adaptive segmentation and context correction. Adaptive segmentation is specifically designed to address traditional OCR challenges such as character sticking and breaking, and dynamically adjusts the segmentation strategy to ensure the accuracy of character segmentation. The context correction module uses prior knowledge of the power industry to solve the misrecognition problem of similar characters (such as 'O' and '0'). The combination of the two ensures that the scheme remains highly reliable even when faced with low-quality nameplate images.
[0011] Further, from the set of preliminary recognized text blocks, the pre-set manufacturer field value and equipment name field value are located and extracted; the manufacturer field value and equipment name field value are combined to generate a query combination label, including the following specific steps: Each text block in the set of preliminary recognized text blocks is traversed, and its text content is matched with a pre-set manufacturer keyword set; the manufacturer keyword set includes one or more of manufacturer, factory, factory name, brand, and manufacturer; when the content of a text block matches the manufacturer keyword set successfully, the text block is marked as a manufacturer keyword block; In the set of preliminary recognized text blocks, a text block adjacent in spatial position to the manufacturer keyword block is located as a first candidate field value; the text block content with the highest confidence is selected from the first candidate field value as the initial value of the manufacturer field; Each text block in the set of preliminary recognized text blocks is traversed, and its text content is matched with a pre-set equipment name keyword set; the equipment name keyword set includes one or more of product name, model number, equipment name, and equipment model number; when the content of a text block matches the equipment name keyword set successfully, the text block is marked as an equipment name keyword block; In the set of preliminary recognized text blocks, a text block adjacent in spatial position to the equipment name keyword block is located as a second candidate field value; the text block content with the highest confidence is selected from the second candidate field value as the initial value of the equipment name field; The manufacturer field initial value and the device name field initial value are respectively subjected to string cleaning, and the leading and trailing spaces, colons and quotation marks are removed to obtain standardized manufacturer field values and device name field values; The standardized manufacturer field values and device name field values are connected by underscores to generate a query combination label.
[0012] The above scheme can accurately lock the manufacturer and device name core fields in the cluttered text block by combining keyword set matching and spatial position relationship analysis. The subsequent cleaning and standardization operation eliminates impurities in the original identification result, ensures the standardization and uniqueness of the generated query combination label, and provides a reliable index basis for subsequent accurate and efficient matching of the template library.
[0013] Further, the query combination label is matched with the template library; if the matching is successful, the corresponding structured analysis template is obtained; if the matching fails, a graphical template configuration process is started, the field mapping instructions input by the user based on the preliminary identified text block set are received, a new template is generated, and the new template is associated with the query combination label and stored in the template library, including the following specific steps: The query combination label is subjected to exact string matching with the index labels of all stored templates in the template library; If the exact matching is successful, the corresponding structured analysis template is obtained from the template library; If the exact matching fails, the text similarity between the query combination label and the index labels in the template library is calculated, and the text similarity is calculated by any one of cosine similarity, Jaccard similarity or edit distance algorithm; It is judged whether the highest text similarity is greater than or equal to a preset similarity threshold; If the highest text similarity is greater than or equal to the similarity threshold, it is determined that the fuzzy matching is successful, and the structured analysis template corresponding to the index label with the highest text similarity is obtained from the template library; If the exact matching and the fuzzy matching are both unsuccessful, it is determined that the matching fails, and the graphical template configuration process is started; The graphical template configuration process includes: The graphical user interface is displayed to the user, wherein the content of each text block in the preliminary identified text block set and its bounding box coordinates are presented in the form of an interactive list or table; The standard field name specified by the user for each text block through the interface is received to form a field mapping instruction; The key field specified by the user through the interface from the standard field name is received, and the key field at least includes the field corresponding to the manufacturer field value and the device name field value; According to the field mapping instruction and the key field specification, a new template containing field positioning rules and data standardization rules is generated; The new template is associated with the query combination tag, and the association relationship is stored in the template library.
[0014] The above scheme, through the secondary retrieval strategy from accurate matching to fuzzy matching, first ensures the fast response to the known nameplate format. When encountering a completely new format, the graphical configuration process guides the user to perform simple mapping configuration, so that the new template can be integrated into the system, realizing the zero coding self-expansion of the template library. It fundamentally solves the limitations of the traditional method of pre-defining all templates and being unable to adapt to the update of device models, giving the system great vitality and practicality.
[0015] Further, the structured analysis template obtained or generated is used to analyze and map the preliminary identified text block set, and output standardized key-value pair structure data, including the following specific steps: Load the structured analysis template to obtain the names of each standard field, field positioning rules and data standardization rules defined therein; wherein the field positioning rules are defined based on the relative position relationship between the text blocks or the keyword anchor points; For each standard field defined in the structured analysis template, according to its field positioning rule, locate the value text block corresponding to it in the preliminary identified text block set, and extract its text content as the original field value of the standard field; For each extracted original field value, apply its corresponding data standardization rule for processing: If the field is a numerical field, identify and extract the numerical part and the unit part, and perform unit conversion according to the pre-defined internal standard unit to output the standardized value containing the numerical value and the standard unit; If the field is a text field, remove the invalid characters at the beginning and end, and standardize the output according to the pre-defined format; Combine all the standard fields with their corresponding standardized values to generate standardized key-value pair structure data.
[0016] The above scheme, by applying the pre-defined positioning rules in the template, the system can intelligently map the text blocks recognized by OCR to specific semantic fields. Further, by executing the data standardization rules (such as unit conversion, format standardization), it ensures that the final output key-value pair data meets the standards of computer processing and database storage, providing a high-quality and consistent data basis for subsequent data comparison, analysis and application.
[0017] Further, the key-value pair structure data is compared with the standard parameters in the database, and a difference comparison report is generated, including the following specific steps: According to the standardized key-value pair structure data, the device identification information is retrieved in the database, or according to the query combination label, a matched standard device record is obtained, and a corresponding standard parameter set is obtained, the standard parameter set including standard values of each standard field; The standardized value of each field in the key-value pair structure data is fault-tolerant compared with the standard value of the corresponding field in the standard parameter set: For numerical fields, after unit conversion and normalization of the standardized value and the standard value to the same dimension, the numerical difference is calculated, and it is judged whether the numerical difference exceeds the preset allowed error threshold for the field; For text fields, the text similarity between the standardized value and the standard value is calculated, and it is judged whether the text similarity is lower than the preset similarity threshold for the field; According to the fault-tolerant comparison result, a comparison state identifier is generated for each field, including consistent, inconsistent or missing; If the numerical difference of the numerical field does not exceed the allowed error threshold, or the text similarity of the text field reaches the similarity threshold, it is determined to be consistent; If the numerical difference of the numerical field exceeds the allowed error threshold, or the text similarity of the text field is lower than the similarity threshold, it is determined to be inconsistent; If the corresponding field cannot be found in the key-value pair structure data or the standard parameter set, it is determined to be missing; Based on the comparison state identifier, the standardized value and the standard value of all fields, a structured difference comparison report is automatically generated; The difference comparison report is presented in the form of a table, and the fields determined to be inconsistent and missing are highlighted.
[0018] The above scheme sets different fault-tolerant comparison strategies (such as error threshold and similarity threshold) for different types of fields (numerical and text), avoids false positives caused by small recognition errors or reasonable tolerances, and makes the comparison result more consistent with engineering practice. The finally generated structured report intuitively highlights the differences and missing items, greatly reducing the workload of manual verification, making the on-site acceptance work more efficient, accurate and standardized.
[0019] In a second aspect of the present application, an information extraction device for power equipment nameplate images is provided, comprising: An image preprocessing module is configured to acquire an original power equipment nameplate image, perform edge extraction based on edge detection on the original image to obtain an edge image, perform contour analysis on the edge image to obtain a candidate contour set representing a boundary of the nameplate, calculate a transformation matrix of perspective transformation based on the candidate contour set, perform image correction on the original power equipment nameplate image by using the transformation matrix to obtain a perspective corrected image, perform anti-reflection region identification on the perspective corrected image by using a pre-trained semantic segmentation network to obtain an anti-reflection region mask, and perform image inpainting on the anti-reflection region in the perspective corrected image based on the anti-reflection region mask to obtain an enhanced image. A text block generation module is configured to perform OCR identification on the enhanced image to generate a preliminary identified text block set, and each text block in the preliminary identified text block set includes text content, a confidence level and boundary box coordinates. A label generation module is configured to locate and extract a preset manufacturer field value and a device name field value from the preliminary identified text block set, combine the manufacturer field value and the device name field value to generate a query combined label. A template matching module is configured to match the query combined label with a template library, acquire a corresponding structured analysis template if the matching is successful, start a graphical template configuration process if the matching fails, receive field mapping instructions input by a user based on the preliminary identified text block set, generate a new template, and store the new template in the template library after associating the new template with the query combined label. A structured information extraction module is configured to analyze and map the preliminary identified text block set by using the acquired or generated structured analysis template, and output standardized key-value pair structured data. A comparison module is configured to compare the key-value pair structured data with standard parameters in a database, and generate a difference comparison report.
[0020] In a third aspect, the present application provides an electronic device including a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the information extraction method of the power equipment nameplate image.
[0021] In a fourth aspect, the present application provides a computer readable storage medium storing at least one instruction, wherein the at least one instruction is executed by a processor to implement the information extraction method of the power equipment nameplate image.
[0022] Compared with the prior art, the present application has the following advantages: The present application solves the problems of nameplate image deformation, reflection interference and unstructured text conversion by image correction, reflection repair and intelligent template matching technology, has the advantages of improving nameplate image recognition accuracy, automatically processing reflection interference and realizing intelligent conversion of unstructured text to standardized data. The information extraction device for power equipment nameplate image, electronic equipment and computer readable storage medium provided by the present application also solve the problems proposed in the background art. BRIEF DESCRIPTION OF DRAWINGS
[0023] The drawings constituting a part of the specification of the present application are used to provide further understanding of the present application, the illustrative embodiments of the present application and the description thereof are used to explain the present application, and do not constitute improper limitation on the present application. In the drawings: Figure 1 A flowchart of an information extraction method for a power equipment nameplate image according to an embodiment of the present application; Figure 2 A structural block diagram of an information extraction device for a power equipment nameplate image according to an embodiment of the present application; Figure 3 A structural block diagram of an electronic equipment according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] The technical solutions in the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0025] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. Meanwhile, in the description of the present application, the terms "first", "second" and the like are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0026] Embodiment 1 In the prior art, the acceptance of power equipment nameplates has long relied on manual recording and comparison, which is inefficient and prone to errors. Although optical character recognition technology has been applied in scenarios such as bills and license plates, it still has limitations in the special application environment of power equipment nameplates. In typical application scenarios, workers need to take pictures of metal nameplates in complex environments such as substations. The deviation in shooting angle causes geometric distortion of the image, the reflection of metal causes loss of information in the character area, and the differences in nameplate formats from different manufacturers make it difficult to structure the recognition results, making it difficult for automatic recognition systems to directly output standardized data for acceptance and comparison.
[0027] To solve the above problems, the present scheme finds that the prior art fails to solve the three core problems of image geometric correction, reflection interference elimination, and dynamic template adaptation. For the image distortion problem, edge detection combined with contour analysis is used to locate the nameplate boundary; for the reflection interference, semantic segmentation technology is used to identify the damaged area and perform differential repair; for the format diversity, a dynamic template generation mechanism based on key fields is proposed. Through the organic integration of the multi-stage processing process, a complete solution from the original image to the structured data is formed.
[0028] As shown in Figure 1 The information extraction method of the power equipment nameplate image includes S1-S6: S1, obtain the original power equipment nameplate image, perform edge extraction based on edge detection on the original image to obtain an edge image; perform contour analysis on the edge image to obtain a candidate contour set representing the boundary of the nameplate; based on the candidate contour set, calculate a transformation matrix of perspective transformation; use the transformation matrix to correct the image of the original power equipment nameplate to obtain a perspective corrected image; use a pre-trained semantic segmentation network to identify the reflection area of the perspective corrected image to obtain a reflection area mask; based on the reflection area mask, repair the reflection area in the perspective corrected image to obtain an enhanced image; S2, perform OCR recognition on the enhanced image to generate a preliminary recognized text block set; each text block in the preliminary recognized text block set includes text content, confidence and bounding box coordinates; S3, locate and extract the preset manufacturer field value and equipment name field value from the preliminary recognized text block set; combine the manufacturer field value and the equipment name field value to generate a query combined label; S4, match the query combined label with the template library; if the matching is successful, obtain the corresponding structured analysis template; if the matching fails, start a graphical template configuration process, receive the field mapping instructions input by the user based on the preliminary recognized text block set, generate a new template, and store the new template in the template library after associating it with the query combined label; S5, parsing and field mapping are performed on the set of preliminary identified text blocks using the acquired or generated structured parsing template, and standardized key-value pair structured data is outputted; S6, the key-value pair structured data is compared with the standard parameters in the database, and a difference comparison report is generated.
[0029] In a more specific embodiment, the scheme acquires the original power equipment nameplate image and performs edge detection to obtain an edge image, acquires a candidate contour set through contour analysis and calculates a transformation matrix, and corrects the original image to obtain a perspective correction image. The technical scheme uses a semantic segmentation network to identify the reflection area and repair to generate an enhanced image, generates a text block set containing text content, confidence and coordinates through OCR identification. The manufacturer and equipment name fields are positioned and extracted to generate a query label, a parsing template is acquired or generated by matching the template library, and finally standardized key-value pair data is outputted and compared with the database parameters to generate a difference report.
[0030] Wherein, edge detection refers to extracting the area with sharp gray scale change in the image through mathematical operators, which can be realized by Canny operator or Sobel operator, and is used to accurately capture the physical boundary of the nameplate. Contour analysis refers to geometric shape detection on the edge image, which determines the nameplate area by finding the largest quadrilateral contour, and solves the image distortion problem caused by shooting angle deviation. Perspective transformation refers to calculating the spatial transformation matrix according to the quadrilateral vertices, correcting the tilted image to the front view, and ensuring the geometric accuracy of subsequent processing. Semantic segmentation network refers to a pre-trained deep learning model that can distinguish between reflection areas and normal areas, generate a binary mask to guide image repair, and solve the character missing problem caused by metal reflection. The query combination label refers to the equipment identification formed by combining key fields, which connects the manufacturer and equipment name with underscores to realize accurate matching and dynamic expansion of the template. The structured parsing template contains field positioning rules and data standardization rules, which establish the mapping relationship between text blocks and standard fields through spatial position relationship or keyword anchor points.
[0031] Specifically, after edge detection and contour analysis of the original image, geometric correction is performed by calculating the transformation matrix to eliminate trapezoidal distortion caused by improper shooting angle. The corrected image is input into the semantic segmentation network to identify the reflective region, and the area of the region is selected to repair the neighborhood or generate the adversarial network to repair and restore the character information hidden by the reflection. When the enhanced image is subjected to OCR recognition, the text features are strengthened by combining attention mechanism, accurate segmentation is realized through vertical projection analysis and character classification, and context correction is performed by using industry dictionary. The extracted manufacturer and equipment name field is standardized to generate a unique identifier, and the template library is searched by combining accurate matching and fuzzy matching. When the matching fails, a graphical configuration interface is started to allow user interactive field mapping relationship to form a reusable new template. Finally, the application parses the template to convert the text block into standardized key-value pairs, and a difference report is automatically generated by multidimensional comparison with the standard parameters of the database.
[0032] Compared with the prior art, the traditional OCR system directly processes the original image, which is easily affected by geometric distortion and reflection interference, and lacks structured processing capability for power equipment nameplates. The present scheme eliminates physical interference factors through multi-stage image processing, and adapts to different formats by combining a dynamic template matching mechanism, solving the adaptability problem of general OCR in professional scenarios. Existing methods often use a single repair algorithm when processing reflective regions, and the present scheme implements differentiated repair strategies based on the area of the reflection to improve repair quality while ensuring processing efficiency. In terms of template matching, traditional systems rely on fixed template libraries, and the present scheme introduces fuzzy matching and user interaction mechanisms to improve the system's ability to adapt to new format nameplates.
[0033] Through the above technical solutions, the present application solves the problems of geometric distortion correction, reflection interference elimination and heterogeneous format adaptation in power equipment nameplate image recognition. It realizes the automatic conversion from the original image to structured data, improves the recognition accuracy and data processing efficiency. Through the dynamic template generation mechanism, the dependence on pre-set templates is reduced, making the system adapt to the format differences of nameplates from different manufacturers and different periods. The standardized key-value pair data generated finally can be directly used for equipment parameter acceptance comparison, greatly reducing the manual intervention link, and providing reliable technical support for power equipment digital management.
[0034] The application further proposes a specific implementation mode of edge detection and contour analysis after obtaining the original power equipment nameplate image. Specifically, the Canny operator or the Sobel operator is used to perform edge detection on the original image to obtain an edge image; a contour finding algorithm is used to find a maximum quadrilateral contour to form a candidate contour set; a perspective transformation matrix is calculated according to the vertices of the quadrilateral contour, or an affine rotation matrix is calculated by detecting the text line edge through the Hough line transformation; the original image is corrected by using the transformation matrix; a pre-trained convolutional neural network is used to perform semantic segmentation on the corrected image to generate a binary mask; and the area of the reflective region is used to select a neighborhood pixel repair or a generative adversarial network repair.
[0035] The Canny operator refers to an edge detection algorithm based on gradient amplitude calculation and double threshold processing, which can be specifically implemented by the steps of Gaussian filter denoising, gradient amplitude and direction calculation, non-maximum suppression and hysteresis threshold processing, and is used to accurately extract the nameplate edge features in a complex background. The contour finding algorithm refers to a method of extracting closed contours in an image through connected component analysis, which can be specifically implemented by traversing the pixel boundary chain code using the Suzuki85 algorithm, and is used to screen out candidate contours representing the nameplate boundary from the edge image. The Hough line transformation refers to a method of detecting straight line features in an image through parameter space accumulation, which can be specifically implemented by accumulating the parameters of straight lines in the polar coordinate system, and is used to calculate the affine transformation parameters through the text line inclination angle when the quadrilateral contour is missing. The generative adversarial network refers to a deep learning model containing a generator and a discriminator, which can be specifically implemented by using a conditional generative adversarial network architecture, and is used for texture synthesis and content repair of large-area reflective regions.
[0036] Specifically, after the original image is subjected to edge detection, the quadrilateral boundary is preferentially located through a contour screening mechanism. When a valid quadrilateral contour is detected, a perspective transformation matrix is constructed based on the vertex coordinates to eliminate the geometric distortion caused by the shooting angle tilt. If the quadrilateral contour cannot be located, the dominant inclination angle is calculated through the Hough line detection of the text line edge, and the image is corrected in the horizontal direction by using affine rotation. The corrected image is input into a binary classification semantic segmentation network, multi-scale features are extracted through convolutional layers, and a reflective region mask is output. For reflective regions of different areas, different repair strategies are adopted: small-area regions are quickly filled by using neighborhood pixel interpolation to avoid excessive calculation; and large-area regions are reconstructed with reasonable texture details by using a generative adversarial network to ensure that the repaired image meets the subsequent OCR recognition requirements.
[0037] Compared with the prior art, the traditional method usually only uses a single perspective transformation or affine transformation for image correction, which is difficult to deal with complex scenes of contour loss or text tilt. The scheme realizes a multi-modal geometric correction strategy through the cooperative mechanism of contour detection and Hough line transformation. The existing anti-reflection repair technology mostly uses a global repair algorithm, resulting in waste of computing resources or loss of details. The scheme dynamically selects a repair method according to the area of the anti-reflection region, optimizes the processing efficiency while ensuring the repair quality.
[0038] Through the above technical solutions, the application can eliminate image distortion caused by shooting angle deviation and improve the robustness of geometric correction in different scenes. Through the regional repair strategy, the normal region information integrity is preserved while the anti-reflection region is accurately repaired, avoiding the image blur or artifact problems caused by traditional methods, and providing high-quality input data for subsequent text recognition.
[0039] The application further proposes specific steps for performing OCR recognition on the enhanced image to generate a preliminary recognized text block set: processing the enhanced image through a text detection network integrated with an attention mechanism module, strengthening the text region features and suppressing background interference, and outputting a text region coordinate set; based on the text region coordinate set, cutting out each text line image from the enhanced image; performing vertical projection analysis on each text line image to find the valleys to determine the initial segmentation points and obtain a candidate character image set; using a pre-trained character classifier to classify and recognize each candidate character image in the candidate character image set and calculate the character confidence thereof; when the character confidence of a candidate character image is lower than a first preset threshold, it is determined as a connected character, and adaptive segmentation is started; the adaptive segmentation includes backtracking to the text line image, adjusting the segmentation point position or inputting it into a dedicated connected character segmentation model for fine segmentation, until the character confidence of all segmented character images is higher than the first preset threshold or cannot be further improved through segmentation, obtaining an optimized character recognition result and the corresponding character confidence thereof; combining the optimized character recognition result in the order of the text lines to form the original recognized text content; inputting the original recognized text content into a context correction module based on the power industry dictionary and the pre-trained language model for processing: for a character whose character confidence is lower than a second preset threshold, generating a candidate character set similar in shape; combining the context semantics to select, from the candidate character set, a character combination that can make the entire word or field have the highest matching degree in the power industry dictionary, and output the final text content after correction; integrating the text region coordinates as the bounding box coordinates, the final text content as the text content, and calculating the confidence of the entire text block based on the character confidence to generate the preliminary recognized text block set.
[0040] The attention mechanism module refers to a neural network component that enhances the features of the text region through dynamic weight distribution, which can be implemented using channel attention or spatial attention mechanism, and is used to suppress background interference and improve the accuracy of text region positioning. The vertical projection analysis refers to a method of finding the wave trough as the character segmentation point by counting the pixel distribution of the text line image in the vertical direction, which can be implemented using histogram statistics combined with gradient detection algorithm, and is used to solve the problem of character sticking or uneven spacing.
[0041] The character classifier refers to a character recognition model trained based on a convolutional neural network, which can be implemented using ResNet or MobileNet architecture, and is used to classify the segmented character images and output the confidence.
[0042] The adaptive segmentation refers to the process of dynamically adjusting the segmentation strategy according to the character confidence, which can be implemented using backtracking segmentation based on threshold judgment or calling a special segmentation model, and is used to optimize the recognition results of low-confidence characters.
[0043] The context correction module refers to a text correction component that combines power industry dictionary and language model, which can be implemented using bidirectional LSTM or Transformer model, and is used to correct recognition errors according to semantic association.
[0044] Specifically, the enhanced image is first located by the text detection network integrated with attention mechanism, and then the text line images are cropped and subjected to vertical projection analysis, and the characters are preliminarily segmented by wave trough detection. After the segmented character images are recognized by the classifier, if the confidence is lower than the threshold, the adaptive segmentation mechanism is triggered to re-segment by adjusting the segmentation point or calling a special model. All character recognition results are combined in order as the original text, and then subjected to context correction by power industry dictionary and language model, to finally generate a text block set containing text content, confidence and coordinates.
[0045] Compared with the prior art, the traditional OCR technology directly recognizes characters on the whole image, without optimization for the problems of power plaque reflection interference, character sticking, etc., resulting in high recognition error rate. The present scheme solves the problem of inaccurate character segmentation through vertical projection analysis and adaptive segmentation, and improves the recognition accuracy in complex scenarios by combining confidence threshold judgment and context correction mechanism. Through the above technical scheme, the present application can accurately segment and recognize the plaque text with reflection, inclination or character sticking, reduce the misrecognition rate through context semantic correction, adapt to the format differences of plaques from different manufacturers, and provide high-reliability text block data basis for subsequent structured analysis.
[0046] The application further proposes a method of locating and extracting preset manufacturer field values and device name field values from the preliminarily identified text block set, combining the manufacturer field values and the device name field values to generate a query combination label. The specific steps include: traversing the text block set to match a manufacturer keyword set and a device name keyword set, locating text blocks adjacent to the keyword blocks as candidate field values, selecting the content with the highest confidence as an initial value, generating a standardized field value after string cleaning, and connecting the standardized field value with an underscore to form a query combination label.
[0047] The manufacturer keyword set refers to a preset string set containing manufacturer-related words, which can be implemented by using a list containing keywords such as "manufacturer", "manufacturer", "brand", etc. This set is used to quickly filter out text blocks that may contain manufacturer information.
[0048] The text blocks adjacent in spatial position refer to text regions adjacent to the keyword blocks in the horizontal or vertical direction in the image coordinate system, which can be realized by analyzing the geometric relationship of the bounding box coordinates. This feature is based on the rule that field values are usually adjacent to keywords in the layout of nameplates, improving the efficiency of field positioning.
[0049] String cleaning refers to the removal of unnecessary symbols at the beginning and end of the field value, which can be implemented by using an algorithm that matches and replaces characters such as spaces, colons, or quotation marks using regular expressions. This operation can eliminate interference symbols introduced by OCR recognition and improve the standardization of the field.
[0050] Specifically, in the preliminarily identified text block set, first, the manufacturer and device name keyword blocks are located by matching the preset keywords, and then the candidate field values are selected according to the spatial adjacency relationship. The most reliable candidate value is selected by confidence sorting, and the redundant symbols are removed by string cleaning, and finally the standardized manufacturer and device name fields are combined into a query label. This method combines keyword matching and spatial relationship analysis to solve the problem of field positioning difficulty caused by the format difference of nameplates, and uses confidence screening and string cleaning to improve the accuracy of field values.
[0051] Compared with the prior art, the traditional method relies on fixed rules or manual annotation to extract key fields, which is difficult to adapt to the format changes of nameplates from different manufacturers. The present scheme dynamically matches keywords and spatial adjacency relationships, combined with a confidence screening mechanism, can automatically adapt to various layout forms and reduce the dependence on manual template configuration. In addition, the prior art does not consider the possible symbol interference in the OCR recognition result, while the present scheme further improves the standardization of the field value through string cleaning.
[0052] Through the technical solution, the application realizes the automatic extraction and standardization processing of the manufacturer and equipment name fields in the power equipment nameplate, and solves the field positioning error problem caused by the non-uniform format of the nameplate. Through dynamic matching and spatial relationship analysis, the method improves the extraction accuracy of the key fields, and provides a reliable basis for subsequent template matching and data comparison.
[0053] The application further proposes to match the query combination tag with the template library; if the matching is successful, the corresponding structured analysis template is obtained; if the matching fails, the graphical template configuration process is started, the field mapping instructions input by the user based on the preliminary identified text block set are received, a new template is generated, and the new template is associated with the query combination tag and stored in the template library, including the following specific steps: the query combination tag is accurately string matched with the index tags of all stored templates in the template library; if the accurate matching is successful, the corresponding structured analysis template is obtained from the template library; if the accurate matching fails, the text similarity of the query combination tag and each index tag in the template library is calculated, and the text similarity is calculated by any one of the cosine similarity, Jaccard similarity or edit distance algorithm; it is judged whether the highest text similarity is greater than or equal to a preset similarity threshold; if the highest text similarity is greater than or equal to the similarity threshold, it is determined that the fuzzy matching is successful, and the structured analysis template corresponding to the index tag with the highest text similarity is obtained from the template library; if the accurate matching and the fuzzy matching are both unsuccessful, it is determined that the matching fails, and the graphical template configuration process is started; wherein, the graphical template configuration process includes: showing a graphical user interface to the user, wherein the contents of each text block in the preliminary identified text block set and its boundary box coordinates are presented in an interactive list or table form; receiving the standard field name specified by the user for each text block through the interface to form the field mapping instruction; receiving the key field specified by the user from the standard field name through the interface, the key field at least including the field corresponding to the manufacturer field value and the equipment name field value; according to the field mapping instruction and the key field specification, a new template containing field positioning rules and data standardization rules is generated; the new template is associated with the query combination tag, and the association relationship is persistently stored in the template library.
[0054] The query combination tag refers to an identifier generated by combining the manufacturer field value and the equipment name field value, which can be implemented by string splicing, and is used for quickly retrieving the corresponding parsing rule in the template library. The text similarity calculation refers to measuring the similarity between two strings by an algorithm, for example, the cosine similarity algorithm can be used to compare the text distance in the word vector space, so as to find an approximate template when the exact match fails. The graphical template configuration process refers to the process of guiding the user to complete the field mapping through a visual interface, which can be implemented by a drag-and-drop interactive design, facilitating the user to intuitively establish the correspondence between the text block and the standard field. The field positioning rule refers to a logical condition that defines the relative position relationship between text blocks, for example, a keyword anchor point or a coordinate offset can be used for positioning, to ensure that the parsing template can accurately extract the target field.
[0055] Specifically, when the query combination tag cannot find the corresponding template through exact matching or fuzzy matching, the system automatically enters the graphical configuration interface. In this interface, the user can view all identified text blocks and their coordinate positions, and complete the mapping relationship configuration by manually specifying the corresponding standard field name of each text block. The specification of the key field further constrains the generation logic of the template, ensuring that the manufacturer and the equipment name are processed as the core identifier first. The new template is generated and bound to the query combination tag for storage, and when the same combination tag is encountered later, the template can be directly called for parsing.
[0056] Compared with the prior art, the traditional method only supports the mechanical matching of fixed templates and cannot adapt to the diversity of nameplates of different manufacturers. The present scheme solves the problem of template matching failure caused by differences in nameplate layout by introducing a fuzzy matching mechanism and user interactive configuration, while reducing the technical threshold for manually writing parsing rules.
[0057] Through the above technical solutions, the present application can automatically adapt to nameplates of different formats of power equipment, quickly generate customized parsing rules when templates are missing, and improve the coverage and accuracy of structured information extraction. The user only needs to complete a simple mapping operation through a visual interface to establish a new template, avoiding the complex code writing or rule configuration process, and greatly shortening the system deployment and maintenance cycle.
[0058] The present application further proposes a method of using the obtained or generated structured parsing template to parse and field map the set of preliminary identified text blocks and output standardized key-value pair structure data, including loading the structured parsing template to obtain the name of each standard field, field positioning rule and data standardization rule, positioning the corresponding value text block in the set of preliminary identified text blocks according to the field positioning rule and extracting the original field value, applying the data standardization rule to the original field value for processing, and combining the standardized standard field and standardized value to generate key-value pair structure data.
[0059] The field positioning rule refers to a rule for determining the position of a target field through the relative position relationship or keyword anchor point between text blocks, and can be implemented by using a spatial relationship algorithm based on coordinate offset or a keyword matching algorithm, and is used for accurately positioning the target field in a complex layout scenario. The data standardization rule refers to a rule for uniformly formatting and semantically converting the field content, and can be implemented by using a regular expression matching, a unit conversion algorithm, or a predefined format template, and is used for eliminating data heterogeneity caused by different plaque formats. The numerical field processing includes identifying the numerical part and the unit part and performing unit conversion, and can be implemented by extracting the numerical value and the unit through a regular expression and then calling a unit conversion function library, to ensure that the numerical value is stored in a standard unit. The text field processing includes removing invalid characters and normalizing output according to the format, and can be implemented by using a string trimming function and a format template interpolation method, to ensure that the text content conforms to a unified specification.
[0060] Specifically, after the structured parsing template is loaded, the system executes the parsing process one by one according to the field names defined in the template. For each standard field, first, the field positioning rule is used to search for a matching text region in the text block set. For example, when the field positioning rule is defined as "located at the right adjacent position of the keyword 'rated voltage'", the system will scan all the text block contents, find the text block containing "rated voltage", and then extract the right adjacent text block content as the original field value. Subsequently, the data standardization rule is applied to the original field value: if it is a numerical field, the system automatically separates the numerical value and the unit and performs standardization conversion, for example, converts "220kV" to the combination of "220" and "kilo-volt"; if it is a text field, the system removes redundant symbols and reorganizes according to the preset format, for example, cleans "model: ABC-123" to "ABC-123". Finally, all the fields are standardized and output as structured data in the form of key-value pairs.
[0061] Compared with the prior art, the traditional method usually relies on fixed rules or manual configuration when parsing the OCR recognition result, and is difficult to adapt to the format differences of plaques from different manufacturers. The prior art lacks a dynamic field positioning mechanism and a standardization processing flow, resulting in high error rate in parsing and chaotic output data format. The present scheme realizes the configurability of the field positioning rule and the data standardization rule through the structured parsing template, can automatically adapt to different layout formats, and eliminates data expression differences through standardization processing. By the technical solution, the application realizes automatic analysis and standardized output of the power equipment nameplate information, solves the problem that the OCR recognition result is difficult to be directly used due to the non-uniform format of the nameplate. Through dynamic field positioning and standardized rule application, it is ensured that the nameplate data of different sources is converted into a uniform format of key-value pair structure, and the efficiency of subsequent data comparison and acceptance process is improved. The standardized processing process effectively eliminates the problems of non-uniform units, character redundancy, etc., improves the data quality and machine readability, and provides reliable input for automatic acceptance.
[0062] The application further proposes to compare the key-value pair structure data with the standard parameters in the database, and generate a difference comparison report, including retrieving the matching standard equipment record in the database according to the equipment identification information or query combination label in the standardized key-value pair structure data to obtain the corresponding standard parameter set, the standard parameter set containing the standard values of each standard field; fault-tolerant comparison is performed between the standardized value of each field in the key-value pair structure data and the standard value of the corresponding field in the standard parameter set; for numerical value type fields, the standardized value and the standard value are unit converted and normalized to the same dimension, and then the numerical difference is calculated and it is judged whether it exceeds the allowed error threshold; for text type fields, the text similarity between the standardized value and the standard value is calculated and it is judged whether it is lower than the similarity threshold; according to the fault-tolerant comparison result, an comparison state identifier is generated for each field, the comparison state identifier including consistent, inconsistent or missing; based on the comparison state identifier, the standardized value and the standard value of all fields, a structured difference comparison report is automatically generated, the difference comparison report is presented in the form of a table and the fields judged as inconsistent and missing are highlighted.
[0063] Among them, fault-tolerant comparison refers to differentiating numerical value type fields and text type fields through a preset error threshold or similarity threshold, which can be realized by using unit conversion algorithm and text similarity algorithm, solving the misjudgment problem caused by non-uniform units or character recognition errors. The comparison state identifier refers to a state mark generated by logical judgment, which can be realized by using enumeration type or classification label, and is used to intuitively reflect the comparison result of each field. The difference comparison report refers to a visual document that structures the comparison results, which can be realized by using a table generation tool combined with highlight rendering technology, which facilitates quick positioning of abnormal data.
[0064] Specifically, the device identification information or query combination tag is used to retrieve the corresponding standard parameter set from the database to ensure the accuracy of the comparison benchmark. The standardized value of the numerical field is converted to the same dimension as the standard value through unit conversion to eliminate the influence of unit difference on numerical comparison, for example, converting kilovolts to volts before calculating the numerical difference. The similarity calculation of the text field uses cosine similarity or edit distance algorithm, combined with the power industry dictionary for semantic correction, to avoid text inconsistency caused by character misrecognition. When the field comparison result exceeds the preset threshold, it is automatically marked as inconsistent or missing state, and the difference report is displayed in table form to highlight the abnormal fields, and color marking is used to improve readability.
[0065] Compared with the prior art, the existing method usually only performs simple text matching or numerical comparison, lacks fault tolerance processing of unit difference and semantic similarity, and has high misjudgment rate and cannot identify partial matching. The present scheme can automatically process unit conversion and identify text differences with similar semantics by introducing fault tolerance mechanism and differential comparison strategy, thereby reducing the misjudgment risk caused by recognition error or format inconsistency.
[0066] Through the above technical scheme, the present application can automatically identify the subtle differences between standardized data and standard parameters, accurately distinguish numerical errors and text deviations, and generate intuitive difference reports, solving the problems of low efficiency and easy omission of abnormal fields in manual comparison, and improving the accuracy and automation level of power equipment acceptance.
[0067] Embodiment 2 As Figure 2 shown, based on the same inventive concept as the above embodiment, the present application also provides an information extraction device for power equipment nameplate images, which comprises an image preprocessing module, a text block generation module, a label generation module, a template matching module, a structured information extraction module and a comparison module. The image preprocessing module is used for edge extraction and contour analysis of the original image, calculating the transformation matrix and completing the image correction, identifying the reflective region through the semantic segmentation network and repairing to obtain an enhanced image; the text block generation module is used for generating a preliminary recognition text block set containing text content, confidence and bounding box coordinates by performing OCR identification on the enhanced image; the label generation module is used for positioning and extracting the manufacturer and device name field values to generate a query combination label; the template matching module is used for matching the label with the template library, and when the matching fails, starting a graphical template configuration process to generate a new template; the structured information extraction module uses the analysis template to map the text block set to output key-value pair structured data; and the comparison module compares the structured data with the database standard parameters to generate a difference report.
[0068] The image preprocessing module refers to a component that realizes the geometric correction of the nameplate image through edge detection and contour analysis. Specifically, the Canny operator can be used for edge detection, and a perspective transformation can be realized by combining quadrilateral contour positioning, thereby solving the image distortion problem caused by shooting angle deviation. The text block generation module refers to a component that integrates OCR recognition and context correction. Specifically, the text region features can be strengthened using the attention mechanism, and high-precision character segmentation can be realized by combining vertical projection analysis and character classifiers, thereby solving the character blurring problem caused by glare interference. The label generation module refers to a component that generates the equipment identification based on keyword matching and confidence filtering. Specifically, the manufacturer keyword set can be matched to locate adjacent text blocks, and a standardized label can be generated through string cleaning, thereby solving the field positioning difficulty problem caused by the inconsistent format of nameplates. The template matching module refers to a component that supports dynamic template configuration. Specifically, the cosine similarity algorithm can be used for fuzzy matching, and a new template can be generated by receiving user field mapping instructions through a graphical interface when the matching fails, thereby solving the problem of missing analysis rules caused by differences in nameplate formats of different manufacturers.
[0069] Specifically, the workflow of the device includes four stages: image preprocessing, text recognition, template matching, and data comparison. In the image preprocessing stage, after the original image is subjected to edge detection and contour analysis, perspective transformation or affine rotation is selected for geometric correction according to the detection results. Subsequently, the semantic segmentation network is used to identify the glare area, and the neighborhood repair or the generative adversarial network is used to complete image enhancement according to the situation. In the text recognition stage, after the enhanced image is positioned by the text detection network, fine segmentation is realized through vertical projection and character classification, and a high-confidence text block set is generated by combining the context correction with the power industry dictionary. In the template matching stage, the query label is generated by combining the manufacturer and the device name field, and a new template containing field positioning rules is generated through the graphical configuration interface when the matching fails. In the data comparison stage, the structured data and the database standard parameters are subjected to fault-tolerant comparison of numerical fields and similarity calculation of text fields, and a difference report is automatically generated with the abnormal fields highlighted.
[0070] Compared with the prior art, the traditional method relies on manual processing of image distortion and glare interference, and the general OCR system cannot adapt to the diversified layout of power nameplates. The device realizes automatic image enhancement through the geometric correction and glare repair modules, and solves the problem of format differences of nameplates of different manufacturers by using a dynamic template matching mechanism. Compared with existing systems that only use fixed templates, the present scheme can guide users to quickly build new analysis rules when template matching fails, thereby improving the compatibility with historical equipment and new model nameplates.
[0071] By the technical scheme, the application realizes full-process automatic processing of the power equipment nameplate image, eliminates the influence of the shooting angle deviation in the image correction stage, improves the character recognition rate of the reflection area in the text recognition stage through the staged repair strategy, and adapts to the analysis requirements of different format nameplates in the template matching stage through the fuzzy matching and dynamic configuration mechanism. The finally output standardized key-value pair data can be directly compared with the database parameters, reduces the work intensity of manual verification, and solves the problems of high data extraction error rate and the like caused by the non-uniform format in the traditional method.
[0072] Embodiment 3 As Figure 3 indicated, the application further provides an electronic device 100 for implementing the information extraction method of the power equipment nameplate image. The electronic device 100 comprises a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on the at least one processor 102, and at least one communication bus 104.
[0073] The memory 101 can be used to store the computer program 103, and the processor 102 realizes the steps of the information extraction method of the power equipment nameplate image of embodiment 1 by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101.
[0074] The memory 101 can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required by a function (such as a sound playing function, an image playing function, etc.), and the like; and the data storage area can store data (such as audio data) created according to the use of the electronic device 100, and the like. In addition, the memory 101 can comprise a non-volatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device.
[0075] The at least one processor 102 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The processor 102 can be a microprocessor or can also be any conventional processor, etc. The processor 102 is the control center of the electronic device 100, and is connected to various parts of the entire electronic device 100 through various interfaces and lines.
[0076] The memory 101 in the electronic device 100 stores a plurality of instructions to implement an information extraction method for a power equipment nameplate image, and the processor 102 can execute the plurality of instructions to implement: obtain an original power equipment nameplate image, perform edge extraction based on edge detection on the original image to obtain an edge image, perform contour analysis on the edge image to obtain a candidate contour set representing a boundary of the nameplate, calculate a transformation matrix of perspective transformation based on the candidate contour set, perform image correction on the original power equipment nameplate image using the transformation matrix to obtain a perspective corrected image, identify a reflection area in the perspective corrected image using a pre-trained semantic segmentation network to obtain a reflection area mask, and perform image inpainting on the reflection area in the perspective corrected image based on the reflection area mask to obtain an enhanced image; perform OCR recognition on the enhanced image to generate a preliminary recognized text block set, and each text block in the preliminary recognized text block set includes text content, a confidence and a bounding box coordinate; locate and extract a preset manufacturer field value and a device name field value from the preliminary recognized text block set, combine the manufacturer field value and the device name field value to generate a query combined label; match the query combined label with a template library, if the matching is successful, obtain a corresponding structured parsing template, if the matching fails, start a graphical template configuration process, receive a field mapping instruction input by a user based on the preliminary recognized text block set, generate a new template, and store the new template in the template library after associating the new template with the query combined label; use the obtained or generated structured parsing template to parse and map fields of the preliminary recognized text block set, and output standardized key-value pair structured data; compare the key-value pair structured data with standard parameters in a database, and generate a difference comparison report.
[0077] Embodiment 4 The modules / units integrated in the electronic device 100, if implemented in the form of software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms. The computer-readable medium can include any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, and read-only memory (ROM).
[0078] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) including computer-usable program code.
[0079] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the functions specified in one or more flows and / or blocks.
[0080] These computer program instructions can also be stored in a computer-readable memory capable of guiding a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the functions specified in one or more flows and / or blocks.
[0081] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks
[0082] In the description of the present specification, the description of the terms "one embodiment", "an example", "a specific example" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0083] Finally, it should be noted that the above embodiments are merely used to illustrate the technical solutions of the present application but not to limit it, and although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the specific embodiments of the present application can be modified or replaced equivalently without departing from the spirit and scope of the present application, and any modification or equivalent replacement without departing from the spirit and scope of the present application should be covered in the protection scope of the claims of the present application.
Claims
1. An information extraction method of an electric power equipment nameplate image, characterized by, The method comprises the following steps: An original power equipment nameplate image is acquired, and edge extraction based on edge detection is performed on the original image to obtain an edge image; Contour analysis is performed on the edge image to obtain a candidate contour set representing the boundary of the nameplate; and a transformation matrix of perspective transformation is calculated based on the candidate contour set; Image correction is performed on the original power equipment nameplate image by using the transformation matrix to obtain a perspective correction image; a pre-trained semantic segmentation network is used to identify the reflection area of the perspective correction image to obtain a reflection area mask; and image inpainting is performed on the reflection area in the perspective correction image based on the reflection area mask to obtain an enhanced image; OCR recognition is performed on the enhanced image to generate a preliminary recognized text block set; each text block in the preliminary recognized text block set comprises text content, confidence and boundary box coordinates; The pre-set manufacturer field value and the equipment name field value are located and extracted from the preliminary recognized text block set; The manufacturer field value and the equipment name field value are combined to generate a query combined label; The query combined label is matched with a template library; if the matching is successful, a corresponding structured analysis template is acquired; If the matching fails, a graphical template configuration process is started, field mapping instructions input by a user based on the preliminary recognized text block set are received, a new template is generated, and the new template is associated with the query combined label and stored in the template library; The structured analysis template acquired or generated is used to analyze and map the fields of the preliminary recognized text block set, and standardized key-value pair structure data is output; The key-value pair structure data is compared with standard parameters in a database, and a difference comparison report is generated.
2. The information extraction method of an electric power equipment nameplate image according to claim 1, characterized by, An original power equipment nameplate image is acquired, and edge extraction based on edge detection is performed on the original image to obtain an edge image; contour analysis is performed on the edge image to obtain a candidate contour set representing the boundary of the nameplate; and a transformation matrix of perspective transformation is calculated based on the candidate contour set; Image correction is performed on the original power equipment nameplate image by using the transformation matrix to obtain a perspective correction image; a pre-trained semantic segmentation network is used to identify the reflection area of the perspective correction image to obtain a reflection area mask; and image inpainting is performed on the reflection area in the perspective correction image based on the reflection area mask to obtain an enhanced image, comprising the following specific steps: A Canny operator or a Sobel operator is used to perform edge detection on the original power equipment nameplate image to obtain an edge image; A contour finding algorithm is used to process the edge image to find the largest quadrilateral contour to obtain the candidate contour set; Based on the candidate contour set, when a quadrilateral contour is successfully located, a transformation matrix of perspective transformation is calculated according to the four vertices of the quadrilateral contour; when a quadrilateral contour is not located, a Hough line transformation is used to detect the text line edge in the image, the inclination angle of the dominant line is calculated, and an affine rotation transformation matrix is calculated based on the inclination angle; The original power equipment nameplate image is subjected to perspective transformation or affine rotation by using the transformation matrix to obtain a perspective correction image; The pre-trained convolutional neural network is used for semantic segmentation of the reflection area of the perspective correction image, and a binary reflection area mask is output, wherein the convolutional neural network is a binary classification segmentation network for distinguishing reflection areas and normal areas; Based on the reflection area mask, the reflection area in the perspective correction image is repaired: for the reflection area with an area less than a preset threshold, a neighborhood pixel-based image repair algorithm is used for repair; for the reflection area with an area greater than or equal to the preset threshold, a generative adversarial network is used for repair.
3. The information extraction method of a power equipment nameplate image according to claim 2, characterized by, An OCR recognition is performed on the enhanced image to generate a preliminary recognized text block set; each text block in the preliminary recognized text block set includes text content, confidence and bounding box coordinates, including the following specific steps: A text detection network integrated with an attention mechanism module is used to process the enhanced image, to strengthen the features of the text region and suppress the background interference, and to output a text region coordinate set; Based on the text region coordinate set, each text line image is cropped from the enhanced image; A vertical projection analysis is performed on each text line image to find the valleys to determine the initial segmentation points, and a candidate character image set is obtained; A pre-trained character classifier is used to classify and recognize each candidate character image in the candidate character image set, and the character confidence of each candidate character image is calculated; When the character confidence of a candidate character image is lower than a first preset threshold, it is determined to be a connected character, and an adaptive segmentation is started; The adaptive segmentation includes: backtracking to the text line image, adjusting the position of the segmentation point or inputting it into a dedicated connected character segmentation model for fine segmentation, until the character confidence of all segmented character images is higher than the first preset threshold or cannot be further improved by segmentation, to obtain an optimized character recognition result and the corresponding character confidence; The optimized character recognition result is combined in the order of the text lines to form the original recognized text content; The original recognized text content is input into a context correction module based on the power industry dictionary and the pre-trained language model: for the character whose character confidence is lower than a second preset threshold, a candidate character set with similar shapes is generated; combined with the context semantics, the character combination that can make the entire word or field have the highest matching degree in the power industry dictionary is selected from the candidate character set, and the final text content after correction is output; The text region coordinates are integrated as the bounding box coordinates, the final text content is taken as the text content, and the confidence of the entire text block is calculated based on the character confidence, to generate the preliminary recognized text block set.
4. The information extraction method of a power equipment nameplate image according to claim 3, characterized by, From the preliminary recognized text block set, the preset manufacturer field value and the equipment name field value are located and extracted; the manufacturer field value and the equipment name field value are combined to generate a query combination label, including the following specific steps: Each text block in the preliminary recognized text block set is traversed, and its text content is matched with a preset manufacturer keyword set; the manufacturer keyword set includes one or more of manufacturer, factory, factory name, brand and manufacturer; when the content of a text block matches the manufacturer keyword set, the text block is marked as a manufacturer keyword block; Locate, in the set of the preliminary identified text blocks, a text block adjacent to the manufacturer keyword block in spatial position as a first candidate field value; Select, from the first candidate field value, the content of the text block with the highest confidence as the initial value of the manufacturer field; Iterate through each text block in the set of the preliminary identified text blocks, match the text content of the text block with the preset set of device name keywords, and the set of device name keywords includes one or more of product name, model number, device name, and device model number; when the content of a text block matches the set of device name keywords successfully, mark the text block as a device name keyword block; Locate, in the set of the preliminary identified text blocks, a text block adjacent to the device name keyword block in spatial position as a second candidate field value; select, from the second candidate field value, the content of the text block with the highest confidence as the initial value of the device name field; Perform string cleaning on the initial value of the manufacturer field and the initial value of the device name field respectively to remove spaces, colons, and quotation marks at the beginning and end to obtain standardized manufacturer field values and device name field values; Connect the standardized manufacturer field values and device name field values with underscores to generate a query combination tag.
5. The information extraction method of an electric power equipment nameplate image according to claim 4, characterized by, Match the query combination tag with the template library; if a match is successful, obtain the corresponding structured parsing template; If the matching fails, start a graphical template configuration process, receive the field mapping instructions input by the user based on the set of the preliminary identified text blocks, generate a new template, and store the new template in the template library after associating it with the query combination tag, including the following specific steps: Perform exact string matching of the query combination tag with the index tags of all stored templates in the template library; If the exact matching is successful, obtain the corresponding structured parsing template from the template library; If the exact matching fails, calculate the text similarity between the query combination tag and each index tag in the template library, and the text similarity is calculated by any one of cosine similarity, Jaccard similarity, or edit distance algorithm; Determine whether the highest text similarity is greater than or equal to a preset similarity threshold; If the highest text similarity is greater than or equal to the similarity threshold, it is determined that the fuzzy matching is successful, and the structured parsing template corresponding to the index tag with the highest text similarity is obtained from the template library; If neither the exact matching nor the fuzzy matching is successful, it is determined that the matching fails, and the graphical template configuration process is started; The graphical template configuration process includes: Show the graphical user interface to the user, where the content and boundary box coordinates of each text block in the set of the preliminary identified text blocks are presented in an interactive list or table form; Receive the standard field names specified by the user for each text block through the interface to form the field mapping instructions; Receive the key fields specified by the user from the standard field names through the interface, and the key fields at least include the fields corresponding to the manufacturer field values and the device name field values; Generate a new template containing field positioning rules and data standardization rules according to the field mapping instructions and the key fields; Associate the new template with the query combination tag, and persistently store the association relationship in the template library.
6. The information extraction method of a power equipment nameplate image according to claim 5, characterized by, The obtained or generated structured parsing template is used to parse and field map the set of preliminarily identified text blocks, and output standardized key-value pair structured data, including the following specific steps: Load the structured parsing template to obtain the names of each standard field, field positioning rules and data standardization rules defined therein; wherein the field positioning rules are defined based on the relative position relationship between the text blocks or the keyword anchor points; For each standard field defined in the structured parsing template, locate the value text block corresponding to the standard field in the set of preliminarily identified text blocks according to the field positioning rules, and extract the text content thereof as the original field value of the standard field; For each extracted original field value, apply the corresponding data standardization rule for processing: If the field is a numerical field, identify and extract the numerical part and the unit part, and perform unit conversion according to the predefined internal standard unit to output a standardized value containing the numerical value and the standard unit; If the field is a text field, remove the invalid characters at the beginning and end, and standardize the output according to the predefined format; Combine all the standard fields with their corresponding standardized values to generate standardized key-value pair structured data.
7. The information extraction method of a power equipment nameplate image according to claim 6, characterized by, Compare the key-value pair structured data with the standard parameters in the database and generate a difference comparison report, including the following specific steps: According to the device identification information in the standardized key-value pair structured data, or according to the query combination tag, retrieve the matching standard device record in the database to obtain the corresponding standard parameter set, which contains the standard values of each standard field; Compare the standardized value of each field in the key-value pair structured data with the standard value of the corresponding field in the standard parameter set: For numerical fields, after unit conversion and normalization to the same dimension, calculate the numerical difference and determine whether the numerical difference exceeds the preset allowed error threshold for the field; For text fields, calculate the text similarity between the standardized value and the standard value, and determine whether the text similarity is lower than the preset similarity threshold for the field; According to the results of the fault-tolerant comparison, generate a comparison state identifier for each field, which includes consistent, inconsistent or missing; If the numerical difference of the numerical field does not exceed the allowed error threshold, or the text similarity of the text field reaches the similarity threshold, it is determined to be consistent; If the numerical difference of the numerical field exceeds the allowed error threshold, or the text similarity of the text field is lower than the similarity threshold, it is determined to be inconsistent; If the corresponding field cannot be found in the key-value pair structured data or the standard parameter set, it is determined to be missing; Based on the comparison state identifier, the standardized value and the standard value of all fields, automatically generate a structured difference comparison report; The difference comparison report is presented in table form, and the fields determined to be inconsistent and missing are highlighted.
8. An information extraction apparatus of an electric power equipment nameplate image, characterized by comprising: It includes: An image preprocessing module for obtaining an original power equipment nameplate image, performing edge extraction based on edge detection on the original image to obtain an edge image; The edge image is subjected to contour analysis to obtain a candidate contour set representing the boundary of the nameplate; and a transformation matrix of perspective transformation is calculated based on the candidate contour set; The original power equipment nameplate image is subjected to image correction using the transformation matrix to obtain a perspective-corrected image; the perspective-corrected image is subjected to anti-reflection region identification using a pre-trained semantic segmentation network to obtain an anti-reflection region mask; and the anti-reflection region in the perspective-corrected image is subjected to image inpainting based on the anti-reflection region mask to obtain an enhanced image; The text block generation module is configured to perform OCR identification on the enhanced image to generate a set of preliminary identified text blocks; each text block in the set of preliminary identified text blocks includes text content, a confidence level and boundary box coordinates; The label generation module is configured to locate and extract a preset manufacturer field value and a device name field value from the set of preliminary identified text blocks; The manufacturer field value and the device name field value are combined to generate a query combined label; The template matching module is configured to match the query combined label with a template library; if the matching is successful, a corresponding structured analysis template is obtained; If the matching fails, a graphical template configuration process is started, field mapping instructions input by a user based on the set of preliminary identified text blocks are received, a new template is generated, and the new template is associated with the query combined label and stored in the template library; The structured information extraction module is configured to analyze and map the set of preliminary identified text blocks using the obtained or generated structured analysis template to output standardized key-value pair structured data; The comparison module is configured to compare the key-value pair structured data with standard parameters in a database and generate a difference comparison report.
9. An electronic device, comprising: The computer readable storage medium stores at least one instruction, which is executed by the processor to implement the information extraction method of the power equipment nameplate image according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores at least one instruction, which is executed by the processor to implement the information extraction method of the power equipment nameplate image according to any one of claims 1 to 7.