Method and device for dividing image content, electronic equipment and storage medium

By extracting and processing text features and visual features in images, and using prediction models to determine image segmentation positions, it solves the problem of the lack of logical structure in long image segmentation results in the existing technology, and achieves more accurate and in-depth image content segmentation.

CN118628731APending Publication Date: 2024-09-10DOUYIN VISION CO LTD

Patent Information

Application Number
CN202410642919.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing long image segmentation methods ignore the semantic information and internal logical structure in the image, making the segmentation results difficult to meet the needs of information structuring and lacking effective reflection of content logic.

Method used

By determining the text area in the original image, extracting the text content, obtaining text features, and combining the image features, use the prediction model to determine the image segmentation position, and then divide the image to achieve image segmentation based on multi-modal information.

Benefits of technology

It improves the depth of understanding and accuracy of image division, can effectively reflect the text and visual features of images, and meet the needs of information structuring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628731A
    Figure CN118628731A
Patent Text Reader

Abstract

The invention provides an image content dividing method and device, electronic equipment and a storage medium. The method for dividing the image content comprises the following steps: determining a text region in an original image; extracting text content in the text area; obtaining text features based on the text content; obtaining a first sequence feature based on the original image and the text feature; determining at least one image segmentation position based on the first sequence feature through a prediction model; the original image is divided based on the at least one image segmentation position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for dividing image content. Background Art

[0002] As a form of visual expression that combines pictures and texts and is rich in information, long images have been widely used in e-commerce, product manuals, social media and other fields. The technical research on efficient understanding and intelligent segmentation of long images has important technical value and market demand. The long image segmentation method provided by related solutions is usually based on the visual features of the image such as texture, color, and edges. The long image is divided into several continuous visual areas through algorithms such as threshold segmentation, region growing, and edge detection. Although such methods can initially realize the physical segmentation of long images, because they ignore the semantic information and internal logical structure in the long image, the segmentation results often lack effective expression of the content logic and are difficult to meet the needs of information structuring. Summary of the invention

[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, according to one or more embodiments of the present disclosure, a method for dividing image content is provided, including:

[0005] Determine the text area in the original image;

[0006] Extracting text content in the text area;

[0007] Obtaining text features based on the text content;

[0008] Obtaining a first sequence feature based on the original image and the text feature;

[0009] Determine at least one image segmentation position based on the first sequence feature by a prediction model;

[0010] The original image is divided based on the at least one image segmentation position.

[0011] In a second aspect, according to one or more embodiments of the present disclosure, a device for dividing image content is provided, including:

[0012] A text region determination unit, used for determining a text region in an original image;

[0013] A text content extraction unit, used to extract text content in the text area;

[0014] A text feature unit, used to obtain text features based on the text content;

[0015] A sequence feature unit, used for obtaining a first sequence feature based on the original image and the text feature;

[0016] A prediction unit, configured to determine at least one image segmentation position based on the first sequence feature by using a prediction model;

[0017] A dividing unit is used to divide the original image based on the at least one image segmentation position.

[0018] In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call the program code stored in the memory so that the electronic device executes the method provided according to one or more embodiments of the present disclosure.

[0019] In a fourth aspect, according to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, wherein the non-transitory computer storage medium stores a program code, and when the program code is executed by a computer device, the computer device executes the method provided according to one or more embodiments of the present disclosure.

[0020] According to one or more embodiments of the present disclosure, by extracting text features from an original image, a first sequence feature is obtained based on the original image and the text feature, an image segmentation position is obtained based on the first sequence feature through a prediction model, and the original image is divided based on the image segmentation position. This allows the image to be divided based on multimodal information such as text and visual features of the image, thereby improving the depth of understanding and accuracy of image segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0022] Figure 1 A flowchart of a method for dividing image content provided by an embodiment of the present disclosure;

[0023] Figure 2 A visual effect diagram of dividing an image provided by an embodiment of the present disclosure;

[0024] Figure 3 A schematic diagram of a spliced ​​image provided by an embodiment of the present disclosure;

[0025] Figure 4 A schematic diagram of a model architecture provided for an embodiment of the present disclosure;

