Lightweight text detection method and system based on multi-scale feature fusion

A lightweight text detection method based on multi-scale feature fusion and attention mechanism solves the accuracy and efficiency problems of Chinese text detection on mobile terminals and embedded devices, achieving high-efficiency text detection results.

CN121686468APending Publication Date: 2026-03-17SHANDONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511895789.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing technologies struggle to detect Chinese text in real time on mobile terminals and embedded devices, especially complex strokes and small target text. Furthermore, traditional lightweight networks are insufficient in terms of accuracy and computational efficiency.

Method used

A lightweight text detection method based on multi-scale feature fusion is adopted. By repeatedly performing bilinear projection and element-wise multiplication operations, a multi-scale fused feature map is generated. Then, channel attention and spatial attention are combined to generate an enhanced feature map. Finally, the text bounding box is extracted through differentiability operation and morphological dilation.

Benefits of technology

It improves the detection accuracy of Chinese text and small target text, reduces computational complexity, and adapts to the real-time detection needs of mobile terminals and embedded devices.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention belongs to the technical field of computer visual recognition, and particularly relates to a lightweight text detection method and system based on multi-scale feature fusion, which comprises the following steps: executing double-path linear projection, respectively performing activation function processing, performing element-by-element multiplication operation, extracting text features, and particularly processing Chinese text features with complex structures and small target texts. The number of repeated execution times is dynamically set to adapt to the extraction depths in different scenes, so that the detection precision is improved, and the calculation efficiency is improved; the feature recognition degree is further enhanced through multi-scale large convolution and channel and space attention processing, and precise detection is achieved in combination with micro-binaryzation and bounding box optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision recognition technology, specifically relating to a lightweight text detection method and system based on multi-scale feature fusion. Background Technology

[0002] With the rapid popularization of mobile internet and embedded devices, the demand for scene text detection technology in fields such as smart terminal interaction, real-time translation, and information collection is becoming increasingly urgent. Text detection in Chinese scenes, as a core sub-task, faces unique technical challenges: Chinese text encompasses dozens of commonly used and artistic fonts, exhibiting strong font diversity, complex stroke structures, flexible layouts, and significant differences in text contrast. Furthermore, in practical applications, it is often accompanied by complex background interference such as noise, blurring, and occlusion. Simultaneously, small target text, such as tiny Chinese characters in online images or compact text on signs, further increases the difficulty of detection due to its low pixel ratio and sparse feature information.

[0003] While traditional backbone networks, such as ResNet50, have strong feature extraction capabilities, they have as many as 25 million parameters, resulting in high computational complexity. This makes them unsuitable for resource-constrained scenarios such as mobile terminals and embedded devices, and they cannot meet the requirements for real-time detection. On the other hand, existing lightweight networks often achieve parameter compression by simplifying the network structure, which often leads to a decrease in feature representation capabilities and insufficient accuracy in capturing complex Chinese stroke features and detecting small target text.

[0004] Traditional feature fusion methods (such as weighted summation and direct concatenation) fail to fully capture the nonlinear relationships between features, are prone to information loss when processing high-dimensional data, and are difficult to take into account the multi-scale features of Chinese text and the weak features of small target text, resulting in a high rate of missed detection and false detection during the detection process. Summary of the Invention

[0005] To address the problems in the background technology, this invention provides a lightweight text detection method and system based on multi-scale feature fusion.

[0006] The technical solution of the present invention is as follows: This invention provides a lightweight text detection method based on multi-scale feature fusion, comprising: S1: After downsampling the text image to be detected, double linear projection is repeatedly performed. After being processed by activation functions, element-wise multiplication is performed multiple times, and convolution is performed to generate the first-stage feature map. S2: After downsampling the first-stage feature map, the dual-path linear projection is repeatedly performed. After being processed by activation functions, the element-wise multiplication operation is performed multiple times, and then convolution is performed to generate the second-stage feature map. S3: After downsampling the second-stage feature map, the bilinear projection is repeatedly performed. After being processed by the activation function, the element-wise multiplication operation is performed multiple times, and then convolution is performed to generate the third-stage feature map. S4: After downsampling the feature map in the third stage, the double linear projection is repeatedly performed. After being processed by the activation function, the element-wise multiplication operation is performed multiple times, and then convolution is performed to generate the feature map in the fourth stage. S5: The second-stage feature map, the third-stage feature map, and the fourth-stage feature map are processed by bilinear interpolation, and then combined with the first-stage feature map to unify the number of channels, and adaptive weighted fusion is performed to generate a multi-scale fused feature map. S6: The multi-scale fusion feature maps are processed by multiple large convolutions of different scales and then spliced ​​together to generate a high-dimensional feature map. The high-dimensional feature map is processed sequentially through channel attention, spatial attention, and convolution to generate an enhanced feature map.

