An adaptive multi-scale document image detection system and method

The adaptive multi-scale image and text detection system solves the problems of variable image quality, large differences in text scale, and insufficient utilization of context in OCR technology in industrial scenarios. It achieves high-precision and robust automated visual inspection, which is particularly suitable for complex industrial scenarios such as machine tool circuit diagrams.

CN122116367APending Publication Date: 2026-05-29NANJING TALIANG TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING TALIANG TECH CO LTD
Filing Date
2026-04-21
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing OCR technologies suffer from poor accuracy and robustness in complex industrial scenarios due to varying image quality, large differences in text scale, and insufficient utilization of context, making it difficult to meet the requirements of high accuracy, high robustness, and strong logical consistency.

Method used

An adaptive multi-scale image and text detection system is designed, including an adaptive image quality enhancement preprocessing module, an image and text region detection module, an orientation correction module, an OCR image and text recognition module, and a post-processing and logical verification module. It adopts a convolutional recurrent neural network (CRNN) based on a hierarchical context-guided visual feature extraction network and an integrated scale-adaptive attention module to achieve end-to-end detection through adaptive processing and logical verification.

Benefits of technology

It significantly improves the localization accuracy and contextual understanding of text regions in complex scenarios, dynamically adapts to text recognition at different scales, ensures high reliability and logical consistency from the original image to the structured output result, and achieves high-precision and robust automated visual inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122116367A_ABST
    Figure CN122116367A_ABST
Patent Text Reader

Abstract

The application discloses a kind of self-adapting multi-scale graph-text detection system and method, belong to computer vision and artificial intelligence technical field.System includes self-adapting image quality enhancement module, graph-text area detection module, direction correction module, OCR graph-text recognition module and post-processing and logic verification module.The method is realized through the collaborative work of above-mentioned module, and end-to-end detection and identification of image Chinese text under industrial complex scene are realized.The application is aimed at the problem of image quality variability, text scale difference and insufficient use of context information, proposes to use hierarchical context-guided visual feature extraction network for text detection to enhance the global context modeling capability;And integrate scale adaptive attention module in recognition network, through multi-branch hollow convolution and attention mechanism to make model dynamically adapt to text of different sizes.The system and method significantly improve the accuracy, robustness and automation degree in industrial scene such as machine tool circuit diagram recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and artificial intelligence, and in particular to an adaptive multi-scale image and text detection system and method. Background Technology

[0002] Optical Character Recognition (OCR) technology has been widely applied in various scenarios such as document digitization and license plate recognition. Its core typically includes two stages: text detection and text recognition. In text detection, although convolutional neural network (CNN)-based detection models have become mainstream, their receptive fields are limited, making it difficult to effectively model long-range contextual dependencies. Furthermore, they lack the attention guidance mechanism that simulates the human visual process of "whole-to-part," limiting their performance in complex backgrounds and varied layouts in industrial images. In text recognition, while end-to-end models represented by CRNNs show significant results, their convolutional backbone networks have fixed receptive fields. During preprocessing, images often need to be scaled to a uniform size, leading to distortion or blurring of text information with significant scale differences, resulting in insufficient robustness. In addition, images acquired in industrial settings often suffer from noise, blurring, uneven lighting, and other quality defects. Existing general-purpose OCR systems lack targeted adaptive preprocessing capabilities, further restricting their accuracy and reliability in critical industrial scenarios.

[0003] To address multi-scale problems, solutions such as feature pyramid networks have been proposed, but these typically require modifying the entire backbone network, resulting in complex structures and high computational costs. Furthermore, existing technologies often focus on improving single aspects, lacking an end-to-end systematic design encompassing image enhancement, region localization, orientation correction, recognition, and post-verification. This makes it difficult to meet the stringent requirements of high precision, robustness, and strong logical consistency in industrial inspection. Summary of the Invention

[0004] In view of the problems existing in the prior art, the present invention is proposed.

[0005] Therefore, this invention aims to solve the problems of poor accuracy and robustness of OCR in complex industrial scenarios due to variations in image quality, large differences in text scale, and insufficient utilization of context.

