A method and device for extracting information based on images

By training the target recognition and image classification model, combined with the knowledge database, the vertical domain information in the image is extracted, which solves the problems of low image information conversion efficiency and poor accuracy in the existing technology, and achieves fast and accurate image information extraction and text generation. , reducing user knowledge requirements.

CN113642595BActive Publication Date: 2024-09-17BEIJING KINGSOFT DIGITAL ENTERTAINMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010392763.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-11
Publication Date
2024-09-17
Estimated Expiration
2040-05-11

AI Technical Summary

Technical Problem

Existing technology requires users to have high observation ability and prior knowledge when converting picture information into text, and open-domain picture recognition can only simply list targets and cannot provide accurate vertical domain information, which is inefficient.

Method used

By training the target recognition model and picture classification model, combined with the knowledge database, the target vertical field information in the picture to be edited is extracted, and accurate picture information is generated, which reduces the user's requirements for prior knowledge and improves the accuracy and pertinence of information extraction.

Benefits of technology

It achieves rapid acquisition of the main content of images, reduces users' requirements for prior knowledge, improves the accuracy and usability of information extraction, provides professional and accurate image editing text, and assists users in completing document editing efficiently.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113642595B
    Figure CN113642595B
Patent Text Reader

Abstract

The present application proposes a method and device for extracting information based on pictures, wherein the method includes: extracting picture information of the picture to be edited through the target recognition model and the preset knowledge database described in the present application, and obtaining the picture content information corresponding to the picture to be edited in the target vertical field to which it belongs; classifying the picture to be edited through the picture classification model described in the present application, and obtaining the picture classification information corresponding to the picture to be edited; and generating accurate picture information corresponding to the picture to be edited according to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited. The present application can help users quickly obtain accurate picture information corresponding to the picture to be edited, thereby understanding the main content contained in the picture to be edited, greatly reducing the requirements for users' prior knowledge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, computing equipment and computer-readable storage medium for extracting information based on an image. Background Art

[0002] When users are writing articles, such as news writing, they need to convert the image information taken on site into text. This process requires users to have high observation ability and prior knowledge. If the image information in the image cannot be accurately identified, the user will have a wrong understanding of the image, which will affect the accuracy of the article description and writing efficiency. In the prior art, the main ways to convert image information into text include manual description and open-domain image recognition and text conversion, where manual description refers to the user manually editing the image content by observing the image, and open-domain image recognition and text conversion refers to listing the content in the image for users to use by detecting the target in the image. However, the problem with the prior art is that manual description requires users to have a lot of professional knowledge, and the accuracy is difficult to guarantee, while open-domain image recognition and text conversion only simply lists the targets, and cannot return accurate image information for a certain vertical field. At the same time, since the returned text content is a simple list of the target names in the image, it cannot be directly used by users and has low efficiency. Summary of the invention

[0003] In view of this, the embodiments of the present application provide a method, apparatus, computing device and computer-readable storage medium for extracting information based on an image to solve the technical defects existing in the prior art.

[0004] According to a first aspect of an embodiment of this specification, a method for training a target recognition model is provided, comprising:

[0005] Obtaining a target recognition training sample and a corresponding target recognition training label, wherein the target recognition training sample includes a sample picture set corresponding to at least one target vertical field, and the target recognition training label includes annotation information of each sample picture in the sample picture set, wherein the annotation information includes a target type and a target position coordinate;

[0006] The target recognition model is trained using the target recognition training samples and the corresponding target recognition training labels, and the parameters of the target recognition model are adjusted according to the loss value of the target recognition model until a training termination condition is met.

[0007] According to a second aspect of an embodiment of this specification, a method for training an image classification model is provided, comprising:

[0008] Acquire classification training samples and corresponding classification training labels, wherein the classification training samples include a sample picture set corresponding to at least one target vertical field, and the classification training labels include the target vertical field to which each sample picture in the sample picture set belongs and the picture scene to which each sample picture belongs;

[0009] The image classification model is trained using the classification training samples and the corresponding classification training labels, and the parameters of the image classification model are adjusted according to the loss value of the image classification model until a training termination condition is met.

[0010] According to a third aspect of an embodiment of this specification, a method for extracting information based on a picture is provided, comprising:

[0011] Extracting picture information from the picture to be edited by using the target recognition model and the preset knowledge database, and obtaining picture content information corresponding to the picture to be edited in the target vertical field to which it belongs;

[0012] Classify the image to be edited by the image classification model as described above, and obtain image classification information corresponding to the image to be edited;

[0013] According to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited, accurate picture information corresponding to the picture to be edited is generated.

[0014] According to a fourth aspect of an embodiment of this specification, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the image-based information extraction method when executing the instructions.

[0015] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer instructions, and when the instructions are executed by a processor, the steps of the image-based information extraction method are implemented.

[0016] This application extracts information and classifies pictures to be edited according to the target vertical field to which the pictures to be edited belong, helping users to quickly obtain accurate picture information corresponding to the pictures to be edited and thus understand the main content contained in the pictures to be edited, greatly reducing the requirements for users' prior knowledge. Compared with the open domain, the knowledge extraction method of this application is more targeted and can also ensure the accuracy and usability of picture analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a structural block diagram of a computing device provided in an embodiment of the present application;

[0018] Figure 2is a flow chart of a method for training a target recognition model provided in an embodiment of the present application;

[0019] Figure 3 Schematic diagram of the model architecture of the target recognition model provided in the embodiment of the present application;

[0020] Figure 4 is a flowchart of a method for training an image classification model provided in an embodiment of the present application;

[0021] Figure 5 Schematic diagram of the model architecture of the image classification model provided in the embodiment of the present application;

[0022] Figure 6 Schematic diagram of the model composition structure of the base image classification model provided in the embodiment of the present application;

[0023] Figure 7 is a flowchart of a method for extracting information based on a picture provided in an embodiment of the present application;

[0024] Figure 8 is another flow chart of the image-based information extraction method provided in an embodiment of the present application;

[0025] Fig. 9 is a picture to be edited provided in an embodiment of the present application;

[0026] Fig.10 is another flow chart of the image-based information extraction method provided in an embodiment of the present application;

[0027] Fig.11 is a flowchart of a training method for a text generation model provided in an embodiment of the present application;

[0028] Fig.12 is a flowchart of a method for generating text based on an image provided in an embodiment of the present application;

[0029] Fig.13 is another flow chart of the method for generating text based on an image provided in an embodiment of the present application;

[0030] Fig.14 It is a flowchart of the Chinese template library construction method provided in the embodiment of the present application;

[0031] Fig.15 It is an overall flow chart of the text method based on the picture to be edited provided by the embodiment of the present application;

[0032] Fig.16 It is a structural schematic diagram of a training device for a target recognition model provided in an embodiment of the present application;

[0033] Fig.17It is a structural schematic diagram of a training device for an image classification model provided in an embodiment of the present application;

[0034] Fig.18 is a schematic diagram of the structure of a picture-based information extraction device provided in an embodiment of the present application;

[0035] Fig.19 It is a structural schematic diagram of a training device for a text generation model provided in an embodiment of the present application;

[0036] Fig. 20 is a structural schematic diagram of a text generation device based on an image provided in an embodiment of the present application;

[0037] Fig.21 It is another structural schematic diagram of the image-based text generation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0039] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0040] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0041] First, the terms involved in one or more embodiments of the present invention are explained.

[0042] Vertical field: refers to a classification that focuses on a certain major category, such as sports or government affairs, and provides all in-depth information and related services in that field.