[0007] The repeated execution of bilinear projection described in S1, after being processed by activation functions, involves multiple element-wise multiplication operations, specifically: The proportion of text regions with pixel areas no larger than the first preset size in the text image to be detected is taken as the proportion of small target text; the number of texts within a second preset size pixel is taken as the density of small target text. The number of repetitions is determined based on the proportion and / or density of small target text.

[0008] The repeated execution of bilinear projection described in S2, after being processed by activation functions, involves multiple element-wise multiplication operations, specifically: The proportion of artistic fonts in the total text of the text image to be detected is taken as the proportion of complex fonts; the standard deviation of the text line tilt angle is taken as the typesetting complexity. The number of repetitions is determined based on the proportion of complex fonts and / or the complexity of the layout.

[0009] The repeated execution of bilinear projection described in S3, after being processed by activation functions, involves multiple element-wise multiplication operations, specifically: The standard deviation of the tilt angle of the text lines in the text image to be detected is used as the typesetting complexity; the number of texts within the second preset size pixel is used as the small target text density. The number of repetitions is determined based on the typographical complexity and / or the density of small target text.

[0010] The repeated execution of bilinear projection described in S4, after processing by activation functions, involves multiple element-wise multiplication operations, specifically: The noise variance of the text image to be detected is calculated as the background noise intensity; the average brightness of the text and the average brightness of the background in the text image to be detected are calculated using the Weber contrast formula to obtain the contrast. The number of repetitions is determined based on the background noise intensity and / or contrast.

[0011] Furthermore, it also includes: enhancing the feature map through convolution to obtain a probability map and a threshold map, and then using differentiable operations on the probability map and the threshold map to generate an approximate binary map.

[0012] After performing morphological dilation on the approximate binary image, contour data of all candidate text regions are extracted using a contour detection algorithm. For each contour, the minimum bounding rectangle is used as the initial text bounding box, and a non-maximum suppression algorithm is used to remove bounding boxes with overlap exceeding the overlap threshold, thus obtaining the text bounding box coordinates.

[0013] The bilinear projections described in S1, S2, S3, and S4, after being processed by activation functions and then multiplied element-wise, also include sequential depthwise convolution and normalization.

[0014] Before downsampling the text image to be detected as described in S1, the text image to be detected is further standardized. If the image size exceeds a preset threshold, it is adjusted to the preset threshold range by scaling proportionally.

[0015] This invention also provides a lightweight text detection system based on multi-scale feature fusion, comprising: The first-stage feature map generation module is used to repeatedly perform bilinear projection after downsampling the text image to be detected, process it through activation functions, multiply it element-wise multiple times, and then perform convolution to generate the first-stage feature map. The second-stage feature map generation module is used to repeatedly perform bidirectional linear projection after downsampling the first-stage feature map. After processing by activation functions, the two-stage feature maps are multiplied element-wise multiple times and then convolved to generate the second-stage feature map. The third-stage feature map generation module is used to repeatedly perform bidirectional linear projection after downsampling the second-stage feature map. After processing by activation functions, the element-wise multiplication operation is performed multiple times, and then convolution is performed to generate the third-stage feature map. The fourth-stage feature map generation module is used to repeatedly perform bilinear projection after downsampling the feature map in the third stage. After processing by activation functions, the feature map is multiplied element-wise multiple times and then convolved to generate the fourth-stage feature map. Multi-scale fusion feature map generation module: The second-stage feature map, the third-stage feature map, and the fourth-stage feature map are processed by bilinear interpolation, and then combined with the first-stage feature map with a unified number of channels for adaptive weighted fusion to generate a multi-scale fusion feature map. Enhanced feature map generation module: Multi-scale fused feature maps are processed by multiple large convolutions of different scales and then concatenated to generate high-dimensional feature maps; The high-dimensional feature map is processed sequentially through channel attention, spatial attention, and convolution to generate an enhanced feature map.