[0006] To address the aforementioned technical problems, this invention provides the following technical solution: an adaptive multi-scale image and text detection system, comprising: an adaptive image quality enhancement preprocessing module for performing quality diagnosis on the input image to be detected and dynamically executing corresponding enhancement processing; an image and text region detection module connected to the adaptive image quality enhancement preprocessing module for detecting and locating target image and text regions from the enhanced image; an orientation correction module connected to the image and text region detection module for performing orientation recognition and correction on the target image and text regions; an OCR image and text recognition module connected to the orientation correction module for performing text detection and recognition on the corrected image and text regions; the OCR image and text recognition module includes a text detection network and a text recognition network, wherein the text detection network is a hierarchical context-guided visual feature extraction network, and the text recognition network is a convolutional recurrent neural network (CRNN) integrating a scale-adaptive attention module (SAAM); and a post-processing and logical verification module connected to the OCR image and text recognition module for sorting the recognized text results and comparing and verifying them with a preset standard template sequence.

[0007] In a preferred embodiment of the adaptive multi-scale image and text detection system of the present invention, the adaptive image quality enhancement preprocessing module includes an image quality diagnosis unit and an image correction execution unit. The image quality diagnosis unit is used to analyze the input image and determine the types of quality defects present. The image correction execution unit is connected to the image quality diagnosis unit and is used to dynamically call and execute one or more of the processing links consisting of noise processing, brightness adjustment, deblurring, and advanced correction sub-modules according to the types of quality defects.

[0008] As a preferred embodiment of the adaptive multi-scale image and text detection system of the present invention, the text detection network sequentially includes: a global location awareness module, used to extract global spatial layout features of the input image and generate a global location feature map; a local character feature extraction module, connected to the global location awareness module, used to extract character-level local features under the guidance of the global location feature map; a feature integration module, connected to the global location awareness module and the local character feature extraction module respectively, used to fuse the global location feature map and the local features to generate an integrated feature map for text localization; and a detection head, connected to the feature integration module, used to output the bounding box coordinates of the text region according to the integrated feature map.

[0009] In a preferred embodiment of the adaptive multi-scale image and text detection system of the present invention, the text recognition network comprises a convolutional neural network (CNN) backbone, a scale-adaptive attention module (SAAM), a recurrent neural network sequence decoding module, and a transcription layer connected in sequence. The CNN backbone is used to extract visual feature maps of input text image blocks. The SAAM is connected to the CNN backbone and is used to perform scale-adaptive enhancement on the visual feature maps, outputting enhanced feature maps. The recurrent neural network sequence decoding module is connected to the SAAM and is used to perform sequence context modeling on the enhanced feature maps. The transcription layer is connected to the recurrent neural network sequence decoding module and is used to output the final text recognition result. The SAAM includes a multi-branch dilated convolutional layer and an attention fusion unit, used to perform scale-adaptive enhancement on the feature maps extracted by the CNN backbone.

[0010] As a preferred embodiment of the adaptive multi-scale image and text detection system of the present invention, the post-processing and logical verification module uses the longest common subsequence algorithm to compare and verify the text sequence.

[0011] To address the aforementioned technical problems, this invention also provides an adaptive multi-scale image and text detection method. Employing an adaptive multi-scale image and text detection system, the method further includes the following steps: S1: Performing quality diagnosis and dynamic enhancement on the image to be detected through an adaptive image quality enhancement preprocessing flow; S2: Locating the target image and text region from the enhanced image using an image and text region detection model; S3: Performing orientation recognition and correction on the target image and text region using an orientation correction model; S4: Performing text detection and text recognition on the corrected region using an OCR image and text recognition flow; wherein, text detection is performed using a hierarchical context-guided visual feature extraction network, and text recognition is performed using a convolutional recurrent neural network (CRNN) integrating a scale-adaptive attention module (SAAM); S5: Performing post-processing and logical verification on the recognized text results.

[0012] As a preferred embodiment of the adaptive multi-scale image and text detection method of the present invention, the adaptive image quality enhancement preprocessing process includes: analyzing the image quality defect type, and dynamically selecting and performing one or more of the following combinations: noise processing, brightness adjustment, deblurring, and advanced correction processing based on the diagnostic results.

[0013] As a preferred embodiment of the adaptive multi-scale image-text detection method of the present invention, the text detection steps include: extracting global layout features of the image; extracting local character features under the guidance of global features; fusing features and predicting text bounding boxes.

