Tibetan text line detection method and device and electronic equipment

Through the pre-trained text line detection model, using fragment detection network, feature aggregation encoding network and mapping output network, the problem of low detection result accuracy in Tibetan text line detection is solved, achieving accurate detection and avoiding complex post-processing. Improved detection performance.

CN118587714APending Publication Date: 2024-09-03HANVON CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310205841.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-03
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The existing technology has the problem of low detection accuracy in Tibetan text line detection, especially because the text lines in the Tibetan ancient book images are compact and the characters are stacked up and down by letters, which leads to the impact of complex post-processing based on regression and segmentation methods. Test results.

Method used

Using a pre-trained text line detection model, including fragment detection network, feature aggregation coding network and mapping output network, through fragment detection, position coding and aggregation coding, the text line detection results of Tibetan text images are obtained, and the regression method is combined to deal with the overlapping problem and the feature aggregation and classification capabilities of neural networks.

Benefits of technology

It achieves accurate detection of Tibetan text lines, avoids complex post-processing, and improves detection performance and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587714A
    Figure CN118587714A
Patent Text Reader

Abstract

The invention discloses a Tibetan text line detection method and device, and belongs to the technical field of text line detection. The method is executed through a pre-trained text line detection model, the text line detection model comprises a fragment detection network, a feature aggregation coding network and a mapping output network, the Tibetan text image is subjected to fragment detection through the fragment detection network, and a detection frame and fragment features of candidate fragments are obtained; according to the detection frame, obtaining position coding information of the candidate fragment; performing aggregation coding on the position coding information and the fragment characteristics through a characteristic aggregation coding network to obtain an aggregation coding vector of each candidate fragment; and performing coding mapping on the aggregated coding vector through a mapping output network to obtain a text line detection result of the Tibetan text image. According to the method, the advantage that the regression method can effectively process the overlapping problem and the powerful feature aggregation classification capability of the neural network model are combined, and accurate detection of Tibetan text lines is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of text line detection, and in particular to a Tibetan text line detection method, device, electronic device, and computer-readable storage medium. Background Art

[0002] The purpose of text line detection is to detect the text line area in the text image. The existing text line detection technology can be divided into two categories: regression-based text line detection and segmentation-based text line detection. Among them, regression-based text line detection detects text as a target, which is mainly inspired by some target detection methods; segmentation-based text line detection classifies the pixels of the image, distinguishes the text part and the background part, obtains the binary image belonging to the text part, and then obtains the text line detection frame through the post-processing part.

[0003] However, due to the compactness of text lines in Tibetan ancient book images, the characters are composed of letters stacked up and down, and there are cross-adhesion characteristics between letters in adjacent lines. When using the regression method or segmentation method in the prior art to detect text lines, there are at least the following defects: when detecting based on the segmentation method, it is impossible to determine the category of the overlapping area; when text line detection is performed based on the regression method, overlapping targets can be detected, and complex post-processing, such as anchor point generation, non-maximum suppression, binarization or contour extraction, is relied on to generate or refine the final detection results, and complex post-processing often affects the accuracy of the final detection results.

[0004] It can be seen that the Tibetan text line detection method in the prior art needs to be improved. Summary of the invention

[0005] The embodiments of the present application provide a Tibetan text line detection method and device, and an electronic device, which are used to improve the defect of low detection result accuracy in Tibetan text line detection.

[0006] In a first aspect, an embodiment of the present application provides a Tibetan text line detection method, comprising:

[0007] The method is performed by a pre-trained text line detection model, the text line detection model comprising: a segment detection network, a feature aggregation encoding network and a mapping output network, the method comprising:

[0008] Performing segment detection on the Tibetan text image through the segment detection network to obtain detection frames and segment features of candidate segments;

[0009] Acquire position coding information of the candidate segment according to the detection frame;

[0010] Performing aggregation coding on the position coding information and the segment features through the feature aggregation coding network to obtain an aggregate coding vector for each of the candidate segments;

[0011] The aggregated coding vector is coded and mapped through the mapping output network to obtain a text line detection result of the Tibetan text image.

[0012] In a second aspect, an embodiment of the present application provides a Tibetan text line detection device, which is executed by a pre-trained text line detection model, wherein the text line detection model includes: a segment detection network, a feature aggregation encoding network, and a mapping output network, and the device includes:

[0013] A segment detection and image feature acquisition module, used to perform segment detection on the Tibetan text image through the segment detection network to obtain a detection frame and segment features of a candidate segment;

[0014] A segment position coding information acquisition module, used to acquire the position coding information of the candidate segment according to the detection frame;

[0015] An aggregate coding module, configured to perform aggregate coding on the position coding information and the segment features through the feature aggregate coding network to obtain an aggregate coding vector for each of the candidate segments;

[0016] A mapping output module is used to perform encoding mapping on the aggregated encoding vector through the mapping output network to obtain a text line detection result of the Tibetan text image.

[0017] In a third aspect, an embodiment of the present application further discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the Tibetan text line detection method described in the embodiment of the present application when executing the computer program.

[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the Tibetan text line detection method disclosed in the embodiment of the present application are performed.

[0019] The Tibetan text line detection method disclosed in the embodiment of the present application is executed by a pre-trained text line detection model, and the text line detection model includes: a segment detection network, a feature aggregation coding network and a mapping output network. The method performs segment detection on the Tibetan text image through the segment detection network to obtain the detection frame and segment features of the candidate segment; and obtains the position coding information of the candidate segment according to the detection frame; then, the position coding information and the segment features are aggregated and encoded by the feature aggregation coding network to obtain the aggregate coding vector of each candidate segment; finally, the aggregate coding vector is encoded and mapped by the mapping output network to obtain the text line detection result of the Tibetan text image. This method combines the advantages of the regression method that can effectively deal with overlapping problems and the powerful feature aggregation classification ability of the neural network model, which not only realizes the accurate detection of Tibetan text lines, but also avoids complex post-processing and improves the performance of Tibetan text line detection.

[0020] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] Figure 1 is a flow chart of the Tibetan text line detection method according to an embodiment of the present application;