[0016] Beneficial effects This invention extracts text features by performing dual linear projections, processing them with activation functions, and then performing element-wise multiplication. It is particularly effective for handling complex Chinese text structures and small target text features. By dynamically setting the number of repetitions to adapt to the extraction depth in different scenarios, it improves detection accuracy and computational efficiency. Furthermore, it enhances feature recognition through multi-scale large convolutions and channel and spatial attention processing, and achieves accurate detection by combining differentiable binarization and bounding box optimization. Detailed Implementation

[0017] The following examples are intended to illustrate the present invention, and not to further limit the invention.

[0018] Example 1 This invention provides a lightweight text detection method based on multi-scale feature fusion, comprising: S1: After downsampling the text image to be detected, the dual-linear projection is repeatedly performed. After processing by activation functions, element-wise multiplication is performed multiple times, followed by convolution to generate the first-stage feature map. The specific operation is as follows: The text image to be detected is downsampled by a 3×3 convolution with a stride of 2, which compresses the spatial resolution to half that of the text image to be detected and increases the number of channels from 3 to 32, resulting in a preliminary feature map F11.

[0019] The initial feature map F11 is subjected to dual-path linear projection to generate two 32-channel feature maps; after being transformed by the GELU activation function, the feature maps are multiplied element by element to achieve feature crossing, resulting in the 32-channel feature map F12.

[0020] Feature map F12 extracts spatial features through a 7×7 depthwise convolution with a stride of 1, resulting in a 32-channel feature map F13.

[0021] Feature map F13 is batch normalized to obtain feature map F14.

[0022] The above operations complete the process of "performing two linear projections, processing them separately with activation functions, and then multiplying them element by element".

[0023] Preferably, before downsampling the text image to be detected, the method further includes standardizing the text image to be detected, normalizing the pixel values ​​to the [0,1] range, and if the image size exceeds a preset threshold, adjusting it to the preset threshold range by proportional scaling.

[0024] Furthermore, the repeated execution of the bilinear projection, after being processed by the activation function, involves multiple element-wise multiplication operations, specifically as follows: The proportion of text regions in the text image to be detected whose pixel area is no larger than a first preset size is taken as the proportion of small target text. The number of text elements within the second preset size pixel is used as the small target text density. ; Based on the proportion of small target text and / or small target text density Determine the number of repetitions.

[0025] Since this process extracts pixel-level details, such as Chinese character strokes and small target text edges, the determination of the number of repetitions needs to match the requirements for extracting small target text detail features.

[0026] Preferably, if the proportion of small target text If the proportion of the target text is not greater than the preset small target text proportion, then the double linear projection is repeatedly executed, and after being processed by the activation function, the element-wise multiplication operation is performed twice.

[0027] If the proportion of small target text The proportion of small target text is greater than the preset small target text density. If the text density is not less than the first preset small target text density, then the dual-path linear projection is repeatedly executed, and after being processed by the activation function, the element-wise multiplication operation is performed three times.

[0028] In one specific embodiment, for ≤30% is a typical scenario where small target text accounts for a low percentage; in this case, the repetition count is set to 2. For >30%, or ≥5 per 10,000 pixels indicates dense text in small targets; therefore, the repetition count should be set to 3.

[0029] When the number of repetitions is determined to be 2, feature map F14 is subjected to bilinear projection to generate two 32-channel feature maps; after nonlinear transformation by the GELU activation function, they are multiplied element-wise to achieve feature crossing, resulting in 32-channel feature map F15.

[0030] Feature map F15 increases the number of channels from 32 to 64 through a 1×1 convolution, completing the integration of S1 features and obtaining feature map F16, which is the first-stage feature map.