[0026] Figure 5 A schematic diagram of the structure of an apparatus for dividing image content provided by an embodiment of the present disclosure;

[0027] Figure 6 The figure is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0029] It should be understood that the steps described in the embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0030] As used herein, the term "including" and its variations are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The term "responsive to" and related terms refer to a signal or event being affected to a certain extent by another signal or event, but not necessarily completely or directly. If event x occurs "responsive to" event y, x may be directly or indirectly responsive to y. For example, the occurrence of y may ultimately lead to the occurrence of x, but there may be other intermediate events and / or conditions. In other cases, y may not necessarily lead to the occurrence of x, and x may occur even if y has not yet occurred. In addition, the term "responsive to" may also mean "at least partially responsive to".

[0031] The term "determine" broadly covers a variety of actions, which may include obtaining, calculating, computing, processing, deriving, investigating, searching (e.g., searching in a table, database, or other data structure), ascertaining, and similar actions, and may also include receiving (e.g., receiving information), accessing (e.g., accessing data in a memory) and similar actions, as well as parsing, selecting, choosing, establishing, and similar actions, etc. The relevant definitions of other terms will be given in the following description. The relevant definitions of other terms will be given in the following description.

[0032] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the provisions of relevant laws and regulations.

[0033] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, and usage scenarios of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. For example, in response to receiving an active request from the user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information, so that the user can autonomously choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0034] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information is sent to the user in a manner such as a pop-up window, in which the prompt information can be presented in text form. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0035] It is understandable that the above-mentioned notification and process of obtaining user authorization, as well as the processing of images, are merely illustrative and do not constitute a limitation on the implementation method of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation method of the present disclosure.

[0036] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0037] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0038] For the purposes of this disclosure, the phrase "A and / or B" means (A), (B), or (A and B).

[0039] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0040] refer to Figure 1 , Figure 1 A flowchart of a method for dividing image content provided by an embodiment of the present disclosure is shown, and the method includes steps S110 to S160.

[0041] Step S110: Determine the text area in the original image.

[0042] Step S120: extracting text content in the text area.

[0043] The original image may include an image composed of text and pictures. In a specific embodiment, the original image may be a screenshot (eg, a long screenshot) of a web page interface or an application interface, in which a plurality of text areas and pictures are arranged and distributed.

[0044] In some embodiments, the text area in the original image can be determined and the text content therein can be identified by a text recognition model. The text recognition model (e.g., an OCR model) can automatically locate, identify, and extract text information in an image. Exemplarily, the text recognition model can be a machine learning-based model (e.g., a hidden Markov model, a conditional random field), a deep learning-based model (e.g., a convolutional neural network, a recurrent neural network, a Transformer model), but the present disclosure is not limited thereto.

[0045] Step S130: obtaining text features based on the text content.

[0046] In some embodiments, the text features may include word embedding features, which are low-dimensional, dense real-valued vector representations of words in the text through word embedding technology, which can capture the semantic relationship, similarity and contextual dependency between words. In a specific embodiment, the extracted text content can be input into the FastText model to obtain the corresponding word embedding features.

[0047] Step S140: obtaining a first sequence feature based on the original image and the text feature.

[0048] In some embodiments, the original image can be preprocessed, such as denoising, size standardization, cropping, etc., and feature extraction can be performed on the original image to obtain image features, and the image features are spliced ​​with text features to form a joint input feature containing image and text information; the joint input feature is input into a cross-modal model (such as a Transformer model) to obtain a first sequence feature. The first sequence feature contains the deep fusion result of the original image and text features, which can be used for subsequent downstream tasks.

[0049] Step S150: Determine at least one image segmentation position based on the first sequence feature through a prediction model.

[0050] Step S160: Divide the original image based on at least one image segmentation position.

[0051] In some embodiments, the image segmentation position is the position in the direction of the long side of the original image. For example, when the height of the original image in the vertical direction (i.e., the Y axis) is greater than its width in the horizontal direction (i.e., the X axis), the image segmentation position may be the position on the Y axis; when the height of the original image in the vertical direction (i.e., the Y axis) is less than its width in the horizontal direction (i.e., the X axis), the image segmentation position may be the position on the X axis. In this way, the image segmentation task can be converted into a sequence modeling task of predicting the position on the X axis or the Y axis.