[0014] As a preferred embodiment of the adaptive multi-scale image-text detection method of the present invention, the text recognition steps include: extracting visual features of text image blocks; performing multi-scale extraction and attention-weighted fusion of the features through the scale adaptive attention module (SAAM) to obtain enhanced features; and performing sequence decoding and transcription output on the enhanced features.

[0015] As a preferred embodiment of the adaptive multi-scale image and text detection method of the present invention, step S5 includes: sorting the identified text according to its spatial location to form a sequence, and comparing it with a preset standard template sequence using the longest common subsequence algorithm to identify and locate errors.

[0016] The beneficial effects of this invention are as follows: By integrating adaptive image quality enhancement, a hierarchical context-guided detection network, and a scale-adaptive attention recognition module, this invention constructs an end-to-end industrial image and text detection system. It can intelligently diagnose and repair various quality defects in input images, providing clean input for subsequent analysis. By simulating a "glance first, focus later" visual mechanism, it significantly improves the localization accuracy and contextual understanding of text regions in complex scenes. In particular, the designed plug-and-play scale-adaptive attention module allows the recognition network to dynamically adapt to text of different scales without changing the input size or main structure, greatly improving the generalization and robustness of the recognition model. The entire system, through streamlined region detection, orientation correction, and logical verification, ensures high reliability and logical consistency from the original image to the structured output result, effectively solving the core challenges faced by image and text character detection and recognition in industrial scenarios, such as variable quality, large scale differences, and strong logical requirements, achieving high-precision and highly robust automated visual detection. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a system flowchart of the present invention.

[0019] Figure 2 This is a schematic diagram of the adaptive image quality enhancement module of the present invention.

[0020] Figure 3 This is a schematic diagram of the text detection network (hierarchical context-guided) structure of the present invention.

[0021] Figure 4This is a schematic diagram of the text recognition network (CRNN integrating SAAM) structure of the present invention.

[0022] Figure 5 This is a schematic diagram of the internal structure of the Scale Adaptive Attention (SAAM) module of the present invention. Detailed Implementation

[0023] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0024] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0025] Secondly, the term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it an embodiment that is mutually exclusive, either alone or selectively, with other embodiments.

[0026] Example 1, referring to Figures 1-5 This is the first embodiment of the present invention, which provides an adaptive multi-scale image and text detection system. The system includes an adaptive image quality enhancement preprocessing module for diagnosing the quality of the input image to be detected and dynamically performing corresponding enhancement processing; an image and text region detection module connected to the adaptive image quality enhancement preprocessing module for detecting and locating target image and text regions from the enhanced image; an orientation correction module connected to the image and text region detection module for orientation recognition and correction of the target image and text regions; and an OCR image and text recognition module connected to the orientation correction module for text detection and recognition of the corrected image and text regions. The OCR image and text recognition module includes a text detection network and a text recognition network. The text detection network is a hierarchical context-guided visual feature extraction network, and the text recognition network is a convolutional recurrent neural network (CRNN) integrating a scale-adaptive attention module (SAAM). A post-processing and logical verification module connected to the OCR image and text recognition module is used to sort the recognized text results and compare them with a preset standard template sequence for verification.

[0027] It is worth noting that this system aims to provide an end-to-end inspection solution for industrial scenarios such as machine tool circuit diagrams. Users can take pictures and upload images to the server via a mobile app to start the process. The preset standard template sequence is derived from a statistical summary of all circuit interface names for a specific machine tool model, including multiple non-repeating labels such as "24V1", "0V", "X01" to "Y12" (where 24V1 and 0V represent the required voltages, X represents the interface in the X-axis direction of the machine tool, and Y represents the interface in the Y-axis direction of the machine tool). This template serves as the benchmark for post-processing verification. The text detection network and text recognition network are two independent but collaborative deep learning models in the OCR image recognition module. The former is responsible for locating all text regions in the image, while the latter is responsible for recognizing the specific character content within each region.

[0028] In this embodiment, the image region detection module is based on the YOLOv8 object detection framework, specifically designed for detecting and locating route map regions from complex backgrounds. Through deep learning technology, it accurately identifies the location of the route map in the image and returns its bounding box coordinates and confidence score. Training process: The network parameters are initialized based on pre-trained weights from YOLOv8n, trained for 150 epochs using a self-labeled dataset, and the optimal model weights are saved. The model receives the input image to be detected, performs forward propagation through the network, predicts the bounding box position, category, and confidence score, and finally returns the bounding box coordinates and confidence score of the detected route map region. The image is then cropped based on the bounding box coordinates to obtain the route map.