[0023] Figure 2 is a structural schematic diagram of a text line detection model in the Tibetan text line detection method of an embodiment of the present application;

[0024] Figure 3 is a schematic diagram of a Tibetan text image in an embodiment of the present application;

[0025] Figure 4 yes Figure 3 Schematic diagram of candidate segment detection results of a Tibetan text image shown;

[0026] Figure 5 is a schematic diagram of the network structure of the converter encoder used in the embodiment of the present application;

[0027] Figure 6 It is a schematic diagram of the structure of a Tibetan text line detection device in one embodiment of the present application;

[0028] Figure 7 A block diagram schematically shows an electronic device for executing the method according to the present application; and

[0029] Figure 8 Schematically shows a storage unit for holding or carrying a program code for implementing the method according to the present application 。 DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0031] The present application discloses a Tibetan text line detection method, which is performed by a pre-trained text line detection model. Figure 1 As shown, the method includes: steps 110 to 140.

[0032] like Figure 2 As shown, the text line detection model includes: a segment detection network 210, a feature aggregation encoding network 220 and a mapping output network 230. The segment detection network 210 is used to perform segment detection on the input Tibetan text image based on a regression detection method.

[0033] Optional, such as Figure 2 As shown, the segment detection network 210 further includes: a feature extraction network 2101 and an object detection network 2102. The feature extraction network 2101 is used to extract image features of the Tibetan text image input to the text line detection model to obtain a global feature map, and the object detection network 2102 is used to perform object detection on the global feature map based on regression detection technology to obtain a detection frame of the candidate segment included in the Tibetan text image.

[0034] In the following, in combination with the structure of the text line detection model, a specific implementation method of a Tibetan text line detection method disclosed in an embodiment of the present application is further illustrated.

[0035] Step 110: Perform segment detection on the Tibetan text image through the segment detection network to obtain detection frames and segment features of candidate segments.

[0036] As mentioned above, the fragment detection network 210 includes: a feature extraction network 2101 and a target detection network 2102. In some embodiments of the present application, fragment detection is performed on a Tibetan text image through the fragment detection network to obtain a detection frame and fragment features of a candidate fragment, including: sub-step 1101 and sub-step 1102.

[0037] Sub-step 1101: performing multi-scale feature extraction on the Tibetan text image through the feature extraction network to obtain global feature maps of preset multiple scales.

[0038] Optionally, the feature extraction network 2101 can be obtained by connecting a convolutional neural network and a feature pyramid network in series. Wherein, the convolutional neural network can adopt a convolutional neural network structure including but not limited to: Resnet50 (Resnet, Residual Network, residual network). Optionally, according to the characteristics of Tibetan characters, the relevant convolution parameters can be adjusted based on the existing mainstream convolutional neural network to better extract the text features in the image. The convolutional neural network is composed of a series of operations such as convolution, maximum pooling, batch normalization, etc., and is composed of the convolution layer and the maximum pooling layer in the standard convolutional neural network model.

[0039] The feature pyramid network can handle the multi-scale variation problem in object detection with minimal increase in computational effort. It is a top-down network structure used to construct feature maps of different sizes with high-level semantics. In the feature maps output by the feature pyramid network, low-resolution feature maps have stronger semantic information, while high-resolution feature maps have weaker semantic information but richer spatial information. The feature pyramid network can fuse feature maps of multiple resolutions and output feature maps of different scales.

[0040] The scale of the feature map output by the feature extraction network is determined by the size of the input image, the network structure and the network parameters. In some embodiments of the present application, the feature extraction network can be configured to output feature maps of three scales, hereinafter referred to as "global feature maps", which correspond to 1 / 4, 1 / 8, and 1 / 16 of the original size of the Tibetan text image, respectively. That is, after the Tibetan text image of size H×W is input into the text line detection model, the feature extraction network performs multi-scale feature extraction on the Tibetan text image, and three scales can be obtained: and The global feature map of .

[0041] The above preset scale is only a feasible scale value. Those skilled in the art should understand that by adjusting the network structure and network parameters of the feature extraction network, the feature extraction network can also output global feature maps of other quantities and other scales. In the embodiments of the present application, the scale of the feature map output by the feature extraction network is not limited. The purpose of using multi-scale feature maps is to adapt to the detection of targets of different sizes.

[0042] The specific network structures of the convolutional neural network and the feature pyramid network in the feature extraction network can be found in the prior art and will not be described in detail in the embodiments of the present application.

[0043] In sub-step 1102, the object detection network is used to perform segment detection of corresponding widths on the global feature map of each scale to obtain detection frames and segment features of candidate segments corresponding to each scale.

[0044] Optionally, the target detection network 2102 is a target detection network based on regression technology. The target detection network 2102 is used to detect the text position in the Tibetan text image based on the global feature map. Since the length of the text line is not fixed, some are very long and some are very short, which causes the text line detection to be different from the general target detection. When performing text line detection based on the regression method, it is necessary to set a text candidate frame. In the embodiment of the present application, due to the uncertainty of the length of the Tibetan text line, it is impossible to clearly define a suitable text candidate frame. In the embodiment of the present application, the Tibetan text line is regarded as composed of multiple small fragments, and each small fragment is used as a detection target. Since the change of the text line in the length direction is more drastic than the change of the height, the small fragment has the following characteristics: fixed width and variable height. By converting the Tibetan text line detection into the Tibetan text fragment detection, the text line detection process is further converted into the position of the fitting fragment in the vertical direction.

[0045] After obtaining global feature maps of different scales, the global feature maps of each scale are further subjected to target detection through the target detection network using anchor frames of different sizes to locate text fragments in Tibetan text images.

[0046] In some embodiments of the present application, the object detection network is used to perform fragment detection of corresponding widths on the global feature map of each scale to obtain detection frames and fragment features of candidate fragments corresponding to each scale, including: for the global feature map of each scale, the object detection network is used to perform fragment detection on the global feature map using anchor frames of N sizes corresponding to the corresponding scale to obtain detection frames of candidate fragments corresponding to each scale, wherein the width of the anchor frame of each size is: a preset width negatively correlated with the corresponding scale, and the height of the anchor frame of each size is: a height determined according to the distribution data of the text line height in the training samples of the text line detection model and negatively correlated with the corresponding scale, and N is a natural number greater than 1; according to the detection frame of the candidate fragment corresponding to each scale, and the global feature map, the fragment features of each candidate fragment are obtained.