[0043] Pictures to be edited: refers to pictures that need to generate description text, such as news pictures that need to be converted into text descriptions.

[0044] Picture scene: refers to the scene category described by the picture to be edited, which can be a detailed classification under a certain vertical field, such as group photo scenes and speech scenes in the government field.

[0045] Target recognition information: Target recognition technology is used to identify relevant image content information from the image to be edited, that is, to extract targets in the target vertical field in the image to be edited. For example, in the field of blind guides, various types of vehicles, pedestrians, traffic signs, and traffic lights are all objects that need attention.

[0046] Target knowledge information: Based on the target identified in the image to be edited, the relevant encyclopedia information corresponding to the target is obtained through the knowledge database, such as the public personal information and basketball career information corresponding to the target "Yao Ming".

[0047] Image content information: information describing the image content of the image to be edited obtained by summarizing the target recognition information and target knowledge information of the image to be edited.

[0048] Image classification information: The vertical field and image scene to which the image to be edited belongs are obtained by classifying the image to be edited using image classification technology.

[0049] Accurate picture information: structured data describing the picture content of the picture to be edited obtained by summarizing the picture classification information and picture content information of the picture to be edited.

[0050] Image editing text: text generated based on the accurate information of the image to be edited, combined with the document type or target vertical field selected by the user, with a text that reflects the image content of the image to be edited and has a specific writing field and a specific writing style.

[0051] Deep learning model: Deep learning is a general term for a class of pattern analysis methods. In terms of specific research content, it mainly involves three types of methods: (1) Neural network systems based on convolution operations, namely convolutional neural networks (CNNs). (2) Autoencoder neural networks based on multi-layer neurons, including autoencoders and sparse coding, which has received widespread attention in recent years. (3) Deep belief networks (DBNs) that are pre-trained in the form of multi-layer autoencoder neural networks and then further optimize the weights of the neural network by combining identification information.

[0052] Bidirectional recurrent neural network: In some tasks, the output at the current moment is not only related to the past information, but also to the information at the subsequent moments. For example, given a sentence, that is, a sequence of words, the part of speech of each word is related to the context. Therefore, a network layer can be added to transmit information in reverse time order to enhance the network's capabilities. Bidirectional recurrent neural network (Bi-RNN) consists of two layers of recurrent neural networks. Both layers input the sequence x, but the information is transmitted in opposite directions. Assume that the first layer transmits information in chronological order and the second layer transmits information in reverse time order. The hidden states of these two layers at time t are ht(1) and ht(2) document types respectively. Concatenate ht(1) and ht(2) to obtain the final output hidden state vector.

[0053] Document type: Document type refers to the category of articles corresponding to the specific scenario or writing style in which the document is used. For example, documents on People's Daily Online are mostly news, documents on Economic Daily Online are mostly narrative or academic, and so on.

[0054] In the present application, a method, apparatus, computing device and computer-readable storage medium for extracting information based on an image are provided, which are described in detail one by one in the following embodiments.

[0055] Figure 1 The structure block diagram of a computing device 100 according to an embodiment of the present specification is shown. The components of the computing device 100 include but are not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.

[0056] The computing device 100 also includes an access device 140 that enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0057] In one embodiment of the present specification, the above components of the computing device 100 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0058] The computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 100 may also be a mobile or stationary server.

[0059] The processor 120 may execute Figure 2 Steps in the method shown. Figure 2 It is a schematic flowchart showing a method for training a target recognition model according to an embodiment of the present application, including steps 202 to 204.

[0060] Step 202: Obtain target recognition training samples and corresponding target recognition training labels, wherein the target recognition training samples include a set of sample images corresponding to at least one target vertical field, and the target recognition training labels include annotation information of each sample image in the sample image set, wherein the annotation information includes a target type and a target position coordinate.

[0061] In an embodiment of the present application, the present application targets at least one target vertical field and obtains a set of sample images corresponding to at least one target vertical field. For example, the target vertical field is the sports field and / or the government field. A set of sample images is constructed by obtaining images of athletes in the sports field and / or civil servants in the government field participating in various activities or events, and each sample image is annotated by manual annotation to form a target recognition training label. The annotation information includes the target type and the upper left and lower right boundary coordinates of the target position, wherein the target type may be a target appearing in the sample image, such as a person or an object, and the upper left and lower right boundary coordinates of the target position are used to indicate the area where the target type appears in the sample image.

[0062] Step 204: Train the target recognition model using the target recognition training samples and the corresponding target recognition training labels, and adjust the parameters of the target recognition model according to the loss value of the target recognition model until the training termination condition is met.

[0063] In an embodiment of the present application, the present application fine-tunes the initialized Fast R-CNN model through the target recognition training samples and the corresponding target recognition training labels to obtain a target recognition model for target detection in at least one vertical field, which is used to identify the target and position in the image to be edited and obtain the result {type: person, position [xx, xx, xxx, xxx]}, wherein the architecture of the Fast R-CNN model is as follows Figure 3 As shown in the figure, during training, the Fast R-CNN network takes the entire sample image of a fixed size of 224×224 and a set of annotation information as input. The model first uses 5 convolutional layers and 2 maximum pooling layers to process the entire sample image to generate a convolutional feature map, and then inputs the output of the 5th convolutional layer and about 2000 candidate regions (region proposal) into the RoI (Region of Interest) pooling layer to extract a fixed-size feature vector from the convolutional feature map. After passing through two fully connected layers with outputs of 4096 dimensions, they pass through parallel fully connected layers with outputs of 21 dimensions and 84 dimensions respectively, and finally split into two parallel output layers, one for the normalized probability corresponding to the vertical field of each target, and the other outputs four real values ​​for each target, and each group of real values ​​encodes the position of the binding box (bunding box) of the corresponding target.

[0064] This application uses an initialized deep learning model and fine-tunes the training data for the target vertical field to obtain target recognition for the target vertical field of the image to be edited, thereby achieving targeted information extraction for the image to be edited and ensuring the accuracy and professionalism of the information extraction.

[0065] The processor 120 may execute Figure 4 Steps in the method shown. Figure 4 It is a schematic flowchart showing a method for training a target recognition model according to an embodiment of the present application, including steps 402 to 404.

[0066] Step 402: Obtain classification training samples and corresponding classification training labels, wherein the classification training samples include a sample picture set corresponding to at least one target vertical field, and the classification training labels include the target vertical field to which each sample picture in the sample picture set belongs and the picture scene to which each sample picture belongs.

[0067] In an embodiment of the present application, the present application targets at least one target vertical field and obtains a set of sample images corresponding to at least one target vertical field. For example, the target vertical field is the sports field and / or the government field. A set of sample images is constructed by obtaining images of athletes in the sports field and / or civil servants in the government field participating in various activities or events, and the target vertical field to which the sample images belong and the image scenes to which each sample image belongs are used as preset classification labels, such as sports, government affairs, competitions, and group photos.

[0068] Step 404: Train the image classification model using the classification training samples and the corresponding classification labels, and adjust the parameters of the image classification model according to the loss value of the image classification model until the training termination condition is met.

[0069] In an embodiment of the present application, the present application trains the convolutional neural network model initialized by the classification training samples and the corresponding classification label pairs to obtain an image classification model for at least one target vertical field and a specific image scene in each target vertical field, wherein the architecture of the convolutional neural network model is as follows: Figure 5 As shown in the figure, during training, a sample image of a fixed size of 798x798x3 is input into multiple convolutional layers for convolution operation, and then the convolution feature map output by the last convolutional layer is subjected to the maximum pooling operation through the maximum pooling layer to obtain a convolution feature map of a final size of 1x1x3, which is then reduced in dimension through the fully connected layer to obtain a vector of 1xN dimensions, where N represents the classification probability of the sample image corresponding to N types of target vertical fields and image scenes, and the maximum value is taken as the final prediction result of the sample image.