[0052] Exemplarily, the prediction model is configured to predict an integer value y in the interval [0,1000], where y reflects the ratio of the ordinate (or abscissa) of the image segmentation position to the height (or width) of the original image on the scale [0,1000]. Assuming that the original image is a vertically long image with a height greater than a width, the calculation relationship between y and the actual ordinate value Y of the image segmentation position is as follows:

[0053] y=(Y / h)·1000 (1)

[0054] Wherein, h is the height of the original image. Based on the y value determined by the prediction model and combined with the height h of the original image, the ordinate Y of the image segmentation position can be inferred from the above formula (1), and the original image can be divided into two upper and lower regions based on the ordinate value Y. In this way, when the prediction model outputs multiple integer values ​​y, multiple ordinates Y can be obtained accordingly, and the original image can be divided into multiple regions arranged vertically based on the multiple ordinates.

[0055] In some embodiments, the prediction model is a model that can be used to perform the above-mentioned sequence modeling tasks, such as a model based on the Transformer architecture, a state space model (SSMs), a RetNet (RetentiveNetwork), a recurrent neural network model (RNNs), a temporal convolutional network (TCNs), etc., but the present disclosure is not limited to this.

[0056] According to one or more embodiments of the present disclosure, by extracting text features from the original image, a first sequence feature is obtained based on the text feature and the original image, an image segmentation position is obtained based on the first sequence feature through a prediction model, and the original image is divided based on the image segmentation position, thereby achieving image segmentation based on multimodal information such as text and visual features of the image, thereby improving the depth of understanding and accuracy of image segmentation.

[0057] In some embodiments, step S150 further includes: determining at least one image segmentation position and its corresponding label based on the first sequence feature through the prediction model. Accordingly, the divided areas of the original image can be identified based on the label. In this embodiment, since the text content of the image is integrated, not only can the original image be divided into regions, but the divided areas can also be identified to reflect the category or theme of the area. Taking the e-commerce application scenario as an example, assuming that the original image is a long image corresponding to the product details page, the label text may include but is not limited to "main object", "selling point", "details", "comments", "deadline", "recommendation" and other content reflecting the purpose of the divided area.

[0058] See also Figure 2 , which shows an image division effect diagram provided according to an embodiment of the present disclosure. The original image 10 of the product details page is divided into multiple areas, including but not limited to areas 11, 12 and 13. The corresponding label text is displayed at the preset position of each area (such as the upper left corner). Among them, the label text corresponding to area 11 is "Main Object", indicating that the content presented in area 11 is about the main object corresponding to the product details page (such as the product); the label text corresponding to area 12 is "Selling Point", indicating that the content presented in area 11 is about the selling point of the product; the label text corresponding to area 13 is "Comment", indicating that the content presented in area 13 is a comment about the product.

[0059] In a specific embodiment, for an original image, one or more vectors (y, c) can be obtained through the prediction model. Wherein, y is an integer value in the interval [0, 1000] in the aforementioned embodiment, and the actual ordinate value Y of the image segmentation position can be obtained based on the y value through the above formula (1); c is an integer value that can be greater than 1000, and has a preset mapping relationship with the identification content. Based on c, the corresponding identification content can be obtained, for example, "1001" corresponds to "main object" and "1002" corresponds to "selling point". For example, assuming that a vector output by the prediction model is (500, 1001), it indicates that starting from half the height of the original image (to the next image segmentation position), the content about the "main object" is displayed.

[0060] In another specific embodiment, for an original image, the prediction model can output one or more vectors (y1, c, y2). Wherein, y1 and y2 are integer values ​​in the interval [0, 1000] in the aforementioned embodiment, and the actual ordinate values ​​Y1 and Y2 of the image segmentation position can be obtained based on the values ​​of y1 and y2 respectively by the above formula (1); c is an integer value that can be greater than 1000, and has a preset mapping relationship with the identification content, and the corresponding identification content can be obtained based on c, for example, "1001" corresponds to "main object" and "1002" corresponds to "selling point". For example, assuming that a vector output by the prediction model is (500, 1002, 750), it indicates that the content about the "selling point" is displayed from half to three quarters of the height of the original image.