[0031] This invention employs dual linear projection, processing each element with an activation function followed by element-wise multiplication. Compared to traditional convolution or additive fusion, this method more accurately captures subtle details such as single strokes of Chinese characters and edges of small target text, fully extracting the detailed features of Chinese text with complex stroke structures. Furthermore, based on the dynamic repetition configuration of the proportion and density of small target text, computational resources are allocated on demand, achieving both detailed feature extraction and computational efficiency.

[0032] S2: After downsampling the first-stage feature map, the bidirectional linear projection is repeatedly performed. After processing with activation functions, element-wise multiplication is performed multiple times, followed by convolution to generate the second-stage feature map. The specific operation is as follows: In the first stage, the feature map is downsampled using a 3×3 convolution with a stride of 2, compressing the resolution to 1 / 8 of the text image to be detected, while maintaining the number of channels at 64, resulting in feature map F21.

[0033] Feature map F21 undergoes bilinear projection, is processed by activation functions, and then multiplied element-wise, consistent with the logic of S1, to finally obtain feature map F24.

[0034] Furthermore, the repeated execution of the bilinear projection, after being processed by the activation function, involves multiple element-wise multiplication operations, specifically as follows: The proportion of artistic fonts in the total text of the text image to be detected is taken as the proportion of complex fonts. The standard deviation of the text line slant angle is used as the typesetting complexity. ; Based on the proportion of complex fonts and / or typographical complexity Determine the number of repetitions.

[0035] Since this process focuses on the local structure of Chinese text and the overall outline of small target text, the number of repetitions needs to be matched with the complexity of Chinese structure and the requirements of feature integration.

[0036] Preferably, if the proportion of complex fonts The proportion of complex fonts should not exceed the preset limit, and the layout complexity should be no higher. If the complexity is not greater than the first preset layout complexity, then the double-line linear projection is executed repeatedly, and after being processed by the activation function, the element-wise multiplication operation is performed three times.

[0037] If complex fonts account for a large proportion The proportion of complex fonts exceeds the preset limit, or the layout complexity is higher. If the complexity exceeds the first preset layout complexity, then the double-line linear projection is executed repeatedly, and after being processed by the activation function, the element-wise multiplication operation is performed four times.

[0038] In one specific embodiment, for ≤20%, and ≤5°, which falls under the category of typical Chinese scenarios with simple structure and regular layout, so the repetition count is set to 3. For >20%, or >5° indicates a complex Chinese scene with mixed artistic fonts; set the repetition count to 4.

[0039] When the number of repetitions is determined to be 3, the feature map F24 is then subjected to the double linear projection again. After being processed by the activation function, the element-wise multiplication operation is performed twice to obtain the 64-channel feature map F25.

[0040] Feature map F25 increases the number of channels from 64 to 128 through a 1×1 convolution, resulting in feature map F26, which is the second-stage feature map.

[0041] In the second stage of feature map generation, the present invention still performs dual-path linear projection, which is processed by activation functions and then multiplied element by element to ensure the consistency of feature extraction. At the same time, the number of repetitions is dynamically set by the proportion of complex fonts and the complexity of layout to meet the needs of Chinese structural feature extraction and improve computational efficiency.

[0042] S3: After downsampling the second-stage feature map, the bilinear projection is repeatedly performed. After processing with activation functions, element-wise multiplication is performed multiple times, followed by convolution to generate the third-stage feature map. The specific operation is as follows: In the second stage, the feature map is downsampled using a 3×3 convolution with a stride of 2, compressing the resolution to 1 / 16 of the text image to be detected, while maintaining the number of channels at 128, resulting in feature map F31.

[0043] Feature map F31 undergoes bilinear projection, is processed by activation functions, and then multiplied element-wise, consistent with the logic of S1 and S2, ultimately yielding feature map F34.

[0044] Furthermore, the repeated execution of the bilinear projection, after being processed by the activation function, involves multiple element-wise multiplication operations, specifically as follows: The standard deviation of the text line tilt angle in the text image to be detected is used as the typesetting complexity. The number of text elements within the second preset size pixel is used as the small target text density. ; Based on layout complexity and / or small target text density Determine the number of repetitions.