[0029] In this embodiment, the orientation correction module is an image orientation classifier based on MobileNetV3-Small, used to identify the rotation direction of an image (0°, 90°, 180°, 270°), providing orientation information for subsequent image processing. A transfer learning strategy is employed, achieving efficient orientation classification through fine-tuning of the pre-trained model. Training process: A pre-trained MobileNetV3-Small is used as the feature extractor. All parameters of the backbone network are frozen, and a new fully connected layer adapted to the four-class classification is designed. Only this connected layer is trained. The model is trained for 100 epochs using a self-labeled dataset, and the optimal model weights are saved. The model receives a line diagram, performs inference through the feature extractor and classification head, and outputs the probabilities of the four orientation classes and the final classification result.

[0030] Specifically, the adaptive image quality enhancement preprocessing module includes an image quality diagnosis unit and an image correction execution unit. The image quality diagnosis unit is used to analyze the input image and determine the types of quality defects. The image correction execution unit is connected to the image quality diagnosis unit and is used to dynamically call and execute one or more of the processing links consisting of noise processing, brightness adjustment, deblurring, and advanced correction sub-modules according to the type of quality defect.

[0031] It's worth noting that the "adaptiveness" of this module is reflected in its dynamic construction of the processing pipeline based on real-time diagnostic results, rather than a fixed process. The image quality diagnostic unit assesses whether the image has defects such as salt-and-pepper noise, Gaussian noise, uneven illumination, motion blur, shadows, or glare. The correction execution unit intelligently calls the corresponding sub-modules: median filtering is used for impulse noise; Gaussian filtering is used for Gaussian noise; the brightness adjustment module comprehensively applies Gamma correction and contrast-limited adaptive histogram equalization (CLAHE) to optimize the dynamic range; the deblurring module estimates the point spread function (PSF) and applies Wiener filtering for deconvolution; the advanced correction module uses the Retinex algorithm to eliminate shadows and uses image inpainting techniques to remove high-brightness glare, thus providing high-quality image input for subsequent steps.

[0032] Specifically, the text detection network sequentially includes: a global location awareness module, used to extract global spatial layout features of the input image and generate a global location feature map; a local character feature extraction module, connected to the global location awareness module, used to extract character-level local features under the guidance of the global location feature map; a feature integration module, connected to the global location awareness module and the local character feature extraction module respectively, used to fuse the global location feature map and the local features to generate an integrated feature map for text localization; and a detection head, connected to the feature integration module, used to output the bounding box coordinates of the text region based on the integrated feature map.

[0033] It's worth noting that this network employs a three-stage hierarchical architecture to simulate the "glance-then-focus" mechanism of human vision, thereby enhancing contextual modeling capabilities. The global location awareness module rapidly scans the entire image to obtain a rough distribution and layout of text regions, its output serving as high-level semantic guidance information. Guided by this global information, the local character feature extraction module focuses on local regions that may contain text, refining the extraction of character features such as strokes and edges, while effectively suppressing background interference. The feature integration module deeply fuses contextual information containing global semantics with detailed local features through feature map addition or concatenation, resulting in features used for prediction that possess both good scene understanding and detail discrimination capabilities. The detection head typically consists of convolutional layers and fully connected layers, responsible for decoding the integrated features into specific text bounding box coordinates and confidence scores.

[0034] Specifically, the text recognition network includes a convolutional neural network (CNN) backbone, a scale-adaptive attention module (SAAM), a recurrent neural network sequence decoding module, and a transcription layer connected in sequence. The CNN backbone is used to extract visual feature maps of input text image blocks. The SAAM is connected to the CNN backbone and is used to perform scale-adaptive enhancement on the visual feature maps, outputting enhanced feature maps. The recurrent neural network sequence decoding module is connected to the SAAM and is used to perform sequence context modeling on the enhanced feature maps. The transcription layer is connected to the recurrent neural network sequence decoding module and is used to output the final text recognition result. The SAAM includes a multi-branch dilated convolutional layer and an attention fusion unit, used to perform scale-adaptive enhancement on the feature maps extracted by the CNN backbone.