[0061] It should be noted that the output content of the prediction model may also be encoded in other ways or output forms, and the present disclosure does not limit this.

[0062] In some embodiments, after determining the text region in the original image, a binary image corresponding to the original image may be generated based on the position of the text region in the original image, and the binary image and the original image may be spliced ​​to obtain a spliced ​​image, and further, in step S140, the first sequence feature may be obtained based on the spliced ​​image and the text feature. The text region and the non-text region in the binary image may be represented by two different colors, respectively.

[0063] For example, a binary image (e.g., a black-and-white image) can be created based on the position information of the text area identified by OCR. In the binary image, the area where the text is located is filled with white (or black), and the background is filled with black (or white). The binary image is horizontally spliced ​​with the original image to obtain a spliced ​​image for subsequent processing.

[0064] For example, see Figure 3The stitched image 30 includes an original image 10 and a binary image 20 generated based on the original image 10. In the binary image 20, the text area is filled with white, and other areas are filled with black.

[0065] In this embodiment, the original image that originally contained complex visual elements is simplified into a binary image that only highlights the text area. The text part forms a sharp contrast with the non-text part, thereby enhancing the feature expression of the text area and highlighting the layout features of the original image, thereby further realizing the division of the image based on multimodal information such as text, vision and layout features of the image.

[0066] In some embodiments, a first sequence feature can be obtained based on the spliced ​​image and text features through a feature extraction model. In a specific embodiment, a sliding window sampling method can be adopted to divide the spliced ​​image into multiple fixed-size sub-image blocks through a fixed-size window (i.e., sliding window), and the multiple sub-image blocks are input into the feature extraction model for subsequent processing. For example, after the spliced ​​image is processed with a fixed width and height, T sub-image blocks are obtained by sampling according to a given sliding window size (H×W). In particular, for long image processing, this sampling method helps to feed the binary image containing text area information into the model together with the local features of the original image for further text-image correlation analysis, image segmentation and learning of understanding tasks.

[0067] refer to Figure 4 , which shows a model architecture diagram provided by an embodiment of the present disclosure. Multiple sub-image blocks (e.g., T-frame H×W image blocks) obtained by dividing the spliced ​​image are input into the feature extraction model together with the corresponding text features to obtain the first sequence feature, which integrates the multimodal information such as text, layout and vision in the image. Then, the first sequence feature is input into the prediction model to obtain information for indicating the image segmentation position and its corresponding information for indicating the label. For example, see Figure 4 , the prediction model can output vectors (y1, c1), (y2, c2), (y3, c3), (y4, c4), where y1-y4 is information used to indicate the image segmentation position, and c1-c4 is information used to indicate the label corresponding to the image segmentation position.

[0068] In some embodiments, the feature extraction model can be a Video Swin Transformer model, which is a video semantic understanding model based on the Swin Transformer architecture, which effectively captures the spatiotemporal local and global information in the video sequence by introducing a window self-attention mechanism and staged feature extraction. The feature extraction model includes multiple stages (Stage), in each stage, the input features are downsampled, for example, using a 2×2 pooling window, the width and height of the feature map are reduced to half of the original (the number of channels can be doubled), so as to gradually refine high-level abstract features and reduce the complexity of subsequent calculations.

[0069] In some embodiments, in the process of generating the first sequence feature, the intermediate product used to generate the first sequence feature is subjected to a feature dimensionality reduction operation to reduce the features of the intermediate product in the target dimension; wherein the target dimension is the dimension corresponding to the direction of the short side of the original image. For example, assuming that the original image is a vertically long image with a height greater than a width, the target dimension is the dimension in the width direction (i.e., the W dimension). In this case, the input feature can be pooled along the W dimension by using the maximum pooling. Exemplarily, assuming that in the feature extraction model, if the dimensional form of the feature (intermediate product) generated in one stage is expressed as (T / 2)×(H / 16)×(W / 16)×4C, the dimensional form of the feature obtained after the feature dimensionality reduction operation is performed on it is expressed as (T / 2)×(H / 16)×4C; wherein H, W, and T respectively represent the height, width, and number of frames of the input image (e.g., the sub-image block obtained by sliding window sampling in the aforementioned embodiment), and C represents the number of channels.