[0070] In an embodiment of the present application, the image scene classification model includes an image domain classification model and at least one image scene classification model. Figure 6 As shown, the present application first classifies the target vertical field of the picture to be edited, and then performs secondary classification according to the target vertical field to which the picture to be edited belongs using the picture scene classification model of the corresponding field to obtain the picture scene to which the picture to be edited belongs. For example, if the picture to be edited belongs to the target vertical field A after being classified by the picture field classification model, the picture to be edited is further input into the picture scene classification model A corresponding to the target vertical field A to obtain the picture scene a1 under the target vertical field A.

[0071] This application trains a deep learning model of a convolutional neural network using a set of sample images corresponding to at least one target vertical field, and obtains an image classification model that can accurately treat edited images for target vertical fields and image scenes, thereby achieving image classification for vertical fields.

[0072] The processor 120 may execute Figure 7 Steps in the method shown. Figure 7 It is a schematic flowchart showing a method for training a target recognition model according to an embodiment of the present application, including steps 702 to 708.

[0073] Step 702: extracting image information of the image to be edited through the target recognition model described in this application and the preset knowledge database to obtain the image content information corresponding to the image to be edited in the target vertical field to which it belongs.

[0074] In the embodiments of the present application, Figure 8 As shown, the image information of the image to be edited is extracted through the target recognition model described in this application and the preset knowledge database to obtain the image content information corresponding to the image to be edited in the target vertical field to which it belongs, including steps 802 to 806.

[0075] Step 802: Perform target detection on the image to be edited using the target recognition model described in this application to obtain target recognition information corresponding to the image to be edited in the target vertical field to which it belongs.

[0076] In an embodiment of the present application, the system or terminal of the present application uses the target recognition technology to perform target recognition on at least one target vertical field of the present application to obtain target type information and target position information belonging to the target disposal field appearing in the image to be edited, specifically, Fig. 9 As shown, when the image content of the to-be-edited picture P is a group photo of basketball athletes "Zhang San" and "Li Si", the to-be-edited picture P is input into a target recognition model trained based on target vertical fields such as sports, government affairs and other related training data, and the target recognition information obtained is "[{category: person, position [20, 40, 300, 790]}, {category: person, position [300, 40, 790, 790]}]".

[0077] Step 804: Match the target recognition information corresponding to the image to be edited in a preset knowledge database to obtain the target knowledge information corresponding to the image to be edited.

[0078] In the embodiment of the present application, the system of the present application obtains the target belonging to the target vertical field appearing in the image to be edited based on the target type information and target position information belonging to the target disposal field appearing in the image to be edited, obtains the characteristic image of the target using the target recognition method, and matches the characteristic image of the target in the preset knowledge database to obtain the target knowledge information of the target. Specifically, Fig. 9As shown, when the image content of the image P to be edited is a group photo of basketball athletes "Zhang San" and "Li Si", the system of the present application uses a target recognition method to obtain the character portraits of the targets "Zhang San" and "Li Si" as feature images, and uses the character portraits of the targets "Zhang San" and "Li Si" to match them in a preset knowledge database, and returns the target knowledge information of the target "Zhang San" as "Name: Zhang San, Information: {xxx}", and the target knowledge information of the target "Li Si" as "Name: Li Si, Information: {xxx}".

[0079] Step 806: Generate picture content information corresponding to the picture to be edited according to the target recognition information corresponding to the picture to be edited and the target knowledge information corresponding to the picture to be edited.

[0080] In an embodiment of the present application, the system of the present application integrates and summarizes the target recognition information corresponding to the picture to be edited and the target knowledge information corresponding to the picture to be edited, generates the picture content information corresponding to the picture to be edited, and obtains structured data describing the picture content corresponding to the picture to be edited. Specifically, in the case where the picture content of the picture to be edited P is a group photo of basketball players "Zhang San" and "Li Si", by integrating and summarizing the target knowledge information and target recognition information of the targets "Zhang San" and "Li Si", the picture content information corresponding to the picture to be edited P is finally obtained as "[{category: person, position [20, 40, 300, 790], name: Zhang San, information: {xxx}}, {category: person, position [300, 40, 790, 790], name: Li Si, information: {xxx}}]".

[0081] Through target recognition technology, the present application can automatically extract image information of the vertical field to which the image to be edited belongs, such as government affairs, sports or entertainment, and form structured data, thereby realizing the extraction of image information for specific vertical fields and reducing the user's requirements for prior knowledge.

[0082] Step 704: Classify the image to be edited using the image classification model described in this application to obtain image classification information corresponding to the image to be edited.

[0083] In the embodiments of the present application, Fig.10 As shown, the picture to be edited is classified by the picture classification model described in the present application to obtain picture classification information corresponding to the picture to be edited, including steps 1002 to 1006.

[0084] Step 1002: Classify the image to be edited by the image domain classification model described in this application to obtain the target vertical domain to which the image to be edited belongs.

[0085] In an embodiment of the present application, the system or terminal of the present application uses the picture field classification model described in the present application to classify the picture to be edited according to at least one preset target vertical field, obtains the classification probability of each target vertical field of the picture to be edited, and takes the target vertical field corresponding to the maximum classification probability as the target vertical field to which the picture to be edited belongs. Specifically, Fig. 9 As shown, when the image content of the image P to be edited is a group photo of basketball athletes "Zhang San" and "Li Si", the system of the present application classifies the image P to be edited through an image field classification model. The preset categories include sports, entertainment, and politics, and the corresponding classification probabilities are 0.8, 0.15, and 0.05, respectively. The target vertical field to which the image P to be edited belongs is the sports field.

[0086] Step 1004: Based on the target vertical field corresponding to the picture to be edited, the picture to be edited is classified by the picture scene classification model described in the present application to obtain the picture scene to which the picture to be edited belongs.

[0087] In an embodiment of the present application, the system or terminal of the present application further classifies the scene of the image to be edited according to the target vertical field to which it belongs through the image scene classification model described in the present application, obtains the classification probability of each image scene corresponding to the image to be edited in the target vertical field to which it belongs, and takes the image scene corresponding to the maximum classification probability as the image scene to which the image to be edited belongs. Specifically, Fig. 9 As shown, when the image content of the picture P to be edited is a group photo of basketball players "Zhang San" and "Li Si", the system of the present application classifies the picture P to be edited through a picture scene classification model under the sports field. The preset picture scene classifications include group photo, competition and training, and the corresponding classification probabilities are 0.8, 0.15 and 0.05 respectively. Then the picture scene to which the picture P to be edited belongs is a group photo.

[0088] Step 1006: According to the target vertical domain to which the to-be-edited picture belongs and the picture scene to which the to-be-edited picture belongs, construct the picture classification information corresponding to the to-be-edited picture in the target vertical domain to which it belongs.

[0089] In an embodiment of the present application, the system or terminal of the present application aggregates the target vertical field to which the to-be-edited picture belongs and the picture scene to which the to-be-edited picture belongs, and finally obtains the picture classification information corresponding to the to-be-edited picture in the target vertical field to which it belongs. Fig. 9As shown, in the case that the picture content of the picture P to be edited is a group photo of basketball athletes "Zhang San" and "Li Si", it is known that the target vertical field to which the picture P to be edited belongs is sports and the picture scene is a group photo, then the picture classification information of the picture P to be edited is "{Picture classification: [Sports, Group photo]}".