[0045] Since this process focuses on the global layout of the text, such as the direction of long text lines, the distribution of multiple text regions, and high-level semantic information, the determination of the number of repetitions needs to match the layout complexity and the dense features of small target text.

[0046] Preferably, if the typesetting complexity The text density should not exceed the second preset layout complexity and should be small. If the text density is less than the second preset target text density, then the dual-path linear projection is repeatedly executed, and after being processed by the activation function, the element-wise multiplication operation is performed four times.

[0047] If the layout complexity Greater than the second preset layout complexity, or small target text density If the text density is not less than the second preset small target, then the dual-path linear projection is repeatedly executed, and after being processed by the activation function, the element-wise multiplication operation is performed five times.

[0048] In one specific embodiment, for ≤10°, and For layouts with fewer than 3 text elements per 10,000 pixels, where the text is scattered and the target text is small, set the repetition count to 4. >10°, or For cases with ≥3 items per 10,000 pixels, which fall under the categories of complex layouts and small target text sets, the repetition count should be set to 5.

[0049] When the number of repetitions is determined to be 4, the feature map F34 is then subjected to bilinear projection again. After being processed by activation functions, the feature map is multiplied element-wise three times to obtain the 128-channel feature map F35.

[0050] Feature map F35 increases the number of channels from 128 to 256 through a 1×1 convolution, resulting in feature map F36, which is the third-stage feature map.

[0051] In the third stage of feature map generation, this invention utilizes layout complexity and small target text density to dynamically set the number of repetitions, solving the detection omission problem caused by complex layout or dense distribution of small target text, and improving detection accuracy.

[0052] S4: After downsampling the feature map in the third stage, the bilinear projection is repeatedly performed. After processing with activation functions, element-wise multiplication is performed multiple times, followed by convolution to generate the feature map in the fourth stage. The specific operation is as follows: In the third stage, the feature map is downsampled using a 3×3 convolution with a stride of 2, compressing the resolution to 1 / 32 of the text image to be detected, while maintaining the number of channels at 256, resulting in feature map F41.

[0053] Feature map F41 undergoes bilinear projection, is processed by activation functions, and then multiplied element-wise, consistent with the logic of S1, S2, and S3, ultimately yielding feature map F44.

[0054] Furthermore, the repeated execution of the bilinear projection, after being processed by the activation function, involves multiple element-wise multiplication operations, specifically as follows: Calculate the noise variance of the text image to be detected, as the background noise intensity. The average brightness of the text and the average brightness of the background in the image to be detected are calculated using the Weber contrast formula. Specifically, the ratio of the difference between the average brightness of the text and the average brightness of the background to the average brightness of the background is used as the contrast ratio. ; Based on background noise intensity and / or contrast Determine the number of repetitions.

[0055] Since this process focuses on global scene semantics, such as distinguishing between text and background and predicting text regions in complex scenes, the determination of the number of repetitions needs to match the background complexity and semantic distinction requirements.

[0056] Preferably, if the background noise intensity No greater than the preset background noise intensity, and the contrast If the contrast is not less than the preset contrast, then the dual-line linear projection is repeated, and after being processed by the activation function, the element-wise multiplication operation is performed three times.

[0057] If the background noise intensity Greater than the preset background noise level, or contrast If the contrast is less than the preset value, the dual-line linear projection is repeated, and after being processed by the activation function, the element-wise multiplication operation is performed four times.

[0058] In one specific embodiment, for ≤0.1, and A value ≥0.6 indicates a simple background with high contrast; therefore, the repetition count should be set to 3. For... >0.1, or If the value is less than 0.6, it indicates a complex background and low contrast. Set the number of repetitions to 4.

[0059] When the number of repetitions is determined to be 3, the feature map F44 is then subjected to bilinear projection again. After being processed by activation functions, the feature map is multiplied element-wise twice to obtain the 256-channel feature map F45.

[0060] Feature map F45 increases the number of channels from 256 to 512 through a 1×1 convolution, resulting in feature map F46, which is the fourth-stage feature map.