[0047] In some embodiments of the present application, low-level feature maps are used to detect small targets, and high-level feature maps are used to detect large targets. Since the scale of feature maps gradually decreases from low to high levels, missed detection of targets can be avoided by detecting targets of different scales in global feature maps of different scales. On each feature map, each pixel in the x direction (i.e., along the text line direction) predicts a segment. Since the text has a large difference in height, regression fitting is performed in the y direction according to the corresponding anchor box height value.

[0048] Fragment detection is performed on each global feature map separately. Fragment detection uses a regression-based method. Due to the scale differences on different global feature maps, fragments of different widths are predicted. Taking the global feature maps of three different scales obtained in the above steps as an example, for a global feature map with a scale of 1 / 4 of the original image, a fragment with a width of 4 can be predicted, for a global feature map with a scale of 1 / 8 of the original image, a fragment with a width of 8 can be predicted, and for a global feature map with a scale of 1 / 16 of the original image, a fragment with a width of 16 can be predicted.

[0049] In some embodiments of the present application, for the global feature map of each scale, the target detection network is used to perform fragment detection on the global feature map using anchor frames of N sizes corresponding to the scale, and before obtaining the detection frame of the candidate fragment corresponding to each scale, it also includes: obtaining N anchor frame heights corresponding to each scale based on the distribution data of text line heights in the training samples of the text line detection model.

[0050] Optionally, taking the global feature maps of M scales (where M is a natural number greater than 1, for example, M is equal to 3) obtained in the above steps as an example, the text line heights in the training sample set used to train the text line detection model can be clustered, and the height distribution can be counted to obtain N×M height category center values ​​as the heights of the anchor boxes during segment detection; then, the obtained N×M anchor box heights are divided into M groups according to size, each group including N height values; finally, each group of anchor box height values ​​is respectively assigned to the global feature maps of M scales, and the larger the feature map, the smaller the height value of the assigned anchor box. In this way, for each scale of the global feature map, N sizes of anchor boxes can be used for target detection, thereby further improving the detection accuracy.

[0051] The height distribution information of text line images in the training set is obtained through clustering algorithm, and the height of the anchor box is adaptively obtained to improve the fitting ability of the model.

[0052] In the text line detection stage, for each of the scales of the global feature map obtained in the above steps, when the object detection network performs segment detection, the object detection network uses N anchor frames of sizes corresponding to the scale to perform segment detection on the global feature map respectively, and obtains M detection frames of candidate segments corresponding to the scale. Figure 3 Taking the Tibetan text image shown in as an example, by using anchor boxes of different sizes to perform segment detection on global feature maps of different scales, we can obtain the following Figure 4 There are several detection boxes shown in , each of which corresponds to a candidate segment. Figure 4 It can be seen from the detection frames shown in FIG. 1 that the detection frames have various sizes, such as detection frames 410 , 420 , and 430 , that is, Tibetan text line segments of various sizes are detected in the Tibetan text image.

[0053] Since the lines of ancient Tibetan texts are staggered and overlapped, the intersections are irregular. The intersections are the upper and lower character areas of the characters, which generally only occupy a small part of the character area. By using the regression method to filter the text area in the form of fragments, the text lines can be better fitted in the form of small areas based on the fragment form, and the text information of adjacent lines will not be included, so the detection results are more accurate.

[0054] In some embodiments of the present application, each detection frame corresponds to an image area in the Tibetan text image, and the image area is the image area of ​​the candidate segment in the detection frame. Further, according to the correspondence between the pixel position in the Tibetan text image and the features in the global feature map, the regional features in each global feature map corresponding to the image area in the specified detection frame can be obtained, and the regional features can be used as the segment features of the candidate segment corresponding to the detection frame.

[0055] In some other embodiments of the present application, the global feature maps of various scales obtained in the aforementioned steps may be first fused to obtain a fused feature map of a specified scale; then, based on the correspondence between the pixel positions of the Tibetan text image and the features in the fused feature map, the regional features in the fused feature map corresponding to the image area within the specified detection frame are obtained, and the regional features are used as the segment features of the candidate segment corresponding to the detection frame.

[0056] In some embodiments of the present application, in order to reduce the number of features input during aggregate coding, certain sub-image area image features in the image area corresponding to the detection box of the candidate segment can be used as segment features to reduce the size of the segment features of each candidate segment and reduce the computational complexity of the aggregate coding.

[0057] In some embodiments of the present application, the segment features of each candidate segment are obtained according to the detection frame of the candidate segment corresponding to each scale and the global feature map, including: obtaining the image features of the Tibetan text image according to the global feature map; obtaining the feature values ​​of target feature points in the image features according to the feature mapping relationship between the image area of ​​the Tibetan text image and the image features, wherein the target feature points are selected from: feature points that carry image features of at least three image areas in the detection frame; and generating the segment features of the candidate segment corresponding to the detection frame according to the feature values ​​of the target feature points.

[0058] Optionally, the at least three image areas in the detection frame include: an image area covering part or all of the upper border, an image area covering part or all of the lower border, and a central area of ​​the detection frame. The size of each image area can be determined based on the feature mapping relationship between the image area of ​​the Tibetan text image and the image feature. For example, when a 4×4 image area in the Tibetan text image is mapped to a feature point in the image feature, the size of the image area can be a 4×4 rectangular area, an 8×4 rectangular area, or a rectangular area of ​​other sizes whose side length is an integer multiple of 4.

[0059] Optionally, the global image features of the above-mentioned various scales may be fused to obtain the image features of the Tibetan text image; or, the global image features of a certain scale (such as the maximum scale output by the feature extraction network) may be selected as the image features of the Tibetan text image.

[0060] Corresponding to different image feature acquisition methods, the feature mapping relationship between the image feature and the image region of the Tibetan text image is different. The specific method for determining the feature mapping relationship between the image feature and the Tibetan text image is prior art and will not be described in detail here.