[0090] This application uses an image classification model to perform a primary classification of the target vertical field for the edited images, and then performs a secondary classification of the image scenes based on the target vertical field of the edited images, thereby performing a targeted and detailed classification of the edited images and realizing information extraction for professional fields.

[0091] Step 706: Generate accurate picture information corresponding to the picture to be edited according to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited.

[0092] In an embodiment of the present application, according to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited in the target vertical field to which it belongs, generating the accurate picture information corresponding to the picture to be edited includes:

[0093] The image content information corresponding to the image to be edited and the image classification information corresponding to the image to be edited in the target vertical field to which the image to be edited belongs are aggregated and structured to obtain structured accurate image information corresponding to the image to be edited. Fig. 9 As shown, when the picture content of the picture P to be edited is a group photo of basketball athletes "Zhang San" and "Li Si", by integrating the picture content information and the picture classification information, the accurate picture information is finally obtained as "{Picture classification: [Sports, Group photo], Picture content: [{Type: People, Position [20, 40, 300, 790], Name: Zhang San, Information: {xxx}}, {Type: People, Position [300, 40, 790, 790], Name: Li Si, Information: {xxx}}}".

[0094] The system of the present application can combine the image content information extracted from the image to be edited with the image classification information, thereby screening the simply listed image information to a certain extent, and generating structured and accurate information that professionally and accurately describes the image content reflected by the image to be edited according to the target vertical field to which the image to be edited belongs.

[0095] This application extracts information and classifies pictures to be edited according to the target vertical field to which the pictures to be edited belong, helping users to quickly obtain accurate picture information corresponding to the pictures to be edited and thus understand the main content contained in the pictures to be edited, greatly reducing the requirements for users' prior knowledge. Compared with the open domain, the knowledge extraction method of this application is more targeted and can also ensure the accuracy and usability of picture analysis.

[0096] Step 708: Generate picture editing text corresponding to the picture to be edited according to the picture accurate information corresponding to the picture to be edited.

[0097] In an embodiment of the present application, the system or terminal of the present application generates a picture editing text corresponding to the picture to be edited through a preset text generation model or Chinese template library combined with accurate picture information corresponding to the picture to be edited.

[0098] This application obtains accurate image information corresponding to the image to be edited in the target vertical field, and combines the document type involved in the image editing text or the template expression of related classifications in the target disposal field to edit the image editing text that meets the requirements and has professional industry reference value, thereby helping users to quickly understand the main information contained in the image to be edited, and providing professional image editing text, thereby assisting users to efficiently and accurately complete professional document editing and writing work in their field.

[0099] The processor 120 may also execute Fig.11 Steps in the method shown. Fig.11 11 is a schematic flowchart showing a method for training a text generation model according to an embodiment of the present application, including steps 1102 to 1104.

[0100] Step 1102: Acquire text generation training samples and corresponding text generation training labels, wherein the text generation training samples include text structured data corresponding to the candidate document type, and the text generation training labels include category annotations corresponding to the text structured data.

[0101] In an embodiment of the present application, the system or terminal of the present application determines at least one document type for different target vertical fields, such as news documents, biographical documents or narrative documents, etc. The text generation training data includes text structured data corresponding to each document type and category annotations for each document type corresponding to the text structured data, that is, manually annotating existing text into structured data similar to the accurate information of the picture as input to the model.

[0102] Step 1104: Train the text generation model using the text generation training samples and the corresponding text generation training labels, and adjust the parameters of the text generation model according to the loss value of the text generation model until the training termination condition is met.

[0103] In an embodiment of the present application, during the training phase, the text structured data corresponding to the document type is first subjected to word embedding operations, and then the embedded representations corresponding to the document type are concatenated to obtain the input vector of the model. The embedded representations corresponding to the document type are processed through a bidirectional recurrent neural network to generate text encodings corresponding to the document type, thereby obtaining automatically generated text.

[0104] This application uses a deep learning model to train several text generation models for at least one document type, thereby realizing automatic text generation for images to be edited in different target vertical fields.

[0105] The processor 120 may execute Fig.12 Steps in the method shown. Fig.12 12 is a schematic flowchart showing a method for generating text based on an image according to an embodiment of the present application, including steps 1202 to 1208.

[0106] Step 1202: Determine at least one target vertical field, and obtain picture content information corresponding to the picture to be edited and picture classification information corresponding to the picture to be edited according to the target vertical field to which the picture to be edited belongs.

[0107] In an embodiment of the present application, the system or terminal of the present application extracts picture information from the picture to be edited through a preset target recognition model and a preset knowledge database, obtains picture content information corresponding to the picture to be edited in the target vertical field to which it belongs, and classifies the picture to be edited through a preset picture classification model to obtain picture classification information corresponding to the picture to be edited. Specifically, in the case where the picture content of the picture to be edited P is a group photo of basketball athletes "Zhang San" and "Li Si", the picture content information corresponding to the picture to be edited P is "[{category: person, position [20, 40, 300, 790], name: Zhang San, information: {xxx}}, {category: person, position [300, 40, 790, 790], name: Li Si, information: {xxx}}]", and the picture classification information of the picture to be edited P is "{picture classification: [sports, group photo]}".

[0108] Step 1204: Generate accurate picture information corresponding to the picture to be edited according to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited.

[0109] In an embodiment of the present application, the system or terminal of the present application obtains structured accurate information of the image to be edited by aggregating and structuring the image content information corresponding to the image to be edited and the image classification information corresponding to the target vertical field to which the image to be edited belongs. Fig. 9 As shown, in the case where the picture content of the to-be-edited picture P is a group photo of basketball athletes "Zhang San" and "Li Si", by integrating the picture content information and the picture classification information, the accurate picture information is finally obtained as "{Picture classification: [Sports, Group photo], Picture content: [{Type: People, Position [20, 40, 300, 790], Name: Zhang San, Information: {xxx}}, {Type: People, Position [300, 40, 790, 790], Name: Li Si, Information: {xxx}}}."

[0110] The system of the present application can combine the image content information extracted from the image to be edited with the image classification information, thereby screening the simply listed image information to a certain extent, and generating structured data that professionally and accurately describes the image content reflected by the image to be edited according to the target vertical field to which the image to be edited belongs.

[0111] Step 1206: Based on the accurate information of the picture corresponding to the picture to be edited, generate the picture editing text corresponding to the picture to be edited through the text generation model described in this application.

[0112] In an embodiment of the present application, the system or terminal of the present application inputs the accurate picture information corresponding to the picture to be edited into the corresponding text generation model to generate the picture editing text corresponding to the picture to be edited according to the document type corresponding to the target vertical field to which the picture to be edited belongs or the document type selected by the user, for example, Fig. 9 As shown, when the image P to be edited is classified as [sports, group photo], the user can choose to use the text generation model corresponding to "news documents" to obtain the image editing text corresponding to the image to be edited, "Sports stars Zhang San and Li Si took a group photo. The one on the left is Zhang San, and the one on the right is Li Si."

[0113] The present application automatically generates picture editing text by inputting the structured data of the picture content reflected by the picture to be edited into a text generation model corresponding to a specific document type, thereby achieving selectivity and controllability in the expression form and type of the text, so that the user can control the style and writing field of the generated text.

[0114] Step 1208: Output the picture editing text corresponding to the picture to be edited and the picture accurate information corresponding to the picture to be edited to the user.

