Image processing method, neural network model training method, device and electronic equipment
By utilizing text style feature information in the image processing method to match it with the risk image database, the risk image recognition process is simplified, the recognition accuracy is improved, and the problem of inaccurate judgment caused by text recognition errors in the existing technology is solved.
Patent Information
- Application Number
- CN202010880547.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-27
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2040-08-27
AI Technical Summary
In existing image management methods based on OCR technology, the text recognition process is prone to errors, leading to misjudgment of risk. In addition, adding interference information during the image production process will affect recognition accuracy, resulting in inaccurate risk judgment.
By obtaining the text style feature information in the image to be identified and matching it with the text style feature information in the risk image database, it is determined whether the image is a risk image, avoiding direct recognition of text content.
The risk image recognition process is simplified, the recognition accuracy is improved, and the problem of inaccurate judgment caused by text recognition errors in the existing technology is solved.
Smart Images

Figure CN114120005B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically to an image processing method, apparatus, electronic device, and computer storage medium. Furthermore, this application also relates to a neural network model training method, apparatus, electronic device, and computer storage medium; and another image processing method. Background Art
[0002] Text in images has long been a key area of research in image processing. In particular, image control can be achieved through the use of text within images. For example, it can be used to determine whether an image poses a risk by examining the text within it. This type of control requires identifying the text within the image and then determining whether the identified text represents a risk.
[0003] Most of the recognition processes for the text in the above-mentioned images are based on OCR technology. OCR (Optical Character Recognition) refers to the process in which an electronic device (such as a scanner or digital camera) checks characters printed on paper, determines their shape by detecting dark and light patterns, and then uses character recognition methods to translate the shape into computer text. After the text in the image is recognized, the text recognition information is input into the text detection model to determine whether there is a risk. However. This image control method based on OCR technology involves a long control link. Once the text recognition process goes wrong, it is easy to cause risk judgment errors. At the same time, in the production process of some existing images containing text, some interference information will be added to interfere with OCR recognition. In this way, when OCR recognizes the text in the image, it is very likely that it will not be able to accurately recognize it, which will also lead to misjudgment of risk images. Summary of the Invention
[0004] The embodiment of the present application provides an image processing method to improve the accuracy of risk image recognition.
[0005] The present invention provides an image processing method, including:
[0006] Obtain an image to be recognized containing text;
[0007] Based on the image to be identified, obtaining text style feature information in the image to be identified;
[0008] If a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database, the image to be identified is determined to be a risk image.
[0009] Optionally, obtaining text style feature information in the image to be recognized based on the image to be recognized includes:
[0010] The image to be identified is input into a target neural network model to obtain text style feature information in the image to be identified; the target neural network model is a trained neural network model used to extract text style feature information in an image.
[0011] Optionally, the risk image database includes at least one risk image;
[0012] The method further includes: calculating a matching degree between the text style feature information in the image to be identified and the text style feature information in the risk image to obtain a matching degree between the text style feature information in the image to be identified and the text style feature information in the risk image;
[0013] The target image whose text style feature information matches the text style feature information in the image to be identified is queried in the risk image database, including: in the risk image database, there is a risk image whose text style feature information meets the matching degree threshold condition between the text style feature information and the text style feature information in the image to be identified.
[0014] Optionally, the method further includes comparing the matching degree with the matching degree threshold condition to determine whether the matching degree satisfies the matching degree threshold condition.
[0015] Optionally, the method further includes: obtaining text style feature information in the risk image;
[0016] The obtaining of the text style feature information in the risk image includes: providing the risk image in the risk image database to the target neural network model to obtain the text style feature information in the risk image.
[0017] Optionally, the target image whose text style feature information matches the text style feature information in the image to be identified is queried in the risk image database, including: in the risk image database, there is at least one risk image such that the text style feature information in the risk image matches the text style feature information in the image to be identified.
[0018] Optionally, inputting the image to be recognized into a target neural network model to obtain text style feature information in the image to be recognized includes:
[0019] The image to be recognized is input into the target neural network model to obtain a vector of the text style in the image to be recognized, and the vector of the text style in the image to be recognized is used as the text style feature information in the image to be recognized.
[0020] Optionally, the step of searching the risk image database for a target image whose text style feature information matches the text style feature information in the image to be identified includes:
[0021] There is a target image in the risk image database, such that the Euclidean distance between the text style vector in the target image and the text style vector in the image to be identified is less than a preset distance threshold.
[0022] Optionally, the target neural network model is obtained by training based on a text style feature library of an image;
[0023] The target neural network model is obtained by training based on the text style feature library of the image, including:
[0024] Pre-establishing a text style feature library of an image, wherein the text style feature library is obtained based on a correspondence between an image and regular attribute information of text in the image;
[0025] An initial neural network model is trained based on the text style feature library to obtain the target neural network model.
[0026] Optionally, the target neural network model is trained in the following manner:
[0027] Obtaining a first image sample containing risk text and a first trained neural network model;
[0028] Inputting the first image sample into the trained first neural network model to obtain risk text structure feature information in the first image sample; the trained first neural network model is a model for obtaining text structure feature information in the input image based on the input image;
[0029] Obtaining a second image sample containing the risk text and an initial neural network model; the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample;
[0030] Based on the risk text structure feature information and the second image sample, the initial neural network model is trained to obtain the target neural network model.
[0031] Optionally, the method further includes: obtaining the first image sample according to the second image sample;
[0032] The obtaining of the first image sample according to the second image sample includes:
[0033] Obtaining risk text information in the second image sample;
[0034] Based on the risk text information, the risk text information is aligned with an image that does not contain text to obtain the first image sample.
[0035] Optionally, obtaining text style feature information in the image to be recognized based on the image to be recognized includes:
[0036] Obtaining global feature information of the image to be identified; the global feature information is at least one of color, texture, and shape information of the image to be identified;
[0037] Detecting a text area of the image to be recognized, and obtaining text area information of the image to be recognized;
[0038] Based on the text region information and the global feature information, text style feature information in the image to be recognized is obtained.
[0039] Optionally, obtaining text style feature information in the image to be recognized based on the text region information and the global feature information includes:
[0040] Extracting text feature information from the global feature information based on the text region information;
[0041] The text feature information is input into a graph convolutional neural network to obtain text style feature information in the image to be identified.
[0042] Optionally, also include:
[0043] providing the image to be identified as a risk image to the client as an initial risk judgment result of the image to be identified;
[0044] A second risk judgment result fed back by the client in response to the initial risk judgment result is obtained, and the second risk judgment result is used as a target risk judgment result of the image to be identified.
[0045] Optionally, after determining that the image to be identified is a risk image, the method further includes: obtaining an image matching degree between the target image and the image to be identified;
[0046] Taking the image to be identified as a risk image as an initial risk judgment result of the image to be identified;
[0047] Determining whether the image matching degree satisfies a risk threshold condition for directly identifying the image to be identified as a risk image;
[0048] If the image matching degree meets the risk threshold condition, the initial risk judgment result is used as the target risk judgment result of the image to be identified;
[0049] If the image matching degree does not meet the risk threshold condition, manual recognition is performed on the image to be identified, and the manual recognition result is used as the target risk judgment result of the image to be identified.
[0050] Optionally, before obtaining the text style feature information in the image to be recognized, the method further includes:
[0051] Determining whether the text in the image to be recognized can be accurately recognized;
[0052] If the text in the image to be identified can be accurately identified and the text recognition result contains risk information, then the image to be identified is determined to be a risk image.
[0053] Optionally, the text style feature information in the image to be recognized includes at least one of the style and color of the text in the image to be recognized.
[0054] The present invention also provides a method for training a neural network model, including:
[0055] Obtaining a first image sample containing risk text and a first trained neural network model;
[0056] Inputting the first image sample into the trained first neural network model to obtain risk text structure feature information in the first image sample; the trained first neural network model is a model for obtaining text structure feature information in the input image based on the input image;
[0057] Obtaining a second image sample containing the risk text and an initial neural network model; the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample;
[0058] Based on the risk text structure feature information and the second image sample, the initial neural network model is trained to obtain a target neural network model; wherein, the target neural network model is a model for obtaining text style feature information in an input image based on the input image.
[0059] Correspondingly, an embodiment of the present application provides an image processing device, including:
[0060] An image to be recognized obtaining unit, configured to obtain an image to be recognized containing text;
[0061] a text style feature information obtaining unit, configured to obtain text style feature information in the image to be identified based on the image to be identified;
[0062] The risk judgment unit is configured to judge that the image to be identified is a risk image if a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database.
[0063] Correspondingly, an embodiment of the present application further provides a neural network model training device, comprising:
[0064] A first obtaining unit, configured to obtain a first image sample containing risk text and a trained first neural network model;
[0065] a structural feature information obtaining unit, configured to input the first image sample into the trained first neural network model to obtain structural feature information of risky text in the first image sample; the trained first neural network model is a model for obtaining structural feature information of text in an input image based on an input image;
[0066] A second obtaining unit is configured to obtain a second image sample containing the risk text and an initial neural network model; the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample;
[0067] The target neural network model acquisition unit is used to train the initial neural network model based on the risk text structure feature information and the second image sample to obtain a target neural network model; wherein, the target neural network model is a model used to obtain text style feature information in an input image based on the input image.
[0068] The present invention provides an image processing method, including:
[0069] Obtain an image to be recognized containing text in the target video;
[0070] Based on the image to be identified, obtaining text style feature information in the image to be identified;
[0071] If a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database, it is determined that the target video contains a risk image.
[0072] An embodiment of the present application provides an electronic device, including:
[0073] processor;
[0074] The memory is used to store a computer program, which is executed by the processor to perform the above-mentioned image processing method and neural network model training method.
[0075] An embodiment of the present application provides a computer storage medium, which stores a computer program. The computer program is run by a processor to execute the above-mentioned image processing method and neural network model training method.
[0076] Compared with the prior art, the embodiments of the present application have the following advantages:
[0077] An embodiment of the present application provides an image processing method, comprising: obtaining an image to be identified containing text; obtaining text style feature information in the image to be identified based on the image to be identified; and determining that the image to be identified is a risk image if a target image whose text style feature information matches the text style feature information in the image to be identified is found in a risk image database. Because the present application aims to perform risk management on images to be identified, it is necessary to determine whether the image to be identified is a risk image. To determine whether the image to be identified is a risk image, first, the image to be identified containing text is obtained. Then, text style feature information in the image to be identified is obtained. Finally, if a target image whose text style feature information matches the text style feature information in the image to be identified is found in a risk image database, the image to be identified is determined to be a risk image. In the above image processing method, when determining whether the image to be identified is a risk image, the text contained in the image does not need to be identified; only the text style feature information in the image to be identified is obtained. If a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database, the image to be identified is determined to be a risk image. This image processing method simplifies the entire process of identifying an image to be identified. It can also solve the problem of inaccurate risk judgment caused by the need to identify text content in the existing technology, thereby improving the accuracy of risk image recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0079] Figure 1 Schematic diagram of the application scenario of the image processing method of this application;
[0080] Figure 2 This is a flowchart of the image processing method according to the first embodiment of the present application;
[0081] Figure 3 A schematic diagram of the process of training a neural network model according to the first embodiment of the present application;
[0082] Figure 3A This is a schematic structural diagram of the first neural network model of the first embodiment of the present application;
[0083] Figure 3B This is a schematic structural diagram of the second neural network model of the first embodiment of the present application;
[0084] Figure 4 This is a schematic structural diagram of the second target neural network model of the first embodiment of the present application;
[0085] Figure 5 A flowchart of the neural network model training provided in the second embodiment of the present application;
[0086] Figure 6 A schematic diagram of an image processing device provided in a third embodiment of the present application;
[0087] Figure 7 A schematic diagram of a neural network model training device provided in the fourth embodiment of the present application;
[0088] Figure 8 A flowchart of an image processing method provided in the fifth embodiment of the present application;
[0089] Figure 9 A schematic diagram of an electronic device provided in accordance with the sixth embodiment of the present application. DETAILED DESCRIPTION
[0090] The following description sets forth many specific details to facilitate a thorough 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 scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.
[0091] To more clearly demonstrate the image processing method provided by the embodiment of the present application, let's first introduce the application scenario of the image processing method provided by the embodiment of the present application. The image processing method provided by the embodiment of the present application can be applied to the field of image management and control to determine whether an image is a risky image. Specifically, whether the image is a risky image can be determined by determining whether the text in the image contains risks. That is, when the image contains risky text, the image is determined to be a risky image.
[0092] Existing methods for controlling images based on text within them determine whether an image is a risky image by determining whether the text within the image contains risks, thereby controlling such risky images. Most of these existing methods rely on OCR technology to identify text within an image and determine whether the text within the image is risky. If the text within the image is risky, the image is considered a risky image. Using this approach, when determining whether an image is a risky image, the recognized text must be input into a text detection model to determine whether the text is risky.
[0093] As the use of OCR to identify text in images to determine whether an image is a risky image becomes increasingly widespread, more and more risky images are being created with interference information that interferes with the OCR recognition results. For example, when creating risky images, text is often deformed or rendered in a difficult-to-recognize color when it is attached to the image or added to the image. This interference can severely impact the OCR recognition process, rendering the OCR technology incapable of recognizing the text in the image. Even if OCR can recognize the text in the image, the corresponding recognition result is erroneous or inaccurate. If OCR cannot recognize the text in the image, it cannot perform a risk assessment on the image containing text. Even if OCR can recognize the text in the image, if the recognition result is erroneous or inaccurate, even if the recognition result (i.e., the recognized text in the image) is input into a text detection model, the inaccurate OCR recognition result will naturally result in an inaccurate detection result, resulting in an inaccurate risk assessment of the image.
[0094] In addition, due to this method of existing technology, it is necessary to use OCR technology to first recognize the text in the image, and then input the recognized text into the text detection model for risk detection. The management and control chain involved is relatively long, which makes the entire operation of risk identification of the image more complicated.
[0095] The image processing method of the present application identifies whether an image to be identified containing text is a risk image based on the degree of match between the text style feature information in the image to be identified and the text style feature information of risk images in the risk image database. This is mainly related to the production process of risk images containing text. In the present application, the text style feature information in the image can refer to at least one of the style, color, arrangement of characters in the text, relationship between characters, and relationship between text and image.
[0096] In the existing process of producing risk images containing text, the text style feature information in each batch of risk images containing text is matched. In other words, the text style feature information in each batch of risk images containing text is the same. Therefore, some types of risk images containing text can be collected in advance and stored in the risk image database. If a target image whose text style feature information matches the text style feature information in the current image to be identified is queried in the risk image database, it can be determined that the current image to be identified is a risk image. It can be understood that the target image whose text style feature information matches the text style feature information in the current image to be identified is queried in the risk image database, which may mean that the text style feature information in the current image to be identified containing text matches the text style feature information in one or some risk images in the risk image database. Of course, in the present application, risk images mainly refer to risk information involving text in the image. The above-mentioned image control refers to image control of images containing risk text information as risk images.
[0097] Specifically, the text style feature information in the current image to be recognized is obtained by inputting the current image to be recognized into a target neural network model. The target neural network model is a trained neural network model for extracting text style feature information from images.
[0098] In this application, the text style feature information in the current image to be identified is actually matched with the text style feature information in the risk image in the risk image database. Therefore, it is necessary to obtain the text style feature information in the current image to be identified as well as the text style feature information in the risk image.
[0099] Similar to the method for obtaining text style feature information from the current image to be identified, obtaining text style feature information from the risk image involves inputting risk images from the risk image database into the target neural network model to obtain text style feature information from the risk image. In practice, each risk image in the risk image database can be input into the target neural network model to obtain text style feature information from each risk image.
[0100] The application scenario diagram of the image processing method of this application is as follows Figure 1As shown. First, the client obtains the image to be identified containing text, and sends the image to be identified to the server. The server calls the risk image database and obtains the text style feature information of the image to be identified and the text style feature information in the risk image in the risk image database. Afterwards, the text style feature information of the image to be identified and the text style feature information in the risk image in the risk image database are matched. If a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database, the image to be identified is judged to be a risk image. Finally, the server sends the recognition result that the image to be identified is a risk image to the client. The recognition result can be a direct indication that the image to be identified is a risk image, or it can be a target image. When the server queries the target image, it can also indicate that the image to be identified is a risk image. At this time, the server can directly send the target object to the client.
[0101] For example, there are two risk images in the risk image database. The text in the first risk image is deformed, and the color of the text in the second risk image makes it unrecognizable by OCR technology. Assuming that the text in the image to be recognized is deformed, then the text style feature information in the first risk image in the image risk database matches the text style feature information in the image to be recognized. Therefore, a target image with text style feature information matching the text style feature information in the image to be recognized must be found in the risk image database. In other words, the first risk image is the target image.
[0102] The embodiments of this application do not specifically limit the application scenarios of the image processing method. The application scenario of the image processing method described above is merely one example of an application scenario of the image processing method provided by this application. The purpose of providing this application scenario example is to facilitate understanding of the image processing method provided by this application, and is not intended to limit the image processing method provided by this application. Other application scenarios of the image processing method provided by this application are not described in detail in the embodiments of this application.
[0103] First embodiment
[0104] The first embodiment of the present application provides an image processing method, which is as follows: Figure 2-Figure 4 Provide explanation.
[0105] Please refer to Figure 2 , which is a flowchart of an image processing method provided in the first embodiment of the present application.
[0106] In step S201, an image to be recognized containing text is obtained.
[0107] In this embodiment, the image processing method is primarily used to manage risky images containing risky text. Therefore, to determine whether an image to be identified that contains text is a risky image containing risky text, the first step in determining whether the image to be identified is a risky image containing risky text is to obtain the image to be identified.
[0108] Obtaining an image to be recognized refers to obtaining an image to be recognized that contains text. If the image processing method is applied on the server, one way for the server to obtain an image to be recognized that contains text is to obtain an image to be recognized that contains text provided by the client.
[0109] In step S202, based on the image to be recognized, text style feature information in the image to be recognized is obtained.
[0110] After obtaining the image to be recognized, the server obtains text style feature information in the image to be recognized based on the image to be recognized.
[0111] As a method of obtaining text style feature information in an image to be identified based on the image to be identified: the image to be identified is input into a target neural network model to obtain text style feature information in the image to be identified, wherein the target neural network model is a trained neural network model for extracting text style feature information in an image.
[0112] In this embodiment, the text style feature information in the image may refer to at least one of the style and color of the text in the image, the arrangement of characters in the text, the relationship between characters, and the relationship between the text and the image.
[0113] The target neural network model in this embodiment is able to extract the text style feature information in the image. This is mainly related to the training process of the target neural network model. In the following description, how to train the target neural network model is specifically described.
[0114] In fact, in this embodiment, the ability of the target neural network model to extract text style feature information from an image is primarily related to the process of obtaining the target neural network model by training the initial neural network model. The text style feature information of the image obtained by the target neural network model can refer to, for example, the rules or manner in which text is overlaid on the image. It can also refer to the style and color of the text in the image. When training the initial neural network model, a text style feature library for the image can be pre-constructed using a large number of image samples. This text style feature library can contain the correspondence between the regular attribute information of the image and the text in the image. During this process, when constructing the text style feature library for the image, multiple to-be-recognized image samples can be generated based on the rules of the text style feature library. These generated to-be-recognized image samples are then used to train the initial neural network model. Training the initial neural network model yields the target neural network model. Since the target neural network model is obtained by training the target neural network model using multiple to-be-recognized image samples generated based on the text style feature library, the target neural network model can extract text style feature information from subsequently input images to be recognized.
[0115] Furthermore, when training a neural network model, risk images in the risk image database can be used as real training image samples to train the initial neural network model. These real training image samples can be referred to as second image samples. In practice, for risk images in the image database, text style feature information can be obtained using existing methods.
[0116] During the training process, the initial neural network model is trained based on the second image sample and the text style feature information in the risk image, and the internal parameters of the initial neural network model are adjusted. When the risk image is input into the initial neural network model, if the output result is the text style feature information in the risk image, the initial neural network model is considered to have been trained, and the trained initial neural network model is used as the target neural network model.
[0117] However, in practice, the number of risk images in a risk image database may be relatively small, making it difficult to train the initial neural network model using the above method. Therefore, before training the initial neural network, a pre-trained neural network model, namely the first neural network model, is trained using a large amount of artificially synthesized image data (i.e., the first image samples). For ease of distinction, the initial neural network model is defined as the second neural network model.
[0118] The above-mentioned first neural network model is a backbone network. In the research of modern deep learning algorithms, a general backbone network and a specific task network (i.e., the second neural network model in this embodiment) have become a standard design pattern. The backbone network is mainly used for feature extraction. In this embodiment, the backbone network is used to extract features in the image. The backbone network and the subsequent second neural network model are trained together so that the extracted features are more suitable for specific tasks. The subsequent second neural network model is responsible for detecting the location and category of the target from these extracted features. Since the backbone network plays the role of "backbone" in the link where it is located in the entire network training process, it is called the backbone network.
[0119] The first neural network model acquires the text structure feature information in the first image sample, so that it has the ability to extract and distinguish the text style in the image. Therefore, when training the second neural network model, it is only necessary to transfer the ability of the first neural network model to extract the text style in the image to the second neural network model to obtain the text style feature information in the image. By acquiring the text style feature information in the image, the second neural network model can retrieve the target image that matches the image to be identified from the risk image database. The schematic diagram of the entire process of training the neural network model is shown in the figure below. Figure 3 Since the first neural network model can transfer the ability to extract text style from an image to the second neural network model, in this embodiment, the second neural network is also called a feature transfer network.
[0120] In order to solve the problem of lack of second image samples, a large number of image samples can be obtained based on the second image samples, and the large number of image samples are the first image samples. Specifically, the first image samples can be obtained in the following manner.
[0121] First, the risk text information in the second image sample is obtained. Obtaining the risk text information in the second image sample may be to obtain the specific meaning of the risk text in the second image sample and the style feature information of the risk text. After obtaining the risk text information in the second image sample, based on the risk text information, the risk text information is fitted with an image that does not contain text to obtain the first image sample. In fact, the process may be to extract the risk text information in the second image sample directly from the second image sample. Then, the extracted risk text information is fitted with some images that do not contain text, that is, a large number of image samples containing risk text are generated using the extracted risk text information. A large number of image samples containing risk text are also the first image samples in this embodiment. Based on this method, risk images can be mass-produced.
[0122] Please continue to refer to Figure 3, input the first image sample into the trained first neural network model ( Figure 3 The backbone network in the first image is used to obtain the risk text structure feature information in the first image sample. The trained first neural network model is a model for obtaining the text structure feature information in the input image based on the input image.
[0123] The training process for the first neural network model can actually be to first obtain a first initial neural network model, and then train the first initial neural network model based on the first image sample and the risk text structure feature information in the first image sample. When the first neural network model can obtain the text structure feature information in the input image based on the input image, the first neural network model is considered to have completed training. Of course, in the above process, some existing technical means can be used to obtain the risk text structure feature information in the image corresponding to the image containing text. Therefore, the risk text structure feature information in the image sample obtained by the existing technology is used as a reference for the output result of the first neural network model to determine whether the first neural network model has been trained.
[0124] After obtaining the risk text structure feature information, the risk text structure feature information and the second image sample are input into the initial neural network model ( Figure 3 The feature transfer network in is used to train the initial neural network model to obtain the target neural network model.
[0125] The above risk text structure feature information is represented in the form of text structure vector (i.e. Figure 3 The text style feature information output by the target neural network model is represented by the text style vector (i.e. Figure 3 In the embedding2). In this embodiment, the text structure vector refers to the representation of text structure feature information in the form of a vector. Similarly, the text style vector refers to the representation of text style feature information in the form of a vector. Simply put, embedding is the use of a low-dimensional vector to represent any object, for example, it can represent a word, or a product, or a movie, and so on. Since objects corresponding to embedding vectors with similar distances have similar meanings, in this embodiment, the text structure feature information and the text structure feature information in the image are represented in the form of an embedding vector. This makes it easy to determine whether the text structure feature information and the text structure feature information in the two images match in this embodiment, thereby determining whether the two images match.
[0126] exist Figure 3A and Figure 3B The structural diagrams of the first neural network model and the second neural network model are shown in Figure 2. Figure 3A , which is a schematic diagram of the structure of the first neural network model. The first neural network model includes: a ResNet50 network model and an FPN network model (feature pyramid network model). After an image (for example, one of the first image samples) is input into the first neural network model, the ResNet50 network model first extracts the image's feature information. Specifically, the image feature information extraction involves extracting features at different scales. These features are then fused using the FPN network model. After feature fusion, the model splits into two branches, both of which initially consist of convolutional blocks. The first branch uses a multi-head attention mechanism to focus on certain features in the image. In this embodiment, the multi-head attention mechanism can focus on features corresponding to text. These features in the image are then upsampled and passed through a convolutional block. Afterwards, the text labeling module is used to obtain the pixel locations of the text in the image. In practice, the text labeling module is used to determine the location of text in the image. The text labeling module corresponds to a first loss function module (which is a cross entropy loss function). This first loss function module is used to determine the accuracy of the text positions marked by the text labeling module during training of the first neural network model. The second branch also uses the multi-head attention mechanism to focus on certain features in the image, and then linearly transforms the features in the focused image to obtain the form of the text structure vector. Of course, when training the first neural network model, the module used to output the form of the text structure vector also corresponds to a loss function module, that is, Figure 3A The second loss function module (which is a triplet loss function) in the training process is used to determine whether the form of the output text structure vector is accurate when training the first neural network model. The first loss function and the second loss function are mainly used to detect the training level of the first neural network model when training the first neural network model.
[0127] After obtaining the text structure vector (embedding1) output by the first neural network model, it is input into the second neural network model together with the second image sample. Please refer to the structural diagram of the second neural network model. Figure 3B The second neural network model includes, in sequence: a convolution block, a multi-head attention mechanism module, a convolution block, and a text style vector output module. The second neural network model also includes a third loss function (also a triplet loss function) for determining whether the output text style vector is accurate when training the second neural network model. The third loss function is used to detect the training level of the second neural network model when training the second neural network model.
[0128] After the second neural network model is trained, the target neural network model can be obtained. In fact, the trained first neural network model and the trained second neural network model can be used as the target neural network model, or the trained second neural network model can be used as the target neural network model.
[0129] Once the target neural network model is obtained, the image to be identified and the risk image from the risk image database can be fed into the target neural network model to obtain the text style feature information for the image to be identified and the text style feature information for the risk image, respectively. Taking the image to be identified as an example, the text style feature information for the image to be identified refers to the text style vector output by the target neural network model, i.e., the embedding2 corresponding to the image to be identified.
[0130] The above describes a method for obtaining text style feature information in an image to be recognized based on the image to be recognized. This embodiment also provides another method for obtaining text style feature information in an image to be recognized based on the image to be recognized. This other method for obtaining text style feature information in an image to be recognized based on the image to be recognized is described below.
[0131] First, global feature information of the image to be identified is obtained. In this embodiment, the global feature information is at least one of color, texture, and shape information of the image to be identified.
[0132] Afterwards, the text area of the image to be recognized is detected to obtain the text area information of the image to be recognized.
[0133] Finally, based on the text area information and global feature information, the text style feature information in the image to be recognized is obtained.
[0134] Specifically, the above-mentioned method of obtaining text style feature information in the image to be recognized based on text region information and global feature information can be described as follows. First, based on the text region information, the text feature information in the global feature information is extracted. After the text feature information in the global feature information is extracted, the text feature information is input into the graph convolutional neural network to obtain the text style feature information in the image to be recognized.
[0135] Specifically, the other method of obtaining the text style feature information in the image to be identified is also based on the neural network model. In order to distinguish the above target neural network model, the other neural network model is recorded as the second target neural network model. The structural diagram of the second target neural network model is shown in FIG. Figure 4 Please refer to Figure 4, in the second target neural network model, including: resnet50 network model, FPN network model. resnet50 network model, FPN network model is used to extract the fusion feature information of different scales in the image, that is, global feature information. At the same time, the second target neural network model also includes a detection module and a graph convolutional network (graph convolutional network is Figure 4 The GCN network in the image). The detection module is used to detect the text area information in the image and extract the style feature information of a single character in the text from the global feature information based on the text area information. Then the graph convolutional network obtains the text style feature information in the image based on the style feature information of a single character ( Figure 4 in the embedding).
[0136] In step S203 , if a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database, the image to be identified is determined to be a risk image.
[0137] In this embodiment, the risk image database includes at least one risk image. After obtaining the text style feature information in the image to be identified, a matching degree is calculated between the text style feature information in the image to be identified and the text style feature information in the risk image to obtain a matching degree between the text style feature information in the image to be identified and the text style feature information in the risk image.
[0138] A scenario in which a target image whose text style feature information matches that of the image to be identified is found in the risk image database may refer to a risk image in which the degree of match between the text style feature information of the image to be identified and the text style feature information of the image to be identified satisfies a matching threshold. Therefore, after obtaining the degree of match between the text style feature information of the image to be identified and the text style feature information of the risk image, it is necessary to compare the degree of match with the matching threshold to determine whether the degree of match satisfies the matching threshold.
[0139] Specifically, since step S202 has already explained that the text style feature information output by the target neural network model is represented by a text style vector, obtaining the degree of match between the text style feature information in the image to be identified and the text style feature information in the risk image may refer to obtaining the Euclidean distance between the text style vector in the image to be identified and the text style vector in the risk image. Therefore, finding a target image in the risk image database whose text style feature information matches the text style feature information in the image to be identified may refer to the Euclidean distance between the text style vector in the target image and the text style vector in the image to be identified being less than a preset distance threshold.
[0140] Of course, in this embodiment, since it is necessary to obtain the degree of match between the text style feature information in the image to be identified and the text style feature information in the risk image, it is necessary to obtain the text style feature information in the risk image. As one method of obtaining the text style feature information in the risk image, the risk image in the risk image database is provided to the target neural network model to obtain the text style feature information in the risk image.
[0141] In this embodiment, a target image whose text style feature information matches the text style feature information in the image to be identified is queried in the risk image database, which may mean that there is at least one risk image in the risk image database, so that the text style feature information in the risk image matches the text style feature information in the image to be identified.
[0142] In the above process of identifying whether the image to be identified is a risk image, the text style feature information of the image to be identified extracted based on the target neural network model can be used to match the image in the risk image library with the image to be identified, thereby performing risk identification on the image to be identified. In order to further improve the accuracy of the recognition result of the image to be identified, in this embodiment, the above recognition result can also be used as the initial risk judgment result of the image to be identified, and the initial risk judgment result can be provided to the client. The user can further determine whether the image to be identified is a risk image through the client, and the result of the user's determination of whether the image to be identified is a risk image can be considered as the second risk result. Finally, the second risk judgment result can be used as the target risk judgment result of the image to be identified. The target risk judgment result here can refer to the final risk judgment result.
[0143] Similarly, to further improve the accuracy of the recognition results of the image to be identified, in this embodiment, while the above-mentioned recognition results are used as the initial risk judgment results of the image to be identified, the image matching degree between the target image and the image to be identified can also be obtained. After obtaining the image matching degree, it is determined whether the image matching degree meets the risk threshold condition for directly confirming the image to be identified as a risk image. If the image matching degree meets the risk threshold condition, the initial risk judgment result is used as the target risk judgment result of the image to be identified; if the image matching degree does not meet the risk threshold condition, manual recognition is used for the image to be identified, and the manual recognition result is used as the target risk judgment result of the image to be identified.
[0144] For example, an image to be identified that has an image matching degree of more than 70% with the target image can be directly judged as a risk image. In this process, in fact, only the target neural network model is used to judge the image to be identified as a risk image, that is, the initial risk judgment result of the image to be identified is the final target risk judgment result. For images to be identified that have an image matching degree of less than 70% with the target image, manual recognition is used to judge the risk of the image to be identified, and the manual recognition result is used as the target risk judgment result of the image to be identified. Of course, it is understandable that an image to be identified that has a very low image matching degree with the target image can be judged as not a risk image. In fact, a very low image matching degree may mean that the target image whose text style feature information is not found to match the text style feature information in the image to be identified.
[0145] In addition, in order to further improve the risk identification efficiency of the image to be identified, it is also possible to determine whether the text in the image to be identified can be accurately identified before obtaining the text style feature information in the image to be identified; if the text in the image to be identified can be accurately identified and the text recognition result contains risk information, the image to be identified is judged to be a risk image.
[0146] Specifically, the text in the image to be recognized is recognized to obtain a text recognition result of the image to be recognized. This can be performed by using OCR technology, that is, identifying the specific text in the image to be recognized.
[0147] The text in the image to be recognized can be accurately recognized, which means that the text recognition result matches the text in the image to be recognized.
[0148] In this embodiment, after obtaining the text recognition result, it is determined whether the text recognition result matches the text in the image to be recognized.
[0149] If the text recognition result matches the text in the image to be recognized, a determination is made as to whether the text recognition result contains risk information. If so, the image to be recognized is considered a risk image. The matching of the text recognition result with the text in the image to be recognized actually means that the text in the image to be recognized can be accurately recognized. When using OCR technology to recognize text in images, some images can contain text that can be recognized by OCR. For such images, determining whether the image to be recognized is a risk image can be done solely based on the text recognition result.
[0150] Of course, if the text recognition result does not match the text in the image to be recognized, then the style feature information of the text in the image to be recognized is obtained.
[0151] For images where text cannot be accurately recognized by OCR technology, the text recognition results do not match the actual text in the image. For such images, obtaining text style feature information from the image can be used to determine whether the image is a risky image. The method for obtaining text style feature information from the image is described in detail in step S202 and will not be further described here.
[0152] This embodiment of the present application provides an image processing method. When identifying whether an image to be identified is a risk image, this embodiment does not require recognition of the text contained in the image. Instead, it merely obtains the text style characteristics of the image to be identified. If a target image with text style characteristics matching the text style characteristics of the image to be identified is found in a risk image database, the image to be identified is determined to be a risk image. This image processing method simplifies the entire process of identifying the image to be identified and improves the accuracy of risk image identification.
[0153] Second embodiment
[0154] The second embodiment of the present application further provides a neural network model training method. Since the training method has been described in detail in the first embodiment, the relevant parts can be referred to the partial description of the first embodiment. The embodiment described below is only illustrative.
[0155] Please refer to Figure 5 , which is a flowchart of a neural network model training provided in the second embodiment of the present application.
[0156] In step S501, a first image sample containing risk text and a trained first neural network model are obtained.
[0157] In step S502, the first image sample is input into a trained first neural network model to obtain risk text structure feature information in the first image sample.
[0158] In this embodiment, the trained first neural network model is a model for obtaining text structure feature information in an input image based on the input image.
[0159] In step S503, a second image sample containing risk text and an initial neural network model are obtained.
[0160] In this embodiment, the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample.
[0161] In step S504, an initial neural network model is trained based on the risk text structure feature information and the second image sample to obtain a target neural network model.
[0162] In this embodiment, the target neural network model is a model for obtaining text style feature information in an input image based on the input image.
[0163] Third embodiment
[0164] Corresponding to the application scenario embodiment of the image processing method of the present application and the image processing method provided in the first embodiment, the third embodiment of the present application also provides an image processing device. Since the device embodiment is basically similar to the application scenario embodiment and the first embodiment, the description is relatively simple. For relevant details, please refer to the application scenario embodiment and the partial description of the first embodiment. The device embodiment described below is merely illustrative.
[0165] Please refer to Figure 6 , which is a schematic diagram of an image processing device provided in the third embodiment of the present application.
[0166] The image processing device comprises:
[0167] The image to be recognized obtaining unit 601 is used to obtain an image to be recognized containing text;
[0168] The text style feature information obtaining unit 602 is configured to obtain text style feature information in the image to be recognized based on the image to be recognized;
[0169] The risk judgment unit 603 is configured to judge that the image to be identified is a risk image if a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database.
[0170] Optionally, the text style feature information obtaining unit is specifically configured to:
[0171] The image to be identified is input into a target neural network model to obtain text style feature information in the image to be identified; the target neural network model is a trained neural network model used to extract text style feature information in an image.
[0172] Optionally, the risk image database includes at least one risk image;
[0173] The method further includes: a matching degree obtaining unit; the matching degree obtaining unit is specifically configured to: calculate the matching degree between the text style feature information in the image to be identified and the text style feature information in the risk image, and obtain the matching degree between the text style feature information in the image to be identified and the text style feature information in the risk image;
[0174] The target image whose text style feature information matches the text style feature information in the image to be identified is queried in the risk image database, including: in the risk image database, there is a risk image whose text style feature information meets the matching degree threshold condition between the text style feature information and the text style feature information in the image to be identified.
[0175] Optionally, it further includes: a matching degree judgment unit; the matching degree judgment unit is specifically used to: compare the matching degree with the matching degree threshold condition to determine whether the matching degree meets the matching degree threshold condition.
[0176] Optionally, the text style feature information obtaining unit is further configured to: obtain text style feature information in the risk image;
[0177] The text style feature information obtaining unit is specifically configured to provide the risk image in the risk image database to the target neural network model to obtain the text style feature information in the risk image.
[0178] Optionally, the target image whose text style feature information matches the text style feature information in the image to be identified is queried in the risk image database, including: in the risk image database, there is at least one risk image such that the text style feature information in the risk image matches the text style feature information in the image to be identified.
[0179] Optionally, the text style feature information obtaining unit is specifically configured to:
[0180] The image to be recognized is input into the target neural network model to obtain a vector of the text style in the image to be recognized, and the vector of the text style in the image to be recognized is used as the text style feature information in the image to be recognized.
[0181] Optionally, the step of searching the risk image database for a target image whose text style feature information matches the text style feature information in the image to be identified includes:
[0182] There is a target image in the risk image database, such that the Euclidean distance between the text style vector in the target image and the text style vector in the image to be identified is less than a preset distance threshold.
[0183] Optionally, the method further includes: a training unit; the training unit is specifically used to: obtain the target neural network model through training based on the text style feature library of the image;
[0184] The training unit is specifically used to:
[0185] Pre-establishing a text style feature library of an image, wherein the text style feature library is obtained based on a correspondence between an image and regular attribute information of text in the image;
[0186] An initial neural network model is trained based on the text style feature library to obtain the target neural network model.
[0187] Optionally, the system further includes a training unit, wherein the training unit is specifically configured to train the target neural network model in the following manner:
[0188] Obtaining a first image sample containing risk text and a first trained neural network model;
[0189] Inputting the first image sample into the trained first neural network model to obtain risk text structure feature information in the first image sample; the trained first neural network model is a model for obtaining text structure feature information in the input image based on the input image;
[0190] Obtaining a second image sample containing the risk text and an initial neural network model; the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample;
[0191] Based on the risk text structure feature information and the second image sample, the initial neural network model is trained to obtain the target neural network model.
[0192] Optionally, the method further includes: a first image sample obtaining unit; the first image sample obtaining unit is specifically configured to: obtain the first image sample according to the second image sample;
[0193] The first image sample obtaining unit is specifically configured to:
[0194] Obtaining risk text information in the second image sample;
[0195] Based on the risk text information, the risk text information is aligned with an image that does not contain text to obtain the first image sample.
[0196] Optionally, the text style feature information obtaining unit is specifically configured to:
[0197] Obtaining global feature information of the image to be identified; the global feature information is at least one of color, texture, and shape information of the image to be identified;
[0198] Detecting a text area of the image to be recognized, and obtaining text area information of the image to be recognized;
[0199] Based on the text region information and the global feature information, text style feature information in the image to be recognized is obtained.
[0200] Optionally, the text style feature information obtaining unit is specifically configured to:
[0201] Extracting text feature information from the global feature information based on the text region information;
[0202] The text feature information is input into a graph convolutional neural network to obtain text style feature information in the image to be identified.
[0203] Optionally, it also includes: a target risk judgment unit;
[0204] The target risk judgment unit is specifically used to:
[0205] providing the image to be identified as a risk image to the client as an initial risk judgment result of the image to be identified;
[0206] A second risk judgment result fed back by the client in response to the initial risk judgment result is obtained, and the second risk judgment result is used as a target risk judgment result of the image to be identified.
[0207] Optionally, the system further includes: an image matching degree obtaining unit and an image matching degree judging unit; the image matching degree obtaining unit is specifically configured to: after judging that the image to be identified is a risk image, obtain the image matching degree between the target image and the image to be identified;
[0208] The image matching degree judgment unit is specifically used to: take the image to be identified as a risk image as the initial risk judgment result of the image to be identified; judge whether the image matching degree meets the risk threshold condition for directly confirming the image to be identified as a risk image; if the image matching degree meets the risk threshold condition, take the initial risk judgment result as the target risk judgment result of the image to be identified; if the image matching degree does not meet the risk threshold condition, use manual identification for the image to be identified, and use the manual identification result as the target risk judgment result of the image to be identified.
[0209] Optionally, the system further includes: a text recognition result judgment unit; the text recognition result judgment unit is specifically configured to: before obtaining the text style feature information in the image to be recognized, judge whether the text in the image to be recognized can be accurately recognized;
[0210] The risk judgment unit is configured to judge that the image to be recognized is a risk image if the text in the image to be recognized can be accurately recognized and the text recognition result contains risk information.
[0211] Optionally, the text style feature information in the image to be recognized includes at least one of the style and color of the text in the image to be recognized.
[0212] Fourth embodiment
[0213] Corresponding to the neural network model training method provided in the second embodiment of the present application, the fourth embodiment of the present application also provides a neural network model training device. Since the device embodiment is basically similar to the description of the neural network model training in the second embodiment and the first embodiment, the description is relatively simple. For relevant details, please refer to the description of the first embodiment and the second embodiment. The device embodiment described below is merely illustrative.
[0214] Please refer to Figure 7 , which is a schematic diagram of a neural network model training device provided in the fourth embodiment of the present application.
[0215] The neural network model training device includes:
[0216] A first obtaining unit 701 is configured to obtain a first image sample containing risk text and a trained first neural network model;
[0217] The structural feature information obtaining unit 702 is configured to input the first image sample into the trained first neural network model to obtain structural feature information of risky text in the first image sample; the trained first neural network model is a model for obtaining structural feature information of text in the input image based on the input image;
[0218] The second obtaining unit 703 is configured to obtain a second image sample containing the risk text and an initial neural network model; the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample;
[0219] The target neural network model obtaining unit 704 is used to train the initial neural network model based on the risk text structure feature information and the second image sample to obtain a target neural network model; wherein, the target neural network model is a model used to obtain text style feature information in an input image based on the input image.
[0220] Fifth embodiment
[0221] The fifth embodiment of the present application provides another image processing method, which is an application of the method of the first embodiment to determine whether a video contains risky images. Figure 8 Provide explanation.
[0222] Please refer to Figure 8, which is a flowchart of an image processing method provided in the fifth embodiment of the present application.
[0223] In step S801, an image to be recognized containing text in a target video is obtained.
[0224] In this embodiment, an image to be recognized containing text in a target video is first obtained. One method for obtaining the image to be recognized containing text in the target video is to obtain each video frame in the target video and, based on each video frame, obtain a video frame image containing text. The video frame image containing text is then used as the image to be recognized.
[0225] In step S802, based on the image to be recognized, text style feature information in the image to be recognized is obtained.
[0226] After obtaining the image to be recognized, the text style feature information in the image to be recognized can be obtained. Of course, it is understood that since the target video may contain multiple images to be recognized containing text, the text style feature information in each image to be recognized containing text is obtained one by one. Specifically, the text style feature information in the image to be recognized is obtained according to the implementation method described in step S202 of the first embodiment, which will not be repeated here.
[0227] In step S803, if a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database, it is determined that the target video contains a risk image.
[0228] After obtaining the text style feature information from the image to be identified, it is then determined whether the text style feature information in the image to be identified matches the text style feature information in the risk image database. Specifically, it is determined whether a target image with text style feature information matching the text style feature information in the image to be identified can be found in the risk image database. If so, it can be determined that the target video contains a risky image and is, therefore, a risky video.
[0229] Sixth embodiment
[0230] Corresponding to the image processing method provided in the first embodiment of the present application, the neural network model training method provided in the second embodiment, and the image processing method provided in the fifth embodiment, the sixth embodiment of the present application also provides an electronic device.
[0231] As shown in Figure 9, Figure 9 This is a schematic diagram of an electronic device provided in the sixth embodiment of the present application.
[0232] The electronic device comprises:
[0233] Processor 901;
[0234] The memory 902 is used to store a computer program, which is executed by the processor to execute the image processing method in the first embodiment, the neural network model training method in the second embodiment, and the image processing method provided in the fifth embodiment.
[0235] Seventh embodiment
[0236] Corresponding to the image processing method provided in the first embodiment of the present application, the neural network model training method provided in the second embodiment, and the image processing method provided in the fifth embodiment, the seventh embodiment of the present application also provides a computer storage medium, which stores a computer program, and the computer program is run by the processor to execute the image processing method in the first embodiment, the neural network model training method in the second embodiment, and the image processing method provided in the fifth embodiment.
[0237] Although the present application is disclosed as above with the preferred embodiments, it is not intended to limit the present application. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0238] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-permanent storage in a computer-readable medium, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0239] 1. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmitting medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable storage media, such as modulated data signals and carrier waves.
[0240] 2. Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
Claims
1. An image processing method, characterized in that: include: Obtain an image to be recognized containing text; Based on the image to be recognized, obtaining text style feature information in the image to be recognized, including: inputting the image to be recognized into a target neural network model to obtain the text style feature information; The target neural network model is trained by: inputting a first image sample containing risk text into a trained first neural network model to obtain structural feature information of the risk text in the first image sample; training an initial neural network model based on the structural feature information of the risk text and a second image sample containing the risk text to obtain the target neural network model; the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample; If a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database, the image to be identified is determined to be a risk image.
2. The image processing method according to claim 1, wherein: The risk image database includes at least one risk image; The method further includes: calculating a matching degree between the text style feature information in the image to be identified and the text style feature information in the risk image to obtain a matching degree between the text style feature information in the image to be identified and the text style feature information in the risk image; The target image whose text style feature information matches the text style feature information in the image to be identified is queried in the risk image database, including: in the risk image database, there is a risk image whose text style feature information meets the matching degree threshold condition between the text style feature information and the text style feature information in the image to be identified.
3. The image processing method according to claim 2, wherein: Also includes: The matching degree is compared with the matching degree threshold condition to determine whether the matching degree satisfies the matching degree threshold condition.
4. The image processing method according to claim 2, wherein: Also includes: Obtaining text style feature information in the risk image; The obtaining of the text style feature information in the risk image includes: providing the risk image in the risk image database to the target neural network model to obtain the text style feature information in the risk image.
5. The image processing method according to claim 1, wherein: The target image whose text style feature information matches the text style feature information in the image to be identified is queried in the risk image database, including: in the risk image database, there is at least one risk image such that the text style feature information in the risk image matches the text style feature information in the image to be identified.
6. The image processing method according to claim 1, wherein: Inputting the image to be recognized into a target neural network model to obtain text style feature information in the image to be recognized includes: The image to be recognized is input into the target neural network model to obtain a vector of the text style in the image to be recognized, and the vector of the text style in the image to be recognized is used as the text style feature information in the image to be recognized.
7. The image processing method according to claim 6, characterized in that: The target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database, including: There is a target image in the risk image database, such that the Euclidean distance between the text style vector in the target image and the text style vector in the image to be identified is less than a preset distance threshold.
8. The image processing method according to claim 1, wherein: The target neural network model is obtained by training based on a text style feature library of an image; The target neural network model is obtained by training based on the text style feature library of the image, including: Pre-establishing a text style feature library of an image, wherein the text style feature library is obtained based on a correspondence between an image and regular attribute information of text in the image; An initial neural network model is trained based on the text style feature library to obtain the target neural network model.
9. The image processing method according to claim 1, wherein: The method further comprises: Obtaining a first image sample containing risky text and a trained first neural network model; the trained first neural network model is a model for obtaining text structure feature information in the input image based on the input image; A second image sample containing the risk text and an initial neural network model are obtained.
10. The image processing method according to claim 9, wherein: Also includes: obtaining the first image sample according to the second image sample; The obtaining of the first image sample according to the second image sample includes: Obtaining risk text information in the second image sample; Based on the risk text information, the risk text information is aligned with an image that does not contain text to obtain the first image sample.
11. The image processing method according to claim 1, wherein: The obtaining, based on the image to be recognized, text style feature information in the image to be recognized includes: Obtaining global feature information of the image to be identified; the global feature information is at least one of color, texture, and shape information of the image to be identified; Detecting a text area of the image to be recognized, and obtaining text area information of the image to be recognized; Based on the text region information and the global feature information, text style feature information in the image to be recognized is obtained.
12. The image processing method according to claim 11, wherein: The obtaining, based on the text region information and the global feature information, text style feature information in the image to be recognized includes: Extracting text feature information from the global feature information based on the text region information; The text feature information is input into a graph convolutional neural network to obtain text style feature information in the image to be identified.
13. The image processing method according to claim 1, wherein: Also includes: providing the image to be identified as a risk image to the client as an initial risk judgment result of the image to be identified; A second risk judgment result fed back by the client in response to the initial risk judgment result is obtained, and the second risk judgment result is used as a target risk judgment result of the image to be identified.
14. The image processing method according to claim 1, wherein: After determining that the image to be identified is a risk image, the method further includes: obtaining an image matching degree between the target image and the image to be identified; Taking the image to be identified as a risk image as an initial risk judgment result of the image to be identified; Determining whether the image matching degree satisfies a risk threshold condition for directly identifying the image to be identified as a risk image; If the image matching degree meets the risk threshold condition, the initial risk judgment result is used as the target risk judgment result of the image to be identified; If the image matching degree does not meet the risk threshold condition, manual recognition is performed on the image to be identified, and the manual recognition result is used as the target risk judgment result of the image to be identified.
15. The image processing method according to claim 1, wherein: Before obtaining the text style feature information in the image to be recognized, the method further includes: determining whether the text in the image to be recognized can be accurately recognized; If the text in the image to be identified can be accurately identified and the text recognition result contains risk information, then the image to be identified is determined to be a risk image.
16. The image processing method according to claim 1, wherein: The text style feature information in the image to be recognized includes at least one of the style and color of the text in the image to be recognized.
17. A neural network model training method, characterized in that: include: Obtaining a first image sample containing risk text and a first trained neural network model; Inputting the first image sample into the trained first neural network model to obtain risk text structure feature information in the first image sample; the trained first neural network model is a model for obtaining text structure feature information in the input image based on the input image; Obtaining a second image sample containing the risk text and an initial neural network model; the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample; Based on the risk text structure feature information and the second image sample, the initial neural network model is trained to obtain a target neural network model; wherein, the target neural network model is a model for obtaining text style feature information in an input image based on the input image.
18. An image processing device, characterized in that: include: An image to be recognized obtaining unit, configured to obtain an image to be recognized containing text; A text style feature information obtaining unit is configured to obtain text style feature information in the image to be identified based on the image to be identified, including: inputting the image to be identified into a target neural network model to obtain the text style feature information; the target neural network model is trained in the following manner: inputting a first image sample containing risk text into a trained first neural network model to obtain risk text structural feature information in the first image sample; training an initial neural network model based on the risk text structural feature information and a second image sample containing the risk text to obtain the target neural network model; the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample; The risk judgment unit is configured to judge that the image to be identified is a risk image if a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database.
19. A neural network model training device, characterized in that: include: A first obtaining unit, configured to obtain a first image sample containing risk text and a trained first neural network model; a structural feature information obtaining unit, configured to input the first image sample into the trained first neural network model to obtain structural feature information of risky text in the first image sample; the trained first neural network model is a model for obtaining structural feature information of text in an input image based on an input image; A second obtaining unit is configured to obtain a second image sample containing the risk text and an initial neural network model; the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample; The target neural network model acquisition unit is used to train the initial neural network model based on the risk text structure feature information and the second image sample to obtain a target neural network model; wherein, the target neural network model is a model used to obtain text style feature information in an input image based on the input image.
20. An image processing method, characterized in that: include: Obtain an image to be recognized containing text in the target video; Based on the image to be recognized, obtaining text style feature information in the image to be recognized, including: inputting the image to be recognized into a target neural network model to obtain the text style feature information; The target neural network model is trained by: inputting a first image sample containing risk text into a trained first neural network model to obtain structural feature information of the risk text in the first image sample; training an initial neural network model based on the structural feature information of the risk text and a second image sample containing the risk text to obtain the target neural network model; the first image sample is an image sample obtained based on the second image sample, and the second image sample is a historical image sample; If a target image whose text style feature information matches the text style feature information in the image to be identified is found in the risk image database, it is determined that the target video contains a risk image.
21. An electronic device, characterized in that: include: processor; A memory for storing a computer program, wherein the computer program is executed by a processor to perform the method according to any one of claims 1 to 17 and claim 20.
22. A computer storage medium, characterized in that The computer storage medium stores a computer program, which is executed by a processor to perform the method according to any one of claims 1 to 17 and claim 20.