[0035] It's worth noting that this recognition network is an enhancement of the classic CRNN architecture. The convolutional neural network (CNN) backbone (such as variants of VGG or ResNet) first extracts basic visual feature maps from a cropped single text image patch. This feature map is then fed into a plug-and-play SAAM module, which captures multi-scale features across different receptive fields through multiple parallel settings of dilated convolutional branches with varying dilation rates (e.g., dilation rates of 1, 2, and 4). The attention fusion unit analyzes the features output from each branch through a lightweight fully connected network, dynamically generating a set of weights that reflect the importance of each branch's features at the scale of the current input text. Finally, the multi-scale features are fused through a weighted summation, outputting an enhanced feature map that is most sensitive to and robust to the current text scale. This enhanced feature map is then serialized and fed into a recurrent neural network (such as LSTM) to capture inter-character contextual dependencies, and finally decoded into a text string by a connectionist temporal classification (CTC) transcription layer, effectively addressing the problem of inadequacy in recognizing text with a fixed receptive field and varying scales.

[0036] Specifically, the post-processing and logic verification module uses the longest common subsequence algorithm to compare and verify the text sequences;

[0037] It's worth noting that this module first sorts the recognized text information based on the coordinates of the text boxes output by the OCR detection network (e.g., from left to right, from top to bottom), resulting in an ordered sequence of recognized text. Then, it compares this sequence with a standard template sequence pre-stored in the system backend, tailored to a specific machine tool interface. The comparison uses the Longest Common Subsequence (LCS) algorithm, which identifies the longest common component between two sequences. By analyzing the differences between the recognized sequence and the template sequence, this module can accurately identify three types of errors: "disordered" (text order is incorrect), "missing" (expected text is not recognized), and "redundant" (extra text is recognized). It can also pinpoint the specific location of the error in the image or result, thus achieving logical-level verification based on domain knowledge, greatly improving the reliability of the system output.

[0038] In use, the system's workflow is as follows: The machine tool circuit diagram uploaded by the user is first intelligently analyzed and repaired by the adaptive image quality enhancement preprocessing module to obtain a clear and standardized image. Subsequently, the image and text region detection module (based on the YOLOv8n model training) accurately selects the entire circuit diagram region from the image. The orientation correction module (based on a four-class classification model fine-tuned by MobileNetV3-Small) determines and rotates the region to the positive orientation. The corrected region is then sent to the OCR image and text recognition module, where the text detection network first locates the bounding boxes of all character labels within the region, and the text recognition network (CRNN integrating SAAM) then recognizes the characters within each box one by one. Finally, all recognition results are sorted and compared with a standard template, and the post-processing and logical verification module outputs the final structured results and error annotations, completing the entire process from the original image to intelligent analysis.

[0039] Example 2, refer to Figures 1-5 This is the second embodiment of the present invention, which provides an adaptive multi-scale image and text detection method.

[0040] The method includes the following steps: S1: Perform quality diagnosis and dynamic enhancement on the image to be detected through an adaptive image quality enhancement preprocessing process; S2: Locate the target image region from the enhanced image using an image region detection model; S3: Perform orientation recognition and correction on the target image region using an orientation correction model; S4: Perform text detection and text recognition on the corrected region using an OCR image recognition process; wherein, text detection is performed using a hierarchical context-guided visual feature extraction network, and text recognition is performed using a convolutional recurrent neural network (CRNN) integrating a scale-adaptive attention module (SAAM); S5: Perform post-processing and logical verification on the recognized text results;

[0041] It is worth noting that this method is applied to intelligent inspection scenarios of industrial machine tool circuits. Steps S1 to S5 constitute a complete automated processing chain, with the input being the original image captured by the user and the output being verified structured text information and possible error reports. Text detection and recognition are the core components of this method, handled by two specially optimized deep learning models, which together solve the challenge of text localization and recognition in complex industrial images.

[0042] Specifically, the adaptive image quality enhancement preprocessing procedure includes: analyzing the type of image quality defects, and dynamically selecting and performing one or more of the following processes based on the diagnostic results: noise processing, brightness adjustment, deblurring, and advanced correction processing.