[0115] In an embodiment of the present application, the system or terminal of the present application further provides the generated picture editing text corresponding to the picture to be edited and the picture accurate information corresponding to the picture to be edited to the user, so that the user can obtain sufficient reference information when editing the text of the picture, for example, Fig. 9 As shown, when the picture content of the picture P to be edited is a group photo of basketball athletes "Zhang San" and "Li Si", the accurate picture information corresponding to the picture P to be edited "{Picture classification: [Sports, Group photo], Picture content: [{Type: People, Position [20, 40, 300, 790], Name: Zhang San, Information: {xxx}}, {Type: People, Position [300, 40, 790, 790], Name: Li Si, Information: {xxx}}}, and the picture editing text corresponding to the picture to be edited "Sports stars Zhang San and Li Si took a group photo, the one on the left is Zhang San, and the one on the right is Li Si." are returned to the user.

[0116] This application provides users with all the picture editing text corresponding to the picture to be edited and the accurate picture information corresponding to the picture to be edited, so that users can obtain professional information in the target vertical field in a targeted manner, reduce the requirements for the user's professional knowledge level, and help users complete the text description of pictures efficiently.

[0117] This application obtains accurate image information corresponding to the image to be edited in the target vertical field, and edits image editing text that meets the requirements and has professional industry reference value in combination with the document type involved in the image editing text or the template expression of the relevant classification in the target disposal field, so as to help users quickly understand the main information contained in the image to be edited, and provide professional image editing text, thereby assisting users to efficiently and accurately complete the professional document editing and writing work in their field, and can ensure the accuracy and usability of image analysis and image editing text.

[0118] The processor 120 may execute Fig.13 Steps in the method shown. Fig.13 13 is a schematic flowchart showing a method for generating text based on an image according to an embodiment of the present application, including steps 1302 to 1308.

[0119] Step 1302: Determine at least one target vertical field, and obtain picture content information corresponding to the picture to be edited and picture classification information corresponding to the picture to be edited according to the target vertical field to which the picture to be edited belongs.

[0120] In an embodiment of the present application, the system or terminal of the present application extracts picture information from the picture to be edited through a preset target recognition model and a preset knowledge database, obtains picture content information corresponding to the picture to be edited in the target vertical field to which it belongs, and classifies the picture to be edited through a preset picture classification model to obtain picture classification information corresponding to the picture to be edited. Specifically, in the case where the picture content of the picture to be edited P is a group photo of basketball athletes "Zhang San" and "Li Si", the picture content information corresponding to the picture to be edited P is "[{category: person, position [20, 40, 300, 790], name: Zhang San, information: {xxx}}, {category: person, position [300, 40, 790, 790], name: Li Si, information: {xxx}}]", and the picture classification information of the picture to be edited P is "{picture classification: [sports, group photo]}".

[0121] Step 1304: Generate accurate picture information corresponding to the picture to be edited according to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited.

[0122] In an embodiment of the present application, the system or terminal of the present application obtains structured accurate information of the image to be edited by aggregating and structuring the image content information corresponding to the image to be edited and the image classification information corresponding to the target vertical field to which the image to be edited belongs. Fig. 9 As shown, in the case where the picture content of the to-be-edited picture P is a group photo of basketball athletes "Zhang San" and "Li Si", by integrating the picture content information and the picture classification information, the accurate picture information is finally obtained as "{Picture classification: [Sports, Group photo], Picture content: [{Type: People, Position [20, 40, 300, 790], Name: Zhang San, Information: {xxx}}, {Type: People, Position [300, 40, 790, 790], Name: Li Si, Information: {xxx}}}."

[0123] Step 1306: Based on the accurate information of the picture corresponding to the picture to be edited, generate the picture editing text corresponding to the picture to be edited through a preset Chinese template library.

[0124] In the embodiments of the present application, Fig.14 As shown, according to the accurate information of the picture corresponding to the picture to be edited, the picture editing text corresponding to the picture to be edited is generated through a preset Chinese template library, including steps 1402 to 1406.

[0125] Step 1402: Based on at least one target vertical field and at least one picture scene, construct a Chinese template for each target vertical field corresponding to each picture scene to form a Chinese template library.

[0126] In an embodiment of the present application, the system or terminal of the present application constructs a corresponding number of types of Chinese templates according to at least one target vertical field and the picture scene classification under each target vertical field. For example, it includes three target vertical fields, and each target vertical field includes three picture scene classifications, then a total of nine types of Chinese templates are included, and a Chinese template library is constructed based on the nine types of Chinese templates.

[0127] Step 1404: Match the Chinese template library according to the accurate information of the picture corresponding to the picture to be edited, and obtain the Chinese template corresponding to the picture to be edited.

[0128] In an embodiment of the present application, the system or terminal of the present application matches the Chinese template library according to the corresponding classification field and picture scene based on the accurate information of the picture corresponding to the picture to be edited, especially the picture classification information corresponding to the picture to be edited, and returns the Chinese template under the corresponding classification. Fig. 9 As shown, when the image P to be edited belongs to the "group photo" category under the "sports field", the corresponding Chinese template library will have a preset Chinese template similar to "Sports stars {Person 1} and {Person 2} took a group photo, the one on the left is {Person 1}, and the one on the right is {Person 2}."

[0129] Step 1406: Fill in the Chinese template corresponding to the picture to be edited with Chinese characters according to the accurate picture information corresponding to the picture to be edited, and generate picture editing text corresponding to the picture to be edited.

[0130] In an embodiment of the present application, the system or terminal of the present application fills in Chinese with the Chinese template corresponding to the picture to be edited according to the accurate picture information corresponding to the picture to be edited, thereby generating the picture editing text corresponding to the picture to be edited. Specifically, in the case that the picture content of the picture to be edited P is a group photo of basketball athletes "Zhang San" and "Li Si", the accurate picture information corresponding to the picture to be edited P is "{Picture classification: [Sports, Group photo], Picture content: [{Type: People, Location [20, 40, 300, 790], Name: Zhang San, Information: {xxx}}, {Type: People, Location [300, 40, 790, 790], Name: Li Si, Information: {xxx}}}, At the same time, the Chinese template matched from the Chinese template library is "Sports stars {Person 1} and {Person 2} took a group photo, the one on the left is {Person 1}, and the one on the right is {Person 2}. ", a similar method to cloze test can be used to generate the picture editing text "Sports stars {Zhang San} and {Li Si} took a photo together. The one on the left is {Zhang San}, and the one on the right is {Li Si}."

[0131] Step 1308: Output the picture editing text corresponding to the picture to be edited and the picture accurate information corresponding to the picture to be edited to the user.

[0132] In an embodiment of the present application, the system or terminal of the present application further provides the generated picture editing text corresponding to the picture to be edited and the picture accurate information corresponding to the picture to be edited to the user, so that the user can obtain sufficient reference information when editing the text of the picture, for example, Fig. 9 As shown, when the picture content of the picture P to be edited is a group photo of basketball athletes "Zhang San" and "Li Si", the accurate picture information corresponding to the picture P to be edited "{Picture classification: [Sports, Group photo], Picture content: [{Type: People, Position [20, 40, 300, 790], Name: Zhang San, Information: {xxx}}, {Type: People, Position [300, 40, 790, 790], Name: Li Si, Information: {xxx}}}, and the picture editing text corresponding to the picture to be edited "Sports stars Zhang San and Li Si took a group photo, the one on the left is Zhang San, and the one on the right is Li Si." are output to the user.