[0061] In the fourth stage of feature map generation, this invention utilizes background noise intensity and contrast to dynamically set the number of repetitions, thus solving the problems of traditional text detection methods being easily interfered with in complex backgrounds and having low accuracy in detecting low-contrast text.

[0062] S5: The second-stage, third-stage, and fourth-stage feature maps are processed by bilinear interpolation, then combined with the first-stage feature map to unify the number of channels, and adaptively weighted fusion is performed to generate a multi-scale fused feature map. The specific operation is as follows: After upsampling the second-stage, third-stage, and fourth-stage feature maps to the same spatial resolution as the first-stage feature map using a bilinear interpolation algorithm, the feature maps at different scales are then weighted and summed element-wise based on preset adaptive weight coefficients (learned and solidified through a large number of samples) to generate a multi-scale fused feature map.

[0063] The first-stage feature map has high-resolution features, preserving detailed information about Chinese character strokes and small target text. The third-stage and fourth-stage feature maps have low-resolution features, providing global information on text layout and achieving comprehensive integration of multi-scale information.

[0064] S6: The multi-scale fusion feature maps are processed by multiple large convolutions of different scales and then spliced ​​together to generate a high-dimensional feature map. The high-dimensional feature map is processed sequentially through channel attention, spatial attention, and convolution to generate an enhanced feature map.

[0065] In one specific embodiment, the multi-scale fusion feature map is processed by three large convolutions of different scales (3×3, 5×5, and 7×7) to extract features of different receptive fields to meet the needs of text of different sizes and layouts.

[0066] The features obtained from three large convolutional processes at different scales are concatenated along the channel dimension to form a high-dimensional feature map, which integrates information from multiple receptive fields.

[0067] The high-dimensional feature map is subjected to global average pooling and max pooling to generate two channel context descriptors. After being activated by a shared MLP network and sigmoid, a channel attention weight map is generated. The feature contributions obtained from large convolution processing at different scales are dynamically allocated to enhance the channel features related to Chinese text and small target text.

[0068] The feature maps after channel attention processing are subjected to channel-dimensional average pooling and max pooling, and then concatenated and activated by 7×7 convolution and sigmoid to generate a spatial attention weight map, so as to accurately focus on the spatial region where the text is located and suppress background noise.

[0069] The feature map after spatial attention processing is compressed back to the original channel dimension by 1×1 convolution, and then added point by point with the multi-scale fused feature map to further enhance the expression of key text features and generate an enhanced feature map.

[0070] In addition, it includes: enhancing the feature map through convolution to obtain a probability map and a threshold map; and then using differentiable operations on the probability map and threshold map to generate an approximate binary map. The implementation formula is as follows: ; In the formula, , , These represent the approximate binary map, the probability map, and the threshold map, respectively; k is the magnification factor, which is set to 50 in this embodiment; (i,j) represents the coordinate points in the probability map and the threshold map.

[0071] After performing morphological dilation on the approximate binary image, contour data of all candidate text regions are extracted using a contour detection algorithm. For each contour, the minimum bounding rectangle is used as the initial text bounding box, and a non-maximum suppression algorithm is used to remove bounding boxes with overlap exceeding the overlap threshold, thus obtaining the text bounding box coordinates.

[0072] When enhancing feature map generation, this invention further strengthens feature recognition through multi-scale large convolution and channel and spatial attention processing, and achieves accurate detection by combining differentiable binarization and bounding box optimization.

[0073] This invention extracts text features by performing dual linear projections, processing them with activation functions, and then performing element-wise multiplication. It is particularly effective for handling complex Chinese text structures and small target text features. By dynamically setting the number of repetitions to adapt to the extraction depth in different scenarios, it improves detection accuracy and computational efficiency. Furthermore, it enhances feature recognition through multi-scale large convolutions and channel and spatial attention processing, and achieves accurate detection by combining differentiable binarization and bounding box optimization.