[0061] In some embodiments of the present application, for a candidate segment, feature points carrying image features of the image area covered by the detection frame in the image features of the Tibetan text image can be determined according to the position of the detection frame corresponding to the candidate segment. Then, representative feature points are selected from these feature points as target feature points, and segment features of the candidate segment are generated according to the feature values ​​of the target feature points.

[0062] The image features of the Tibetan text image are: the size obtained after multi-scale feature extraction is the original Figure 1 / 4 global feature body as an example, that is, after feature extraction of the 4×4 image area in the original image, one feature point in the global feature map can be obtained. According to the feature mapping relationship between the image area of ​​the Tibetan text image and the global feature map, it can be obtained that each feature point in the global feature map carries the image features of which image area of ​​the Tibetan text image, that is, according to the feature mapping relationship between the image area of ​​the Tibetan text image and the global feature map, each feature point in the global feature map that carries the image features of the image in the specified detection frame can be obtained as the candidate feature points of the specified detection frame, and it can be determined which part of the image of the detection frame each candidate feature point carries the image features of. Afterwards, the candidate feature points that carry the image features of the specified image area in the detection frame are selected as the target feature points.

[0063] Optionally, candidate feature points that carry image features of the image area where the entire upper border of the detection box is located, candidate feature points that carry image features of the image area where the entire lower border of the detection box is located, and candidate feature points that carry image features of the central area of ​​a specified size of the detection box can be selected as target feature points.

[0064] By selecting the image area where the upper and lower borders of the detection box are located, and the feature points of the image features of the central image area, as the target feature points, and generating the fragment features of the candidate fragment corresponding to the corresponding detection box based on the target feature points, the obtained fragment features include both the boundary features and the text features of the fragment while reducing the amount of feature data, which is conducive to improving the clustering accuracy based on the aggregation of fragment features in the height direction.

[0065] Step 120: Obtain position coding information of the candidate segment according to the detection frame.

[0066] Optionally, the position information of the detection frame can be represented by the positions of the four vertices of the detection frame, or by the diagonal positions of the detection frame, or by the center position of the detection frame, the width and height of the detection frame. In other embodiments of the present application, the position of the detection width can also be uniquely represented by other methods. Accordingly, the position encoding information of the candidate segment corresponding to the specified detection frame can be obtained by encoding the position information representing the detection frame.

[0067] In some embodiments of the present application, obtaining the position coding information of the candidate segment according to the detection frame includes: sub-step A1 and sub-step A2.

[0068] Sub-step A1, obtaining position coordinates of at least two designated pixel positions in the detection frame as first position information corresponding to the candidate segment.

[0069] Optionally, the at least two designated pixel positions include: a pixel position located at an upper border of the detection frame and a pixel position located at a lower border of the detection frame.

[0070] For example, the at least two specified pixel positions include: a pixel position located at the midpoint of the upper border of the detection frame, and a pixel position located at the midpoint of the lower border of the detection frame. The at least two specified pixel positions are pixel positions that can express the positional relationship between the detection frame and the text line.

[0071] Sub-step A2: encoding the first position information to obtain position coding information corresponding to the candidate segment.

[0072] Next, the position code of each pixel position is obtained by respectively encoding the horizontal coordinate and the vertical coordinate of each pixel position in the first position information (for example, performing trigonometric function position coding); finally, the position codes of the horizontal coordinate and the vertical coordinate of all pixel positions in the position information are spliced, and the spliced ​​result is used as the position code information of the candidate fragment corresponding to the detection frame.

[0073] In some embodiments of the present application, obtaining the position coding information of the candidate segment according to the detection frame includes: sub-step B1, sub-step B2 and sub-step B3.

[0074] Sub-step B1, determining at least two designated feature points in the image feature according to a feature mapping relationship between an image area of ​​the Tibetan text image and the image feature.

[0075] The at least two designated feature points include: a feature point carrying image features of an image region where an upper border of the detection frame is located, and a feature point carrying image features of an image region where a lower border of the detection frame is located.

[0076] The method for determining the feature mapping relationship between the image area of ​​the Tibetan text image and the image feature is prior art and will not be described in detail here.

[0077] The method for determining the at least two designated feature points may refer to the method for determining the target feature points mentioned above, which will not be described in detail here.

[0078] Sub-step B2: obtaining second position information of the corresponding candidate segment according to the position coordinates of the at least two designated feature points in the feature image.

[0079] Optionally, the position coordinates of the at least two designated feature points in the feature image may be used as the position coordinates of the corresponding candidate segments for position encoding in the next step.

[0080] Sub-step B3, encoding the second position information to obtain position coding information corresponding to the candidate segment.

[0081] For the specific implementation of encoding the second position information to obtain the position coding information of the corresponding candidate segment, please refer to the above description and will not be repeated here.

[0082] By selecting the position coordinates of the specified pixel position of the detection box as the position information of the corresponding candidate segment for encoding, or encoding the feature map coordinates of the feature points corresponding to the specified area of ​​the detection box as the position information of the corresponding candidate segment, to obtain the position coding information of the candidate segment, not only can the position coding information fully express the position relationship between the candidate segments based on the text line (such as whether they are located in the same text line), but also can reduce the data amount of the position coding information, thereby reducing the data processing amount when the candidate segments are aggregated and encoded, and improving the aggregation efficiency.

[0083] Step 130, performing aggregation coding on the position coding information and the segment features through the feature aggregation coding network to obtain an aggregate coding vector for each of the candidate segments.

[0084] In some embodiments of the present application, the feature aggregation coding network is constructed based on a multi-head self-attention network, and the position coding information and the fragment features are aggregated and encoded by the feature aggregation coding network to obtain an aggregate coding vector for each of the candidate fragments, including: for each of the candidate fragments, the position coding information and the fragment features of the candidate fragment are used as the features to be encoded of the candidate fragment; the sequence of the features to be encoded is used as the input feature sequence of the feature aggregation coding network, and the multi-head self-attention network is used to perform correlation calculation on the features to be encoded in the input feature sequence to obtain an aggregate coding vector for each of the candidate fragments.