[0133] The system of this application can output the picture to be edited and the picture editing text corresponding to the picture to be edited to the user (author) at the same time, assisting the user to complete the editing and writing of the entire professional document. This application is aimed at professional document editing in vertical fields. It uses the accurate picture information corresponding to the picture to be edited, combined with a Chinese template library built based on the target vertical field and picture scene, to automatically generate picture editing text that meets the requirements of professional documents, and returns the picture editing text corresponding to the picture to be edited and the accurate picture information corresponding to the picture to be edited to the user, thereby helping the user to quickly understand the main information in the picture to be edited, and helping the user to efficiently and accurately complete the editing and writing of professional documents.

[0134] Fig.15 A method for generating text based on a picture according to an embodiment of the present specification is shown. The method for generating text based on a picture is described by taking a picture P to be edited of a group photo of basketball players "Zhang San" and "Li Si" as an example, and includes steps 1502 to 1514.

[0135] Step 1502: Input the image P to be edited into a target recognition model trained based on target vertical fields such as sports, government affairs and other related training data, and obtain the target recognition information of "[{category: person, position [20, 40, 300, 790]}, {category: person, position [300, 40, 790, 790]}]".

[0136] Step 1504: Use the character portraits of the targets "Zhang San" and "Li Si" to match in the preset knowledge database, and return the target knowledge information of the target "Zhang San" as "name: Zhang San, information: {xxx}", and the target knowledge information of the target "Li Si" as "name: Li Si, information: {xxx}"

[0137] Step 1506: By integrating and summarizing the target knowledge information and target identification information of the targets "Zhang San" and "Li Si", the picture content information corresponding to the picture P to be edited is finally obtained as "[{category: person, location [20, 40, 300, 790], name: Zhang San, information: {xxx}}, {category: person, location [300, 40, 790, 790], name: Li Si, information: {xxx}}]".

[0138] Step 1508: Input the image P to be edited into an image classification model trained based on target vertical fields such as sports, government affairs and other related training data to obtain image classification information "{image classification: [sports, group photo]}" corresponding to the image P to be edited.

[0139] Step 1510: Summarize the picture content information and picture classification information corresponding to the picture P to be edited, and obtain the accurate picture information corresponding to the edited picture P "{Picture classification: [Sports, Group photo], Picture content: [{Type: People, Position [20, 40, 300, 790], Name: Zhang San, Information: {xxx}}, {Type: People, Position [300, 40, 790, 790], Name: Li Si, Information: {xxx}}}".

[0140] Step 1512: input the accurate information of the picture P to be edited into a preset text generation model or a preset Chinese template library to obtain the picture editing text corresponding to the picture P to be edited: "Sports stars Zhang San and Li Si took a group photo. The one on the left is Zhang San, and the one on the right is Li Si."

[0141] Step 1514: The accurate picture information corresponding to the picture to be edited P "{Picture category: [Sports, Group photo], Picture content: [{Type: People, Position [20, 40, 300, 790], Name: Zhang San, Information: {xxx}}, {Type: People, Position [300, 40, 790, 790], Name: Li Si, Information: {xxx}}}, and the picture editing text corresponding to the picture to be edited "Sports stars Zhang San and Li Si took a group photo. The one on the left is Zhang San, and the one on the right is Li Si." are returned to the user.

[0142] Corresponding to the above method embodiment, this specification also provides an embodiment of a training device for a target recognition model. Fig.16FIG. 1 is a schematic diagram showing the structure of a training device for a target recognition model according to an embodiment of the present specification. Fig.16 As shown, the device comprises:

[0143] The target recognition training data acquisition module 161 is configured to acquire target recognition training samples and corresponding target recognition training labels, wherein the target recognition training samples include a set of sample images corresponding to at least one target vertical field, and the target recognition training labels include annotation information of each sample image in the set of sample images, wherein the annotation information includes a target type and a target position coordinate;

[0144] The target recognition model training module 162 is configured to train the target recognition model through the target recognition training samples and the corresponding target recognition training labels, and adjust the parameters of the target recognition model according to the loss value of the target recognition model until the training termination condition is met.

[0145] This application trains a deep learning model of a convolutional neural network using a set of sample images corresponding to at least one target vertical field, and obtains an image classification model that can accurately treat edited images for target vertical fields and image scenes, thereby achieving image classification for vertical fields.

[0146] Corresponding to the above method embodiment, this specification also provides an embodiment of a training device for an image classification model. Fig.17 FIG. 1 is a schematic diagram showing the structure of a training device for an image classification model according to an embodiment of the present specification. Fig.17 As shown, the device comprises:

[0147] The classification training data acquisition module 171 is configured to acquire classification training samples and corresponding classification training labels, wherein the classification training samples include a set of sample images corresponding to at least one target vertical field, and the classification training labels include the target vertical field to which each sample image in the sample image set belongs and the image scene to which each sample image belongs;

[0148] The classification model training module 172 is configured to train the image classification model through the classification training samples and the corresponding classification training labels, and adjust the parameters of the image classification model according to the loss value of the image classification model until the training termination condition is met.

[0149] Optionally, the picture scene classification model includes a picture domain classification model and at least one picture scene classification model.

[0150] This application uses an image classification model to perform a primary classification of the target vertical field for the edited images, and then performs a secondary classification of the image scenes based on the target vertical field of the edited images, thereby performing a targeted and detailed classification of the edited images and realizing information extraction for professional fields.

[0151] Corresponding to the above method embodiment, this specification also provides an information extraction device embodiment based on a picture, Fig.18 FIG. 1 is a schematic diagram showing a structure of an information extraction device based on a picture according to an embodiment of the present specification. Fig.18 As shown, the device comprises:

[0152] The first information acquisition module 181 is configured to extract image information of the image to be edited through the target recognition model described in this application and the preset knowledge database, and obtain the image content information corresponding to the image to be edited in the target vertical field to which it belongs;

[0153] The second information acquisition module 182 is configured to classify the image to be edited by using the image classification model described in the present application to obtain image classification information corresponding to the image to be edited;

[0154] The first accurate information construction module 183 is configured to generate accurate picture information corresponding to the picture to be edited according to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited;

[0155] The text generation module 184 is configured to generate a picture editing text corresponding to the picture to be edited according to the picture accurate information corresponding to the picture to be edited.

[0156] Optionally, the first information acquisition module 181 includes:

[0157] A target recognition unit is configured to perform target detection on the image to be edited by using the target recognition model described in the present application, and obtain target recognition information corresponding to the image to be edited in the target vertical field to which it belongs;

[0158] An information matching unit is configured to match the target recognition information corresponding to the image to be edited in a preset knowledge database to obtain the target knowledge information corresponding to the image to be edited;

[0159] The content generating unit is configured to generate picture content information corresponding to the picture to be edited according to the target identification information corresponding to the picture to be edited and the target knowledge information corresponding to the picture to be edited.

[0160] Optionally, the second information acquisition module 182 includes:

[0161] A domain classification unit is configured to perform domain classification on the to-be-edited picture by using the picture domain classification model described in the present application to obtain a target vertical domain to which the to-be-edited picture belongs;

[0162] A scene classification unit is configured to classify the picture to be edited based on the target vertical field corresponding to the picture to be edited by using the picture scene classification model described in the present application to obtain the picture scene to which the picture to be edited belongs;

[0163] The classification information construction unit is configured to construct the picture classification information corresponding to the target vertical field to which the picture to be edited belongs according to the target vertical field to which the picture to be edited belongs and the picture scene to which the picture to be edited belongs.

[0164] Optionally, the accurate information building module 183 includes:

[0165] The information aggregation unit is configured to aggregate and structure the image content information corresponding to the image to be edited and the image classification information corresponding to the image to be edited in the target vertical field to which it belongs, so as to obtain structured accurate image information corresponding to the image to be edited.