[0070] In this embodiment, on the basis of simplifying the image segmentation task to the task of predicting the segmentation position in the long side direction of the image (for example, predicting the segmentation position on the Y-axis), by further reducing the dimension of the features in the short side direction of the image during the feature extraction process, the size of the features can be reduced and the key features can be retained, which helps to reduce the computational complexity of the subsequent model.

[0071] In some embodiments, after the feature dimensionality reduction operation, the reduced dimensionality features may be further converted into one-dimensional vectors through a flattening operation to form a first sequence of features.

[0072] In some embodiments, the prediction model can be a model based on the Transformer architecture, which includes an encoder and a decoder, and the encoder and the decoder can respectively include multiple encoding layers and multiple decoding layers. The first sequence feature is input into the encoder to generate a second sequence feature of context modeling, so that the sequence feature can be further integrated into the global context information, thereby improving the expressiveness of the feature and the prediction performance of the model. The decoder decodes the generated second sequence feature to obtain the prediction result of the model.

[0073] In some embodiments, the prediction model can be trained by a loss function (e.g., a cross entropy loss function). For example, the loss between the predicted output of the model based on the training sample and the expected output can be calculated, the gradient of the loss function with respect to the model parameters can be calculated by the back propagation algorithm, and then the parameters of the model can be adjusted using the gradient descent algorithm to reduce the value of the loss function, and the aforementioned steps can be repeated until the model performance reaches the expected level or meets a specific training goal.

[0074] The loss functions provided by related technologies (such as the cross entropy loss function) are usually used for classification tasks (such as image classification, text classification, etc.), especially for the case where the output of the model is a discrete category label. For the misclassification itself, these loss functions will not differentiate in the degree of penalty. For example, whether "cat" is predicted as "snake" or "tiger" or other wrong categories, the contribution of the category error itself to the loss function is the same, because the penalty mechanism of the cross entropy loss function is based on the difference between the predicted probability distribution of each sample and the corresponding true label (that is, the true probability distribution to which the sample belongs). This difference is mainly reflected in the degree of misprediction of a specific category for each sample, but does not focus on the difference between the wrong categories themselves (such as the difference between "snake" and "tiger" in the above example). The above characteristics of this type of loss function are not very suitable for position prediction tasks that are different from the characteristics of classification tasks. In this regard, in some embodiments of the present disclosure, a differentiated penalty strategy is provided to train the model, and a relatively low penalty strength is applied to the predicted positions close to the target image segmentation position (i.e., the desired image segmentation position) (i.e., the degree of correction of its errors or deviations during the training process is small), while a relatively high penalty strength is applied to the predicted positions far away from the target image segmentation position (i.e., the degree of correction of its errors or deviations during the training process is large). In some specific embodiments, a penalty term or weight coefficient that can be adjusted based on the distance between the predicted position and the target position (desired result) can be introduced into the loss function (e.g., the cross entropy loss function). For example, the penalty term increases monotonically with the increase of the distance between the predicted value and the target image segmentation position, thereby forming a relatively low penalty strength area near the target image segmentation position, while a higher penalty strength is applied to the position far away from the target image segmentation position. In some specific embodiments, the penalty term or weight coefficient may be applicable only within a preset range around the target value.

[0075] Accordingly, refer to Figure 5 According to an embodiment of the present disclosure, a device 500 for dividing image content is provided, including:

[0076] A text region determining unit 501, used to determine a text region in an original image;

[0077] A text content extraction unit 502, used to extract text content in the text area;

[0078] A text feature unit 503, used to obtain text features based on the text content;

[0079] A sequence feature unit 504, configured to obtain a first sequence feature based on the original image and the text feature;

[0080] A prediction unit 505, configured to determine at least one image segmentation position based on the first sequence feature by using a prediction model;

[0081] The dividing unit 506 is configured to divide the original image based on the at least one image segmentation position.

[0082] In some embodiments, the means for dividing the image content further comprises:

[0083] A binary image generating unit, configured to generate a binary image corresponding to the original image based on the position of the text area in the original image, wherein the text area and the non-text area in the binary image are represented by two different colors respectively;