[0074] Example 2 This invention also provides a lightweight text detection system based on multi-scale feature fusion, comprising: The first-stage feature map generation module is used to repeatedly perform bilinear projection after downsampling the text image to be detected, process it through activation functions, multiply it element-wise multiple times, and then perform convolution to generate the first-stage feature map. The second-stage feature map generation module is used to repeatedly perform bidirectional linear projection after downsampling the first-stage feature map. After processing by activation functions, the two-stage feature maps are multiplied element-wise multiple times and then convolved to generate the second-stage feature map. The third-stage feature map generation module is used to repeatedly perform bidirectional linear projection after downsampling the second-stage feature map. After processing by activation functions, the element-wise multiplication operation is performed multiple times, and then convolution is performed to generate the third-stage feature map. The fourth-stage feature map generation module is used to repeatedly perform bilinear projection after downsampling the feature map in the third stage. After processing by activation functions, the feature map is multiplied element-wise multiple times and then convolved to generate the fourth-stage feature map. Multi-scale fusion feature map generation module: The second-stage feature map, the third-stage feature map, and the fourth-stage feature map are processed by bilinear interpolation, and then combined with the first-stage feature map with a unified number of channels for adaptive weighted fusion to generate a multi-scale fusion feature map. Enhanced feature map generation module: Multi-scale fused feature maps are processed by multiple large convolutions of different scales and then concatenated to generate high-dimensional feature maps; The high-dimensional feature map is processed sequentially through channel attention, spatial attention, and convolution to generate an enhanced feature map.

[0075] The system of this invention can be applied to various scenarios. In mobile office applications, it can be used in document scanning apps to achieve rapid digitization and text recognition of paper documents. In real-time translation, it is integrated into camera apps to enable real-time detection and translation of text in street view signs, menus, and other scenes. In assistive devices for the visually impaired, it can be used as an assistive reading tool to detect and read aloud text information in the environment through a camera. In image content moderation, it can be used on social media platforms to automatically detect and filter illegal text content in images. In autonomous driving and robotics, it can be used in perception systems to detect and recognize text information such as road signs and shop signs. The system of this invention can be easily deployed in resource-constrained scenarios such as mobile terminals and embedded devices to meet real-time detection requirements.

Claims

1. A lightweight text detection method based on multi-scale feature fusion, characterized in that, Comprise: S1: after the to-be-detected text image is down-sampled, double linear projection is repeatedly executed, and after being processed by an activation function respectively, element-by-element multiplication operation is performed multiple times, convolution is performed, and a first-stage feature map is generated; S2: after the first-stage feature map is down-sampled, double linear projection is repeatedly executed, and after being processed by an activation function respectively, element-by-element multiplication operation is performed multiple times, convolution is performed, and a second-stage feature map is generated; S3: after the second-stage feature map is down-sampled, double linear projection is repeatedly executed, and after being processed by an activation function respectively, element-by-element multiplication operation is performed multiple times, convolution is performed, and a third-stage feature map is generated; S4: after the third-stage feature map is down-sampled, double linear projection is repeatedly executed, and after being processed by an activation function respectively, element-by-element multiplication operation is performed multiple times, convolution is performed, and a fourth-stage feature map is generated; S5: after the second-stage feature map, the third-stage feature map and the fourth-stage feature map are processed by double linear interpolation respectively, the number of channels of the first-stage feature map is unified, adaptive weighted fusion is performed, and a multi-scale fusion feature map is generated; S6: after the multi-scale fusion feature map is processed by multiple large convolutions of different scales respectively, splicing is performed, and a high-dimensional feature map is generated; The high-dimensional feature map is sequentially processed by channel attention, spatial attention and convolution, and an enhanced feature map is generated.

2. The lightweight text detection method based on multi-scale feature fusion according to claim 1, characterized in that, The double linear projection repeatedly executed in S1, and after being processed by an activation function respectively, element-by-element multiplication operation is performed multiple times, specifically: The proportion of the text region with a pixel area less than a first preset size in the total text region in the to-be-detected text image is taken as the small target text proportion; and the number of texts in a second preset size pixel is taken as the small target text density. The number of repetitions is determined according to the small target text proportion and / or the small target text density.