[0085] Optionally, the feature aggregation encoding network is a sequence-to-sequence (i.e., Seq2Seq) encoding network, which is composed of multiple transformer (i.e., transformer) encoders. Each transformer encoder is further composed of a multi-head self-attention network and a feedforward network. Among them, the multi-head self-attention network is used to fuse the input features. After obtaining the position coding information and segment features of each candidate segment included in the Tibetan text image, for each candidate segment, the segment features of the candidate segment can be flattened into a one-dimensional feature vector, and the position coding information and the flattened one-dimensional feature vector are spliced, and the one-dimensional feature vector obtained after splicing is used as the feature to be encoded of the candidate segment. In this way, if the aforementioned steps detect L candidate segments, L groups of features to be encoded will be obtained after feature flattening and splicing, where L is an integer greater than 1.

[0086] Next, these L groups of features to be encoded are composed into a sequence, and the composed sequence is input into the feature aggregation coding network as the input feature sequence of the feature aggregation coding network. The feature aggregation coding network performs encoding processing based on the input feature sequence to obtain an aggregated coding vector corresponding to each group of features to be encoded in the input feature sequence.

[0087] In some embodiments of the present application, the sequence of features to be encoded is used as the input feature sequence of the feature aggregation coding network, and the features to be encoded in the input feature sequence are calculated through the multi-head self-attention network to obtain an aggregated coding vector for each of the candidate fragments, including: for the input feature sequence, the fragment features in the features to be encoded are used as the key, value and query of the multi-head self-attention network, and the position coding information in the features to be encoded is used as the key and query of the multi-head self-attention network, and the features to be encoded in the sequence are calculated through the multi-head self-attention network to obtain an aggregated coding vector for each of the candidate fragments.

[0088] The transformer encoder includes Figure 5Taking the multi-head self-attention network 510, fusion and normalization layer 520, feedforward network 530 and fusion and normalization layer 540 shown as an example, the input of the multi-head self-attention network 510 includes: K (key), V (Value) and Q (Query). In the aggregate coding process, for each group of features to be encoded in the input feature sequence, the following input operations are performed respectively: the segment features in the group of features to be encoded are respectively input to the key, value and query input terminals of the multi-head self-attention network, and the position coding information in the group of features to be encoded is input to the key and query input terminals of the multi-head self-attention network, so as to input each group of features to be encoded in the input feature sequence into the feature aggregation coding network in turn. Afterwards, the multi-head self-attention network in the feature aggregation coding network performs correlation calculation on the features to be encoded in the sequence, realizes clustering of segments belonging to the same text line, and outputs the aggregate coding vector corresponding to each group of features to be encoded. Furthermore, the aggregated coding vector corresponding to each group of features to be encoded may be used as the aggregated coding vector of the candidate segment corresponding to the corresponding features to be encoded.

[0089] The feature aggregation coding network aggregates and encodes the input features to be encoded based on the network parameters obtained through training. The structure and aggregation coding scheme of each network module including the multi-head self-attention network refer to the prior art and will not be described in detail in the embodiments of this application.

[0090] Step 140: Perform encoding mapping on the aggregated encoding vector through the mapping output network to obtain a text line detection result of the Tibetan text image.

[0091] The output of the feature aggregation coding network is a vector, which is a feature representation and cannot intuitively express a certain meaning. Next, the mapping output network is required to encode and map the aggregated coding vector to convert the feature vector into the required text line detection result.

[0092] The mapping output network can perform multiple mapping tasks or one mapping task, each mapping task corresponds to a branch network, and the input of all branch networks is the output of the feature aggregation encoding network. The number of branch networks included in the mapping output network and the mapping tasks performed by each branch network are configured according to the text line detection requirements.

[0093] Taking the output of a segmentation map for Tibetan text line detection as an example, in some embodiments of the present application, the mapping output network includes: a segmentation map output branch network, through which the aggregated coding vector is encoded and mapped to obtain the text line detection result of the Tibetan text image, including: encoding and mapping the aggregated coding vector through the segmentation map output branch network to obtain the text line segmentation prediction result of the Tibetan text image; obtaining the text line detection result according to the text line segmentation prediction result. That is, the segmentation map output branch network performs the segmentation map output task according to the network parameters obtained by pre-training, encodes and maps the aggregated coding vector output by the feature aggregation coding network, and obtains the pixel-level segmentation map of the Tibetan text image. Optionally, the segmentation map can be represented as a two-dimensional matrix equal to the resolution size of the Tibetan text image, and the value of each matrix element is used to express which text line the pixel point at the corresponding position in the Tibetan text image is located in, or it is a background pixel.

[0094] Taking the Tibetan text line detection that needs to output the text line attributes of the text segment as an example, in some embodiments of the present application, the mapping output network includes: a segment classification output branch network, through which the aggregate coding vector is encoded and mapped to obtain the text line detection result of the Tibetan text image, including: encoding and mapping the aggregate coding vector through the segment classification output branch network to obtain the text line classification prediction result of the candidate segment. That is, the segment classification output branch network performs the classification output task of the candidate segment according to the network parameters obtained in advance, encodes and maps the aggregate coding vector output by the feature aggregation coding network, and obtains the classification result based on the text line for each candidate segment detected in the Tibetan text image. The classification result can be used to indicate which text line each candidate segment belongs to.

[0095] Taking the Tibetan text line detection as an example, in some embodiments of the present application, the mapping output network includes: a border detection output branch network, through which the aggregated coding vector is encoded and mapped to obtain the text line detection result of the Tibetan text image, including: encoding and mapping the aggregated coding vector through the border detection output branch network to obtain the detection frame information of the fragment in the Tibetan text image. That is, the border detection output branch network performs the border detection output task according to the network parameters obtained by pre-training, encodes and maps the aggregated coding vector output by the feature aggregation coding network, and obtains the detection frame position information of the fragment detected in the Tibetan text image.

