Text-intensive image recognition model training method and device, equipment and storage medium
By automatically extracting textual statistical and geometric features and combining them with judgment rules to filter samples, and generating prompt words for fine-tuning of multimodal large model instructions, the problems of annotation dependence and sample imbalance in text-dense image recognition are solved, thereby improving the robustness and consistency of recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2026-03-03
- Publication Date
- 2026-06-09
Smart Images

Figure CN122176724A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, particularly to the field of computer vision, and can be used in application scenarios such as information flow recommendation. Specifically, it relates to a method, apparatus, device, and storage medium for training text-dense image recognition models. Background Technology
[0002] Information feed recommendation products typically rely on intelligent algorithms such as deep learning to extract features from massive amounts of content and model user interests to achieve personalized content distribution. To ensure user experience and platform content quality, visual quality control of cover images in the information feed is necessary, especially for cover images with dense text. Existing technologies generally employ image text density recognition methods based on deep neural networks. These methods involve manually labeling a large number of training samples and using models such as Convolutional Neural Networks (CNNs) or Transformers to build binary classifiers. However, these methods are highly sensitive to the quality and standards of the labeled training data. Summary of the Invention
[0003] This disclosure provides a method, apparatus, device, and storage medium for training a text-dense image recognition model.
[0004] According to a first aspect of this disclosure, a method for training a text-dense image recognition model is provided, comprising: extracting text features from each original image in an original image set to obtain text statistical features and text region geometric features; selecting a candidate image set from the original image set according to the text statistical features and text region geometric features and a preset text density determination rule; constructing a prompt word corresponding to each candidate image based on the text region geometric features and text density determination rule corresponding to each candidate image for the candidate image set; and using the candidate image set and the prompt word to perform instruction fine-tuning training on an initial multimodal large model to obtain a text-dense image recognition model.
[0005] According to a second aspect of this disclosure, a method for recognizing dense text images is provided, comprising: extracting text features from an image to be recognized to obtain statistical features of the text to be recognized and geometric features of the text region to be recognized; determining an initial judgment result based on the statistical features of the text to be recognized and the geometric features of the text region to be recognized, according to a preset target text density judgment rule; the initial judgment result being either suspected dense text or non-dense text; when the initial judgment result is suspected dense text, constructing a target prompt word using the geometric features of the text region to be recognized and the target text density judgment rule; inputting the target prompt word and the image to be recognized into a dense text image recognition model, and obtaining a final judgment result corresponding to the image to be recognized based on the recognition result of the dense text image recognition model; the final judgment result being either dense text or non-dense text; the dense text image recognition model is trained using the method of the first aspect.
[0006] According to a third aspect of this disclosure, a resource recommendation method is provided, comprising: obtaining a cover image of the resource to be recommended and a final judgment result corresponding to the cover image; the final judgment result is determined using the method of the second aspect; when the final judgment result is text-dense, a preset scattering strategy is used to recommend the resource to be recommended.
[0007] According to a fourth aspect of this disclosure, a training apparatus for a text-dense image recognition model is provided, comprising: an image processing module for extracting text features from each original image in an original image set to obtain text statistical features and text region geometric features; a rule filtering module for filtering candidate image sets from the original image set according to the text statistical features and text region geometric features, and according to preset text density determination rules; a training prompt word module for constructing prompt words corresponding to each candidate image based on the text region geometric features and text density determination rules corresponding to each candidate image; and a model training module for fine-tuning an initial multimodal large model using the candidate image set and prompt words to obtain a text-dense image recognition model.
[0008] According to a fifth aspect of this disclosure, a text-dense image recognition device is provided, comprising: a feature extraction module for extracting text features from an image to be recognized, obtaining statistical features of the text to be recognized and geometric features of the text region to be recognized; an initial judgment module for determining an initial judgment result based on the statistical features of the text to be recognized and the geometric features of the text region to be recognized, according to a preset target text-dense judgment rule; the initial judgment result being either suspected text-dense or non-text-dense; a prompt word recognition module for constructing a target prompt word using the geometric features of the text region to be recognized and the target text-dense judgment rule when the initial judgment result is suspected text-dense; and a final judgment module for inputting the target prompt word and the image to be recognized into a text-dense image recognition model, and obtaining a final judgment result corresponding to the image to be recognized based on the recognition result of the text-dense image recognition model; the final judgment result being either text-dense or non-text-dense; the text-dense image recognition model is trained using the method described in the first aspect.
[0009] According to a sixth aspect of this disclosure, a resource recommendation device is provided, comprising: an acquisition module, configured to acquire a cover image of a resource to be recommended and a final judgment result corresponding to the cover image; the final judgment result is determined using the method described in the second aspect; and a scattering recommendation module, configured to recommend the resource to be recommended using a preset scattering strategy when the final judgment result is text-dense.
[0010] According to a seventh aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the methods described in the embodiments of this disclosure.
[0011] According to an eighth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any of the methods according to embodiments of this disclosure.
[0012] According to a ninth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the methods according to embodiments of this disclosure.
[0013] The scheme disclosed herein can automatically extract textual statistical and geometric features, combine them with judgment rules to filter samples, generate unified prompt words, and perform fine-tuning of multimodal large model instructions. This significantly reduces data annotation costs and the impact of sample imbalance, while greatly improving the robustness and consistency of dense text recognition.
[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0015] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is a flowchart illustrating a text-dense image recognition model training method according to an embodiment of the present disclosure; Figure 2 This is a flowchart illustrating a text-dense image recognition method according to an embodiment of the present disclosure; Figure 3 This is a flowchart illustrating a resource recommendation method according to an embodiment of the present disclosure; Figure 4 This is another schematic flowchart of a text-dense image recognition method according to an embodiment of the present disclosure; Figure 5 This is a schematic diagram of the process of merging text regions according to an embodiment of the present disclosure; Figure 6 This is another schematic flowchart of a text-dense image recognition method according to an embodiment of the present disclosure; Figure 7 This is a schematic diagram of the structure of a text-dense image recognition model training device according to an embodiment of the present disclosure; Figure 8 This is a schematic diagram of the structure of a text-dense image recognition device according to an embodiment of the present disclosure; Figure 9 This is a schematic diagram of the structure of a resource recommendation device according to an embodiment of the present disclosure; Figure 10 This is a schematic diagram of a scenario for training a text-dense image recognition model according to an embodiment of the present disclosure; Figure 11 This is a schematic diagram of a scenario for a text-dense image recognition method according to an embodiment of the present disclosure; Figure 12 This is a schematic diagram of a scenario for a resource recommendation method according to an embodiment of this disclosure; Figure 13 This is a structural diagram of an electronic device used to implement the text-dense image recognition model training method, text-dense image recognition method, and / or resource recommendation method according to the embodiments of this disclosure. Detailed Implementation
[0016] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0017] In this document, the term "and / or" merely describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. The term "at least one" in this document indicates any combination of at least two of a plurality of elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. The terms "first" and "second" in this document refer to and distinguish between multiple similar technical terms, not to restrict the order or to limit there to only two. For example, "first feature" and "second feature" refer to two categories / two features; the first feature can be one or more, and the second feature can also be one or more.
[0018] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0019] Before introducing the technical solutions of the embodiments of this disclosure, the technical terms that may be used in this disclosure will be further explained: The cover image refers to the primary image displayed for each recommended content on the information feed recommendation page. It usually carries the title, brand elements, or core content image and is a key visual entry point to attract users to click and form a first impression.
[0020] In related technologies, text density recognition techniques based on deep neural networks are commonly used to determine the text proportion and layout in cover images. Large-scale manually annotated image data is used to train binary classification models such as CNNs or Transformers to identify whether the cover image is text-dense. However, such methods are highly sensitive to the quality and standards of the annotation data. When the annotated data is noisy, the definition of text density changes with business strategies, or there are inconsistencies in standards between different annotators or batches, the model's recognition performance will significantly decline. Furthermore, obtaining high-quality annotated samples mainly relies on manual annotation, making rapid iteration difficult. In addition, the task itself suffers from a severe imbalance in class distribution, resulting in a low proportion of samples that truly meet the text density criteria in a large number of cover images. This leads to low efficiency in discovering and annotating effective positive samples, further restricting the continuous optimization of model performance and deployment results.
[0021] To at least partially address one or more of the aforementioned problems and other potential issues, this disclosure proposes a method for training a text-dense image recognition model. This method can automatically extract text statistical and geometric features, combine them with judgment rules to filter samples, generate unified prompt words, and perform multimodal large model instruction fine-tuning. While significantly reducing data annotation costs and the impact of sample imbalance, it significantly improves the robustness and consistency of text-dense recognition.
[0022] This disclosure provides a method for training a text-dense image recognition model. Figure 1 This is a flowchart illustrating a text-dense image recognition model training method according to an embodiment of the present disclosure. This method can be applied to a text-dense image recognition model training device. The text-dense image recognition model training device is located in an electronic device. This electronic device includes, but is not limited to, fixed devices and / or mobile devices. For example, fixed devices include, but are not limited to, servers, which can be cloud servers or ordinary servers. Mobile devices include, but are not limited to, information flow recommendation devices, which can be mobile phones, tablets, etc. In some possible implementations, the text-dense image recognition model training method can also be implemented by a processor calling computer-readable instructions stored in memory. Figure 1 As shown, the training method for this text-dense image recognition model includes: S101. Extract text features from each original image in the original image set to obtain text statistical features and text region geometric features.
[0023] S102. Based on the statistical features of text and the geometric features of text regions, and in accordance with the preset text density determination rules, a candidate image set is obtained from the original image set.
[0024] S103. For the candidate image set, construct prompt words corresponding to each candidate image based on the geometric features of the text region and the text density determination rules corresponding to each candidate image.
[0025] S104. Using the candidate image set and prompt words, fine-tune the initial multimodal large model with instructions to obtain a text-dense image recognition model.
[0026] Here, the original image refers to image data directly obtained from an information flow system or content library that has not undergone intensive text filtering or manual annotation. In this embodiment, the original image can be various cover images, accompanying images, or other original business images. Text statistical features refer to various quantitative indicators related to text obtained at the image level, which can be used to quantitatively characterize the richness of text content in an image. Text region geometric features refer to the features obtained after geometrically modeling the detected text regions, which can be used to depict the spatial arrangement and layout structure of text in an image.
[0027] In this embodiment, each original image in the original image set can be acquired first, and the text regions in the images can be automatically detected and located to obtain detection results containing several text candidate boxes. Simultaneously, text recognition can be performed on each text candidate box to obtain the corresponding text content and character count. Then, based on the detected set of text candidate boxes, text statistical features related to the entire image are calculated, and geometric features of the text region are extracted for each text candidate box.
[0028] Here, the text density determination rule refers to a set of pre-designed judgment conditions used to distinguish whether an image meets the business definition of text density. In this embodiment of the disclosure, the text density determination rule can be a combination of thresholds and logical conditions set by human experience, or it can be a discriminant function obtained based on business needs and historical sample statistics, and the parameters can be adjusted according to the changes in the definition of text density in different scenarios.
[0029] In this embodiment, the text content in the image can first be determined based on statistical features of the text to determine whether it has reached a preliminary density level. If the preliminary conditions are met, the spatial distribution of the text is constrained by combining the geometric features of the text region. Images that meet the determination criteria are then selected from the original image set to form a candidate image set.
[0030] Here, prompt words refer to the text input content used to guide the model to understand and pay attention to information related to text density in an image when interacting with a multimodal large model. In this embodiment of the disclosure, prompt words are dynamically generated based on the specific geometric features of the text regions in each candidate image and the applicable text density determination rules.
[0031] In this embodiment of the disclosure, for each image in the candidate image set, the geometric features of the text region of the image can be read first, and then the geometric features and text density determination rules can be structurally filled based on the pre-designed prompt word template to generate prompt word text that matches the image.
[0032] In this embodiment, candidate images and prompt words can be paired to form multimodal training samples, and a target output can be configured for each sample based on the results of manual correction. On this basis, the training samples are fed into an initial multimodal large model, and the model is trained through fine-tuning via instructions. Through multiple rounds of iterative training, the model learns to accurately extract and fuse text statistics and geometric layout information from images based on clues such as task requirements and text layout described in the prompt words, ultimately resulting in a text-dense image recognition model with stable performance and strong generalization ability on text-dense image recognition tasks.
[0033] The technical solution of this disclosure automatically extracts text statistical features and text region geometric features from unlabeled original images, and combines them with text density judgment rules for candidate image screening. This enables efficient mining of training samples highly relevant to the text density recognition task without large-scale coarse screening, significantly reducing data annotation costs and alleviating the problem of severe imbalance between text-dense and non-text-dense samples. By automatically generating prompts associated with each image using geometric features and judgment rules, the multimodal large model can learn the concept of text density and discrimination boundaries under unified and stable rule constraints during instruction fine-tuning, reducing the impact of changes in annotation standards and subjective differences among annotators on model performance. The text density image recognition model obtained through instruction fine-tuning not only inherits the strong generalization ability of the large model in complex scenes, but also exhibits stronger robustness and consistency in text layout understanding and density judgment.
[0034] In some embodiments, text feature extraction is performed on each original image in the original image set to obtain text statistical features and text region geometric features, including: extracting text features from the original image using an optical character recognition model to obtain text content and text regions; performing statistics on the text content to obtain text statistical features; and performing spatial analysis on the text regions to obtain text region geometric features.
[0035] Here, Optical Character Recognition (OCR) models refer to machine learning or deep learning models used to automatically detect and recognize text in images. They can locate regions containing text in an image, output corresponding candidate boxes or segmented regions, and perform sequence modeling and decoding of pixels within these regions to output corresponding character sequences or text strings. Text content refers to the readable text information parsed from the original image by the OCR model, reflecting the actual semantic text information carried in the image. A text region refers to a sub-region in the original image located by the OCR model and determined to contain text content, defining the specific spatial location and extent of the text within the image.
[0036] In this embodiment, each original image to be processed in the original image set can be acquired first, and the preprocessed image can be input into a pre-trained optical character recognition model. Subsequently, the model first generates candidate regions, automatically detects multiple text regions that may contain text, and outputs the boundary position of each region in the image coordinate system. Feature extraction and sequence modeling are then performed on the image blocks within each text region, decoding the image features into corresponding character sequences, and outputting the text content within that region. Finally, for each original image, a set of text content consisting of the character sequences or strings corresponding to each text region, and a set of text regions consisting of the spatial position and shape information of each text region are obtained.
[0037] In this embodiment, all identified characters or words can first be counted to obtain basic quantitative indicators. Specifically, the composition ratio of different character types, such as the number and proportion of Chinese characters, letters, numbers, and punctuation, can be statistically analyzed to reflect the text component characteristics. Simultaneously, image size information can be combined to calculate the coverage of text content within the entire image, reflecting the spatial weight of the text content visually. Furthermore, the average length, maximum length, minimum length, and content density between lines of text can be statistically analyzed to further characterize the richness and density of the text at the content level. Ultimately, text statistical features including the number of characters, category distribution, and density indicators are formed.
[0038] In this embodiment, the geometric dimensions of each text region can be calculated first. Then, based on the center coordinates or vertex coordinates of the text region, it can be mapped to the normalized coordinate system of the image to analyze the relative positional distribution of the text region in the entire image. Furthermore, the relative relationships between multiple text regions can be modeled to identify whether there are multiple consecutive lines of text, closely arranged paragraphs of text, or scattered and isolated small blocks of text. Simultaneously, through clustering or connectivity analysis, text regions that are close to each other or have layout relationships can be divided into several groups. The overall area, outline shape, and spatial coverage of each group can be calculated, thereby obtaining the geometric features of the text regions, including positional distribution, size and shape, spacing relationships, and layout structure.
[0039] Thus, by first using an OCR model to automatically extract text content and text regions from the original image, and then performing statistical analysis on the text content and spatial geometric analysis on the text regions, a set of text feature representations that includes both content and spatial layout dimensions can be automatically constructed at the image level. By fully utilizing the automatic recognition capabilities of the OCR model, the efficiency and scalability of text feature extraction are significantly improved, while reducing annotation costs. By combining text statistical features with text region geometric features, subsequent text density determination can comprehensively consider multi-dimensional information such as the quantity, coverage, and layout of text in the image, thereby improving the accuracy and robustness of text density recognition.
[0040] In some embodiments, the text content is statistically analyzed to obtain text statistical features, including: analyzing the text content to obtain the number of lines and the number of characters; and obtaining text statistical features based on the number of lines and the number of characters.
[0041] Here, the number of text lines refers to the total number of text lines obtained after dividing the recognized text into several lines according to the visual layout structure after OCR analysis of the original image. The number of text characters refers to the total number of all recognized text characters in the same image.
[0042] In this embodiment, the text regions can first be aggregated and sorted according to their vertical and horizontal coordinates. Based on the vertical overlap or baseline position of the text regions, text regions that are spatially close and have the same arrangement direction are grouped into the same row, thereby dividing the image into several logical text lines. The number of these text lines is then counted to obtain the number of text lines. Subsequently, while completing the row division, the length of the character sequence identified in each text region can be calculated. All characters are counted one by one and summed over the entire image to obtain the number of characters in the image.
[0043] In this embodiment, the number of lines and the number of characters can be directly used as the two basic features. Alternatively, derived indices such as average number of characters per line, maximum number of characters per line, minimum number of characters per line, variance or standard deviation of the number of characters per line can be calculated to describe the uniformity and concentration of text distribution across different lines. In particular, the number of characters can be normalized by combining image size or text coverage area to obtain an average number of characters per unit area or unit width, thereby enhancing the comparability of features across images of different resolutions.
[0044] Thus, by first statistically analyzing the text content to obtain the number of lines and characters, and then constructing text statistical features based on these, the layout hierarchy and information content of text in an image can be accurately characterized using a very small number of highly correlated statistical indicators without increasing complex computational overhead. This is beneficial for quickly assessing text density in large-scale image data. Both the number of lines and characters are directly counted from the OCR recognition results, with clear definitions and simple calculation methods, effectively reducing reliance on manual experience parameters during feature extraction.
[0045] In some embodiments, spatial analysis of the text region is performed to obtain the geometric features of the text region, including: calculating a first area ratio of the total area of all text regions in the original image, and using the first area ratio as the geometric features of the text region.
[0046] In this embodiment, the bounding box or mask information of each text region in the original image can be obtained first, and the area of each text region can be calculated based on its width, height, or the number of foreground pixels in the mask. Then, the areas of all text regions within the same original image are summed to obtain the total area of the text regions. Next, the total area of the original image is calculated based on its resolution, and the total area of the text regions is divided by the total area of the original image to obtain a first area ratio of the total area of the text regions in the original image. Finally, the first area ratio can be stored as a geometric feature of the text regions.
[0047] Thus, by using the ratio of the total area of the text region to the total area of the image as a geometric feature, the spatial coverage of text in an image can be effectively characterized, facilitating the rapid differentiation between image types with very little, moderate, and large areas of text. Simultaneously, the first area ratio is normalized, facilitating unified comparison and thresholding between images of different sizes and from different sources. The calculation process relies solely on basic geometric operations, resulting in low overhead and simple implementation, which is beneficial for efficiently and stably supporting text-dense image recognition tasks in large-scale business scenarios.
[0048] In some embodiments, the original image includes multiple text regions; spatial analysis of the text regions to obtain geometric features of the text regions includes: dynamically merging multiple adjacent text regions according to the spatial proximity relationship between each text region to obtain a merged target text region; calculating a second area ratio of the target text region in the original image, and using the second area ratio as the geometric feature of the text region.
[0049] Here, spatial proximity refers to the degree of closeness and relative position of any two text regions in the image coordinate space. The target text region refers to the merged region obtained after dynamically merging multiple adjacent text regions according to spatial proximity. In this embodiment of the disclosure, the target text region can cover an entire continuous block of text.
[0050] In this embodiment, the spacing, overlap, and relative row / column positions of any two text regions in the horizontal and vertical directions are first calculated and compared with a proximity threshold dynamically set based on text height, line spacing, etc. When the spacing between two text regions is less than the threshold or there is obvious overlap or alignment, they are determined to be spatially adjacent text regions. Subsequently, clustering or connected component analysis is used to divide one or more groups of text regions that meet the proximity condition into several clusters. All text regions within each cluster are dynamically merged, and the merged region is recorded as the corresponding target text region. This integrates the originally scattered small text regions into a small number of large text regions that reflect the actual typesetting structure.
[0051] In this embodiment, the area of each target text region can be calculated based on its circumscribed rectangle or polygonal outline, and the areas of all target text regions within the same image are summed to obtain the total coverage area of the merged text block in the image. Simultaneously, the total area of the entire image is calculated based on the resolution information of the original image. Finally, the total area of the target text regions is divided by the total area of the original image to obtain the second area ratio of the target text regions in the original image, and this normalized ratio value is stored as the geometric feature of the text region corresponding to the image.
[0052] Thus, by introducing spatial proximity and dynamically merging adjacent text regions, small text boxes can be integrated into larger text regions that better align with human visual perception, thereby reducing the influence of irrelevant gaps and noise boxes when calculating area proportions. Secondly, the area proportion is closer to the user's subjective experience, accurately reflecting the layout of blocks of text in the image, improving the stability and accuracy of text density determination. Furthermore, the calculation process is simple and easy to deploy on large-scale image data.
[0053] In some embodiments, multiple adjacent text regions are dynamically merged based on their spatial proximity to obtain a merged target text region. This includes: determining the center point and diagonal length of each text region based on its position information; selecting any two text regions as a text region pair; determining the corresponding target distance and target diagonal length for any text region pair, and using the ratio between the target distance and the target diagonal length as the proximity distance; determining text region pairs whose proximity distance is less than a preset proximity determination threshold as adjacent; and dynamically merging multiple adjacent text region pairs to obtain the merged target text region.
[0054] Here, location information refers to the spatial location of the text region in the original image, which can be represented by the coordinates of the bounding rectangle of the region. The center point refers to the coordinates of the geometric center of the bounding rectangle of the text region, which can be calculated using the x-coordinates of the midpoints of the left and right boundaries and the y-coordinates of the midpoints of the top and bottom boundaries of the rectangle. The diagonal length refers to the length of either of the two diagonals of the bounding rectangle of the text region, which can be calculated using the width and height of the rectangle according to the Pythagorean theorem.
[0055] In this embodiment of the disclosure, the coordinates of the upper left and lower right corners of the bounding rectangle of each text area output by the OCR model can be read first, the width and height of the rectangle can be calculated, the coordinates of the center point of the rectangle can be obtained according to the geometric center formula, and the length of the diagonal of the rectangle can be calculated using the width and height through the Pythagorean theorem.
[0056] Here, a text region pair refers to an ordered or unordered combination of two text regions selected from multiple text regions in the same original image.
[0057] In this embodiment of the disclosure, all text regions in the same original image can be combined in pairs, and several text region pairs can be generated by traversal or neighborhood filtering.
[0058] Here, target distance refers to the spatial distance between two text regions calculated according to preset rules for a given pair of text regions. Target diagonal length refers to the reference length obtained by combining the diagonal lengths of the two text regions for a given pair of text regions.
[0059] In this embodiment, the coordinates of the center points of two text regions can be read first, and the target distance between the center points can be calculated using the Euclidean distance formula. Then, the diagonal lengths of each of the two text regions can be read, and the target diagonal length of the text region pair can be obtained according to a preset rule. Finally, the target distance is divided by the target diagonal length to obtain the dimensionless proximity distance.
[0060] Here, the proximity determination threshold refers to a pre-set numerical threshold for proximity distance. When the proximity distance of a certain text region pair is less than the threshold, the two text regions are considered to be spatially adjacent to each other.
[0061] In this embodiment of the disclosure, the proximity distance of each text region pair is compared with a pre-set proximity determination threshold. When the proximity distance of a text region pair is less than the threshold, the text region pair is marked as a spatially adjacent region pair. For region pairs with a proximity distance greater than or equal to the threshold, they are considered as not adjacent to each other.
[0062] In this embodiment of the disclosure, adjacency relationships between text regions can be constructed based on all pairs of text regions marked as adjacent to each other. One or more groups of text regions connected by adjacency relationships are regarded as the same connected set. Then, a merging operation is performed on all text regions in each connected set to obtain a merged region that covers all text in the connected set. This merged region is defined as the corresponding target text region.
[0063] Thus, by introducing the normalized ratio of the center point distance to the diagonal length as the nearest neighbor distance, and combining it with a preset nearest neighbor determination threshold, scale-independent nearest neighbor determination can be achieved, avoiding inconsistencies in determinations across different font sizes. Furthermore, by dynamically merging text regions determined to be adjacent, multiple small boxes generated by detection fragmentation or character-level segmentation can be integrated into a more cohesive text region that better aligns with human visual perception. This improves the stability, robustness, and accuracy of text-dense image recognition in various scenarios.
[0064] In some embodiments, for any pair of text regions, determining the corresponding target distance and target diagonal length includes: calculating the distance between the center points of the two text regions in the pair of text regions as the target distance; and selecting the larger of the two diagonal lengths of the two text regions in the pair of text regions as the target diagonal length.
[0065] In this embodiment of the disclosure, given the coordinates of the center points of two text regions in a certain text region pair, the straight-line distance between the two center points can be calculated based on the Euclidean distance formula. That is, first, the difference between the horizontal coordinates and the difference between the vertical coordinates are obtained, then the squares are calculated, the sums are calculated, and the square root is taken to obtain the distance between the corresponding center points of the text region pair, and this distance value is directly used as the target distance of the text region pair.
[0066] In this embodiment of the disclosure, given the known diagonal lengths of the two text regions in a certain text region pair, the larger of the two values can be selected as the target diagonal length of the text region pair through numerical comparison.
[0067] Thus, by directly using the Euclidean distance between the center points of two text regions as the target distance, the spatial interval between regions can be quantified in a unified and intuitive way. Furthermore, using the larger of the two diagonal lengths as the target diagonal length better reflects the overall scale characteristics of the text region pair, enabling the proximity distance to have a clear scale normalization capability. This maintains consistency in the proximity determination criteria across different types of text regions, improving the rationality and robustness of proximity judgments.
[0068] In some embodiments, the text density determination rule includes at least: a statistical feature threshold and a geometric feature threshold; according to the text statistical features and the text region geometric features, a candidate image set is obtained from the original image set according to the preset text density determination rule, including: extracting original images from the original image set whose text statistical features are greater than or equal to the statistical feature threshold and whose text region geometric features are greater than or equal to the geometric feature threshold, to obtain the candidate image set.
[0069] Here, the statistical feature threshold refers to a pre-set lower limit for the statistical features of text. When the statistical feature value of a text in an image is greater than or equal to this threshold, the image is considered to have met the basic requirements for dense text in terms of text quantity or density. In this embodiment, the statistical feature threshold includes at least a line count sub-threshold and a character count sub-threshold. The geometric feature threshold refers to a pre-set lower limit for the geometric features of a text region. When the geometric feature value of a text region in an image is greater than or equal to this threshold, the image is considered to have met the basic requirements for dense text in terms of spatial coverage or page occupancy. In this embodiment, the geometric feature threshold includes at least an area ratio sub-threshold.
[0070] In this embodiment, the text statistical features and text region geometric features of each image are compared one by one with pre-set sub-thresholds for line count, character count, and area ratio. Only when the number of lines of text in an image is not less than the line count sub-threshold and the total number of characters is not less than the character count sub-threshold is the text statistical feature considered to be greater than or equal to the statistical feature threshold. Simultaneously, only when the area ratio of the text region in the image is not less than the area ratio sub-threshold is the text region geometric feature considered to be greater than or equal to the geometric feature threshold. Under the premise of satisfying the above two conditions, the image is selected from the original image set and added to the candidate image set. Finally, the candidate image set is composed of all images that satisfy the statistical feature threshold and the geometric feature threshold.
[0071] Thus, by simultaneously introducing statistical and geometric feature thresholds, we can ensure that the selected candidate images have both a sufficient number of lines and characters of text and occupy a sufficiently large image area. This makes the selection results for text-dense images more intuitive for users, significantly improving the purity of the candidate set and the effectiveness of subsequent processing. Furthermore, both statistical and geometric feature thresholds are simple, adjustable scalar parameters, easily configured and optimized for different business scenarios. The calculation process relies only on basic counts and ratio comparisons, making it easy to deploy efficiently on large-scale image data.
[0072] In some embodiments, for a set of candidate images, based on the geometric features of the text regions corresponding to each candidate image and the text density determination rules, a prompt word corresponding to each candidate image is constructed, including: generating structured description information describing the distribution and content of each text region based on the geometric features and statistical features of the text regions corresponding to the candidate images; generating rule description information representing the text density determination rules based on the text density determination rules; and constructing a prompt word based on a preset prompt word template according to the structured description information and the rule description information.
[0073] In this embodiment, all text regions in the same image can first be uniformly organized and sorted based on their geometric and statistical features. Then, a record containing fields such as region number, center coordinates, width and height or diagonal length, area percentage, and identified text content can be generated for each text region. These records are then organized in a predefined format to form a structured descriptive information that fully reflects the text distribution pattern and text content of the image.
[0074] In this embodiment of the disclosure, the threshold parameters and logical relationships such as the line number sub-threshold, word number sub-threshold, and area ratio sub-threshold in the text density determination rule are transcribed into a clear and easy-to-understand descriptive form, thereby constructing a rule description information that can accurately characterize the current text density determination strategy.
[0075] In this embodiment of the disclosure, when generating prompt words, structured description information can be filled into the corresponding layout placeholders in the prompt word template in an appropriate manner, and rule description information can be filled into the corresponding rule placeholders in the prompt word template, and finally automatically concatenated into a complete prompt word text.
[0076] In this way, by transforming the geometric and statistical features of the text regions of candidate images into structured descriptive information and generating clear and readable rule description information at the same time, and then constructing prompt words based on a unified prompt word template, the image content and judgment rule information can be fully presented to the downstream model in a standardized and consistent manner without losing key information. This significantly reduces the ambiguity in model understanding and improves the model's instruction compliance and output consistency in text-intensive tasks.
[0077] In some embodiments, a text-dense image recognition model is obtained by fine-tuning an initial multimodal large model using a candidate image set and prompt words. This includes: constructing a training sample set based on the candidate image set and prompt words using pre-determined annotation information; inputting each candidate image and its corresponding prompt word from the training sample set into the initial multimodal large model to obtain a predicted label; calculating a loss value based on the difference between the predicted label and the annotation information, and updating the parameters of the initial multimodal large model based on the loss value to obtain the text-dense image recognition model.
[0078] Here, the annotation information refers to the supervisory information that is pre-labeled for candidate images by humans or a highly reliable system.
[0079] In this embodiment, for each candidate image, its corresponding annotation information can be removed first, and then combined with the image itself and its prompt words to form a complete training sample record. Subsequently, all such training samples are organized and stored in a unified data format to form a training sample set containing a large number of samples.
[0080] Here, the predicted label refers to the output result automatically generated by the initial multimodal large model based on the current model parameters after receiving the input of a certain training sample.
[0081] In this embodiment of the disclosure, during training, samples are read sequentially or in batches from the training sample set. The candidate image from each sample is input into the initial multimodal large model via the visual encoding part, and the corresponding prompt word is sent as text input to the model's language or multimodal fusion module. Further, under the current parameter configuration, the model jointly encodes and understands the structured descriptions and rule descriptions in the image content and prompt words, and generates corresponding output results based on its internal decoding or output header. These output results are then formatted into predicted labels corresponding to the annotation information, serving as the predicted output for this training sample in the current round of forward inference.
[0082] Here, the loss value refers to the value calculated by a preset loss function based on the difference between the predicted label and the corresponding labeled information. It is used to quantify the degree of inconsistency between the current model output and the standard answer. The larger the loss value, the more the model prediction deviates from the labeled information. During training, the model parameters are updated by minimizing the loss value.
[0083] In this embodiment, after obtaining the predicted label for each training sample, it is aligned with the corresponding annotation information according to a predefined comparison method. The difference between the predicted label and the annotation information is calculated, and this difference is quantified into a loss value using a loss function. Then, backpropagation is performed on the model based on this loss value to calculate the gradient of the parameters of each layer. The parameters of the initial multimodal large model are iteratively updated according to the selected optimization algorithm, so that the model gradually reduces the loss value on the training samples. Finally, after multiple training rounds, when the loss value converges or reaches the expected effect, a text-dense image recognition model that performs better in text-dense image scenarios is obtained.
[0084] Thus, by constructing a training sample set using candidate image sets, structured prompts, and precise annotation information, and then fine-tuning the initial multimodal model based on this set, the model can retain its original general multimodal capabilities while learning output strategies and understanding patterns more suited to the specific task of text-dense image recognition. The loss value calculated from the difference between predicted labels and annotation information provides a clear optimization objective for parameter updates, enabling the model to gradually reduce the error rate under the supervision of a large number of real samples, and improving its adaptability to tasks with complex text layouts, large areas of text coverage, and rule constraints.
[0085] In some implementations, after obtaining a text-dense image recognition model, the OCR model and / or text-dense judgment rules can be optimized based on the recognition results output by the text-dense image recognition model. Specifically, a certain size of image dataset can be selected first, and each image and its corresponding prompt word can be input into the text-dense image recognition model, which will then output a structured recognition result for that image. In particular, the confidence level of the model output can be evaluated, and outputs with higher confidence levels can be retained as high-quality simulation labels or reference results for error correction. Further, for the same batch of images, existing OCR models can be called to generate corresponding OCR output results, and the two can be aligned and compared line by line, region by region, or character by character, and then checked and annotated for correction, thereby forming a batch of training samples specifically for the OCR model. Then, the images can be used as input, and the confirmed text-dense image recognition results can be used as target output labels. The existing OCR model can be retrained or fine-tuned on this training set, so that the recognition ability of the OCR model in text-dense scenes and complex layout scenes can be specifically improved. At the same time, for training samples, we can analyze their feature values in terms of number of lines, number of words, area ratio, etc. By adjusting the sub-thresholds of number of lines, number of words, and area ratio, we can make the rule judgment and the model judgment consistent on the vast majority of samples, while taking into account the business requirements for precision and recall.
[0086] This disclosure provides a method for recognizing dense text images. Figure 2 This is a flowchart illustrating a text-dense image recognition method according to an embodiment of the present disclosure. This method can be applied to a text-dense image recognition device. The text-dense image recognition device is located in an electronic device. This electronic device includes, but is not limited to, fixed devices and / or mobile devices. For example, fixed devices include, but are not limited to, servers, which can be cloud servers or ordinary servers. Mobile devices include, but are not limited to, information flow recommendation devices, which can be mobile phones, tablets, etc. In some possible implementations, the text-dense image recognition method can also be implemented by a processor calling computer-readable instructions stored in memory. Figure 2 As shown, this method for recognizing dense text images includes: S201. Extract text features from the image to be recognized to obtain statistical features of the text to be recognized and geometric features of the text region to be recognized.
[0087] S202. Based on the statistical features of the characters to be identified and the geometric features of the regions to be identified, determine the initial judgment result according to the preset target character density judgment rules; the initial judgment result is suspected character density or non-character density.
[0088] S203. When the initial judgment result is suspected to be dense text, the target prompt word is constructed by using the geometric features of the text region to be identified and the target text density judgment rule.
[0089] S204. Input the target prompt word and the image to be recognized into the text-dense image recognition model. Based on the recognition result of the text-dense image recognition model, obtain the final judgment result corresponding to the image to be recognized. The final judgment result is text-dense or non-text-dense. The text-dense image recognition model is trained using the text-dense image recognition model training method in the embodiments of this disclosure.
[0090] Here, the image to be identified refers to the target image for which the density of text needs to be determined, i.e., an original image obtained from an external source.
[0091] In this embodiment of the disclosure, the text features of the image to be recognized can be extracted first using an OCR model. Based on all detected text regions and their recognition results, the statistical features of the text to be recognized in the image are statistically analyzed. At the same time, the geometric features of the text regions to be recognized are calculated based on the coordinates and size of each text region to obtain the geometric features of the text regions to be recognized.
[0092] Here, the initial determination result refers to the first-stage determination conclusion obtained based on the statistical features of the text and the geometric features of the text region in the image to be identified, according to the preset target text density determination rules. In this embodiment of the disclosure, the initial determination result can be suspected text density or non-text density.
[0093] In this embodiment, the statistical features of the text to be identified and the geometric features of the text region to be identified are compared with the thresholds in the pre-set target text density determination rules, and a comprehensive judgment is made according to the pre-set logical relationship in the rules. When each feature is significantly lower than the corresponding threshold and obviously does not constitute text density, the initial judgment result is directly set as non-text density. When each feature reaches or approaches the threshold, but there is a certain degree of uncertainty or boundary situation, the initial judgment result is set as suspected text density.
[0094] In this embodiment, when the initial determination result is suspected to be dense text, the geometric features of the text region can first be standardized and organized to form structured content describing the layout features of the text region. Simultaneously, the key threshold parameters and their logical relationships in the target dense text determination rule can be transcribed into rule description content. Then, a pre-designed prompt word template is called, and the structured content and rule description content are filled into the corresponding placeholder positions in the template, automatically generating a target prompt word to guide the dense text image recognition model in understanding the text distribution and determination criteria of the image.
[0095] Here, the final judgment result refers to the final conclusion as to whether the image belongs to the category of dense text images after introducing a dense text image recognition model and combining the target prompt word with the image to be recognized for comprehensive judgment.
[0096] In this embodiment, after constructing the target prompt word corresponding to the suspected dense text image, the target prompt word and the image to be identified are input together into a specially trained dense text image recognition model. This model, as a multimodal model, can simultaneously receive image information and text prompt information, and jointly understand and reason about the layout and area ratio of text regions in the image, as well as the judgment rules and geometric descriptions given in the prompt word. Under the current parameters, the model generates a recognition result for the degree of text density in the image, such as outputting a binary classification label or a probability score indicating whether the text is dense or not. Finally, based on the recognition result, the final judgment result corresponding to the image to be identified can be determined according to a preset decision strategy, and this final judgment result is used as the output of this dense text judgment process.
[0097] The technical solution of this disclosure first performs text detection and feature extraction on the image to be recognized, constructing text statistical features and geometric features to provide quantifiable basic data for judgment. A rapid initial screening is performed using preset target text density judgment rules, directly excluding images that clearly do not meet the text density conditions, effectively reducing the number of samples processed by subsequent complex models. Target prompt words containing geometric features and rule information are constructed for suspected samples, thereby improving the model's ability to understand the task background and judgment criteria. A text-dense image recognition model performs fine-grained judgment on suspected samples, outputting a highly reliable final judgment result. This achieves a hierarchical combination of rule-based judgment and model inference, significantly improving the recognition accuracy and robustness for complex text distribution scenes and boundary samples while ensuring computational efficiency.
[0098] In some embodiments, the text-dense image recognition method further includes: when the initial determination result is not text-dense, using the initial determination result as the final determination result.
[0099] In this embodiment of the disclosure, if the initial judgment result is detected as non-text-dense, the steps in the subsequent suspected text-dense branch will not be initiated. That is, no target prompt words will be constructed for the image, nor will it be input into the text-dense image recognition model for further reasoning. Instead, the initial judgment result of non-text-dense will be directly used as the final judgment result corresponding to the image, and the text-dense recognition process of the current image will end.
[0100] Thus, by directly terminating the subsequent complex processing flow when the initial judgment result is not text-dense, and outputting this result as the final judgment result, the fast judgment capability based on threshold rules can be fully utilized to efficiently filter a large number of images that clearly do not meet the text-dense condition. This allows limited computing resources to be concentrated on the fine recognition of suspected text-dense images, effectively reducing the overall system's computational overhead and response latency, improving processing throughput, while maintaining the simplicity of the method structure and ease of implementation.
[0101] This disclosure provides a resource recommendation method. Figure 3 This is a flowchart illustrating a resource recommendation method according to an embodiment of the present disclosure. This resource recommendation method can be applied to a resource recommendation device. The resource recommendation device is located in an electronic device. The electronic device includes, but is not limited to, fixed devices and / or mobile devices. For example, fixed devices include, but are not limited to, servers, which can be cloud servers or ordinary servers. For example, mobile devices include, but are not limited to, information stream recommendation devices, which can be mobile phones, tablets, etc. In some possible implementations, the resource recommendation method can also be implemented by a processor calling computer-readable instructions stored in memory. Figure 3 As shown, the resource recommendation method includes: S301. Obtain the cover image of the resource to be recommended and the final judgment result corresponding to the cover image; the final judgment result is determined by the text-dense image recognition method as described in the embodiments of this disclosure. S302. When the final judgment result is text-dense, a preset scattering strategy is used to recommend the resources to be recommended.
[0102] In this embodiment of the disclosure, when a resource enters the recommendation system to await exposure, its cover image, such as the first frame cover of a video, the first image of an article, or the cover of an e-book, can first be retrieved from the content library or resource management platform as the cover image of the resource to be recommended. Subsequently, the final judgment result corresponding to the cover image can be queried based on its unique identifier.
[0103] Here, the "dispersion strategy" refers to a pre-set control strategy to reduce concentration and distribute exposure during the recommendation sorting and display process, in order to avoid excessive concentration of text-dense cover resources in the same recommendation position, the same time period, or in a continuous list, which would affect the overall visual experience and click conversion. In this embodiment of the disclosure, the dispersion strategy can include various specific forms, such as "not showing on the first screen," which means that text-dense cover resources are not displayed in several positions on the first screen seen by the user when opening the recommendation page; or "showing one after X refreshes," which means that when the user refreshes down or turns the page, at most one text-dense cover resource appears for every X items refreshed, or at least X non-text-dense resources are allowed to be displayed again before text-dense cover resources are allowed to be displayed again.
[0104] In this embodiment, the position and frequency of text-dense cover images among currently ranked resources can be maintained when generating the recommendation list. When a text-dense resource is about to be inserted into the list, it is first checked whether its intended placement is in a prohibited area or whether it violates interval constraints such as "one image appears after X". If it violates these constraints, the exposure of the resource is temporarily suspended, and it is either pushed to the next list or replaced with another non-text-dense resource. Simultaneously, a dispersion strategy can be comprehensively implemented by reducing the overall ranking weight of text-dense resources, setting a maximum number of images displayed per screen, and setting time-based exposure frequency control for the same user. Finally, a sorted recommendation list is output under the premise of satisfying the dispersion strategy constraints, thereby achieving differentiated recommendations for text-dense cover images.
[0105] The technical solution of this disclosure, by introducing resource attributes based on text-dense image recognition results in the recommendation process and employing a specialized dispersion strategy for text-dense cover resources, can effectively control the concentration of visually heavy and information-dense covers in the list without interfering with the content quality assessment and recall logic. Furthermore, the dispersion strategy is superimposed on the ranking results in the form of simple rules, making it easy to flexibly configure and optimize online through parameters, facilitating rapid adaptation to different business scenarios, different terminal screen sizes, and user preferences.
[0106] In some embodiments, the resource recommendation method further includes: when the final determination result is non-text-intensive, using a preset default strategy to recommend the resource to be recommended.
[0107] Here, the default strategy refers to the conventional recommendation and display strategy adopted by the recommendation system. That is, it does not impose special rules for dispersing, limiting frequency, or restricting position for text-dense cover resources, but sorts and exposes them according to the general recommendation process and strategy that the system has already deployed.
[0108] In this embodiment of the disclosure, when the final determination result is detected as non-text-dense, the resource is included in the regular ranking and display process of the recommendation system. For example, it can be recalled along with other candidate resources based on indicators such as user profile, interest tags, and content similarity through the default recall mechanism. Then, the fine ranking model scores it based on features such as click-through rate prediction, completion rate prediction, interaction probability, and content quality score. In the final re-ranking stage, only existing general rules are applied, and its position in the recommendation list is determined and displayed according to the comprehensive score.
[0109] Thus, by employing the default recommendation strategy when the final judgment result is non-text-dense, we can ensure that resources with lower visual burden and more user-friendly layouts are not subject to additional constraints or demotion, fully leveraging the general recommendation model's ability to match user interests and improve conversion rates. Simultaneously, limiting the dispersion strategy to text-dense cover resources ensures that while controlling the concentrated exposure of text-dense content and improving the overall visual experience, it does not sacrifice exposure opportunities and ranking rationality for ordinary resources.
[0110] Figure 4 Another flowchart illustrating a text-dense image recognition method is shown, such as... Figure 4 As shown, it includes: S401. Obtain the image to be recognized. Receive an image from the content producer, resource library, or online request that needs to be determined to be densely packed with text, and use this image as the current object to be processed.
[0111] S402. Perform OCR detection on the image to be recognized. Call the OCR model to detect and recognize the text in the image, and output the bounding box position and size information of each character or line of text, as well as the recognized character content, thus obtaining a complete OCR result.
[0112] S403a, Line Count Judgment. Count the number of text lines appearing in the image from the OCR detection results, and compare this number with a pre-set line count threshold. If the number of lines is significantly higher than the threshold, mark the result as "Line count exceeds threshold"; otherwise, mark it as "Line count is normal".
[0113] S403b, Character Count Judgment. Summarize all recognized character content, calculate the total number of characters in the entire image, and compare it with the preset character count threshold. When the total number of characters or the density of characters is higher than the threshold, mark the character count judgment result as "character count exceeds threshold"; otherwise, mark it as "character count is normal".
[0114] S403c, OCR Merging and Area Judgment. Based on the spatial relationship of the various text boxes detected by OCR, adjacent or overlapping text boxes are merged to obtain several larger-granular text regions. Then, the total area of these merged text regions is calculated and compared with the area of the entire image to obtain the text region area ratio. This ratio is then compared with a preset area threshold. If the ratio is too high, the area judgment result is marked as "area ratio exceeds threshold"; otherwise, it is marked as "area ratio is normal".
[0115] S404. Multimodal Large Model Comprehensive Judgment. When the original image is simultaneously labeled as "number of lines exceeds the threshold", "number of characters exceeds the threshold", and "area ratio exceeds the threshold", the original image, text density judgment rules, and the results of the number judgment, character count judgment, and area judgment, along with their corresponding numerical features, are input into the trained multimodal large model according to the pre-designed prompt word template format. The model then comprehensively infers whether the text distribution of the image constitutes "text density" and outputs the corresponding predicted label or probability score.
[0116] S405. Output the final judgment result. Based on the output result of the multimodal large model, combined with the judgment threshold or decision rules set by the business, mark the current image as "text-dense" or "non-text-dense", and write the final judgment result into the attribute information of the image or resource for subsequent resource recommendation, display shuffling or other business strategy calls.
[0117] In some implementations, an OCR detection model can be used to process the image to be recognized, extracting OCR features for each text region, including the position information of the text boxes and the corresponding text content. After obtaining the OCR results, the image can be judged according to predefined text density quantization standards. For example, the total number of OCR text boxes can be counted in the line count dimension; when the total number of text boxes is greater than 3, the image is considered to have a large number of text lines. At the same time, the total number of characters in all OCR text content can be summarized in the character count dimension; when the total number of characters is greater than 16, the image is considered to have a large amount of text information. Furthermore, in the area dimension, spatially adjacent OCR text boxes can be dynamically merged, the ratio of the total area of the merged overall OCR text region to the total area of the image can be calculated, and compared with a preset area threshold to complete the judgment.
[0118] For example, Figure 5 A flowchart illustrating the process of merging text regions is shown, such as... Figure 5 As shown, to achieve dynamic merging of text boxes, a circle is drawn with the center point of the first text box as the center and a radius of 45% of its diagonal length L. If the center point of the second text box falls within this circle, the first and second text boxes are merged into a larger target text area. Specifically, merged text boxes are not included in subsequent traversals. By using the rule of merging text boxes when the distance between their center points is less than 45% of their maximum diagonal length, the system can adapt to text boxes of different sizes, effectively eliminating fragmented divisions between text areas, avoiding redundant calculations, and thus obtaining a more accurate text area ratio, providing a reliable quantitative basis for subsequent text density determination.
[0119] Figure 6 Another flowchart illustrating a text-dense image recognition method is shown, such as... Figure 6As shown, in the offline stage, quantitative features such as the number of lines, the number of characters, and the area ratio of the merged text region, along with the corresponding text box position information, can be organized into prompt words according to a preset format. These prompt words are then combined with the original image to construct training samples, fine-tuning the multimodal large model, and encapsulated into a text-dense image recognition model. During online inference, for images initially identified as "text-dense" in the OCR rule determination stage, their image data and corresponding prompts are input into the text-dense image recognition model. Based on understanding the overall layout of the image and the meaning of the quantitative indicators in the prompts, the model outputs a more refined text-dense determination result, which is used for subsequent resource recommendation, display shuffling, or other business strategy calls. Through this cascading method, the multimodal calibration model outperforms text-dense recognition methods that rely solely on traditional deep neural networks or single threshold rules in complex scenes and boundary samples.
[0120] In some implementations, a batch recognition request is triggered in real time when an image is published. The image is input into a cascaded model consisting of an OCR model and a multimodal large model to obtain the text-dense features corresponding to each image. These features are then written into a resource feature library or index library as one of the attributes of the resource cover image. During the online fusion stage of recommendation results, the text-dense features of the cover images of resources to be recommended can be read. A preset dispersion strategy is applied to resources that match the "text-dense" tag. For example, controls such as not displaying text-dense cover resources on the first screen and displaying them only once every X views across screens are implemented, ensuring that such resources are not displayed on the first screen and are distributed during multi-screen browsing by showing a maximum of one text-dense image per X views. This achieves an end-to-end closed loop from image-level text-dense recognition to recommendation exposure control. It can accurately identify and quantify the text density of images and distribute highly text-dense resources in a friendly manner during the recommendation stage, thereby significantly improving the overall visual experience and reading comfort of the page while ensuring recommendation effectiveness.
[0121] It should be understood that Figures 4 to 6 The schematic diagrams shown are merely illustrative and not limiting, and are scalable; those skilled in the art can use them as a basis. Figures 4 to 6 Even with various obvious changes and / or substitutions to the examples, the resulting technical solutions still fall within the scope of this disclosure.
[0122] This disclosure provides a training device for a text-dense image recognition model, such as... Figure 7As shown, the device may include: an image processing module 701, used to extract text features from each original image in the original image set to obtain text statistical features and text region geometric features; a rule filtering module 702, used to filter candidate image sets from the original image set according to the text statistical features and text region geometric features, and according to preset text density judgment rules; a training prompt word module 703, used to construct prompt words corresponding to each candidate image based on the text region geometric features and text density judgment rules corresponding to each candidate image; and a model training module 704, used to fine-tune the initial multimodal large model using the candidate image set and prompt words to obtain a text-dense image recognition model.
[0123] In some embodiments, the image processing module 701 includes: a character recognition submodule, used to extract text features from the original image using an optical character recognition model to obtain text content and text regions; a content statistics submodule, used to perform statistics on the text content to obtain text statistical features; and a spatial analysis submodule, used to perform spatial analysis on the text regions to obtain geometric features of the text regions.
[0124] In some embodiments, the content statistics submodule is used to: perform statistics on the text content to obtain the number of lines and the number of characters; and obtain text statistical features based on the number of lines and the number of characters.
[0125] In some embodiments, the spatial analysis submodule is used to: calculate the first area ratio of the total area of all text regions in the original image, and use the first area ratio as the geometric feature of the text regions.
[0126] In some embodiments, the original image includes multiple text regions; the spatial analysis submodule is used to: perform spatial analysis on the text regions to obtain the geometric features of the text regions, including: dynamically merging multiple adjacent text regions according to the spatial proximity relationship between each text region to obtain the merged target text region; calculating the second area ratio of the target text region in the original image, and using the second area ratio as the geometric feature of the text region.
[0127] In some embodiments, the spatial analysis submodule is further configured to: determine the center point and diagonal length of each text region based on the location information of each text region; select any two text regions as a text region pair; for any text region pair, determine the corresponding target distance and target diagonal length, and use the ratio between the target distance and the target diagonal length as the proximity distance; determine text region pairs whose proximity distance is less than a preset proximity determination threshold as mutually adjacent; and dynamically merge multiple text region pairs determined to be mutually adjacent to obtain the merged target text region.
[0128] In some embodiments, the spatial analysis submodule is further configured to: calculate the distance between the center points of two text regions in a text region pair as the target distance; and select the larger of the two diagonal lengths as the target diagonal length based on the diagonal lengths of the two text regions in the text region pair.
[0129] In some embodiments, the text density determination rule includes at least: statistical feature threshold and geometric feature threshold; the rule filtering module 702 includes: a threshold comparison submodule, used to extract original images from the original image set whose text statistical features are greater than or equal to the statistical feature threshold and whose text region geometric features are greater than or equal to the geometric feature threshold, to obtain a candidate image set.
[0130] In some embodiments, the training prompt word module 703 includes: a structured information generation submodule, used to generate structured description information describing the distribution and content of each text region based on the geometric features and statistical features of the text regions corresponding to the candidate image; a rule information generation submodule, used to generate rule description information representing the text density determination rule based on the text density determination rule; and a prompt word construction submodule, used to construct prompt words based on the structured description information and the rule description information, and based on a preset prompt word template.
[0131] In some embodiments, the model training module 704 includes: a sample construction submodule, used to construct a training sample set based on a candidate image set and prompt words using predetermined annotation information; a model inference submodule, used to input each candidate image and its corresponding prompt word from the training sample set into an initial multimodal large model to obtain a predicted label; and an iterative training submodule, used to calculate a loss value based on the difference between the predicted label and the annotation information, and update the parameters of the initial multimodal large model based on the loss value to obtain a text-dense image recognition model.
[0132] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.
[0133] The text-dense image recognition model training device in this embodiment can automatically extract text statistical features and text region geometric features from unlabeled original images, and combine them with text density judgment rules for candidate image screening. This allows for efficient mining of training samples highly relevant to the text-dense recognition task without large-scale coarse screening, significantly reducing data annotation costs and alleviating the severe imbalance between text-dense and non-text-dense samples. By automatically generating prompts associated with each image using geometric features and judgment rules, the multimodal large model can learn the concept of text density and discrimination boundaries under unified and stable rule constraints during instruction fine-tuning, reducing the impact of changes in annotation standards and subjective differences among annotators on model performance. The text-dense image recognition model obtained through instruction fine-tuning not only inherits the strong generalization ability of the large model in complex scenes but also exhibits stronger robustness and consistency in text layout understanding and density judgment.
[0134] This disclosure provides a text-dense image recognition device, such as... Figure 8 As shown, the device may include: a feature extraction module 801, used to extract text features from the image to be recognized, obtaining statistical features of the text to be recognized and geometric features of the text region to be recognized; an initial judgment module 802, used to determine an initial judgment result according to the statistical features of the text to be recognized and the geometric features of the text region to be recognized, and according to a preset target text density judgment rule; the initial judgment result is suspected text density or non-text density; a prompt word recognition module 803, used to construct a target prompt word using the geometric features of the text region to be recognized and the target text density judgment rule when the initial judgment result is suspected text density; and a final judgment module 804, used to input the target prompt word and the image to be recognized into a text density image recognition model, and obtain a final judgment result corresponding to the image to be recognized based on the recognition result of the text density image recognition model; the final judgment result is text density or non-text density; the text density image recognition model is trained using the text density image recognition model training method in this embodiment of the present disclosure.
[0135] In some embodiments, the text-dense image recognition device further includes: a model skipping module 805 ( Figure 8 (not shown in the image), used to take the initial judgment result as the final judgment result when the initial judgment result is not text-dense.
[0136] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.
[0137] The text-dense image recognition device in this embodiment realizes a hierarchical combination of rule judgment and model reasoning, which significantly improves the recognition accuracy and robustness of complex text distribution scenes and boundary samples while ensuring computational efficiency.
[0138] This disclosure provides a resource recommendation device, such as... Figure 9 As shown, the device may include: an acquisition module 901, used to acquire the cover image of the resource to be recommended and the final judgment result corresponding to the cover image; the final judgment result is determined by the text-dense image recognition method as described in the embodiments of this disclosure; and a scattering recommendation module 902, used to recommend the resource to be recommended by adopting a preset scattering strategy when the final judgment result is text-dense.
[0139] In some embodiments, the resource recommendation device further includes: a default recommendation module 903 ( Figure 9 (Not shown in the image) is used to recommend resources using a preset default strategy when the final judgment result is not text-intensive.
[0140] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.
[0141] The resource recommendation device in this embodiment can effectively control the concentration of such visually heavy and information-dense covers in the list without interfering with the content quality assessment and recall logic by introducing resource attributes based on the results of dense text image recognition in the recommendation process and adopting a special dispersion strategy for dense text cover resources.
[0142] This disclosure provides a scenario illustration of a text-dense image recognition model training method, such as... Figure 10 As shown.
[0143] As previously described, the text-dense image recognition model training method provided in this disclosure is applied to electronic devices. These electronic devices are intended to represent various forms of digital computers, such as laptops, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers.
[0144] Specifically, the electronic device may perform the following operations: Text features are extracted from each original image in the original image set to obtain text statistical features and text region geometric features. Based on the text statistical features and text region geometric features, a candidate image set is selected from the original image set according to the preset text density judgment rules. For each candidate image set, a prompt word corresponding to each candidate image is constructed based on the text region geometric features and text density judgment rules corresponding to each candidate image. Using the candidate image set and prompt words, the initial multimodal large model is fine-tuned and trained to obtain a text-dense image recognition model.
[0145] This disclosure provides a scenario illustration of a text-dense image recognition method, such as... Figure 11 As shown.
[0146] As previously described, the text-dense image recognition method provided in this disclosure is applied to electronic devices. These electronic devices are intended to represent various forms of digital computers, such as laptops, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
[0147] Specifically, the electronic device may perform the following operations: Text features are extracted from the image to be recognized to obtain statistical features of the text to be recognized and geometric features of the text region to be recognized. Based on the statistical features of the text to be recognized and the geometric features of the text region to be recognized, an initial judgment result is determined according to a preset target text density judgment rule. When the initial judgment result is suspected text density, a target prompt word is constructed using the geometric features of the text region to be recognized and the target text density judgment rule. The target prompt word and the image to be recognized are input into the text density image recognition model, and the final judgment result corresponding to the image to be recognized is obtained based on the recognition result of the text density image recognition model.
[0148] This disclosure provides a scenario illustration of a resource recommendation method, such as... Figure 12 As shown.
[0149] As previously described, the resource recommendation method provided in this disclosure is applied to electronic devices. Electronic devices are intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
[0150] Specifically, the electronic device may perform the following operations: Obtain the cover image of the resource to be recommended and the final judgment result corresponding to the cover image; when the final judgment result is text-dense, adopt the preset scattering strategy to recommend the resource.
[0151] It should be understood that Figures 10 to 12The scene diagrams shown are merely illustrative and not restrictive; those skilled in the art can interpret them based on... Figures 10 to 12 Even with various obvious changes and / or substitutions to the examples, the resulting technical solutions still fall within the scope of this disclosure.
[0152] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0153] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0154] Figure 13 A schematic block diagram of an example electronic device 1300 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0155] like Figure 13 As shown, device 1300 includes a computing unit 1301, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 1302 or a computer program loaded from storage unit 1308 into random access memory (RAM) 1303. The RAM 1303 may also store various programs and data required for the operation of device 1300. The computing unit 1301, ROM 1302, and RAM 1303 are interconnected via bus 1304. An input / output (I / O) interface 1305 is also connected to bus 1304.
[0156] Multiple components in device 1300 are connected to I / O interface 1305, including: input unit 1306, such as keyboard, mouse, etc.; output unit 1307, such as various types of monitors, speakers, etc.; storage unit 1308, such as disk, optical disk, etc.; and communication unit 1309, such as network card, modem, wireless transceiver, etc. Communication unit 1309 allows device 1300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0157] The computing unit 1301 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 1301 performs the various methods and processes described above, such as text-intensive image recognition model training methods, text-intensive image recognition methods, and / or resource recommendation methods. For example, in some embodiments, the text-intensive image recognition model training methods, text-intensive image recognition methods, and / or resource recommendation methods can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 1308. In some embodiments, part or all of the computer program can be loaded and / or installed on device 1300 via ROM 1302 and / or communication unit 1309. When the computer program is loaded into RAM 1303 and executed by computing unit 1301, one or more steps of the text-dense image recognition model training method, text-dense image recognition method, and / or resource recommendation method described above can be performed. Alternatively, in other embodiments, computing unit 1301 can be configured to perform the text-dense image recognition model training method, text-dense image recognition method, and / or resource recommendation method by any other suitable means (e.g., by means of firmware).
[0158] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0159] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0160] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM), flash memory, optical fiber, compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0161] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0162] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0163] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0164] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0165] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for training a text-dense image recognition model, comprising: Text features are extracted from each original image in the original image set to obtain text statistical features and text region geometric features; Based on the statistical features of the text and the geometric features of the text region, a candidate image set is obtained from the original image set according to the preset text density determination rules; For the candidate image set, based on the geometric features of the text region corresponding to each candidate image and the text density determination rule, a prompt word corresponding to each candidate image is constructed; Using the candidate image set and the prompt words, the initial multimodal large model is fine-tuned and trained to obtain a text-dense image recognition model.
2. The method according to claim 1, wherein, The step of extracting text features from each original image in the original image set to obtain text statistical features and text region geometric features includes: The text features of the original image are extracted using an optical character recognition model to obtain the text content and text regions. The text content is statistically analyzed to obtain the text statistical features; Spatial analysis is performed on the text region to obtain its geometric features.
3. The method according to claim 2, wherein, The step of statistically analyzing the text content to obtain the text statistical features includes: The text content was statistically analyzed to obtain the number of lines and the number of characters. The text statistical features are obtained based on the number of lines and the number of characters.
4. The method according to claim 2, wherein, The spatial analysis of the text region to obtain its geometric features includes: Calculate the first area ratio of the total area of all the text regions in the original image, and use the first area ratio as the geometric feature of the text regions.
5. The method according to claim 2, wherein, The original image includes multiple text regions; The spatial analysis of the text region to obtain its geometric features includes: Based on the spatial proximity relationship between each text region, multiple adjacent text regions are dynamically merged to obtain the merged target text region. Calculate the second area ratio of the target text region in the original image, and use the second area ratio as the geometric feature of the text region.
6. The method according to claim 5, wherein, The step of dynamically merging multiple adjacent text regions based on their spatial proximity to obtain a merged target text region includes: Based on the position information of each text region, determine the center point and diagonal length of each text region; Select any two of the text regions as a text region pair; For any pair of text regions, determine the corresponding target distance and target diagonal length, and use the ratio between the target distance and the target diagonal length as the nearest neighbor distance; Text regions whose proximity distance is less than a preset proximity determination threshold are determined to be mutually adjacent; Multiple text regions that are determined to be adjacent to each other are dynamically merged to obtain the merged target text region.
7. The method according to claim 6, wherein, The step of determining the corresponding target distance and target diagonal length for any pair of text regions includes: Calculate the distance between the center points of the two text regions in the text region pair, and use it as the target distance; Based on the diagonal lengths of the two text regions in the text region pair, the larger value is selected as the target diagonal length.
8. The method according to claim 1, wherein, The text density determination rule includes at least: statistical feature threshold and geometric feature threshold; The step of selecting a candidate image set from the original image set according to the statistical features of the text and the geometric features of the text region, and in accordance with a preset text density determination rule, includes: From the original image set, extract the original images in which the text statistical features are greater than or equal to the statistical feature threshold and the text region geometric features are greater than or equal to the geometric feature threshold to obtain the candidate image set.
9. The method according to claim 1, wherein, For the candidate image set, based on the geometric features of the text region corresponding to each candidate image and the text density determination rule, a prompt word corresponding to each candidate image is constructed, including: Based on the geometric features and statistical features of the text regions corresponding to the candidate images, structured descriptive information describing the distribution of each text region and the text content is generated. Based on the text density determination rule, generate rule description information that represents the text density determination rule; Based on the structured description information and the rule description information, the prompt words are constructed using a preset prompt word template.
10. The method according to claim 1, wherein, The step of using the candidate image set and the prompt words to fine-tune the initial multimodal large model to obtain a text-dense image recognition model includes: Based on the candidate image set and the prompt words, a training sample set is constructed using pre-determined annotation information; Each candidate image and its corresponding prompt word in the training sample set are input into the initial multimodal large model to obtain the predicted label; The loss value is calculated based on the difference between the predicted label and the labeled information, and the parameters of the initial multimodal large model are updated according to the loss value to obtain the text-dense image recognition model.
11. A method for recognizing dense text images, comprising: Text features are extracted from the image to be recognized to obtain statistical features of the text to be recognized and geometric features of the text region to be recognized; Based on the statistical features of the characters to be identified and the geometric features of the regions of the characters to be identified, the initial judgment result is determined according to the preset target character density judgment rules. The initial determination result is either suspected to be text-dense or non-text-dense. When the initial determination result is suspected to be dense text, the target prompt word is constructed by using the geometric features of the text region to be identified and the target text density determination rule; The target prompt word and the image to be identified are input into the dense text image recognition model. Based on the recognition result of the dense text image recognition model, the final judgment result corresponding to the image to be identified is obtained. The final determination result is either text-dense or non-text-dense; the text-dense image recognition model is trained using the method described in any one of claims 1-10.
12. The method according to claim 11, wherein, The method further includes: When the initial determination result is not text-dense, the initial determination result is taken as the final determination result.
13. A resource recommendation method, comprising: Obtain the cover image of the resource to be recommended and the final judgment result corresponding to the cover image; The final determination result is determined using the method described in any one of claims 11-12; When the final determination result is that the text is dense, a preset scattering strategy is used to recommend the resources to be recommended.
14. The method according to claim 13, wherein, The method further includes: When the final determination result is that the resource to be recommended is not text-intensive, a preset default strategy is adopted to recommend the resource.
15. A training device for a text-dense image recognition model, comprising: The image processing module is used to extract text features from each original image in the original image set to obtain text statistical features and text region geometric features; The rule filtering module is used to filter candidate image sets from the original image set according to the text statistical features and the text region geometric features, and according to the preset text density determination rules. The training prompt word module is used to construct prompt words corresponding to each candidate image for the candidate image set based on the geometric features of the text region corresponding to each candidate image and the text density determination rules; The model training module is used to fine-tune the initial multimodal large model using the candidate image set and the prompt words to obtain a text-dense image recognition model.
16. A text-dense image recognition device, comprising: The feature extraction module is used to extract text features from the image to be recognized, and obtain the statistical features of the text to be recognized and the geometric features of the text region to be recognized. The initial determination module is used to determine the initial determination result according to the statistical features of the text to be identified and the geometric features of the text region to be identified, and according to the preset target text density determination rules. The initial determination result is either suspected to be text-dense or non-text-dense. The prompt word recognition module is used to construct target prompt words by utilizing the geometric features of the text region to be recognized and the target text density judgment rules when the initial judgment result is suspected to be dense text. The final determination module is used to input the target prompt word and the image to be recognized into the text-dense image recognition model, and obtain the final determination result corresponding to the image to be recognized based on the recognition result of the text-dense image recognition model; The final determination result is either text-dense or non-text-dense; the text-dense image recognition model is trained using the method described in any one of claims 1-10.
17. A resource recommendation device, comprising: The acquisition module is used to acquire the cover image of the resource to be recommended and the final judgment result corresponding to the cover image; The final determination result is determined using the method described in any one of claims 11-12; The scatter recommendation module is used to recommend the resources to be recommended using a preset scatter strategy when the final judgment result is text-dense.
18. An electronic device comprising: At least one processor; as well as A memory that is communicatively connected to at least one processor; wherein, The memory stores instructions that can be executed by at least one processor to enable the at least one processor to perform the method of any one of claims 1-14.
19. A non-transitory computer-readable storage medium storing computer instructions, wherein, Computer instructions are used to cause a computer to perform the method according to any one of claims 1-14.
20. A computer program product comprising a computer program stored on a storage medium, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1-14.