Information extraction method, device and equipment for power equipment nameplate image and medium
Patent Information
- Application Number
- CN202511552258.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2045-10-28
AI Technical Summary
[0003]当前电力行业普遍采用人工抄录铭牌信息的方式,现场拍摄环节受作业环境限制,工人难以保持垂直拍摄角度,导致获取的铭牌图像普遍存在梯形畸变和旋转偏移,传统OCR技术直接处理此类变形图像时识别准确率骤降
本发明通过图像矫正、反光修复及智能模板匹配技术,解决铭牌图像变形、反光干扰及非结构化文本转换难题,具有提升铭牌图像识别准确率、自动化处理反光干扰及实现非结构化文本到标准化数据的智能转换的优点。本发明提供的一种电力设备铭牌图像的信息提取装置、电子设备和计算机可读存储介质同样解决了背景技术部分提出的问题。
Smart Images

Figure CN121388005B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital management technology for power equipment, and specifically relates to a method, apparatus, equipment and medium for extracting information from the nameplate image of power equipment. Background Technology
[0002] Power equipment asset management is a core aspect of power grid operation and maintenance. Among them, equipment nameplates, as carriers of key parameter information, directly affect the reliability of equipment lifecycle management through accurate identification and acceptance.
[0003] Currently, the power industry generally uses manual transcription of nameplate information. Due to the limitations of the working environment, workers find it difficult to maintain a vertical shooting angle during the on-site shooting process, resulting in trapezoidal distortion and rotational offset in the acquired nameplate images. When traditional OCR technology directly processes such deformed images, the recognition accuracy drops sharply. Summary of the Invention
[0004] The purpose of this application is to provide a method, apparatus, device and medium for extracting information from the nameplate image of power equipment, which has the advantages of improving the accuracy of nameplate image recognition, automatically processing reflective interference and realizing intelligent conversion of unstructured text to standardized data.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for extracting information from images of nameplates of power equipment, comprising: The process involves acquiring the original power equipment nameplate image, performing edge extraction based on edge detection to obtain an edge image, performing contour analysis on the edge image to obtain a set of candidate contours representing the nameplate boundary, calculating the perspective transformation matrix based on the candidate contour set, applying the transformation matrix to the original power equipment nameplate image to obtain a perspective-corrected image, using a pre-trained semantic segmentation network to identify reflective areas in the perspective-corrected image to obtain a reflective area mask, and performing image inpainting on the reflective areas in the perspective-corrected image based on the reflective area mask to obtain an enhanced image. OCR recognition is performed on the enhanced image to generate a preliminary set of recognized text blocks; each text block in the preliminary set of recognized text blocks includes text content, confidence score, and bounding box coordinates; From the initial identified text block set, locate and extract the preset manufacturer field value and device name field value; combine the manufacturer field value and device name field value to generate query combination tags; The query combination tags are matched with the template library; if the match is successful, the corresponding structured parsing template is obtained; if the match fails, the graphical template configuration process is started, the field mapping instructions input by the user based on the preliminary recognition text block set are received, a new template is generated, and the new template is associated with the query combination tags and stored in the template library. Using the acquired or generated structured parsing template, the preliminarily identified text block set is parsed and its fields are mapped to output standardized key-value pair structured data; The key-value pair structure data is compared with the standard parameters in the database, and a difference comparison report is generated.
[0006] The above solution addresses the common problems of image distortion and reflection interference in on-site shooting through integrated robust image preprocessing, laying the foundation for subsequent high-precision OCR recognition. By querying and combining tags for generation and adaptive template matching, it solves the problem of inconsistent parsing due to the diverse formats of nameplates, realizing intelligent conversion from unstructured text to structured data. Finally, through automatic comparison with standard parameters, it transforms manual acceptance work into automated data verification, improving the efficiency and accuracy of power equipment asset information entry and acceptance, forming a complete digital closed loop.
[0007] Further, the 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 set of candidate contours representing the nameplate boundary; based on the candidate contour set, the transformation matrix of perspective transformation is calculated; using the transformation matrix, the original power equipment nameplate image is corrected to obtain a perspective-corrected image; a pre-trained semantic segmentation network is used to identify reflective areas in the perspective-corrected image to obtain a reflective area mask; based on the reflective area mask, the reflective areas in the perspective-corrected image are inpainted to obtain an enhanced image, including the following specific steps: Edge detection is performed on the original power equipment nameplate image using the Canny or Sobel operator to obtain the edge image; The edge image is processed using a contour detection algorithm to find the largest quadrilateral contour and obtain a set of candidate contours. Based on the candidate contour set, when a quadrilateral contour is successfully located, the transformation matrix of perspective transformation is calculated based on the four vertices of the quadrilateral contour; when a quadrilateral contour is not located, the edges of text lines in the image are detected by Hough line transformation, the tilt angle of the dominant line is calculated, and the transformation matrix of affine rotation is calculated based on the tilt angle. The original power equipment nameplate image is subjected to perspective transformation or affine rotation using a transformation matrix to obtain a perspective-corrected image. A pre-trained convolutional neural network is used to perform semantic segmentation of reflective regions in perspective-corrected images, and a binary reflective region mask is output. The convolutional neural network is a binary classification segmentation network used to distinguish between reflective regions and normal regions. Based on a reflective area mask, image inpainting is performed on reflective areas in perspective-corrected images: for reflective areas with an area smaller than a preset threshold, a neighborhood pixel-based image inpainting algorithm is used for inpainting; for reflective areas with an area greater than or equal to the preset threshold, a generative adversarial network is used for inpainting.
[0008] The above scheme, by combining contour and text line detection, ensures correction even when nameplate boundaries are indistinct, improving the robustness and applicability of the preprocessing stage. By differentiating the area of reflective regions and employing different restoration strategies, an optimal balance between restoration effect and computational efficiency is achieved: rapid restoration is used for small areas, while GANs are used to generate more reasonable character content for large areas of severe reflection, enhancing the ability to obtain clear and well-organized nameplate images in complex on-site environments.
[0009] Furthermore, OCR recognition is performed on the enhanced image to generate a preliminary set of recognized text blocks. Each text block in the preliminary set includes text content, confidence score, and bounding box coordinates, including the following specific steps: The enhanced image is processed by a text detection network with an integrated attention mechanism module to strengthen text region features and suppress background interference, and output a set of text region coordinates. Based on the set of text region coordinates, each text line image is cropped from the enhanced image; Vertical projection analysis is performed on each text line image to find the troughs to determine the initial segmentation point, thus obtaining a set of candidate character images; A pre-trained character classifier is used to classify and recognize each candidate character image in the candidate character image set, and its character confidence score is calculated. When the character confidence score of a candidate character image is lower than a first preset threshold, it is determined to be a contiguous character, and adaptive segmentation is initiated. The adaptive segmentation includes: backtracking to the text line image, adjusting the segmentation point position or inputting it into a dedicated contiguous character segmentation model for fine segmentation, until the character confidence score of all segmented character images is higher than the first preset threshold or cannot be further improved by segmentation, thus obtaining the optimized character recognition result and its corresponding character confidence score. The optimized character recognition results are combined in the order of text lines to form the original recognized text content; The original recognized text content is input into the context correction module based on the power industry dictionary and pre-trained language model for processing: for characters whose confidence is lower than the second preset threshold, a set of candidate characters with similar shapes is generated; combined with the context semantics, the character combination that makes the whole word or field match the most in the power industry dictionary is selected from the candidate character set, and the final corrected text content is output. The text region coordinates are integrated as bounding box coordinates, the final text content is used as text content, and the confidence of the entire text block is calculated based on the confidence of each character to generate a preliminary set of recognized text blocks.
[0010] The above solution improves character recognition accuracy in complex scenarios through a dual approach of adaptive segmentation and context-based error correction. Adaptive segmentation specifically addresses traditional OCR challenges such as character adhesion and breakage, ensuring accurate character segmentation by dynamically adjusting the segmentation strategy. The context-based error correction module utilizes prior knowledge from the power industry to resolve misrecognition issues of similar-looking characters (such as 'O' and '0'). The combination of these two techniques allows the solution to maintain extremely high recognition reliability even when dealing with low-quality nameplate images.
[0011] Furthermore, from the initially identified text block set, the preset manufacturer field value and device name field value are located and extracted; the manufacturer field value and device name field value are combined to generate query combination tags, including the following specific steps: Iterate through each text block in the initially identified text block set and match its text content with a preset set of manufacturer keywords; the set of manufacturer keywords includes one or more of manufacturer, factory, factory name, brand, and producer; when the content of a text block successfully matches the set of manufacturer keywords, the text block is marked as a manufacturer keyword block; In the initial identification of the text block set, the text block that is spatially adjacent to the manufacturer keyword block is selected as the first candidate field value; from the first candidate field values, the text block content with the highest confidence is selected as the initial value of the manufacturer field; Iterate through each text block in the initially identified text block set and match its text content with a preset set of device name keywords. The set of device name keywords includes one or more of the following: product name, model, device name, and device model. When the content of a text block matches the set of device name keywords, mark the text block as a device name keyword block. In the initial set of identified text blocks, the text block that is spatially adjacent to the device name keyword block is selected as the second candidate field value; from the second candidate field values, the text block content with the highest confidence is selected as the initial value of the device name field. The initial values of the Manufacturer field and the Equipment Name field are cleaned by removing leading and trailing spaces, colons, and quotation marks to obtain standardized values for the Manufacturer field and the Equipment Name field. Connect the standardized manufacturer field value and the device name field value with an underscore to generate query combination labels.
[0012] The above solution, by combining keyword set matching and spatial relationship analysis, can accurately locate the two core fields of manufacturer and equipment name in messy text blocks. Subsequent cleaning and standardization operations eliminate impurities in the original identification results, ensuring the standardization and uniqueness of the generated query combination tags, and providing a reliable indexing basis for accurate and efficient matching in the subsequent template library.
[0013] Furthermore, the query combination tags are matched against the template library; if a match is successful, the corresponding structured parsing template is obtained; if a match fails, the graphical template configuration process is initiated, receiving the field mapping instructions input by the user based on the initially recognized text block set, generating a new template, and storing the new template in the template library after associating it with the query combination tags. This includes the following specific steps: Perform exact string matching between the query combination tags and the index tags of all existing templates in the template library; If an exact match is found, the corresponding structured parsing template is retrieved from the template library; If an exact match fails, the text similarity between the query combined tags and each index tag in the template library is calculated. The text similarity is calculated using any one of the cosine similarity, Jaccard similarity, or edit distance algorithms. Determine whether the highest text similarity score is greater than or equal to a preset similarity threshold; If the highest text similarity is greater than or equal to the similarity threshold, the fuzzy matching is considered successful, and the structured parsing template corresponding to the index tag with the highest text similarity is obtained from the template library. If neither exact match nor fuzzy match is successful, the match is deemed to have failed, and the graphical template configuration process is initiated. The graphical template configuration process includes: Present the user with a graphical user interface, in which the content of each text block in the initially identified text block set and its bounding box coordinates are presented in an interactive list or table format. Receive the standard field names specified by the user for each text block through the interface, and form field mapping instructions; Receive key fields specified by the user from standard field names through the interface. The key fields include at least the fields corresponding to the manufacturer field value and the device name field value. Based on the field mapping instructions and key field specifications, generate a new template that includes field location rules and data standardization rules; Associate the new template with the query combination tags and persist this association to the template library.
[0014] The above solution, through a two-tiered retrieval strategy ranging from precise matching to fuzzy matching, first ensures rapid response for known nameplate formats. When encountering a completely new format, the graphical configuration process guides users through simple mapping configurations, integrating the new template into the system and achieving zero-coding self-expansion of the template library. This fundamentally solves the limitations of traditional methods that require pre-defining all templates and cannot adapt to device model updates, giving the system strong vitality and practicality.
[0015] Furthermore, using the acquired or generated structured parsing template, the initially identified text block set is parsed and its fields mapped to output standardized key-value pair structured data, including the following specific steps: Load the structured parsing template and obtain the names, field positioning rules, and data standardization rules of each standard field defined therein; among them, the field positioning rules are defined based on the relative positional relationship between text blocks or keyword anchors; For each standard field defined in the structured parsing template, according to its field location rules, the corresponding value text block is located in the preliminary identified text block set, and its text content is extracted as the original field value of the standard field. For each extracted raw field value, its corresponding data standardization rule is applied for processing: If the field is a numeric field, the numeric part and the unit part are identified and extracted, and the unit conversion is performed according to the predefined internal standard unit to output a standardized value containing the numeric value and the standard unit. If the field is a text field, remove invalid characters at the beginning and end, and output it in a normalized format according to the predefined format; All standardized fields are combined with their corresponding standardized values to generate standardized key-value pair structured data.
[0016] The above solution, through the application of predefined positioning rules in the template, enables the system to intelligently map text blocks recognized by OCR to specific semantic fields. Furthermore, by executing data standardization rules (such as unit conversion and format standardization), it ensures that the final output key-value pairs conform to the standards of computer processing and database storage, providing a high-quality and highly consistent data foundation for subsequent data comparison, analysis, and application.
[0017] Furthermore, 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: Based on the device identification information in the standardized key-value pair structure data, or based on the query combination tags, the matching standard device records are retrieved in the database to obtain the corresponding standard parameter set, which contains the standard values of each standard field. Perform a fault-tolerant comparison between the standardized value of each field in the key-value pair structured data and the standard value of the corresponding field in the standard parameter set: For numerical fields, after converting and normalizing the standardized value and the standard value to the same dimension, the numerical difference is calculated, and it is determined whether the numerical difference exceeds the preset allowable error threshold for the field. For text fields, calculate the text similarity between the normalized value and the standard value, and determine whether the text similarity is lower than the preset similarity threshold for the field; Based on the results of the fault-tolerant comparison, a comparison status identifier is generated for each field, which includes consistent, inconsistent, or missing. If the numerical difference of a numeric field does not exceed the allowable error threshold, or the text similarity of a text field reaches the similarity threshold, then they are considered to be consistent. If the numerical difference of a numeric field exceeds the allowable error threshold, or the text similarity of a text field is lower than the similarity threshold, then 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 status identifiers, standardized values, and standard values of all fields, a structured difference comparison report is automatically generated; The discrepancy comparison report is presented in tabular form, highlighting fields that are judged to be inconsistent or missing.
[0018] The above solution avoids false alarms caused by minor identification errors or reasonable tolerances by setting differentiated fault-tolerant comparison strategies (such as error thresholds and similarity thresholds) for different types of fields (numerical and textual), making the comparison results more consistent with engineering realities. The automatically generated structured report intuitively highlights differences and missing items, greatly reducing the workload of manual verification and making on-site acceptance work more efficient, accurate, and standardized.
[0019] In a second aspect, the present invention provides an information extraction device for images of nameplates of power equipment, comprising: The image preprocessing module is used to acquire the original power equipment nameplate image, perform edge extraction based on edge detection to obtain an edge image, perform contour analysis on the edge image to obtain a set of candidate contours representing the nameplate boundary, calculate the 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, use a pre-trained semantic segmentation network to identify reflective areas in the perspective-corrected image to obtain a reflective area mask, and perform image inpainting on the reflective areas in the perspective-corrected image based on the reflective area mask to obtain an enhanced image. The text block generation module is used to perform OCR recognition on the enhanced image and generate a preliminary recognition text block set; each text block in the preliminary recognition text block set includes text content, confidence score, and bounding box coordinates; The tag generation module is used to locate and extract preset manufacturer field values and device name field values from the initially identified text block set; and combine the manufacturer field values and device name field values to generate query combination tags; The template matching module is used to match query combination tags with the template library. If the match is successful, the corresponding structured parsing template is obtained. If the match fails, the graphical template configuration process is started, which receives the field mapping instructions input by the user based on the preliminary recognition text block set, generates a new template, and stores the new template in the template library after associating it with the query combination tags. The structured information extraction module is used to parse and map fields of the initially identified text block set using the acquired or generated structured parsing template, and output standardized key-value pair structured data. The comparison module is used to compare key-value pair structured data with standard parameters in the database and generate a difference comparison report.
[0020] In a third aspect, the present invention provides an electronic device including a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the information extraction method for the nameplate image of power equipment as described above.
[0021] In a fourth aspect, the present invention provides a computer-readable storage medium storing at least one instruction that, when executed by a processor, implements the information extraction method for the nameplate image of power equipment as described above.
[0022] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention solves the problems of nameplate image distortion, glare interference, and unstructured text conversion by employing image correction, reflection repair, and intelligent template matching technologies. It offers advantages such as improved nameplate image recognition accuracy, automated processing of glare interference, and intelligent conversion of unstructured text into standardized data. The information extraction device, electronic device, and computer-readable storage medium for power equipment nameplate images provided by this invention also address the problems raised in the background section. Attached Figure Description
[0023] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart illustrating a method for extracting information from an image of a power equipment nameplate, according to an embodiment of the present invention. Figure 2 This is a structural block diagram of an information extraction device for power equipment nameplate images according to an embodiment of the present invention; Figure 3 This is a structural block diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0024] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. The components of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0025] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0026] Example 1 In existing technologies, 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 to scenarios such as tickets and license plates, it still has shortcomings in the special application environment of power equipment nameplates. In typical application scenarios, operators need to photograph metal nameplates in complex environments such as substations. Deviations in shooting angles cause geometric distortion of the image, metal reflections cause loss of information in the character area, and differences in the format of nameplates from different manufacturers make it difficult to structure the recognition results, making it difficult for automated recognition systems to directly output standardized data for acceptance comparison.
[0027] To address the aforementioned issues, this solution analyzes and finds that existing technologies fail to solve three core problems: image geometric correction, glare removal, and dynamic template adaptation. For image distortion, an edge detection combined with contour analysis is used to locate the nameplate boundaries. For glare, semantic segmentation technology is studied to identify damaged areas and perform differentiated repair. For layout diversity, a dynamic template generation mechanism based on key fields is proposed. Through the organic integration of a multi-stage processing flow, a complete solution from raw image to structured data is formed.
[0028] like Figure 1 As shown, a method for extracting information from an image of a power equipment nameplate includes steps S1 to 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 set of candidate contours representing the nameplate boundary; calculate the transformation matrix of perspective transformation based on the candidate contour set; use the transformation matrix to perform image correction on the original power equipment nameplate image to obtain a perspective-corrected image; use a pre-trained semantic segmentation network to identify reflective areas in the perspective-corrected image to obtain a reflective area mask; perform image inpainting on the reflective areas in the perspective-corrected image based on the reflective area mask to obtain an enhanced image. S2. Perform OCR recognition on the enhanced image to generate a preliminary set of recognized text blocks; each text block in the preliminary set of recognized text blocks includes text content, confidence level, and bounding box coordinates. S3. From the initially identified text block set, locate and extract the preset manufacturer field value and device name field value; combine the manufacturer field value and device name field value to generate query combination tags; S4. Match the query combination tags with the template library; if the match is successful, obtain the corresponding structured parsing template; if the match fails, start the graphical template configuration process, receive the field mapping instructions input by the user based on the preliminary recognition text block set, generate a new template, and store the new template in the template library after associating it with the query combination tags. S5. Using the acquired or generated structured parsing template, parse and map the fields of the initially identified text block set, and output standardized key-value pair structured data. S6. Compare the key-value pair structure data with the standard parameters in the database and generate a difference comparison report.
[0029] In a more specific embodiment, this solution acquires the original power equipment nameplate image and performs edge detection to obtain an edge image. It then obtains a candidate contour set through contour analysis and calculates a transformation matrix to correct the original image, resulting in a perspective-corrected image. A semantic segmentation network is used to identify and repair reflective areas, generating an enhanced image. OCR is used to recognize and generate a set of text blocks containing text content, confidence levels, and coordinates. The solution also locates and extracts manufacturer and equipment name fields to generate query tags, matches templates to obtain or generate parsing templates, and finally outputs standardized key-value pair data, comparing it with database parameters to generate a discrepancy report.
[0030] Edge detection involves extracting regions of dramatic grayscale changes in an image using mathematical operators, such as the Canny or Sobel operators, to accurately capture the physical boundaries of the nameplate. Contour analysis performs geometric shape detection on the edge image, identifying the nameplate area by finding the largest quadrilateral contour, thus addressing image distortion caused by shooting angle deviations. Perspective transformation calculates a spatial transformation matrix based on the quadrilateral vertices to correct tilted images into a frontal view, ensuring geometric accuracy in subsequent processing. The semantic segmentation network is a pre-trained deep learning model capable of distinguishing between reflective and normal areas, generating a binary mask to guide image restoration and addressing character loss caused by metallic reflections. Query combination tags are device identifiers formed by combining key fields, using underscores to connect the manufacturer and device name, enabling precise template matching and dynamic expansion. The structured parsing template includes field positioning rules and data standardization rules, establishing a mapping relationship between text blocks and standard fields through spatial relationships or keyword anchors.
[0031] Specifically, after edge detection and contour analysis, the original image undergoes geometric correction using a calculated transformation matrix to eliminate trapezoidal distortion caused by improper shooting angle. The corrected image is then input into a semantic segmentation network to identify reflective areas. Based on the area of these areas, neighborhood repair or generative adversarial network (GAN) repair is selected to restore character information obscured by reflections. When performing OCR recognition on the enhanced image, an attention mechanism is used to strengthen text features. Precise segmentation is achieved through vertical projection analysis and character classification, and contextual error correction is performed using an industry dictionary. The extracted manufacturer and device name fields are standardized to generate unique identifiers, and a template library is retrieved using a combination of exact and fuzzy matching. When a match fails, a graphical configuration interface is activated, allowing users to interactively establish field mapping relationships to create reusable new templates. Finally, the parsed template is applied to convert text blocks into standardized key-value pairs. Through multi-dimensional comparison with standard parameters in the database, a difference report is automatically generated.
[0032] Compared to existing technologies, traditional OCR systems, which directly process raw images, are susceptible to geometric distortion and glare interference, and lack structured processing capabilities specifically for power equipment nameplates. This solution eliminates physical interference through multi-stage image processing and combines a dynamic template matching mechanism to adapt to different layouts, solving the adaptability problem of general-purpose OCR in professional scenarios. Existing methods often employ a single repair algorithm when processing reflective areas; this solution implements a differentiated repair strategy based on the reflective area, improving repair quality while maintaining processing efficiency. Regarding template matching, traditional systems rely on a fixed template library; this solution introduces fuzzy matching and user interaction mechanisms, enhancing the system's adaptability to new nameplate layouts.
[0033] Through the above technical solutions, this application solves the problems of geometric distortion correction, anti-glare interference elimination, and heterogeneous format adaptation in the image recognition of power equipment nameplates. It achieves automated conversion from raw images to structured data, improving recognition accuracy and data processing efficiency. The dynamic template generation mechanism reduces reliance on preset templates, enabling the system to adapt to differences in nameplate formats from different manufacturers and time periods. The final standardized key-value pair data can be directly used for equipment parameter acceptance comparison, significantly reducing manual intervention and providing reliable technical support for the digital management of power equipment.
[0034] This application further proposes a specific implementation method for edge detection and contour analysis after acquiring the original power equipment nameplate image. Specifically, it includes: using the Canny or Sobel operator to perform edge detection on the original image to obtain an edge image; using a contour discovery algorithm to find the largest quadrilateral contour to form a candidate contour set; calculating the perspective transformation matrix based on the quadrilateral contour vertices, or calculating the affine rotation matrix by detecting text line edges through Hough line transform; correcting the original image using the transformation matrix; using a pre-trained convolutional neural network to perform semantic segmentation of the reflected area on the corrected image to generate a binary mask; and selecting neighboring pixels for inpainting or using a generative adversarial network for inpainting based on the area of the reflected area.
[0035] Among them, the Canny operator refers to an edge detection algorithm based on gradient magnitude calculation and double thresholding. Specifically, it can be implemented using Gaussian filtering for noise reduction, gradient magnitude and direction calculation, non-maximum suppression, and hysteresis thresholding steps to accurately extract nameplate edge features in complex backgrounds. The contour discovery algorithm is a method for extracting closed contours in an image through connected component analysis. Specifically, it can be implemented using the Suzuki85 algorithm to traverse pixel boundary chain codes, used to filter candidate contours representing nameplate boundaries from edge images. The Hough line transform is a method for detecting straight line features in an image through parameter space accumulation. Specifically, it can be implemented using an accumulator in polar coordinates to statistically analyze straight line parameters, used to calculate affine transformation parameters based on the text line tilt angle when quadrilateral contours are missing. Generative Adversarial Networks (GANs) are deep learning models containing generators and discriminators, specifically implemented using a conditional generative adversarial network architecture, used for texture synthesis and content restoration in large reflective areas.
[0036] Specifically, after edge detection, the original image prioritizes locating quadrilateral boundaries using a contour filtering mechanism. When a valid quadrilateral contour is detected, a perspective transformation matrix is constructed based on its vertex coordinates to eliminate geometric distortion caused by the tilted shooting angle. If the quadrilateral contour cannot be located, the dominant tilt angle is calculated using Hough lines at the text line edges, and affine rotation is used to correct the image's horizontal direction. The corrected image is then input into a binary classification semantic segmentation network, which extracts multi-scale features through convolutional layers and outputs a mask for reflective areas. Differentiated repair strategies are employed for reflective areas of different sizes: small areas are quickly filled using neighboring pixel interpolation to avoid overcomputation; large areas utilize a generative adversarial network to reconstruct reasonable texture details, ensuring that the repaired image meets the requirements of subsequent OCR recognition.
[0037] Compared to existing technologies, traditional methods typically employ only a single perspective or affine transformation for image correction, making it difficult to handle complex scenarios with missing contours or skewed text. This solution implements a multimodal geometric correction strategy through a collaborative mechanism of contour detection and Hough line transform. Existing reflection restoration techniques often use global restoration algorithms, leading to wasted computational resources or loss of detail. This solution dynamically selects the restoration method based on the area of the reflective region, optimizing processing efficiency while ensuring restoration quality.
[0038] Through the above technical solution, this application can eliminate image distortion caused by shooting angle deviation and improve the robustness of geometric correction in different scenarios. By adopting a regional repair strategy, it can accurately repair reflective areas while preserving the integrity of information in normal areas, avoiding image blurring or artifacts caused by traditional methods, and providing high-quality input data for subsequent text recognition.
[0039] This application further proposes specific steps for performing OCR recognition on enhanced images to generate a preliminary set of recognized text blocks: The enhanced image is processed by a text detection network integrating an attention mechanism module to enhance text region features and suppress background interference, outputting a set of text region coordinates; based on the text region coordinate set, each text line image is cropped from the enhanced image; vertical projection analysis is performed on each text line image to find troughs to determine the initial segmentation point, obtaining a set of candidate character images; a pre-trained character classifier is used to classify and recognize each candidate character image in the candidate character image set, and its character confidence score is calculated; when the character confidence score of a candidate character image is lower than a first preset threshold, it is determined to be a contiguous character, and adaptive segmentation is initiated; adaptive segmentation includes backtracking to the text line image, adjusting the segmentation point position, or inputting it into a dedicated contiguous character segmentation model for fine segmentation. The process involves fine segmentation until the character confidence scores of all segmented character images exceed a first preset threshold or cannot be further improved through segmentation, resulting in optimized character recognition results and their corresponding character confidence scores. These optimized character recognition results are then combined according to the text line order to form the original recognized text content. The original recognized text content is then input into a context correction module based on a power industry dictionary and a pre-trained language model for processing. For characters with confidence scores below a second preset threshold, a set of candidate characters with similar shapes is generated. Combining contextual semantics, the module selects the character combination from the candidate character set that achieves the highest matching degree for the entire word or field in the power industry dictionary, outputting the final corrected text content. Finally, the text region coordinates are integrated as bounding box coordinates, and the final text content is used as the text content. Based on the confidence scores of each character, the confidence score of the entire text block is calculated, generating a preliminary set of recognized text blocks.
[0040] The attention mechanism module refers to a neural network component that enhances text region features through dynamic weight allocation. Specifically, it can be implemented using channel attention or spatial attention mechanisms to suppress background interference and improve text region localization accuracy. Vertical projection analysis refers to a method that uses statistical analysis of the pixel distribution in the vertical direction of a text line image to find valleys as character segmentation points. Specifically, it can be implemented using histogram statistics combined with gradient detection algorithms to address issues such as character overlap or uneven spacing.
[0041] A character classifier is a character recognition model trained on a convolutional neural network. Specifically, it can be implemented using ResNet or MobileNet architectures to classify segmented character images and output confidence scores.
[0042] Adaptive segmentation refers to the process of dynamically adjusting the segmentation strategy based on the character confidence level. Specifically, it can be implemented by backtracking segmentation based on threshold determination or by calling a dedicated segmentation model to optimize the recognition results of low-confidence characters.
[0043] The context correction module is a text correction component that combines a power industry dictionary with a language model. Specifically, it can be implemented using a bidirectional LSTM or Transformer model to correct recognition errors based on semantic relevance.
[0044] Specifically, the image enhancement process first locates the coordinates of text regions using a text detection network integrating an attention mechanism. Then, it crops the images of each text line and performs vertical projection analysis, initially segmenting characters using valley detection. After the segmented character images are recognized by a classifier, if the confidence score is below a threshold, an adaptive segmentation mechanism is triggered, adjusting the segmentation points or calling a dedicated model for re-segmentation. All character recognition results are sequentially combined into the original text, which is then used for contextual error correction using a power industry dictionary and language model, ultimately generating a set of text blocks containing text content, confidence scores, and coordinates.
[0045] Compared to existing technologies, traditional OCR technology directly recognizes characters from the entire image without addressing issues such as glare from power nameplates and character adhesion, resulting in a high error rate. This solution addresses inaccurate character segmentation through vertical projection analysis and adaptive segmentation, and improves recognition accuracy in complex scenarios by combining confidence threshold determination and contextual error correction mechanisms. Through the above technical solution, this application can accurately segment and identify nameplate text with reflection, tilt, or character adhesion, reduce the false recognition rate through contextual semantic error correction, adapt to the differences in nameplate formats of different manufacturers, and provide a highly reliable text block data foundation for subsequent structured parsing.
[0046] This application further proposes a method for locating and extracting preset manufacturer and device name field values from a pre-identified text block set, and combining the manufacturer and device name field values to generate query combination tags. Specific steps include: traversing the text block set to match the manufacturer keyword set and the device name keyword set; locating text blocks adjacent to the keyword blocks as candidate field values; selecting the content with the highest confidence as the initial value; performing string cleaning to generate standardized field values; and connecting them with underscores to form query combination tags.
[0047] The manufacturer keyword set refers to a pre-defined set of strings containing manufacturer-related terms, which can be implemented using a list containing keywords such as "manufacturer," "factory," and "brand." This set is used to quickly filter out text blocks that may contain manufacturer information.
[0048] In this context, spatially adjacent text blocks refer to text regions that are horizontally or vertically adjacent to keyword blocks in the image coordinate system. This can be achieved through geometric analysis of bounding box coordinates. This feature is based on the rule that field values in nameplate layouts are usually adjacent to keywords, thus improving field location efficiency.
[0049] String cleaning refers to removing unnecessary symbols at the beginning and end of field values. This can be achieved using algorithms that match and replace characters such as spaces, colons, or quotation marks using regular expressions. This operation eliminates interfering symbols introduced by OCR recognition and improves the standardization of fields.
[0050] Specifically, in the initial identification of text blocks, keyword blocks for manufacturer and equipment names are first located through preset keyword matching. Then, candidate field values are filtered based on spatial adjacency. The most reliable candidate values are selected by confidence ranking, and redundant symbols are removed through string cleaning. Finally, the standardized manufacturer and equipment name fields are combined into query tags. This method combines keyword matching with spatial relationship analysis, solving the problem of difficult field location caused by differences in nameplate formats, while improving the accuracy of field values through confidence filtering and string cleaning.
[0051] Compared to existing technologies, traditional methods rely on fixed rules or manual annotation to extract key fields, making it difficult to adapt to the varying nameplate formats of different manufacturers. This solution, however, dynamically matches keywords with spatial adjacency relationships, combined with a confidence-based filtering mechanism, enabling it to automatically adapt to various layout formats and reducing reliance on manual template configuration. Furthermore, existing technologies do not consider potential symbolic interference in OCR recognition results, while this solution further enhances the standardization of field values through string cleaning.
[0052] Through the above technical solution, this application achieves automated extraction and standardized processing of the manufacturer and equipment name fields in power equipment nameplates, solving the problem of field location errors caused by inconsistent nameplate formats. This method improves the accuracy of key field extraction through dynamic matching and spatial relationship analysis, providing a reliable foundation for subsequent template matching and data comparison.
[0053] This application further proposes matching query combination tags with a template library; if the match is successful, the corresponding structured parsing template is obtained; if the match fails, a graphical template configuration process is initiated, receiving the field mapping instruction input by the user based on the initially recognized text block set, generating a new template, and storing the new template in the template library after associating it with the query combination tags. This includes the following specific steps: performing precise string matching between the query combination tags and the index tags of all existing templates in the template library; if the precise match is successful, obtaining the corresponding structured parsing template from the template library; if the precise match fails, calculating the text similarity between the query combination tags and each index tag in the template library, using any one of cosine similarity, Jaccard similarity, or edit distance algorithms; determining 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... If the fuzzy match is successful, the structured parsing template corresponding to the index tag with the highest text similarity is retrieved from the template library. If neither exact nor fuzzy matching is successful, the match is considered unsuccessful, and the graphical template configuration process is initiated. The graphical template configuration process includes: displaying a graphical user interface to the user, which presents the content of each text block in the initially identified text block set and its bounding box coordinates in an interactive list or table format; receiving the standard field names specified by the user for each text block through the interface, forming a field mapping instruction; receiving the key fields specified by the user from the standard field names through the interface, the key fields at least including fields corresponding to the manufacturer field value and the device name field value; generating a new template containing field positioning rules and data standardization rules based on the field mapping instruction and the key field specification; establishing an association between the new template and the query combination tag, and persistently storing this association in the template library.
[0054] The query combination tag refers to an identifier generated by combining the manufacturer and device name field values. This can be implemented using string concatenation and is used to quickly retrieve the corresponding parsing rules from the template library. Text similarity calculation measures the similarity between two strings using algorithms. For example, a cosine similarity algorithm can be used to compare text distances in the word vector space, thus finding approximate templates when exact matching fails. The graphical template configuration process guides users through the field mapping process via a visual interface. This can be implemented using a drag-and-drop interactive design, allowing users to intuitively establish the correspondence between text blocks and standard fields. Field positioning rules define the logical conditions for the relative positional relationships between text blocks. For example, keyword anchors or coordinate offsets can be used for positioning to ensure that the parsing template accurately extracts the target fields.
[0055] Specifically, when a query combination tag cannot find a corresponding template through exact or fuzzy matching, the system automatically enters a graphical configuration interface. In this interface, users can view all identified text blocks and their coordinates, and manually configure the mapping relationship by specifying the standard field names corresponding to each text block. The specification of key fields further constrains the template generation logic, ensuring that the manufacturer and device names are prioritized as core identifiers. Once a new template is generated, it is bound and stored with the query combination tag; subsequent encounters with the same combination tag can directly call this template for parsing.
[0056] Compared to existing technologies, traditional methods only support mechanical matching of fixed templates, which cannot adapt to the diversity of nameplate formats from different manufacturers. This solution solves the problem of template matching failure caused by differences in nameplate layout by introducing a fuzzy matching mechanism and user-interactive configuration, while also reducing the technical threshold for manually writing parsing rules.
[0057] Through the above technical solution, this application can automatically adapt to different formats of power equipment nameplates, and quickly generate customized parsing rules when templates are missing, thereby improving the coverage and accuracy of structured information extraction. Users only need to complete a simple mapping operation through a visual interface to create new templates, avoiding complex code writing or rule configuration processes, and significantly shortening the system deployment and maintenance cycle.
[0058] This application further proposes a method for parsing and mapping fields of a preliminarily identified text block set using an acquired or generated structured parsing template and outputting standardized key-value pair structured data. The method includes loading a structured parsing template to obtain the names of each standard field, field location rules, and data standardization rules; locating the corresponding value text block in the preliminarily identified text block set according to the field location rules and extracting the original field values; applying data standardization rules to process the original field values; and combining the standardized standard fields and standardized values to generate key-value pair structured data.
[0059] Among them, field location rules refer to the rules for determining the location of target fields through the relative positional relationship between text blocks or keyword anchors. Specifically, this can be implemented using spatial relationship algorithms based on coordinate offsets or keyword matching algorithms, used to accurately locate target fields in complex typesetting scenarios. Data standardization rules refer to the rules for unifying the format and semantic conversion of field content. Specifically, this can be implemented using regular expression matching, unit conversion algorithms, or predefined format templates, used to eliminate data heterogeneity caused by different nameplate formats. Numerical field processing includes identifying the numerical and unit parts and performing unit conversion. Specifically, this can be achieved by extracting the numerical value and unit using regular expressions and then calling a unit conversion function library, ensuring that the numerical value is stored in a standard unit. Textual field processing includes removing invalid characters and outputting according to a standardized format. Specifically, this can be achieved using string trimming functions and format template interpolation methods, ensuring that the text content conforms to a unified standard.
[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, the system first searches for matching text regions in the text block set using field location rules. For example, when the field location rule is defined as "located to the right of the keyword 'rated voltage'", the system will scan all text block contents, find the text block containing "rated voltage", and extract the content of the text block adjacent to its right as the original field value. Subsequently, data standardization rules are applied to the original field values: if it is a numeric field, the system automatically separates the value and unit and performs standardization conversion, such as converting "220kV" to a combination of "220" and "kilovolt"; if it is a text field, the system removes redundant symbols and reorganizes them according to a preset format, such as cleaning "model: ABC-123" into "ABC-123". Finally, after all fields have been standardized, the data is output as structured data in key-value pair format.
[0061] Compared to existing technologies, traditional methods typically rely on fixed rules or manual configuration when parsing OCR recognition results, making it difficult to adapt to differences in nameplate formats from different manufacturers. Existing technologies lack dynamic field location mechanisms and standardized processing flows, resulting in high parsing error rates and inconsistent output data formats. This solution utilizes structured parsing templates to enable configurable field location rules and data standardization rules, automatically adapting to different layout formats while eliminating data representation differences through standardization processing. Through the above technical solution, this application achieves automated parsing and standardized output of power equipment nameplate information, solving the problem that OCR recognition results are difficult to use directly due to inconsistent nameplate formats. By using dynamic field positioning and standardized rule application, it ensures that nameplate data from different sources is converted into a unified key-value pair structure, improving the efficiency of subsequent data comparison and acceptance processes. The standardization process effectively eliminates problems such as inconsistent units and character redundancy, improving data quality and machine readability, and providing reliable input for automated acceptance.
[0062] This application further proposes a method to compare key-value pair structured data with standard parameters in a database and generate a difference comparison report. This includes retrieving matching standard device records in the database based on device identification information or query combination tags in the standardized key-value pair structured data to obtain the corresponding standard parameter set, which contains the standard values of each standard field; performing a fault-tolerant comparison between the standardized value of each field in the key-value pair structured data and the standard value of the corresponding field in the standard parameter set; for numerical fields, performing unit conversion and normalization to the same dimension for the standardized value and the standard value, calculating the numerical difference, and determining whether it exceeds the allowable error threshold; for text fields, calculating the text similarity between the standardized value and the standard value and determining whether it is below the similarity threshold; generating a comparison status identifier for each field based on the fault-tolerant comparison results, which includes consistent, inconsistent, or missing; and automatically generating a structured difference comparison report based on the comparison status identifiers, standardized values, and standard values of all fields. The difference comparison report is presented in tabular form and highlights the fields determined to be inconsistent or missing.
[0063] Among these, fault-tolerant comparison refers to differentiating numerical and textual fields by using preset error or similarity thresholds. This can be achieved using unit conversion algorithms and text similarity algorithms to resolve misjudgments caused by inconsistent units or character recognition errors. Comparison status indicators are status markers generated through logical judgments, which can be implemented using enumerated types or category labels to visually reflect the comparison results for each field. The difference comparison report is a structured and visually summarized document of the comparison results, which can be achieved using table generation tools combined with highlighting technology for quick identification of abnormal data.
[0064] Specifically, equipment identification information or query combination tags are used to retrieve the corresponding set of standard parameters from the database, ensuring the accuracy of the comparison benchmark. Standardized values of numerical fields are converted to the same units as the standard values through unit conversion, eliminating the impact of unit differences on numerical comparisons; for example, kilovolts are converted to volts before numerical difference calculations. Similarity calculations for textual fields use cosine similarity or edit distance algorithms, combined with a power industry dictionary for semantic correction, avoiding inconsistencies caused by character misidentification. When field comparison results exceed a preset threshold, they are automatically marked as inconsistent or missing. A difference report centrally displays abnormal fields in tabular form, while color-coding enhances readability.
[0065] Compared to existing technologies, current methods typically only perform simple text matching or numerical comparison, lacking tolerance for unit differences and semantic similarity, resulting in high false positive rates and the inability to identify partial matches. This solution, by introducing a fault-tolerance mechanism and a differentiated comparison strategy, can automatically handle unit conversion issues and identify semantically similar text differences, reducing the risk of false positives due to recognition errors or format inconsistencies.
[0066] Through the above technical solution, this application can automatically identify subtle differences between standardized data and standard parameters, accurately distinguish between numerical errors and textual deviations, and generate an intuitive difference report. This solves the problems of low efficiency and easy omission of abnormal fields in manual comparison, and improves the accuracy and automation level of power equipment acceptance.
[0067] Example 2 like Figure 2 As shown, based on the same inventive concept as the above embodiments, the present invention also provides an information extraction device for power equipment nameplate images, including an image preprocessing module, a text block generation module, a tag generation module, a template matching module, a structured information extraction module, and a comparison module. The image preprocessing module performs edge extraction and contour analysis on the original image, calculates the transformation matrix and completes image correction, and identifies and repairs reflective areas through a semantic segmentation network to obtain an enhanced image. The text block generation module performs OCR recognition on the enhanced image to generate a preliminary recognition text block set containing text content, confidence level, and bounding box coordinates. The tag generation module locates and extracts the manufacturer and equipment name field values to generate query combination tags. The template matching module matches the tags with a template library; if matching fails, a graphical template configuration process is initiated to generate a new template. The structured information extraction module uses the parsed template to perform field mapping on the text block set and outputs key-value pair structured data. The comparison module compares the structured data with standard parameters in the database to generate a difference report.
[0068] The image preprocessing module is a component that performs geometric correction of nameplate images through edge detection and contour analysis. Specifically, it uses the Canny operator for edge detection and combines it with quadrilateral contour localization to achieve perspective transformation, thus solving the image distortion problem caused by shooting angle deviation. The text block generation module integrates OCR recognition and context correction. Specifically, it uses an attention mechanism to enhance text region features and combines vertical projection analysis and a character classifier to achieve high-precision character segmentation, solving the character blurring problem caused by glare. The label generation module generates device identifiers based on keyword matching and confidence filtering. Specifically, it uses manufacturer keyword set matching to locate adjacent text blocks and generates standardized labels through string cleaning, solving the problem of difficult field location caused by inconsistent nameplate formats. The template matching module supports dynamic template configuration. Specifically, it uses a cosine similarity algorithm for fuzzy matching. When matching fails, it receives user field mapping instructions through a graphical interface to generate a new template, solving the problem of missing parsing rules caused by differences in nameplate formats from different manufacturers.
[0069] Specifically, the device's workflow consists of four stages: image preprocessing, text recognition, template matching, and data comparison. In the image preprocessing stage, the original image undergoes edge detection and contour analysis. Based on the detection results, perspective transformation or affine rotation is selected for geometric correction. Subsequently, a semantic segmentation network identifies reflective areas and, depending on the situation, neighborhood repair or generative adversarial networks are used to enhance the image. In the text recognition stage, after the enhanced image is processed by a text detection network to locate text regions, fine-grained segmentation is achieved through vertical projection and character classification. Contextual error correction is performed using a power industry dictionary to generate a high-confidence text block set. In the template matching stage, query tags are generated by combining manufacturer and equipment name fields. When a match fails, a graphical configuration interface is triggered to generate a new template containing field location rules. In the data comparison stage, structured data is compared with standard database parameters using a fault-tolerant method for numerical fields and similarity calculations are performed for textual fields. A difference report is automatically generated, and abnormal fields are highlighted.
[0070] Compared to existing technologies, traditional methods rely on manual processing of image distortion and reflection interference, and general-purpose OCR systems cannot adapt to the diverse layouts of power nameplates. This device achieves automated image enhancement through geometric correction and reflection repair modules, combined with a dynamic template matching mechanism to solve the problem of format differences between nameplates from different manufacturers. Compared to existing systems that only use fixed templates, this solution can guide users to quickly construct new parsing rules when template matching fails, improving compatibility with historical equipment and new model nameplates.
[0071] Through the above technical solution, this application achieves fully automated processing of power equipment nameplate images. In the image correction stage, it eliminates the influence of shooting angle deviations; in the text recognition stage, it improves the character recognition rate in reflective areas through a phased repair strategy; and in the template matching stage, it adapts to the parsing requirements of different nameplate formats through fuzzy matching and dynamic configuration mechanisms. The final output standardized key-value pairs can be directly and intelligently compared with database parameters, reducing the workload of manual verification and solving the problem of high data extraction error rates caused by inconsistent formats in traditional methods.
[0072] Example 3 like Figure 3 As shown, the present invention also provides an electronic device 100 for implementing a method for extracting information from images of nameplates of power equipment; The electronic device 100 includes a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on at least one processor 102, and at least one communication bus 104.
[0073] The memory 101 can be used to store computer program 103. The processor 102 implements the steps of the information extraction method for the nameplate image of power equipment in 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 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the electronic device 100 (such as audio data), etc. In addition, the memory 101 may include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.
[0075] At least one processor 102 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 102 may be a microprocessor or any conventional processor. Processor 102 is the control center of electronic device 100, connecting various parts of electronic device 100 via various interfaces and lines.
[0076] The memory 101 in the electronic device 100 stores multiple instructions to implement a method for extracting information from a nameplate image of power equipment, and the processor 102 can execute multiple instructions to achieve the following: The process involves acquiring the original power equipment nameplate image, performing edge extraction based on edge detection to obtain an edge image, performing contour analysis on the edge image to obtain a set of candidate contours representing the nameplate boundary, calculating the perspective transformation matrix based on the candidate contour set, applying the transformation matrix to the original power equipment nameplate image to obtain a perspective-corrected image, using a pre-trained semantic segmentation network to identify reflective areas in the perspective-corrected image to obtain a reflective area mask, and performing image inpainting on the reflective areas in the perspective-corrected image based on the reflective area mask to obtain an enhanced image. OCR recognition is performed on the enhanced image to generate a preliminary set of recognized text blocks; each text block in the preliminary set of recognized text blocks includes text content, confidence score, and bounding box coordinates; From the initial identified text block set, locate and extract the preset manufacturer field value and device name field value; combine the manufacturer field value and device name field value to generate query combination tags; The query combination tags are matched with the template library; if the match is successful, the corresponding structured parsing template is obtained; if the match fails, the graphical template configuration process is started, the field mapping instructions input by the user based on the preliminary recognition text block set are received, a new template is generated, and the new template is associated with the query combination tags and stored in the template library. Using the acquired or generated structured parsing template, the preliminarily identified text block set is parsed and its fields are mapped to output standardized key-value pair structured data; The key-value pair structure data is compared with the standard parameters in the database, and a difference comparison report is generated.
[0077] Example 4 If the modules / units integrated in the electronic device 100 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, and read-only memory (ROM).
[0078] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0079] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0080] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0081] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0082] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for extracting information from images of nameplates of power equipment, characterized in that, include: Obtain the original image of the power equipment nameplate, and perform edge extraction based on edge detection on the original image to obtain the edge image; Contour analysis is performed on the edge image to obtain a set of candidate contours representing the nameplate boundary; based on the set of candidate contours, the transformation matrix of perspective transformation is calculated. The original power equipment nameplate image is corrected using a transformation matrix to obtain a perspective-corrected image. A pre-trained semantic segmentation network is used to identify reflective areas in the perspective-corrected image, resulting in a reflective area mask. Based on the reflective area mask, image inpainting is performed on the reflective areas in the perspective-corrected image to obtain an enhanced image. Specific steps include: using the Canny or Sobel operator to perform edge detection on the original power equipment nameplate image to obtain an edge image; using a contour discovery algorithm to process the edge image, finding the largest quadrilateral contour to obtain a candidate contour set; based on the candidate contour set, when a quadrilateral contour is successfully located, the perspective transformation matrix is calculated according to the four vertices of the quadrilateral contour; when a quadrilateral contour is not located, the perspective transformation is performed using... The Hough line transform is used to detect text line edges in the image, calculate the tilt angle of the dominant lines, and calculate the transformation matrix of affine rotation based on the tilt angle. The transformation matrix is then used to perform perspective transformation or affine rotation on the original power equipment nameplate image to obtain a perspective-corrected image. A pre-trained convolutional neural network is used to perform semantic segmentation of reflective areas in the perspective-corrected image, outputting a binary reflective area mask. The convolutional neural network is a binary classification segmentation network used to distinguish between reflective and normal areas. Based on the reflective area mask, image inpainting is performed on the reflective areas in the perspective-corrected image: for reflective areas with an area smaller than a preset threshold, a neighborhood pixel-based image inpainting algorithm is used; for reflective areas with an area greater than or equal to the preset threshold, a generative adversarial network is used for inpainting. The enhanced image is subjected to OCR recognition to generate a preliminary set of recognized text blocks. Each text block in the preliminary set includes text content, confidence score, and bounding box coordinates. The specific steps are as follows: the enhanced image is processed by a text detection network with an integrated attention mechanism module to enhance text region features and suppress background interference, outputting a set of text region coordinates; based on the set of text region coordinates, each text line image is cropped from the enhanced image; vertical projection analysis is performed on each text line image to find troughs to determine the initial segmentation point, resulting in a set of candidate character images; a pre-trained character classifier is used to classify and recognize each candidate character image in the candidate character image set, and its character confidence score is calculated. When the confidence score of a candidate character image is lower than the first preset threshold, it is determined to be a connected character, and adaptive segmentation is initiated. Adaptive segmentation includes: backtracking to the text line image, adjusting the segmentation point position or inputting it into a dedicated sticky 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, thus obtaining the optimized character recognition result and its corresponding character confidence; combining the optimized character recognition result according to the text line order 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 a pre-trained language model for processing: for characters whose character confidence is lower than the second preset threshold, generating a set of candidate characters with similar shapes; combining contextual semantics, selecting the character combination that makes the entire word or field match the most in the power industry dictionary from the candidate character set, and outputting the final corrected text content; integrating the text region coordinates as bounding box coordinates and the final text content as text content, and calculating the confidence of the entire text block based on the confidence of each character, generating a preliminary recognized text block set; From the initial identified text block set, locate and extract the preset manufacturer field value and device name field value; combine the manufacturer field value and device name field value to generate query combination tags; The query combination tags are matched with the template library; if the match is successful, the corresponding structured parsing template is obtained; if the match fails, the graphical template configuration process is started, the field mapping instructions input by the user based on the preliminary recognition text block set are received, a new template is generated, and the new template is associated with the query combination tags and stored in the template library. Using the acquired or generated structured parsing template, the preliminarily identified text block set is parsed and its fields are mapped to output standardized key-value pair structured data; The key-value pair structure data is compared with the standard parameters in the database, and a difference comparison report is generated.
2. The method for extracting information from the nameplate image of power equipment according to claim 1, characterized in that, From the initially identified text block set, the preset manufacturer field value and device name field value are located and extracted; the manufacturer field value and device name field value are combined to generate query combination tags, including the following specific steps: Iterate through each text block in the initially identified text block set and match its text content with a preset set of manufacturer keywords; the set of manufacturer keywords includes one or more of manufacturer, factory, factory name, brand, and producer; when the content of a text block successfully matches the set of manufacturer keywords, the text block is marked as a manufacturer keyword block; In the initial identification of the text block set, the text block that is spatially adjacent to the manufacturer keyword block is selected as the first candidate field value; Select the text block with the highest confidence from the first candidate field values and use it as the initial value for the manufacturer field; Iterate through each text block in the initially identified text block set and match its text content with a preset set of device name keywords. The set of device name keywords includes one or more of the following: product name, model, device name, and device model. When the content of a text block matches the set of device name keywords, mark the text block as a device name keyword block. In the initial set of identified text blocks, the text block that is spatially adjacent to the device name keyword block is selected as the second candidate field value; from the second candidate field values, the text block content with the highest confidence is selected as the initial value of the device name field. The initial values of the Manufacturer field and the Equipment Name field are cleaned by removing leading and trailing spaces, colons, and quotation marks to obtain standardized values for the Manufacturer field and the Equipment Name field. Connect the standardized manufacturer field value and the device name field value with an underscore to generate query combination labels.
3. The method for extracting information from the nameplate image of power equipment according to claim 2, characterized in that, The query combination tags are matched with the template library; if a match is found, the corresponding structured parsing template is obtained. If a match fails, the graphical template configuration process is initiated. This process receives the field mapping instructions input by the user based on the initially identified text block set, generates a new template, and stores the new template in the template library after associating it with the query combination tags. The specific steps include the following: Perform exact string matching between the query combination tags and the index tags of all existing templates in the template library; If an exact match is found, the corresponding structured parsing template is retrieved from the template library; If an exact match fails, the text similarity between the query combined tags and each index tag in the template library is calculated. The text similarity is calculated using any one of the cosine similarity, Jaccard similarity, or edit distance algorithms. Determine whether the highest text similarity score is greater than or equal to a preset similarity threshold; If the highest text similarity is greater than or equal to the similarity threshold, the fuzzy matching is considered successful, and the structured parsing template corresponding to the index tag with the highest text similarity is obtained from the template library. If neither exact match nor fuzzy match is successful, the match is deemed to have failed, and the graphical template configuration process is initiated. The graphical template configuration process includes: Present the user with a graphical user interface, in which the content of each text block in the initially identified text block set and its bounding box coordinates are presented in an interactive list or table format. Receive the standard field names specified by the user for each text block through the interface, and form field mapping instructions; Receive key fields specified by the user from standard field names through the interface. The key fields include at least the fields corresponding to the manufacturer field value and the device name field value. Based on the field mapping instructions and key field specifications, generate a new template that includes field location rules and data standardization rules; Associate the new template with the query combination tags and persist this association to the template library.
4. The method for extracting information from the nameplate image of power equipment according to claim 3, characterized in that, Using the acquired or generated structured parsing template, the initially identified text block set is parsed and its fields mapped to output standardized key-value pair structured data, including the following specific steps: Load the structured parsing template and obtain the names, field positioning rules, and data standardization rules of each standard field defined therein; among them, the field positioning rules are defined based on the relative positional relationship between text blocks or keyword anchors; For each standard field defined in the structured parsing template, according to its field location rules, the corresponding value text block is located in the preliminary identified text block set, and its text content is extracted as the original field value of the standard field. For each extracted raw field value, its corresponding data standardization rule is applied for processing: If the field is a numeric field, the numeric part and the unit part are identified and extracted, and the unit conversion is performed according to the predefined internal standard unit to output a standardized value containing the numeric value and the standard unit. If the field is a text field, remove invalid characters at the beginning and end, and output it in a normalized format according to the predefined format; All standardized fields are combined with their corresponding standardized values to generate standardized key-value pair structured data.
5. The method for extracting information from the nameplate image of power equipment according to claim 4, characterized in that, The key-value pair structure data is compared with standard parameters in the database, and a difference comparison report is generated, including the following specific steps: Based on the device identification information in the standardized key-value pair structure data, or based on the query combination tags, the matching standard device records are retrieved in the database to obtain the corresponding standard parameter set, which contains the standard values of each standard field. Perform a fault-tolerant comparison between the standardized value of each field in the key-value pair structured data and the standard value of the corresponding field in the standard parameter set: For numerical fields, after converting and normalizing the standardized value and the standard value to the same dimension, the numerical difference is calculated, and it is determined whether the numerical difference exceeds the preset allowable error threshold for the field. For text fields, calculate the text similarity between the normalized value and the standard value, and determine whether the text similarity is lower than the preset similarity threshold for the field; Based on the results of the fault-tolerant comparison, a comparison status identifier is generated for each field, which includes consistent, inconsistent, or missing. If the numerical difference of a numeric field does not exceed the allowable error threshold, or the text similarity of a text field reaches the similarity threshold, then they are considered to be consistent. If the numerical difference of a numeric field exceeds the allowable error threshold, or the text similarity of a text field is lower than the similarity threshold, then 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 status identifiers, standardized values, and standard values of all fields, a structured difference comparison report is automatically generated; The discrepancy comparison report is presented in tabular form, highlighting fields that are judged to be inconsistent or missing.
6. An information extraction device for an image of a power equipment nameplate, used to implement the information extraction method for an image of a power equipment nameplate as described in claim 1, characterized in that, include: The image preprocessing module is used to acquire the original power equipment nameplate image, perform edge extraction based on edge detection on the original image, and obtain the edge image. Contour analysis is performed on the edge image to obtain a set of candidate contours representing the nameplate boundary; based on the set of candidate contours, the transformation matrix of perspective transformation is calculated. The original power equipment nameplate image is corrected using a transformation matrix to obtain a perspective-corrected image. A pre-trained semantic segmentation network is used to identify reflective areas in the perspective-corrected image to obtain a reflective area mask. Based on the reflective area mask, the reflective areas in the perspective-corrected image are inpainted to obtain an enhanced image. The text block generation module is used to perform OCR recognition on the enhanced image and generate a preliminary recognition text block set; each text block in the preliminary recognition text block set includes text content, confidence score, and bounding box coordinates; The tag generation module is used to locate and extract the preset manufacturer field value and device name field value from the initially identified text block set; Combine the manufacturer field value with the device name field value to generate query combination tags; The template matching module is used to match the query combination tags with the template library; if the match is successful, the corresponding structured parsing template is obtained. If the match fails, the graphical template configuration process is initiated, which receives the field mapping instructions input by the user based on the preliminary recognition of the text block set, generates a new template, and stores the new template in the template library after associating it with the query combination tags. The structured information extraction module is used to parse and map fields of the initially identified text block set using the acquired or generated structured parsing template, and output standardized key-value pair structured data. The comparison module is used to compare key-value pair structured data with standard parameters in the database and generate a difference comparison report.
7. An electronic device, characterized in that, It includes a processor and a memory, the processor being used to execute a computer program stored in the memory to implement the information extraction method for the nameplate image of power equipment as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, which, when executed by a processor, implements the information extraction method for power equipment nameplate images as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Text detection method and device for nameplate image of power equipment
CN110991448A
Power equipment nameplate information extraction method and related device
CN119229429A