[0096] Those skilled in the art should understand that in the text recognition stage and the model training stage, the specific implementation methods of the segment detection network 210, the feature aggregation coding network 220 and the mapping output network 230 in the text line detection model for feature extraction, aggregation coding and mapping output of the input text image are the same. In order to facilitate the reader to understand the specific implementation methods of the above steps, the training scheme of the text line detection model is illustrated below.

[0097] Optionally, the training samples used to train the text line detection model may include actual samples and synthetic samples, wherein the sample images of the actual samples include conventional Tibetan document sample images, conventional Tibetan scene sample images, Tibetan ancient book woodcut sample images, etc. The synthetic samples cover Tibetan images with multiple fonts, multiple font sizes, and multiple backgrounds, and at the same time, different line overlap rates can be randomly set to fit the actual sample effect.

[0098] At the same time, the training samples need to be labeled in advance and sample labels need to be set.

[0099] Taking the mapping output network of the text line detection model including: a fragment classification output branch network, a bounding box detection output branch network and a segmentation map output branch network as an example, optionally, the sample labels of the training samples include: the true value of the detection box position of the fragment included in the sample image, the true value of the text line classification of the fragment, and the true value of the segmentation map at the pixel level.

[0100] In the sample annotation process, considering the annotation cost and combining the characteristics of the text line detection algorithm executed by the text line detection model, the text line annotation can use polygons to represent the position of the text line, and then further convert the polygonal representation of the text line into multiple continuous fragment representations. Optionally, based on the multi-scale prediction method adopted by the text line detection model, in the training sample annotation process, it is also necessary to convert the true value of the fragment into a fragment representation with a width corresponding to the anchor box width of each scale (such as 4, 8 and 16) according to the network structure design of the text line detection model, so as to mark the detection boxes of the fragments corresponding to multiple scales in the text image.

[0101] Accordingly, the loss value of the text line detection model is calculated according to the loss value corresponding to each branch network. Optionally, the loss value Loss of the text line detection model can be calculated by the following loss function:

[0102] Loss = λL class +α×L det +β×L cluster ;

[0103] Among them, L class represents the text line classification loss of the segment, L det represents the bounding box regression loss for fragment detection, Lcluster represents the pixel-based segmentation loss, α, β, and λ are the weights of the loss values ​​of the corresponding branch networks. class and L cluster The cross entropy loss function can be used to calculate, L det The mean absolute error loss function (ie, L1 loss function) may be used for calculation. The present application does not limit the expression form of the above loss function.

[0104] During the model training process, for each training sample, the text line detection model performs fragment detection on the Tibetan text image through the fragment detection network 210 to obtain the detection frame and fragment features of the candidate fragment in the sample image; then, based on the detection frame, the position coding information of the candidate fragment is obtained; the position coding information and the fragment features are aggregated and encoded through the feature aggregation coding network 220 to obtain the aggregated coding vector of each candidate fragment; finally, the aggregated coding vector is encoded and mapped through the mapping output network 230 to obtain the classification result prediction value of the fragment in the sample image, the detection frame position prediction value of the fragment and the pixel-level segmentation prediction result.

[0105] Afterwards, the text line classification loss, segment bounding box regression loss and segmentation loss of the segment are calculated respectively according to the classification result prediction value, the segment detection box position prediction value and the pixel-level segmentation prediction result, as well as the corresponding true value in the sample label of the training sample. Finally, the model loss of the text line detection model is calculated according to the text line classification loss, segment bounding box regression loss and segmentation loss through the aforementioned model loss function calculation method, and with the goal of optimizing the model loss, the text line detection model is iteratively trained by optimizing the model parameters until the optimal model parameters are obtained.

[0106] The iterative training method of the text line detection model can be found in the prior art and will not be described in detail in the embodiments of the present application.

[0107] After initializing the segment detection network 210, the feature aggregation encoding network 220 and the mapping output network 230 of the text line detection model with the obtained optimal model parameters, a text line detection model applied to Tibetan text line detection can be obtained.

[0108] The specific implementation method of training the text line detection model based on the training samples is the prior art and will not be described in detail in the embodiments of the present application.

[0109] The Tibetan text line detection method disclosed in the embodiment of the present application is executed by a pre-trained text line detection model, and the text line detection model includes: a segment detection network, a feature aggregation coding network and a mapping output network. The method performs segment detection on the Tibetan text image through the segment detection network to obtain the detection frame and segment features of the candidate segment; and obtains the position coding information of the candidate segment according to the detection frame; then, the position coding information and the segment features are aggregated and encoded by the feature aggregation coding network to obtain the aggregate coding vector of each candidate segment; finally, the aggregate coding vector is encoded and mapped by the mapping output network to obtain the text line detection result of the Tibetan text image. This method combines the advantages of the regression method that can effectively deal with overlapping problems and the powerful feature aggregation classification ability of the neural network model, which not only realizes the accurate detection of Tibetan text lines, but also avoids complex post-processing and improves the performance of Tibetan text line detection.

[0110] The Tibetan character structure is characterized by taking the base character as the center, with the front added character in front, the back added character in the back, the upper added character on the top, and the lower added character at the bottom. The lower added character can be multiple, and the base character and the front added character and the back added character are aligned in the horizontal direction. Based on the above characteristics, the Tibetan text line will appear that the adjacent lines are close to each other, the base character part does not cross, but the lower added character of the previous line and the upper added character of the line are on the same horizontal line. And because some Tibetan characters do not have upper added characters and lower added characters, therefore, the characters between adjacent Tibetan text lines are staggered and overlapped, and there is no regularity in the intersection, and it is difficult to detect the Tibetan text line. The Tibetan text line detection in the prior art needs to be post-processed.

[0111] The Tibetan text line detection method disclosed in the embodiment of the present application combines a regression-based detection method to split the text line into multiple small segments, performs regression fitting on each segment, and then aggregates the segments into text lines through a neural network. There is no need to perform complex post-processing on the text line detection results, avoiding the defect of inaccurate detection results due to post-processing, thereby improving the accuracy of Tibetan text line detection.

[0112] The present application also discloses a Tibetan text line detection device, which is executed by a pre-trained text line detection model, wherein the text line detection model includes: a segment detection network, a feature aggregation encoding network and a mapping output network, such as Figure 6 As shown, the device comprises:

[0113] The segment detection and image feature acquisition module 610 is used to perform segment detection on the Tibetan text image through the segment detection network to obtain the detection frame and segment features of the candidate segment;

[0114] A segment position coding information acquisition module 620 is used to acquire the position coding information of the candidate segment according to the detection frame;

[0115] An aggregate coding module 630 is used to perform aggregate coding on the position coding information and the segment features through the feature aggregate coding network to obtain an aggregate coding vector for each of the candidate segments;

[0116] The mapping output module 640 is used to perform encoding mapping on the aggregated encoding vector through the mapping output network to obtain a text line detection result of the Tibetan text image.

[0117] Optionally, the aggregate coding module 630 is further configured to:

[0118] For each of the candidate segments, using the position encoding information and the segment features of the candidate segment as features to be encoded of the candidate segment;

[0119] The sequence of features to be encoded is used as the input feature sequence of the feature aggregation encoding network, and the multi-head self-attention network is used to perform correlation calculation on the features to be encoded in the input feature sequence to obtain an aggregated encoding vector for each candidate segment.

[0120] Optionally, the segment detection network includes: a feature extraction network and a target detection network, and the segment detection and image feature acquisition module 610 is further used to:

[0121] Performing multi-scale feature extraction on the Tibetan text image through the feature extraction network to obtain global feature maps of preset multiple scales;

[0122] The object detection network performs fragment detection of corresponding width on the global feature map of each scale to obtain detection frames and fragment features of candidate fragments corresponding to each scale.

[0123] Optionally, performing fragment detection of corresponding width on the global feature map of each scale through the object detection network to obtain detection frames and fragment features of candidate fragments corresponding to each scale includes:

[0124] For each of the global feature maps of the scale, using the object detection network, using anchor frames of N sizes corresponding to the corresponding scales to perform segment detection on the global feature map respectively, to obtain detection frames of candidate segments corresponding to the scales, wherein the width of the anchor frame of each size is: a preset width negatively correlated with the corresponding scale, the height of the anchor frame of each size is: a height determined according to distribution data of text line heights in training samples of the text line detection model and negatively correlated with the corresponding scale, and N is a natural number greater than 1;

[0125] According to the detection frame of the candidate segment corresponding to each scale and the global feature map, the segment feature of each candidate segment is obtained.

[0126] Optionally, acquiring the segment feature of each candidate segment according to the detection frame of the candidate segment corresponding to each scale and the global feature map includes:

[0127] Acquiring image features of the Tibetan text image according to the global feature map;

[0128] According to the feature mapping relationship between the image area of ​​the Tibetan text image and the image feature, a feature value of a target feature point in the image feature is obtained, wherein the target feature point is selected from: a feature point carrying image features of at least three image areas in the detection frame;

[0129] A segment feature of the candidate segment corresponding to the detection frame is generated according to the feature value of the target feature point.

[0130] The Tibetan text line detection device disclosed in the embodiment of the present application is used to implement the Tibetan text line detection method described in the embodiment of the present application. The specific implementation methods of each module of the device will not be repeated here, and reference can be made to the specific implementation methods of the corresponding steps in the method embodiment.

[0131] The Tibetan text line detection device disclosed in the embodiment of the present application executes the device through a pre-trained text line detection model, and the text line detection model includes: a segment detection network, a feature aggregation coding network and a mapping output network. The device performs segment detection on the Tibetan text image through the segment detection network to obtain the detection frame and segment features of the candidate segment; and obtains the position coding information of the candidate segment according to the detection frame; then, the position coding information and the segment features are aggregated and encoded by the feature aggregation coding network to obtain the aggregate coding vector of each candidate segment; finally, the aggregate coding vector is encoded and mapped by the mapping output network to obtain the text line detection result of the Tibetan text image. The device combines the advantages of the regression method that can effectively handle the overlapping problem and the powerful feature aggregation classification ability of the neural network model, which not only realizes the accurate detection of Tibetan text lines, but also avoids complex post-processing and improves the performance of Tibetan text line detection.

[0132] The Tibetan character structure is characterized by taking the base character as the center, with the front added character in front, the back added character in the back, the upper added character on the top, and the lower added character at the bottom. The lower added character can be multiple, and the base character and the front added character and the back added character are aligned in the horizontal direction. Based on the above characteristics, the Tibetan text line will appear that the adjacent lines are close to each other, the base character part does not cross, but the lower added character of the previous line and the upper added character of the line are on the same horizontal line. And because some Tibetan characters do not have upper added characters and lower added characters, therefore, the characters between adjacent Tibetan text lines are staggered and overlapped, and there is no regularity in the intersection, and it is difficult to detect the Tibetan text line. The Tibetan text line detection in the prior art needs to be post-processed.

[0133] The Tibetan text line detection device disclosed in the embodiment of the present application combines a regression-based detection method to split the text line into multiple small segments, performs regression fitting on each segment, and then aggregates the segments into text lines through a neural network. There is no need to perform complex post-processing on the text line detection results, avoiding the defect of inaccurate detection results due to post-processing, thereby improving the accuracy of Tibetan text line detection.

[0134] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0135] The above is a detailed introduction to a Tibetan text line detection method and device provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0136] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0137] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components in the electronic device according to the embodiment of the present application. The present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0138] For example, Figure 7 An electronic device that can implement the method according to the present application is shown. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer, etc. The electronic device traditionally includes a processor 710 and a memory 720 and a program code 730 stored on the memory 720 and can be run on the processor 710, and the processor 710 implements the method described in the above embodiment when executing the program code 730. The memory 720 can be a computer program product or a computer-readable medium. The memory 720 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. The memory 720 has a storage space 7201 for the program code 730 of the computer program for executing any method step in the above method. For example, the storage space 7201 for the program code 730 can include various computer programs for implementing the various steps in the above method respectively. The program code 730 is a computer-readable code. These computer programs can be read from one or more computer program products or written into the one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. The computer program includes a computer readable code, and when the computer readable code is executed on an electronic device, the electronic device is caused to execute the method according to the above embodiment.