[0166] This application obtains accurate image information corresponding to the image to be edited in the target vertical field, and combines the document type involved in the image editing text or the template expression of related classification in the target disposal field to edit the image editing text, so as to edit the image editing text that meets the requirements and has professional industry reference value, so as to help users quickly understand the main information contained in the image to be edited, and provide professional image editing text, so as to assist users to complete the professional document editing and writing work in their field efficiently and accurately, and ensure the accuracy and usability of image analysis and image editing text.

[0167] Corresponding to the above method embodiment, this specification also provides a training device embodiment of a text generation model, Fig.19 FIG. 2 is a schematic diagram showing the structure of a training device for a text generation model according to an embodiment of the present specification. Fig.19 As shown, the device comprises:

[0168] The text training data acquisition module 191 is configured to acquire text generation training samples and corresponding text generation training labels, wherein the text generation training samples include text structured data corresponding to the candidate document type, and the text generation training labels include category annotations corresponding to the text structured data;

[0169] The text generation model training module 192 is configured to train the text generation model through the text generation training samples and the corresponding text generation training labels, and adjust the parameters of the text generation model according to the loss value of the text generation model until the training termination condition is met.

[0170] This application uses a deep learning model to train several text generation models for at least one document type, thereby realizing automatic text generation for images to be edited in different target vertical fields.

[0171] Corresponding to the above method embodiment, this specification also provides an embodiment of a text generation device based on a picture, Fig. 20 FIG. 1 is a schematic diagram showing a structure of a text generation device based on a picture according to an embodiment of the present specification. Fig. 20 As shown, the device comprises:

[0172] The third information acquisition module 201 is configured to determine at least one target vertical field, and acquire the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited according to the target vertical field to which the picture to be edited belongs;

[0173] The second accurate information building module 202 is configured to generate the image accurate information corresponding to the image to be edited according to the image content information corresponding to the image to be edited and the image classification information corresponding to the image to be edited.

[0174] The first text generation module 203 is configured to generate a picture editing text corresponding to the picture to be edited according to the accurate picture information corresponding to the picture to be edited through the text generation model described in this application.

[0175] Optionally, the first text generating module 203 includes:

[0176] The model usage unit is configured to determine the target document type from at least one candidate document type, input the accurate image information corresponding to the image to be edited into the text generation model corresponding to the target document type, and obtain the image editing text corresponding to the image to be edited, wherein the text generation model is the text generation model described in this application.

[0177] Optionally, the device further comprises:

[0178] The first information output module 204 is configured to output the picture editing text corresponding to the picture to be edited and the picture accurate information corresponding to the picture to be edited to the user.

[0179] The present application automatically generates picture editing text by inputting the structured data of the picture content reflected by the picture to be edited into a text generation model corresponding to a specific document type, thereby achieving selectivity and controllability in the expression form and type of the text, so that the user can control the style and writing field of the generated text.

[0180] Corresponding to the above method embodiment, this specification also provides an embodiment of a text generation device based on a picture, Fig.21 FIG. 1 is a schematic diagram showing a structure of a text generation device based on a picture according to an embodiment of the present specification. Fig.21 As shown, the device comprises:

[0181] The fourth information acquisition module 211 is configured to determine at least one target vertical field, and acquire the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited according to the target vertical field to which the picture to be edited belongs;

[0182] The third accurate information construction module 212 is configured to generate the image accurate information corresponding to the image to be edited according to the image content information corresponding to the image to be edited and the image classification information corresponding to the image to be edited.

[0183] The second text generation module 213 is configured to generate a picture editing text corresponding to the picture to be edited through a preset Chinese template library according to the picture accurate information corresponding to the picture to be edited.

[0184] Optionally, the second text generating module 213 includes:

[0185] A Chinese template library construction unit is configured to construct a Chinese template corresponding to each picture scene in each target vertical field according to at least one target vertical field and at least one picture scene, so as to form a Chinese template library;

[0186] A template library matching unit is configured to match the Chinese template library according to the accurate information of the picture corresponding to the picture to be edited, and obtain the Chinese template corresponding to the picture to be edited;

[0187] The Chinese slot filling unit is configured to fill in the Chinese slots of the Chinese template corresponding to the picture to be edited according to the accurate picture information corresponding to the picture to be edited, so as to generate the picture editing text corresponding to the picture to be edited.

[0188] Optionally, the device further comprises:

[0189] The second information output module 214 is configured to output the picture editing text corresponding to the picture to be edited and the picture accurate information corresponding to the picture to be edited to the user.

[0190] The system of this application can output the picture to be edited and the picture editing text corresponding to the picture to be edited to the user (author) at the same time, assisting the user to complete the editing and writing of the entire professional document. This application is aimed at professional document editing in vertical fields. It uses the accurate picture information corresponding to the picture to be edited, combined with a Chinese template library built based on template vertical fields and picture scenes, to automatically generate picture editing text that meets the requirements of professional documents, and returns the picture editing text corresponding to the picture to be edited and the accurate picture information corresponding to the picture to be edited to the user, thereby helping the user to quickly understand the main information in the picture to be edited, and helping the user to efficiently and accurately complete the editing and writing of professional documents.

[0191] An embodiment of the present application further provides a computing device, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the instructions:

[0192] Obtaining a target recognition training sample and a corresponding target recognition training label, wherein the target recognition training sample includes a sample picture set corresponding to at least one target vertical field, and the target recognition training label includes annotation information of each sample picture in the sample picture set, wherein the annotation information includes a target type and a target position coordinate;

[0193] The target recognition model is trained by using the target recognition training samples and the corresponding target recognition training labels to obtain the target recognition model, wherein the target recognition model associates the target recognition training samples with the target recognition training labels.

[0194] An embodiment of the present application further provides a computing device, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the instructions:

[0195] Acquire classification training samples and corresponding classification training labels, wherein the classification training samples include a sample picture set corresponding to at least one target vertical field, and the classification training labels include the target vertical field to which each sample picture in the sample picture set belongs and the picture scene to which each sample picture belongs;

[0196] The picture classification model is trained by using the classification training samples and corresponding classification labels to obtain the picture classification model, wherein the picture classification model associates the classification training samples with the classification training labels.

[0197] An embodiment of the present application further provides a computing device, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the instructions:

[0198] Extracting picture information of the picture to be edited through the target recognition model described in this application and the preset knowledge database to obtain picture content information corresponding to the picture to be edited in the target vertical field to which it belongs;

[0199] Classify the image to be edited by the image classification model described in this application to obtain image classification information corresponding to the image to be edited;

[0200] Generate accurate picture information corresponding to the picture to be edited according to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited;

[0201] According to the accurate picture information corresponding to the picture to be edited, the picture editing text corresponding to the picture to be edited is generated.

[0202] An embodiment of the present application further provides a computing device, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the instructions:

[0203] Acquire a text generation training sample and a corresponding text generation training label, wherein the text generation training sample includes text structured data corresponding to the candidate document type, and the text generation training label includes a category annotation corresponding to the text structured data;

[0204] The text generation model is trained using the text generation training samples and the corresponding text generation training labels, and the parameters of the text generation model are adjusted according to the loss value of the text generation model until the training termination condition is met.

[0205] An embodiment of the present application further provides a computing device, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the instructions:

[0206] Determine at least one target vertical field, and acquire picture content information corresponding to the picture to be edited and picture classification information corresponding to the picture to be edited according to the target vertical field to which the picture to be edited belongs;

[0207] Generate accurate picture information corresponding to the picture to be edited according to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited;

[0208] According to the accurate information of the picture corresponding to the picture to be edited, the picture editing text corresponding to the picture to be edited is generated by the text generation model as described in the present application.