3. The lightweight text detection method based on multi-scale feature fusion according to claim 1, characterized in that, The double linear projection repeatedly executed in S2, and after being processed by an activation function respectively, element-by-element multiplication operation is performed multiple times, specifically: The proportion of artistic fonts in the total text in the to-be-detected text image is taken as the complex font proportion; and the standard deviation of the text line inclination angle is taken as the typesetting complexity. The number of repetitions is determined according to the complex font proportion and / or the typesetting complexity.

4. The lightweight text detection method based on multi-scale feature fusion according to claim 1, characterized in that, The double linear projection repeatedly executed in S3, and after being processed by an activation function respectively, element-by-element multiplication operation is performed multiple times, specifically: The standard deviation of the text line inclination angle in the to-be-detected text image is taken as the typesetting complexity; and the number of texts in a second preset size pixel is taken as the small target text density. The number of repetitions is determined according to the typesetting complexity and / or the small target text density.

5. The lightweight text detection method based on multi-scale feature fusion according to claim 1, characterized in that, The double linear projection repeatedly executed in S4, and after being processed by an activation function respectively, element-by-element multiplication operation is performed multiple times, specifically: The noise variance of the to-be-detected text image is calculated as the background noise intensity; The average brightness of the text and the average brightness of the background in the to-be-detected text image are calculated by the Weber contrast formula to obtain a contrast; The number of repetitions is determined according to the background noise intensity and / or the contrast.

6. The lightweight text detection method based on multi-scale feature fusion according to claim 1, characterized in that, Further comprise: The enhanced feature map is processed by convolution to obtain a probability map and a threshold map, and the probability map and the threshold map are processed by a differentiable operation to generate an approximate binary map.

7. The lightweight text detection method based on multi-scale feature fusion according to claim 6, characterized in that, After the approximate binary image performs a morphological dilation operation, contour data of all candidate text regions is extracted through a contour detection algorithm; for each contour, a minimum circumscribed rectangle is taken as an initial text bounding box, a non-maximum suppression algorithm is used to remove bounding boxes with an overlap degree exceeding an overlap degree threshold, and text bounding box coordinates are obtained.

8. The lightweight text detection method based on multi-scale feature fusion according to claim 1, characterized in that, The S1, S2, S3 and S4 perform double linear projection, are processed by an activation function respectively, are multiplied element by element, and further include sequentially performing depth convolution and normalization processing.

9. The lightweight text detection method based on multi-scale feature fusion according to claim 1, characterized in that, Before the S1 performs downsampling on the to-be-detected text image, the to-be-detected text image is further subjected to standardization processing, and if the image size exceeds a preset threshold, the image size is adjusted to a preset threshold range by equal proportion scaling.

10. A lightweight text detection system based on multi-scale feature fusion, characterized in that, Comprise: A first stage feature map generation module: after the to-be-detected text image is down-sampled, double linear projection is repeatedly performed, multiplied element by element multiple times after being processed by an activation function respectively, and a first stage feature map is generated by convolution; A second stage feature map generation module: after the first stage feature map is down-sampled, double linear projection is repeatedly performed, multiplied element by element multiple times after being processed by an activation function respectively, and a second stage feature map is generated by convolution; A third stage feature map generation module: after the second stage feature map is down-sampled, double linear projection is repeatedly performed, multiplied element by element multiple times after being processed by an activation function respectively, and a third stage feature map is generated by convolution; A fourth stage feature map generation module: after the third stage feature map is down-sampled, double linear projection is repeatedly performed, multiplied element by element multiple times after being processed by an activation function respectively, and a fourth stage feature map is generated by convolution; A multi-scale fusion feature map generation module: after the second stage feature map, the third stage feature map and the fourth stage feature map are processed by bilinear interpolation respectively, the first stage feature map is combined to unify the channel number, and adaptive weighted fusion is performed to generate a multi-scale fusion feature map; An enhanced feature map generation module: the multi-scale fusion feature map is processed by a large convolution of multiple different scales respectively, spliced, and a high-dimensional feature map is generated; The high-dimensional feature map is sequentially processed by channel attention, spatial attention and convolution to generate an enhanced feature map.