[0084] An image stitching unit, used for stitching the binary image and the original image to obtain a stitched image;

[0085] The sequence feature unit is further used to obtain the first sequence feature based on the spliced ​​image and the text feature.

[0086] In some embodiments, the prediction unit is further used to determine at least one image segmentation position and its corresponding label based on the first sequence feature through the prediction model;

[0087] The device for dividing the image content also includes:

[0088] An identification unit is used to identify the divided areas of the original image based on the labels.

[0089] In some embodiments, the image segmentation position is a position in the direction of the long side of the original image.

[0090] In some embodiments, the sequence feature unit comprises:

[0091] A feature dimension reduction unit is used to perform feature dimension reduction on an intermediate product used to generate the first sequence feature in the process of generating the first sequence feature, so as to reduce the features of the intermediate product in a target dimension; wherein the target dimension is a dimension corresponding to the direction of the short side of the original image.

[0092] In some embodiments, determining at least one image segmentation position based on the first sequence feature includes: generating a second sequence feature for context modeling based on the first sequence feature; and obtaining the at least one image segmentation position based on the second sequence feature.

[0093] In some embodiments, when training the prediction model, if the predicted image segmentation position of the prediction model is closer to the expected image segmentation position, the corresponding penalty intensity is smaller; if the predicted image segmentation position of the prediction model is farther away from the expected image segmentation position, the corresponding penalty intensity is greater.

[0094] For the embodiments of the device, since they basically correspond to the method embodiments, the relevant parts refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, and the modules described as separation modules may or may not be separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present embodiment. Those of ordinary skill in the art can understand and implement without paying creative work.

[0095] Accordingly, according to one or more embodiments of the present disclosure, there is provided an electronic device, including:

[0096] at least one memory and at least one processor;

[0097] The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to enable the electronic device to execute the method for dividing image content provided according to one or more embodiments of the present disclosure.

[0098] Accordingly, according to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, which stores program code, and the program code can be executed by a computer device to enable the computer device to perform the method of dividing image content provided according to one or more embodiments of the present disclosure.

[0099] Reference below Figure 6 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 800 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0100] like Figure 6As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0101] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0102] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0103] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0104] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0105] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0106] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method of the present disclosure.

[0107] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0108] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0109] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0110] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0111] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0112] According to one or more embodiments of the present disclosure, a method for dividing image content is provided, comprising: determining a text area in an original image; extracting text content in the text area; obtaining text features based on the text content; obtaining a first sequence feature based on the original image and the text feature; determining at least one image segmentation position based on the first sequence feature through a prediction model; and dividing the original image based on the at least one image segmentation position.

[0113] According to one or more embodiments of the present disclosure, the method further includes: generating a binary image corresponding to the original image based on the position of the text area in the original image, wherein the text area and the non-text area in the binary image are represented by two different colors respectively; splicing the binary image and the original image to obtain a spliced ​​image; and obtaining a first sequence feature based on the original image and the text feature includes: obtaining the first sequence feature based on the spliced ​​image and the text feature.

[0114] According to one or more embodiments of the present disclosure, determining at least one image segmentation position based on the first sequence feature through a prediction model includes: determining at least one image segmentation position and its corresponding label based on the first sequence feature through the prediction model; the method also includes: identifying the divided areas of the original image based on the label.

[0115] According to one or more embodiments of the present disclosure, the image segmentation position is a position in the direction of the long side of the original image.

[0116] According to one or more embodiments of the present disclosure, obtaining the first sequence feature based on the original image and the text feature includes: in the process of generating the first sequence feature, performing feature dimensionality reduction on the intermediate product used to generate the first sequence feature to reduce the features of the intermediate product in a target dimension; wherein the target dimension is the dimension corresponding to the direction of the short side of the original image.

[0117] According to one or more embodiments of the present disclosure, determining at least one image segmentation position based on the first sequence feature includes: generating a second sequence feature for context modeling based on the first sequence feature; and obtaining the at least one image segmentation position based on the second sequence feature.