[0209] An embodiment of the present application further provides a computing device, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the instructions:

[0210] Determine at least one target vertical field, and acquire picture content information corresponding to the picture to be edited and picture classification information corresponding to the picture to be edited according to the target vertical field to which the picture to be edited belongs;

[0211] Generate accurate information of the image corresponding to the image to be edited according to the image content information corresponding to the image to be edited and the image classification information corresponding to the image to be edited

[0212] According to the accurate information of the picture corresponding to the picture to be edited, the picture editing text corresponding to the picture to be edited is generated through a preset Chinese template library.

[0213] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the image-based information extraction method as described above.

[0214] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the computer-readable storage medium and the technical scheme of the above-mentioned image-based information extraction method belong to the same concept, and the details not described in detail in the technical scheme of the computer-readable storage medium can be found in the description of the technical scheme of the above-mentioned image-based information extraction method.

[0215] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0216] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0217] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0218] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0219] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is limited only by the claims and their full scope and equivalents.

Claims

1. A method for extracting information based on an image, characterized in that: include: The image information of the image to be edited is extracted through the target recognition model and the preset knowledge database to obtain the image content information corresponding to the image to be edited in the target vertical field to which it belongs, wherein the target recognition model is obtained by training the target recognition training samples and the corresponding target recognition training labels, the target recognition training samples include a sample image set corresponding to at least one target vertical field, the target recognition training labels include the annotation information of each sample image in the sample image set, the annotation information includes the target type and the target position coordinates, the target recognition model includes a convolution layer, a ROI pooling layer, two parallel fully connected layers and two parallel output layers, the convolution layer is used to process the sample image to obtain a convolution feature map, the ROI pooling layer is used to extract a feature vector of a fixed size from the convolution feature map, the two parallel fully connected layers are used to process the feature vectors respectively, and input different processing results into the two parallel output layers respectively, and the two parallel output layers are used to output the normalized probability of the target vertical field and the position of the target constraint box respectively; Classifying the to-be-edited picture through a picture classification model to obtain picture classification information corresponding to the to-be-edited picture, wherein the picture classification model includes a picture domain classification model and at least one picture scene classification model, the picture domain classification model is used to classify the sample picture in a target vertical domain to obtain the target vertical domain corresponding to the sample picture, the picture scene classification model is used to perform secondary classification on the sample picture to obtain the picture scene of the sample picture in the target vertical domain, and the picture scene classification model is a picture scene classification model corresponding to the target vertical domain; According to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited, accurate picture information corresponding to the picture to be edited is generated.

2. The method according to claim 1, characterized in that The image information of the image to be edited is extracted through the target recognition model and the preset knowledge database to obtain the image content information corresponding to the image to be edited in the target vertical field to which it belongs, including: Performing target detection on the image to be edited by using a target recognition model to obtain target recognition information corresponding to the image to be edited in the target vertical field to which it belongs; Matching the target recognition information corresponding to the image to be edited in a preset knowledge database to obtain the target knowledge information corresponding to the image to be edited; The picture content information corresponding to the picture to be edited is generated according to the target recognition information corresponding to the picture to be edited and the target knowledge information corresponding to the picture to be edited.

3. The method according to claim 1, characterized in that Classifying the image to be edited by using an image classification model to obtain image classification information corresponding to the image to be edited, including: Performing domain classification on the image to be edited by using the image domain classification model to obtain a target vertical domain to which the image to be edited belongs; Based on the target vertical field corresponding to the picture to be edited, classify the picture to be edited by the picture scene classification model to obtain the picture scene to which the picture to be edited belongs; According to the target vertical field to which the to-be-edited picture belongs and the picture scene to which the to-be-edited picture belongs, the picture classification information corresponding to the to-be-edited picture in the target vertical field to which it belongs is constructed.

4. The method according to claim 1, characterized in that: Generating accurate picture information corresponding to the picture to be edited according to the picture content information corresponding to the picture to be edited and the picture classification information corresponding to the target vertical field to which the picture to be edited belongs, including: The picture content information corresponding to the picture to be edited and the picture classification information corresponding to the picture to be edited in the target vertical field to which it belongs are aggregated and structured to obtain structured accurate picture information corresponding to the picture to be edited.

5. A device for extracting information based on a picture, characterized in that: include: The first information acquisition module is configured to extract image information of the to-be-edited image through a target recognition model and a preset knowledge database to obtain the image content information corresponding to the to-be-edited image in the target vertical field to which it belongs, wherein the target recognition model is obtained through training of target recognition training samples and corresponding target recognition training labels, the target recognition training samples include a set of sample images corresponding to at least one target vertical field, the target recognition training labels include annotation information of each sample image in the sample image set, the annotation information includes a target type and a target position coordinate, the target recognition model includes a convolution layer, a ROI pooling layer, two parallel fully connected layers and two parallel output layers, the convolution layer is used to process the sample image to obtain a convolution feature map, the ROI pooling layer is used to extract a feature vector of a fixed size from the convolution feature map, the two parallel fully connected layers are used to process the feature vectors respectively, and input different processing results into the two parallel output layers respectively, the two parallel output layers are used to output the normalized probability of the target vertical field and the position of the target constraint box respectively; A second information acquisition module is configured to classify the to-be-edited picture through a picture classification model to obtain picture classification information corresponding to the to-be-edited picture, wherein the picture classification model includes a picture domain classification model and at least one picture scene classification model, the picture domain classification model is used to classify the sample picture in a target vertical domain to obtain the target vertical domain corresponding to the sample picture, the picture scene classification model is used to perform secondary classification on the sample picture to obtain the picture scene of the sample picture in the target vertical domain, and the picture scene classification model is a picture scene classification model corresponding to the target vertical domain; An accurate information building module is configured to generate accurate picture information corresponding to the picture to be edited according to picture content information corresponding to the picture to be edited and picture classification information corresponding to the picture to be edited; The text generation module is configured to generate the picture editing text corresponding to the picture to be edited according to the accurate picture information corresponding to the picture to be edited.

6. The device according to claim 5, characterized in that The first information acquisition module includes: The target recognition unit is configured to perform target detection on the image to be edited through a target recognition model to obtain target recognition information corresponding to the image to be edited in the target vertical field to which it belongs; An information matching unit is configured to match the target recognition information corresponding to the image to be edited in a preset knowledge database to obtain the target knowledge information corresponding to the image to be edited; The content generating unit is configured to generate picture content information corresponding to the picture to be edited according to the target identification information corresponding to the picture to be edited and the target knowledge information corresponding to the picture to be edited.

7. The device according to claim 5, characterized in that The second information acquisition module includes: A domain classification unit is configured to perform domain classification on the to-be-edited picture by using the picture domain classification model to obtain a target vertical domain to which the to-be-edited picture belongs; A scene classification unit is configured to classify the picture to be edited based on the target vertical field corresponding to the picture to be edited by using the picture scene classification model to obtain the picture scene to which the picture to be edited belongs; The classification information construction unit is configured to construct the picture classification information corresponding to the target vertical field to which the picture to be edited belongs according to the target vertical field to which the picture to be edited belongs and the picture scene to which the picture to be edited belongs.

8. The device according to claim 5, characterized in that The accurate information building blocks include: The information aggregation unit is configured to aggregate and structure the image content information corresponding to the image to be edited and the image classification information corresponding to the image to be edited in the target vertical field to which it belongs, so as to obtain structured accurate image information corresponding to the image to be edited.

9. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the instructions, the steps of the method according to any one of claims 1 to 4 are implemented.

10. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.