[0043] It's worth noting that this process relies on an intelligent unit integrating multiple image processing algorithms. The diagnostic phase evaluates the image, detecting features such as motion blur and localized shadows. The processing phase dynamically constructs an execution chain: first, a deblurring sub-process is invoked, using Wiener filtering combined with the estimated blur kernel for restoration; then, the Retinex algorithm in the advanced correction sub-process is called to eliminate shadows. This "diagnosis-decision-execution" model avoids fixed and redundant processing of all images, significantly improving preprocessing efficiency and targeting, and ensuring optimal image quality input to subsequent models.

[0044] Specifically, the text detection steps include: extracting global layout features of the image; extracting local character features under the guidance of global features; fusing features and predicting text bounding boxes;

[0045] It's worth noting that this step is specifically executed by the hierarchical context-guided visual feature extraction network. First, the network's global location awareness module extracts a global semantic feature map of the entire image through a series of downsampling convolutional layers. This feature map contains coarse information about "where the text might be distributed in the image." Next, the local character feature extraction module, guided by the aforementioned global feature map, focuses on relevant regions and extracts detailed character features through more refined convolutional operations. Finally, the feature integration module fuses the global and local features to form a composite feature representation that combines macroscopic scene understanding and microscopic detail discrimination, which is then decoded by the detection head to obtain the precise text box coordinates. This process simulates the human visual cognitive path from the whole to the part.

[0046] Specifically, the text recognition steps include: extracting visual features of text image blocks; performing multi-scale extraction and attention-weighted fusion of the features through the scale-adaptive attention module (SAAM) to obtain enhanced features; and performing sequence decoding and transcription output on the enhanced features.

[0047] It's worth noting that this step is the inference process of the enhanced CRNN network. First, the CNN backbone network convolves the cropped individual text image patches, outputting an initial visual feature map. Then, this feature map is fed into the SAAM module, which processes the data in parallel through multiple convolutional branches with different dilation rates to capture feature patterns across different scales. Simultaneously, a lightweight attention network analyzes these multi-scale features and generates a set of adaptive weights to weight and sum the outputs of each branch, dynamically enhancing the feature channels most effective for the current text size, suppressing invalid information, and outputting a scale-enhanced feature map. This enhanced feature is then serialized, and the character sequence context is modeled by an RNN (such as a bidirectional LSTM). Finally, the recognized text string, such as "X01" or "24V1", is output through the CTC decoder.

[0048] Specifically, step S5 includes: sorting the identified text according to spatial location to form a sequence, and comparing it with a preset standard template sequence using the longest common subsequence algorithm to identify and locate errors;

[0049] It's worth noting that this step is crucial for achieving high reliability in industrial inspection. The system sorts all recognition results based on the spatial coordinates of the detected text boxes (e.g., the x and y coordinates of the center point), generating an ordered recognition sequence ["24V1", "0V", "X01", ...]. Simultaneously, the system stores a standard sequence template for the machine tool interface in the background. By calculating the longest common subsequence (LCS) between the recognition sequence and the template sequence, the differences between the two can be accurately compared. For example, if the recognition sequence is missing "X03", the LCS algorithm can determine it as a "missing" error; if the order of "X02" and "X03" is reversed, it is determined as an "out of order" error. The system outputs the error type and its specific location in the sequence, thus achieving automated logical verification.

[0050] In practice, this method works as follows: First, adaptive quality optimization is performed on the input industrial site image to eliminate external interference. Then, two-level localization (first finding the route map area, then correcting its orientation) ensures that the area to be identified is standardized and oriented correctly. Next, a hierarchical context detection network is used to accurately locate all text positions within the area, and a scale-adaptive recognition network is used to accurately identify the character content at each position. This design is specifically designed for the variable text scale in industrial environments. Finally, domain knowledge (preset template) is used to perform mandatory logical consistency verification on the recognition results, identifying and reporting any possible errors, omissions, or out-of-order issues, thereby outputting a highly reliable detection result that can be directly used in subsequent production or management processes.

[0051] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. An adaptive multi-scale image and text detection system, characterized in that: include, An adaptive image quality enhancement preprocessing module is used to perform quality diagnosis on the input image to be detected and dynamically execute corresponding enhancement processing. The image and text region detection module is connected to the adaptive image quality enhancement preprocessing module and is used to detect and locate the target image and text region from the enhanced image. An orientation correction module, connected to the image and text region detection module, is used to perform orientation recognition and correction on the target image and text region; The OCR image and text recognition module, connected to the orientation correction module, is used to perform text detection and recognition on the corrected image and text regions. The OCR image and text recognition module includes a text detection network and a text recognition network. The text detection network is a hierarchical context-guided visual feature extraction network, and the text recognition network is a convolutional recurrent neural network (CRNN) integrating a scale-adaptive attention module (SAAM). The post-processing and logic verification module is connected to the OCR image recognition module and is used to sort the recognized text results and compare and verify them with a preset standard template sequence.