[0139] The embodiment of the present application also discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the Tibetan text line detection method described in the embodiment of the present application are implemented.

[0140] Such a computer program product may be a computer-readable storage medium, which may have a computer-readable storage medium having a Figure 7The memory 720 in the electronic device shown in the figure is similar to the storage segment, storage space, etc. The program code can be compressed and stored in the computer-readable storage medium in an appropriate form. The computer-readable storage medium is generally as shown in the reference Figure 8 The portable or fixed storage unit. Generally, the storage unit includes computer readable code 730', which is a code read by a processor. When the code is executed by the processor, each step in the method described above is implemented.

[0141] The term "one embodiment", "embodiment" or "one or more embodiments" herein means that a particular feature, structure or characteristic described in conjunction with the embodiment is included in at least one embodiment of the present application. In addition, please note that the examples of the term "in one embodiment" here do not necessarily all refer to the same embodiment.

[0142] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0143] In the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.

[0144] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A Tibetan text line detection method, characterized in that: The method is performed by a pre-trained text line detection model, the text line detection model comprising: a segment detection network, a feature aggregation encoding network and a mapping output network, the method comprising: Performing segment detection on the Tibetan text image through the segment detection network to obtain detection frames and segment features of candidate segments; Acquire position coding information of the candidate segment according to the detection frame; Performing aggregation coding on the position coding information and the segment features through the feature aggregation coding network to obtain an aggregate coding vector for each of the candidate segments; The aggregated coding vector is coded and mapped through the mapping output network to obtain a text line detection result of the Tibetan text image.

2. The method according to claim 1, characterized in that The feature aggregation coding network is constructed based on a multi-head self-attention network. The feature aggregation coding network performs aggregation coding on the position coding information and the segment features to obtain an aggregate coding vector of each candidate segment, including: For each of the candidate segments, using the position encoding information and the segment features of the candidate segment as features to be encoded of the candidate segment; The sequence of features to be encoded is used as the input feature sequence of the feature aggregation encoding network, and the multi-head self-attention network is used to perform correlation calculation on the features to be encoded in the input feature sequence to obtain an aggregated encoding vector for each candidate segment.

3. The method according to claim 1, characterized in that: The segment detection network includes: a feature extraction network and a target detection network. The segment detection network is used to perform segment detection on the Tibetan text image to obtain the detection frame and segment features of the candidate segment, including: Performing multi-scale feature extraction on the Tibetan text image through the feature extraction network to obtain global feature maps of preset multiple scales; The object detection network performs fragment detection of corresponding width on the global feature map of each scale to obtain detection frames and fragment features of candidate fragments corresponding to each scale.

4. The method according to claim 3, characterized in that The performing fragment detection of corresponding widths on the global feature map of each scale by the object detection network to obtain detection frames and fragment features of candidate fragments corresponding to each scale includes: For each of the global feature maps of the scale, using the object detection network, using anchor frames of N sizes corresponding to the corresponding scales to perform segment detection on the global feature map respectively, to obtain detection frames of candidate segments corresponding to the scales, wherein the width of the anchor frame of each size is: a preset width negatively correlated with the corresponding scale, the height of the anchor frame of each size is: a height determined according to distribution data of text line heights in training samples of the text line detection model and negatively correlated with the corresponding scale, and N is a natural number greater than 1; According to the detection frame of the candidate segment corresponding to each scale and the global feature map, the segment feature of each candidate segment is obtained.

5. The method according to claim 4, characterized in that The acquiring the segment feature of each candidate segment according to the detection frame of the candidate segment corresponding to each scale and the global feature map includes: Acquiring image features of the Tibetan text image according to the global feature map; According to the feature mapping relationship between the image area of ​​the Tibetan text image and the image feature, a feature value of a target feature point in the image feature is obtained, wherein the target feature point is selected from: a feature point carrying image features of at least three image areas in the detection frame; A segment feature of the candidate segment corresponding to the detection frame is generated according to the feature value of the target feature point.

6. A Tibetan text line detection device, characterized in that: The device is executed by a pre-trained text line detection model, wherein the text line detection model includes: a segment detection network, a feature aggregation encoding network and a mapping output network, and the device includes: A segment detection and image feature acquisition module, used to perform segment detection on the Tibetan text image through the segment detection network to obtain a detection frame and segment features of a candidate segment; A segment position coding information acquisition module, used to acquire the position coding information of the candidate segment according to the detection frame; An aggregate coding module, configured to perform aggregate coding on the position coding information and the segment features through the feature aggregate coding network to obtain an aggregate coding vector for each of the candidate segments; A mapping output module is used to perform encoding mapping on the aggregated encoding vector through the mapping output network to obtain a text line detection result of the Tibetan text image.

7. The device according to claim 6, characterized in that The aggregation coding module is further used for: For each of the candidate segments, using the position encoding information and the segment features of the candidate segment as features to be encoded of the candidate segment; The sequence of features to be encoded is used as the input feature sequence of the feature aggregation encoding network, and the multi-head self-attention network is used to perform correlation calculation on the features to be encoded in the input feature sequence to obtain an aggregated encoding vector for each candidate segment.

8. The device according to claim 6, characterized in that The segment detection network includes: a feature extraction network and a target detection network, and the segment detection and image feature acquisition module is further used to: Performing multi-scale feature extraction on the Tibetan text image through the feature extraction network to obtain global feature maps of preset multiple scales; The object detection network performs fragment detection of corresponding width on the global feature map of each scale to obtain detection frames and fragment features of candidate fragments corresponding to each scale.

9. An electronic device comprising a memory, a processor, and a program code stored in the memory and executable on the processor, wherein: When the processor executes the program code, the Tibetan text line detection method according to any one of claims 1 to 5 is implemented.

10. A computer-readable storage medium having program code stored thereon, characterized in that: When the program code is executed by a processor, the steps of the Tibetan text line detection method described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Text line language recognition method and device and electronic equipment

    CN113468979A

  • Cancer lesion detection-oriented feature extraction and image-text fusion method and system

    CN113469962A

  • Determination of set of candidate transforms for video encoding

    IN202037042035A