[0118] According to one or more embodiments of the present disclosure, when training the prediction model, if the predicted image segmentation position of the prediction model is closer to the expected image segmentation position, the corresponding penalty strength is smaller; if the predicted image segmentation position of the prediction model is farther away from the expected image segmentation position, the corresponding penalty strength is larger.

[0119] According to one or more embodiments of the present disclosure, there is provided a device for dividing image content, comprising: a text area determination unit, for determining a text area in an original image; a text content extraction unit, for extracting text content in the text area; a text feature unit, for obtaining a text feature based on the text content; a sequence feature unit, for obtaining a first sequence feature based on the original image and the text feature; a prediction unit, for determining at least one image segmentation position based on the first sequence feature through a prediction model; and a division unit, for dividing the original image based on the at least one image segmentation position.

[0120] According to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call the program code stored in the memory so that the electronic device executes the method for dividing image content provided according to one or more embodiments of the present disclosure.

[0121] According to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, wherein the non-transitory computer storage medium stores program code, and when the program code is executed by a computer device, the computer device executes the method for dividing image content provided according to one or more embodiments of the present disclosure.

[0122] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0123] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0124] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for dividing image content, characterized in that: include: Determine the text area in the original image; Extracting text content in the text area; Obtaining text features based on the text content; Obtaining a first sequence feature based on the original image and the text feature; Determine at least one image segmentation position based on the first sequence feature by a prediction model; The original image is divided based on the at least one image segmentation position.

2. The method according to claim 1, characterized in that Also includes: Based on the position of the text area in the original image, generating a binary image corresponding to the original image, wherein the text area and the non-text area in the binary image are represented by two different colors respectively; Splicing the binary image and the original image to obtain a spliced ​​image; The obtaining of the first sequence feature based on the original image and the text feature includes: obtaining the first sequence feature based on the spliced ​​image and the text feature.

3. The method according to claim 1, characterized in that The determining at least one image segmentation position based on the first sequence feature through the prediction model comprises: determining at least one image segmentation position and its corresponding label based on the first sequence feature through the prediction model; The method further includes: identifying the divided areas of the original image based on the labels.

4. The method according to claim 1, characterized in that: The image segmentation position is a position in the direction of the long side of the original image.

5. The method according to claim 4, characterized in that The obtaining of a first sequence feature based on the original image and the text feature comprises: In the process of generating the first sequence feature, feature dimensionality reduction is performed on the intermediate product used to generate the first sequence feature to reduce the features of the intermediate product in a target dimension; wherein the target dimension is a dimension corresponding to a direction in which a short side of the original image is located.

6. The method according to claim 1, characterized in that Determining at least one image segmentation position based on the first sequence feature includes: Generate a second sequence feature for context modeling based on the first sequence feature; The at least one image segmentation position is obtained based on the second sequence feature.

7. The method according to claim 1, characterized in that When training the prediction model, if the predicted image segmentation position of the prediction model is closer to the expected image segmentation position, the corresponding penalty strength is smaller; if the predicted image segmentation position of the prediction model is farther away from the expected image segmentation position, the corresponding penalty strength is larger.

8. A device for dividing image content, characterized in that: include: A text region determination unit, used for determining a text region in an original image; A text content extraction unit, used to extract text content in the text area; A text feature unit, used to obtain text features based on the text content; A sequence feature unit, used for obtaining a first sequence feature based on the original image and the text feature; A prediction unit, configured to determine at least one image segmentation position based on the first sequence feature by using a prediction model; A dividing unit is used to divide the original image based on the at least one image segmentation position.

9. An electronic device, characterized in that: include: at least one memory and at least one processor; The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to enable the electronic device to execute the method according to any one of claims 1 to 7.

10. A non-transitory computer storage medium, characterized in that The non-transitory computer storage medium stores a program code, and when the program code is executed by a computer device, the computer device executes the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Document title generation method and device, equipment and storage medium

    CN114399775A

  • Domain-oriented picture table restoration method and system

    CN116152832A

  • Text recognition method and training method and device of text recognition model

    CN116343233A

  • Anaphora image segmentation method and device based on basic model, and storage medium

    CN117877029A

Cited By

  • Image processing method and device, electronic equipment and storage medium

    CN121010616A

  • Image processing method and device, electronic equipment and storage medium

    CN121010616B