2. The adaptive multi-scale image and text detection system as described in claim 1, characterized in that: The adaptive image quality enhancement preprocessing module includes an image quality diagnosis unit and an image correction execution unit. The image quality diagnosis unit is used to analyze the input image and determine the types of quality defects. The image correction execution unit is connected to the image quality diagnosis unit and is used to dynamically call and execute one or more of the processing links consisting of noise processing, brightness adjustment, deblurring, and advanced correction sub-modules according to the types of quality defects.

3. The adaptive multi-scale image and text detection system as described in claim 2, characterized in that: The text detection network includes, in sequence: a global position awareness module, used to extract global spatial layout features of the input image and generate a global position feature map; A local character feature extraction module, connected to the global position awareness module, is used to extract local features at the character level under the guidance of the global position feature map. The feature integration module is connected to the global position awareness module and the local character feature extraction module respectively, and is used to fuse the global position feature map and the local features to generate an integrated feature map for text localization; The detection head is connected to the feature integration module and is used to output the bounding box coordinates of the text region based on the integrated feature map.

4. The adaptive multi-scale image and text detection system as described in claim 1, characterized in that: The text recognition network comprises a convolutional neural network (CNN) backbone, a scale-adaptive attention module (SAAM), a recurrent neural network sequence decoding module, and a transcription layer connected in sequence. The CNN backbone is used to extract visual feature maps of input text image blocks. The SAAM, connected to the CNN backbone, is used to perform scale-adaptive enhancement on the visual feature maps and output enhanced feature maps. The recurrent neural network sequence decoding module, connected to the SAAM, is used to perform sequence context modeling on the enhanced feature maps. The transcription layer, connected to the recurrent neural network sequence decoding module, is used to output the final text recognition result. The scale-adaptive attention module (SAAM) includes a multi-branch dilated convolutional layer and an attention fusion unit, used to perform scale-adaptive enhancement on the feature maps extracted from the backbone of the convolutional neural network (CNN).

5. The adaptive multi-scale image and text detection system as described in claim 4, characterized in that: The post-processing and logic verification module uses the longest common subsequence algorithm to compare and verify the text sequences.

6. An adaptive multi-scale image and text detection method employing the system described in any one of claims 1-5, characterized in that, Includes the following steps: S1: Perform quality diagnosis and dynamic enhancement on the image to be detected through an adaptive image quality enhancement preprocessing workflow; S2: Locate the target image region from the enhanced image using an image region detection model; S3: The orientation of the target graphic region is identified and corrected using an orientation correction model; S4: The corrected region is subjected to text detection and text recognition through the OCR image recognition process; among them, text detection is completed by a hierarchical context-guided visual feature extraction network, and text recognition is completed by a convolutional recurrent neural network (CRNN) integrating a scale-adaptive attention module (SAAM). S5: Perform post-processing and logical verification on the identified text results.

7. The adaptive multi-scale image and text detection method as described in claim 6, characterized in that: The adaptive image quality enhancement preprocessing workflow includes: analyzing the types of image quality defects, and dynamically selecting and performing one or more combinations of noise processing, brightness adjustment, deblurring, and advanced correction processing based on the diagnostic results.

8. The adaptive multi-scale image and text detection method as described in claim 7, characterized in that: The text detection steps include: extracting global layout features of the image; extracting local character features under the guidance of global features; fusing features and predicting text bounding boxes.

9. The adaptive multi-scale image and text detection method as described in claim 8, characterized in that: The text recognition steps include: extracting visual features of text image blocks; performing multi-scale extraction and attention-weighted fusion of the features through the scale-adaptive attention module (SAAM) to obtain enhanced features; and performing sequence decoding and transcription output on the enhanced features.

10. The adaptive multi-scale image and text detection method as described in claim 9, characterized in that: Step S5 includes: sorting the identified text according to spatial location to form a sequence, and comparing it with a preset standard template sequence using the longest common subsequence algorithm to identify and locate errors.