Method, device, electronic device and storage medium for determining image and text data quality
By generating the first scene graph and the second scene graph and calculating the F1 score between them, the problem of low accuracy of image and text data quality determination in the prior art is solved, and higher data quality determination accuracy is achieved.
Patent Information
- Application Number
- CN202410137998.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-01
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-02-01
AI Technical Summary
The existing technology in the image description system is not accurate enough in calculating labels with similar semantics but different categories, resulting in low accuracy in determining the quality of image and text data.
By generating the first scene graph and the second scene graph, the target F1 score between them is calculated. If the score is greater than the preset threshold, it is determined that the data quality of the graphic data meets the preset standard.
It improves the accuracy of determining the quality of image and text data and enhances the accuracy of calculating labels with similar semantics but different categories.
Smart Images

Figure CN117690004B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for determining the quality of graphic data. Background Art
[0002] With the development of science and technology, multimodal research is in the ascendant, and image description technology has become crucial as a bridge between different modalities (image and text). For the description results generated by the image description system, it is necessary to use quantitative evaluation criteria to evaluate its generation quality, which is the quality assessment of image description. The evaluation of image description has become a widely studied and discussed issue in the field of image description.
[0003] In the related art, a solution for judging image quality through scene graph (SG) is proposed. The graphic data is vectorized through the CLIP model, and the matching of image SG and text SG is based on vector calculation. However, the above method is not accurate enough for the calculation of labels with similar semantics but different categories. That is, the related art still has the problem of low accuracy in judging the quality of graphic data. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a method, device, electronic device and storage medium for determining the quality of graphic and text data, to obtain the corresponding first scene graph and second scene graph for the target image data and the target text data in the target graphic and text data, and to directly determine the quality of the graphic and text data through the generated first scene graph and second scene graph, which helps to improve the accuracy of determining the quality of the graphic and text data.
[0005] In a first aspect, an embodiment of the present application provides a method for determining the quality of graphic data, the method comprising:
[0006] Get the generated target graphic data;
[0007] Inputting target image data in the target graphic data into a pre-trained first scene graph generation model to obtain a first scene graph corresponding to the target image data;
[0008] Inputting target text data in the target graphic data into a pre-trained second scene graph generation model to obtain a second scene graph corresponding to the target text data;
[0009] Calculating a target F1 score between the first scene graph and the second scene graph;
[0010] If the target F1 score is greater than a preset score threshold, it is determined that the data quality of the target graphic data meets the preset data quality standard.
[0011] In a possible implementation, when the target graphic data is a pair, calculating the target F1 score between the first scene graph and the second scene graph includes:
[0012] Calculating the precision and recall corresponding to the first scene graph generation model and the second scene graph generation model;
[0013] The target F1 score is determined based on the precision and the recall.
[0014] In a possible implementation, when the target image-text data is a plurality of pairs, a plurality of first scene graphs and a plurality of second scene graphs are generated; and the calculating of the target F1 score between the first scene graph and the second scene graph includes:
[0015] Calculate the corresponding model F1 score of each first scene graph and each second scene graph after being output from the first scene graph generation model and the second scene graph generation model;
[0016] The target F1 score is determined as an average of the F1 scores of the multiple models.
[0017] In a possible implementation, the first scene graph generation model and the second scene graph generation model are trained by the following steps:
[0018] Obtain multiple target sample data after filtering the sample image and text data set;
[0019] Labeling each of the target sample data to obtain a label corresponding to each of the target sample data; wherein the label corresponding to the target sample data includes a scene graph label, a picture style label, and a picture attribute label;
[0020] Inputting the image data and the corresponding labels in the target sample data into a pre-built first neural network, training the first neural network, and determining that the training of the first neural network is completed when the loss function value of the first neural network is less than a first preset threshold value, thereby obtaining the first scene graph generation model;
[0021] The text data and the corresponding labels in the target sample data are input into a pre-constructed second neural network, and the second neural network is trained. When the loss function value of the second neural network is less than a second preset threshold, it is determined that the training of the second neural network is completed, and the second scene graph generation model is obtained.
[0022] In a possible implementation manner, when the sample graphic data is graphic-text data, the step of obtaining a plurality of target sample data after filtering the sample graphic data set includes:
[0023] For each sample image-text data in the sample image-text data set, the sample text data of the sample image-text data is input into a pre-trained text-image model to obtain predicted image data;
[0024] For each sample graphic data, respectively encode the predicted picture data and the sample picture data in the sample graphic data, and calculate a first distance between the encoded predicted picture vector and the sample picture vector;
[0025] The sample image and text data whose first distance is greater than a preset distance threshold in the sample image and text data set are filtered out to determine a plurality of target sample data.
[0026] In a possible implementation, when the sample graphic data is text-generated graphic data, the step of obtaining a plurality of target sample data after filtering the sample graphic data set includes:
[0027] For each sample image-text data in the sample image-text data set, the sample image data in the sample image-text data is input into a pre-trained image-to-text model to obtain predicted text data;
[0028] For each sample graphic data, respectively encode the predicted text data and the sample text data in the sample graphic data, and calculate a second distance between the encoded predicted text vector and the sample text vector;
[0029] The sample image and text data whose second distance is greater than a preset distance threshold in the sample image and text data set are filtered out to determine a plurality of target sample data.
[0030] In a possible implementation, when the sample graphic data is graphic data generated from graphics, the step of obtaining a plurality of target sample data after filtering the sample graphic data set includes:
[0031] For each sample image-text data in the sample image-text data set, the sample text data of the sample image-text data is input into a pre-trained text-generated graph model, and after obtaining the predicted image data, a first distance between the encoded predicted image vector and the sample image vector is calculated;
[0032] For each sample image-text data in the sample image-text data set, input the sample image data of the sample image-text data into a pre-trained image-to-text model, and after obtaining the predicted text data, calculate the second distance between the encoded predicted text vector and the sample text vector;
[0033] Determine a first sample data set whose first distance is less than a preset distance threshold in the sample image and text data set, and a second sample data set whose second distance is less than the preset distance threshold in the sample image and text data set;
[0034] A plurality of sample graphic data included in the intersection of the first sample data set and the second sample data set is determined as a plurality of target sample data.
[0035] In a second aspect, the embodiment of the present application further provides a device for determining the quality of graphic data, the device comprising:
[0036] A data acquisition module, used to acquire the generated target graphic data;
[0037] A first scene graph generation module, used for inputting target image data in the target graphic data into a pre-trained first scene graph generation model to obtain a first scene graph corresponding to the target image data;
[0038] A second scene graph generation module, used for inputting target text data in the target graphic data into a pre-trained second scene graph generation model to obtain a second scene graph corresponding to the target text data;
[0039] A score calculation module, configured to calculate a target F1 score between the first scene graph and the second scene graph;
[0040] The quality determination module is used to determine whether the data quality of the target graphic data meets the preset data quality standard if the target F1 score is greater than a preset score threshold.
[0041] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to execute the method for determining the quality of graphic data as described in any one of the first aspects.
[0042] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for determining the quality of graphic data as described in any one of the first aspects is executed.
[0043] The method, device, electronic device and storage medium for determining the quality of graphic data provided in the embodiments of the present application obtain the generated target graphic data; input the target image data in the target graphic data into a pre-trained first scene graph generation model to obtain a first scene graph corresponding to the target image data; input the target text data in the target graphic data into a pre-trained second scene graph generation model to obtain a second scene graph corresponding to the target text data; calculate the target F1 score between the first scene graph and the second scene graph; if the target F1 score is greater than a preset score threshold, determine that the data quality of the target graphic data meets the preset data quality standard. In this way, the target image data and target text data in the target graphic data obtain the corresponding first scene graph and second scene graph, and the quality of the graphic data is determined directly through the generated first scene graph and second scene graph, which helps to improve the accuracy of the quality determination of the graphic data.
[0044] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A flowchart of a method for determining the quality of graphic data provided by an embodiment of the present application;
[0047] Figure 2 A flowchart of quality determination of graphic and text data provided in an embodiment of the present application;
[0048] Figure 3 A flow chart of model training provided in the embodiment of the present application;
[0049] Figure 4 One of the structural schematic diagrams of a device for determining the quality of graphic data provided in an embodiment of the present application;
[0050] Figure 5 A second structural diagram of a device for determining the quality of graphic data provided in an embodiment of the present application;
[0051] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0053] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied in the field of data processing technology.
[0054] With the development of science and technology, multimodal research is in the ascendant, and image description technology has become crucial as a bridge between different modalities (image and text). For the description results generated by the image description system, it is necessary to use quantitative evaluation criteria to evaluate its generation quality, which is the quality assessment of image description. The evaluation of image description has become a widely studied and discussed issue in the field of image description.
[0055] The most direct solution to the image description quality assessment problem is manual evaluation, that is, industry experts score the description sentences generated by the image description system one by one. The dimensions of manual scoring are mainly considered from the perspectives of consistency, fluency, and richness. However, manual evaluation requires a lot of labor costs, so the automatic method of image quality description has emerged.
[0056] In the related art, a solution for judging image quality through scene graph (SG) is proposed. The graphic data is vectorized through the CLIP model, and the matching of image SG and text SG is based on vector calculation. However, the above method is not accurate enough for the calculation of labels with similar semantics but different categories. That is, the related art still has the problem of low accuracy in judging the quality of graphic data.
[0057] Based on this, an embodiment of the present application provides a method for determining the quality of graphic data to improve the accuracy of determining the quality of graphic data.
[0058] See also Figure 1 , Figure 1 A flow chart of a method for determining the quality of graphic data provided by an embodiment of the present application. Figure 1 As shown in , the method for determining the quality of graphic data provided by the embodiment of the present application includes:
[0059] S101, obtaining generated target graphic and text data.
[0060] S102: Input the target image data in the target graphic data into a pre-trained first scene graph generation model to obtain a first scene graph corresponding to the target image data.
[0061] S103: Input the target text data in the target graphic data into a pre-trained second scene graph generation model to obtain a second scene graph corresponding to the target text data.
[0062] S104: Calculate a target F1 score between the first scene graph and the second scene graph.
[0063] S105: If the target F1 score is greater than a preset score threshold, determine that the data quality of the target graphic data meets a preset data quality standard.
[0064] The method for determining the quality of graphic and text data provided in the embodiment of the present application obtains the corresponding first scene graph and second scene graph from the target image data and the target text data in the target graphic and text data, and directly determines the quality of the graphic and text data through the generated first scene graph and second scene graph, which helps to improve the accuracy of determining the quality of the graphic and text data.
[0065] The following is a description of the exemplary steps of the present application embodiment:
[0066] S101, obtaining generated target graphic and text data.
[0067] In the embodiment of the present application, the target image-text data obtained is in the form of image-text pairs, which can be recorded as<Image,text> ,In the field of computer vision, there are a large number of tasks that use ,image and text pairs for model training. Therefore, the quality of the ,acquired image and text data will affect the accuracy of the ,model training tasks to a certain extent.
[0068] In a possible implementation, the acquired target graphic data may be generated by a text-to-graph model and / or a graph-to-text model; may also be generated by a graphic-to-text model; may also be directly extracted from a web page; or may be graphic data corresponding to a generated scene graph.
[0069] The text-generated graph model is a model that inputs text and outputs an image. For example, the more common text-generated graph models in the current field are diffusion models such as Stable Diffusion and DALL-E; images can be obtained based on the above diffusion models.
[0070] The image-to-text model is a model that inputs an image and outputs text as required. For example, after inputting an image and passing it through the image-to-text model, a detailed description of the image is generated, or a poem is generated to describe the image.
[0071] The image-text generation model is a model that inputs an image and text and outputs an image and text. For example, in the field of image creation, some objects are added to a certain position of the image, and finally the created image and a text description of the created image are output.
[0072] The scene graph is a graph used to describe objects in an image and the relationships between objects. It is usually represented by triplet.
[0073] In a possible implementation, a triple is defined as: (Subject, Predicate, Object), where Subject and Object are both targets in the image, and Predicate is the relationship between targets. To distinguish between the two targets, the target before the predicate is called Subject, and the target after the predicate is called Object.
[0074] For example, a picture includes a girl surfing on a water ski and a man standing next to the girl. For this picture, the scene is determined as follows: Figure 3 The tuple representation can be: (water ski, on, girl); (girl, play, water ski); (man, beside, girl)...
[0075] Furthermore, after obtaining the target graphic data, the target graphic data needs to be processed. The specific processing method is to separate the text data and the image data in the target graphic data, input the target image data in the target graphic data into a pre-trained first scene graph generation model to obtain the first scene graph corresponding to the target image data; input the target text data in the target graphic data into a pre-trained second scene graph generation model to obtain the second scene graph corresponding to the target text data.
[0076] S102: Input the target image data in the target graphic data into a pre-trained first scene graph generation model to obtain a first scene graph corresponding to the target image data.
[0077] S103: Input the target text data in the target graphic data into a pre-trained second scene graph generation model to obtain a second scene graph corresponding to the target text data.
[0078] In an embodiment of the present application, the first scene graph generation model may be a trained CV-SGG model, and the second scene graph generation model may be a trained Text-SGG model.
[0079] In a possible implementation, SSG refers to an algorithm for generating a scene graph (SG). For SGG, it is necessary to output the target category, the location of the target (Bounding box), and the relationship between the targets.
[0080] Among them, Bounding Box: uses coordinates to represent a rectangular area, which generally has the following two formats: (x1, y1, x2, y2) represents the coordinates of the upper left corner and the lower left corner of the rectangle; (x, y, w, h) represents the coordinates of the center point of the rectangle and the width and height of the rectangle.
[0081] For example, if there are multiple identical objects in the picture, for example, multiple apples placed on a table, and when the apples are described by triple data (apple, on, table), the apples cannot be distinguished. At this time, it is necessary to distinguish the identical objects based on the position of the output target in order to describe the picture more accurately.
[0082] In one possible implementation, see Figure 2 , Figure 2 The flowchart of the quality determination of graphic data provided in the embodiment of the present application is as follows: Figure 2 As shown in , after the target graphic and text data (graphic and text pair) is obtained, the target image data in the target graphic and text data is input into a pre-trained first scene graph generation model to obtain a first scene graph; the target text data in the target graphic and text data is input into a pre-trained second scene graph generation model to obtain a second scene graph. The quality of the graphic and text data needs to be judged based on the first scene graph and the second scene graph.
[0083] In a possible implementation, the quality of the graphic data may be determined by a target F1 score between the first scene graph and the second scene graph.
[0084] S104: Calculate a target F1 score between the first scene graph and the second scene graph.
[0085] In a possible implementation, the F1 score is an indicator used in statistics to measure the accuracy of a binary classification model. It takes into account both the precision and recall of the classification model. The F1 score can be regarded as a harmonic average of the model's precision and recall, with a maximum value of 1 and a minimum value of 0.
[0086] In a possible implementation, the accuracy of a model is an indicator used to test system performance in the fields of information retrieval, pattern recognition, etc. It is the ratio of the number of relevant samples in the recognition or retrieval results to the total number of samples in the results.
[0087] Specifically, the accuracy of the model can be calculated by the following formula: accuracy = number of correctly classified samples / total number of samples classified into this category.
[0088] In a possible implementation, the recall rate of the model reflects the ability of the classification model to correctly predict the full range of positive samples, that is, the proportion of positive samples predicted to be positive samples to the total positive samples.
[0089] Specifically, the recall rate of the model can be calculated by the following formula: Recall rate = number of correctly classified samples / number of all samples in this category.
[0090] In a possible implementation, when the target image-text data is a pair, the target F1 score can be directly calculated according to the precision and recall of the model.
[0091] Specifically, when the target image-text data is a pair, the step of “calculating a target F1 score between the first scene graph and the second scene graph” includes:
[0092] a1: Calculate the precision and recall corresponding to the first scene graph generation model and the second scene graph generation model.
[0093] a2: Determine the target F1 score based on the precision and the recall.
[0094] In the embodiment of the present application, the calculation method of the precision and recall rate has been described in the above explanation of the precision and recall rate, and will not be repeated here.
[0095] In one possible implementation, the target F1 score may be determined based on the precision and recall using the following formula:
[0096] ;
[0097] Among them, precision represents the accuracy rate and recall represents the recall rate.
[0098] In another possible implementation, when there are multiple pairs of target graphic and text data, it is necessary to calculate the corresponding F1 scores of each first scene graph and each second scene graph after being output from the first scene graph generation model and the second scene graph generation model, and average the multiple F1 scores to determine the target F1 score.
[0099] Specifically, when the target image-text data is a plurality of pairs, a plurality of first scene graphs and a plurality of second scene graphs are generated, and the step of “calculating the target F1 score between the first scene graph and the second scene graph” includes:
[0100] b1: Calculate the corresponding model F1 score of each first scene graph and each second scene graph after being output from the first scene graph generation model and the second scene graph generation model.
[0101] b2: Determine the average of the F1 scores of multiple models as the target F1 score.
[0102] In an embodiment of the present application, for each target graphic data, the target image data in the target graphic data is input into the first scene graph generation model to obtain the first scene graph, and the target text data in the target graphic data is input into the second scene graph generation model to obtain the second scene graph. The corresponding precision and recall rates will be obtained, and the corresponding model F1 score can be calculated based on the precision and recall rates.
[0103] Furthermore, after obtaining the F1 scores of multiple models, it is necessary to calculate the average of the F1 scores of the multiple models according to the F1 scores of the multiple models and the amount of target graphic data, and then determine the average of the F1 scores of the multiple models as the target F1 score.
[0104] For example, the current number of target graph and text data is 3, the model F1 score corresponding to the first target graph and text data is 0.75; the model F1 score corresponding to the second target graph and text data is 0.50; the model F1 score corresponding to the third target graph and text data is 0.85, then, the calculated target F1 score is (0.75+0.50+0.85) / 3=0.68 (rounded to two decimal places).
[0105] Furthermore, after calculating the target F1 score between the first scene graph and the second scene graph, the quality of the graphic data may be determined according to the target F1 score.
[0106] S105: If the target F1 score is greater than a preset score threshold, determine that the data quality of the target graphic data meets a preset data quality standard.
[0107] In an embodiment of the present application, after determining the target F1 score based on the first scene graph and the second scene graph, it is necessary to compare the target F1 score with a preset score threshold. If the target F1 score is greater than the preset score threshold, it is determined that the quality of the target graphic data meets the preset data quality standard.
[0108] In a possible implementation, the preset score threshold may be determined based on different target image and text data and detection data of historical image and text data quality detection. The preset score thresholds corresponding to different categories of target image and text data, or different models (image-to-text model or text-to-image model) may be different.
[0109] In one possible implementation, the target graphic data is generally generated by a text-to-graph model, or a graph-to-text model, or a graph-to-text-to-graph model. Therefore, the determination and detection of the quality of the target graphic data can be extended to the detection of the model quality of the text-to-graph model, or the graph-to-text model, or the graph-to-text model that generates the target graphic data.
[0110] Among them, the model quality of the text-to-graph model, or the graph-to-text model, or the graph-to-text model for generating the target graph-to-text data can be determined according to the proportion of graph-to-text data whose data quality meets the preset data quality standard in the acquired target graph-to-text data, and when the proportion is lower than a certain threshold, the text-to-graph model, or the graph-to-text model, or the graph-to-text model can be retrained and adjusted. That is, the graph-to-text data quality judgment provided in the embodiments of the present application is applicable to a variety of methods of acquiring graph-to-text data, thereby improving the comprehensiveness and accuracy of graph-to-text data detection.
[0111] In a possible implementation, in the process of detecting the quality of target graphic data, generating the first scene graph and the second scene graph is the basis for calculating the target F1 score of the target graphic data, and then judging the quality of the graphic data, and the first scene graph generation model and the second scene graph generation model are the key to generating the first scene graph and the second scene graph. Therefore, the training process of the first scene graph generation model and the second scene graph generation model will directly affect the accuracy of the judgment of the target graphic data. The training process of the first scene graph generation model and the second scene graph generation model will be explained below.
[0112] Specifically, the first scene graph generation model and the second scene graph generation model are trained by the following steps:
[0113] c1: Get multiple target sample data after filtering the sample image and text dataset.
[0114] c2: labeling each of the target sample data to obtain a label corresponding to each of the target sample data; wherein the label corresponding to the target sample data includes a scene graph label, a picture style label, and a picture attribute label.
[0115] c3: Input the image data and the corresponding labels in the target sample data into a pre-constructed first neural network, train the first neural network, and when the loss function value of the first neural network is less than a first preset threshold, determine that the training of the first neural network is completed, and obtain the first scene graph generation model.
[0116] c4: Input the text data and the corresponding labels in the target sample data into a pre-constructed second neural network, train the neural network, and when the loss function value of the second neural network is less than a second preset threshold, determine that the training of the second neural network is completed, and obtain the second scene graph generation model.
[0117] In an embodiment of the present application, since the acquired sample graphic data may include data directly extracted from a web page, the quality of the sample graphic data may vary. Sample graphic data of too low quality may affect the training accuracy of the first scene graph generation model and the second scene graph generation model. Therefore, before training the first scene graph generation model and the second scene graph generation model, it is necessary to screen the sample graphic data. After filtering out the low-quality data in the sample graphic data, high-quality target sample data remains. Training the first scene graph generation model and the second scene graph generation model with the high-quality target sample data helps to improve the accuracy of the training of the first scene graph generation model and the second scene graph generation model.
[0118] For example, the model input text is "superman", but the output is a picture containing a bowl of soup. The sample image and text data consisting of the text superman and the picture containing a bowl of soup is low-quality and inaccurate sample image and text data. It is necessary to remove the sample image and text data before training the first scene graph generation model and the second scene graph generation model.
[0119] Among them, the sample image and text data may include image-generated text data, text-generated image data, and image-generated image and text data. For different sample image and text data, the quality judgment process of the sample image and text data and the screening process of the target sample images may be different. The following will explain the methods of determining the target sample data according to different sample image and text types.
[0120] Specifically, in the first aspect, when the sample graphic data is graphic-text data:
[0121] The step of "obtaining multiple target sample data after filtering the sample image and text data set" includes:
[0122] d1: For each sample image and text data in the sample image and text data set, the sample text data of the sample image and text data is input into a pre-trained text-image model to obtain predicted image data.
[0123] d2: for each sample graphic data, respectively encode the predicted picture data and the sample picture data in the sample graphic data, and calculate a first distance between the encoded predicted picture vector and the sample picture vector.
[0124] d3: Filter out the sample image and text data whose first distance is greater than a preset distance threshold in the sample image and text data set to determine a plurality of target sample data.
[0125] In an embodiment of the present application, when the sample graphic data is graphic-text data, a trained graphic-graphic model can be used for processing, and the sample text data in the sample graphic data is input into the trained graphic-graphic model to output predicted image data. The quality of the current sample graphic data can be determined by comparing the sample image data in the sample graphic data with the output predicted image data, as well as whether the sample graphic data needs to be filtered out.
[0126] In a possible implementation, for each sample image and text data, the predicted image data and the sample image data may be encoded separately to obtain a predicted image vector and a sample image vector, and then the cosine distance (first distance) between the predicted image vector and the sample image vector is calculated, wherein the smaller the cosine distance value between the two vectors, the more similar the two vectors are.
[0127] In a possible implementation, a preset distance threshold needs to be set in advance. For each sample image and text data, if the first distance between the predicted image vector and the sample image vector is less than the preset distance threshold, it is determined that the sample image data in the sample image and text data is more similar to the predicted image data, then the sample image and text data is characterized as correct sample image and text data, and the sample image and text data needs to be retained; if the first distance between the predicted image vector and the sample image vector is greater than the preset distance threshold, it is determined that the sample image data in the sample image and text data is significantly different from the predicted image data, then the sample image and text data is characterized as inaccurate sample image and text data, and the sample image and text data needs to be filtered out, and after filtering out the sample image and text data in the sample image and text data set whose first distance is less than the preset distance threshold, multiple target sample data are determined.
[0128] In a possible implementation, the preset distance threshold can be determined based on detection data of different target image and text data and historical image and text data distances. The preset distance thresholds corresponding to different categories of target image and text data, or different models (image-to-text model or text-to-image model) may be different.
[0129] In the second aspect, when the sample graphic data is text-generated graphic data:
[0130] The step of "obtaining multiple target sample data after filtering the sample image and text data set" includes:
[0131] e1: For each sample image-text data in the sample image-text data set, the sample image data in the sample image-text data is input into a pre-trained image-to-text model to obtain predicted text data.
[0132] e2: for each sample graphic data, respectively encode the predicted text data and the sample text data in the sample graphic data, and calculate a second distance between the encoded predicted text vector and the sample text vector.
[0133] e3: Filter out the sample image and text data whose second distance is greater than a preset distance threshold in the sample image and text data set to determine a plurality of target sample data.
[0134] In an embodiment of the present application, when the sample graphic data is text-generated image data, a trained graphic-generated text model can be used for processing, and the sample image data in the sample graphic data is input into the trained graphic-generated text model to output predicted text data. The quality of the current sample graphic data can be determined by comparing the sample text data in the sample graphic data with the output predicted text data, as well as whether the sample graphic data needs to be filtered out.
[0135] In a possible implementation, for each sample graphic data, the predicted text data and the sample text data may be encoded separately to obtain a predicted text vector and a sample text vector, and then the cosine distance (second distance) between the predicted text vector and the sample text vector is calculated, wherein the smaller the cosine distance value between the two vectors, the more similar the two vectors are.
[0136] In a possible implementation, a preset distance threshold needs to be set in advance. For each sample image and text data, if the second distance between the predicted text vector and the sample text vector is less than the preset distance threshold, it is determined that the sample text data in the sample image and text data is more similar to the predicted text data, then the sample image and text data is characterized as correct sample image and text data, and the sample image and text data needs to be retained; if the second distance between the predicted text vector and the sample text vector is greater than the preset distance threshold, it is determined that the sample text data in the sample image and text data is significantly different from the predicted text data, then the sample image and text data is characterized as inaccurate sample image and text data, and the sample image and text data needs to be filtered out, and after filtering out the sample image and text data in the sample image and text data set whose second distance is greater than the preset distance threshold, multiple target sample data are determined.
[0137] In a possible implementation, similarly, the preset distance threshold can be determined based on detection data of different target image and text data and historical image and text data distances. The preset distance thresholds corresponding to different categories of target image and text data, or different models (image-to-text model or text-to-image model) can be different.
[0138] In the third aspect, when the sample graphic data is text-generated graphic data:
[0139] Specifically, the step of "obtaining a plurality of target sample data after screening the sample image and text data set" includes:
[0140] f1: For each sample image and text data in the sample image and text data set, the sample text data of the sample image and text data is input into the pre-trained text-based graph model, and after obtaining the predicted image data, the first distance between the encoded predicted image vector and the sample image vector is calculated.
[0141] f2: For each sample image-text data in the sample image-text data set, the sample image data of the sample image-text data is input into a pre-trained image-to-text model, and after obtaining the predicted text data, the second distance between the encoded predicted text vector and the sample text vector is calculated.
[0142] f3: Determine a first sample data set in the sample image and text data sets whose first distance is less than a preset distance threshold, and a second sample data set in the sample image and text data sets whose second distance is less than the preset distance threshold.
[0143] f4: Determine a plurality of sample graphic data included in the intersection of the first sample data set and the second sample data set as a plurality of target sample data.
[0144] In an embodiment of the present application, when the sample image and text data is image-text-generated image and text data, it is necessary to process the sample image data and the sample text data in the sample image data at the same time, that is, the sample text data of the sample image and text data is input into a pre-trained text-generated image model, and the first distance between the output preset image data and the sample image data is determined; the sample image data of the sample image and text data is input into a pre-trained image-generated text model, and the second distance between the output preset text data and the sample text data is determined; and then, based on the first distance and the second distance, a first sample data set in the sample image and text data set whose first distance is less than a preset distance threshold, and a second sample data set in the sample image and text data set whose second distance is less than the preset distance threshold are determined; further, the first sample data set and the second sample data set are intersected, and the multiple sample image and text data in the intersection are determined as multiple target sample data.
[0145] The method for determining the first distance and the second distance has been explained in the description of the first distance and the second distance, and the same calculation method will not be repeated here.
[0146] Exemplarily, the sample image and text data set includes multiple sample image and text data (A1, A2, A3, A4, A5, A6, A7, A8); it is determined that the first sample data set in the sample image and text data set whose first distance is greater than a preset distance threshold is (A3, A4, A5, A6, A7, A8); it is determined that the first sample data set in the sample image and text data set whose second distance is greater than the preset distance threshold is (A1, A6, A7, A8), and after taking the intersection of the first sample data set and the second sample data set, a data set (A6, A7, A8) is obtained, and the sample image and text data A6, A7, A8 are the target sample data obtained after screening.
[0147] Furthermore, after obtaining a plurality of filtered target sample data, each target sample data needs to be labeled and a corresponding label is assigned to each target sample data so as to train the constructed model through the labeled target sample data.
[0148] In a possible implementation, the target sample data may be labeled manually or by using a pre-selected trained labeling model. The specific labeling method is not limited in the embodiments of the present application.
[0149] In one possible implementation, the model generates a scene Figure 1 Generally, images have distinct features, such as artistic style and strong color contrast, which are generally different from real data. In order to ensure the accuracy of model training, when annotating the target sample data, in addition to the conventional scene graph information annotation, the image style and image attributes need to be annotated; that is, the labels corresponding to the target sample data include scene graph labels, image style labels, and image attribute labels.
[0150] For example, a sample picture data includes a female ballerina dancing in a black skirt. The annotations for the sample picture data may include <picture, is, artistic portrait>, <ballerina, wearing, skirt>, <skirt, is, black>, <ballerina, walking on, water>; among which, <picture, is, artistic portrait> and <skirt, is, black> are annotations of the picture style and attributes, which are also represented by triple data, and the predicate uses "is".
[0151] Furthermore, after the target sample data is labeled, the models for processing image data and text data need to be trained separately.
[0152] Specifically, on the one hand, the image data and the corresponding labels in the target sample data are input into a pre-constructed first neural network, and the first neural network is trained. When the loss function value of the first neural network is less than a first preset threshold, it is determined that the training of the first neural network is completed, and a first scene graph generation model is obtained.
[0153] In a possible implementation, the first neural network may be a RelTR model, in which a bounding box (rectangular area) is used to output the target position, that is, during the training of the model, a rectangular area is extracted corresponding to the target feature.
[0154] In another possible implementation, the rectangular area may contain some background information that is irrelevant to the target. If semantic segmentation is used to extract the features of the target, it will be more accurate. That is, in the first neural network for extracting SG in the embodiment of the present application, the module for predicting the target position can also be changed from predicting the Bounding box to predicting the segmentation (mask) of the target.
[0155] On the other hand, the text data and the corresponding labels in the target sample data are input into a pre-constructed second neural network, and the neural network is trained. When the loss function value of the second neural network is less than a second preset threshold, the second neural network training is determined to be completed, and a second scene graph generation model is obtained.
[0156] In one possible implementation, the second neural network may be an end-to-end neural network (Seq2Seq).
[0157] In the embodiment of the present application, the first scene graph generation model and the second scene graph generation model use the same label system during training. There are relatively large differences in the styles of real pictures, generated pictures, real texts, and generated texts. Nevertheless, since the same label system is used during training, the first scene graph generation model and the second scene graph generation model can obtain relatively accurate scene graph (SG) information for data with different styles.
[0158] In a possible implementation, the first preset threshold and the second preset threshold may be determined according to model training requirements and / or model historical training data, and no specific limitation is made herein.
[0159] In another possible implementation, the training cutoff condition for the first neural network and the second neural network may also be to set an iteration number threshold. When the number of iterative optimizations of the first neural network or the second neural network is greater than a preset number of iterations, the model training is determined to be finished, wherein the iteration number threshold may be a pre-set number based on the model training requirements, and the specific setting method is not limited herein.
[0160] For example, see Figure 3 , Figure 3 The model training flow chart provided in the embodiment of the present application is as follows: Figure 3 As shown in , the whole process includes a high-quality data acquisition module, a manual annotation module, and a model training module; the high-quality data acquisition module screens the data in a self-supervised manner, and the final output of the module is a high-quality image-text pair. Through manual annotation, a sample image-text data set is obtained. The sample image-text data set is used for training the first neural network and the second neural network.
[0161] Among them, Figure 3 As shown, the high-quality data acquisition module includes a data processing link 1 and a data processing link 2; in the data processing link 1, the image and text data are input into the text-to-image model for image comparison to generate high-quality image-to-text data; in the data processing link 2, the image and text data are input into the image-to-text model for text comparison to generate high-quality image-to-text data.
[0162] In a possible implementation, for the graphic data generated by the graph-to-text model: they are processed via data processing link one; for the graphic data generated by the text-to-graph model: they are processed via data processing link two; for the graphic data generated by the graph-to-text model, a hybrid mode is adopted, and they are processed respectively via data processing link one and data processing link two; for the graphic data directly extracted from the web page, a hybrid mode can also be adopted, and they are processed respectively via data processing link one and data processing link two.
[0163] It is worth noting that the above processing method is a preferred embodiment provided by the embodiments of the present application, and the processing method and selection method of the specific data processing link can be adjusted according to the specific data processing requirements.
[0164] The method for determining the quality of graphic data provided in the embodiment of the present application comprises the following steps: obtaining generated target graphic data; inputting the target image data in the target graphic data into a pre-trained first scene graph generation model to obtain a first scene graph corresponding to the target image data; inputting the target text data in the target graphic data into a pre-trained second scene graph generation model to obtain a second scene graph corresponding to the target text data; calculating the target F1 score between the first scene graph and the second scene graph; if the target F1 score is greater than a preset score threshold, determining that the data quality of the target graphic data meets the preset data quality standard. In this way, the target image data and the target text data in the target graphic data obtain the corresponding first scene graph and the second scene graph, and the quality of the graphic data is determined directly through the generated first scene graph and the second scene graph, which helps to improve the accuracy of the quality determination of the graphic data.
[0165] Based on the same inventive concept, an embodiment of the present application also provides a device for determining the quality of graphic data corresponding to the method for determining the quality of graphic data. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the method for determining the quality of graphic data in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0166] See also Figure 4 , Figure 5 , Figure 4 This is one of the structural schematic diagrams of a device for determining the quality of graphic data provided in an embodiment of the present application. Figure 5 This is a second structural diagram of a device for determining the quality of graphic data provided by an embodiment of the present application. Figure 4 As shown in , the determining device 400 includes:
[0167] The data acquisition module 410 is used to acquire the generated target graphic data.
[0168] The first scene graph generation module 420 is used to input the target image data in the target graphic data into a pre-trained first scene graph generation model to obtain a first scene graph corresponding to the target image data.
[0169] The second scene graph generation module 430 is used to input the target text data in the target graphic data into a pre-trained second scene graph generation model to obtain a second scene graph corresponding to the target text data.
[0170] The score calculation module 440 is used to calculate a target F1 score between the first scene graph and the second scene graph.
[0171] The quality determination module 450 is configured to determine whether the data quality of the target graphic data meets a preset data quality standard if the target F1 score is greater than a preset score threshold.
[0172] In a possible implementation, Figure 5 As shown, the determining device 400 further includes a model training module 460, and the model training module 460 is used to train the first scene graph generation model and the second scene graph generation model through the following steps:
[0173] Obtain multiple target sample data after filtering the sample image and text data set;
[0174] Labeling each of the target sample data to obtain a label corresponding to each of the target sample data; wherein the label corresponding to the target sample data includes a scene graph label, a picture style label, and a picture attribute label;
[0175] Inputting the image data and the corresponding labels in the target sample data into a pre-built first neural network, training the first neural network, and determining that the training of the first neural network is completed when the loss function value of the first neural network is less than a first preset threshold value, thereby obtaining the first scene graph generation model;
[0176] The text data and the corresponding labels in the target sample data are input into a pre-constructed second neural network, and the second neural network is trained. When the loss function value of the second neural network is less than a second preset threshold, it is determined that the training of the second neural network is completed, and the second scene graph generation model is obtained.
[0177] In a possible implementation, when the target graphic data is a pair, when the calculation module 440 is used to calculate the target F1 score between the first scene graph and the second scene graph, the calculation module 440 is used to:
[0178] Calculating the precision and recall corresponding to the first scene graph generation model and the second scene graph generation model;
[0179] The target F1 score is determined based on the precision and the recall.
[0180] In a possible implementation, when the target image-text data is a plurality of pairs, a plurality of first scene graphs and a plurality of second scene graphs are generated; when the calculation module 440 is used to calculate the target F1 score between the first scene graph and the second scene graph, the calculation module 440 is used to:
[0181] Calculate the corresponding model F1 score of each first scene graph and each second scene graph after being output from the first scene graph generation model and the second scene graph generation model;
[0182] The target F1 score is determined as an average of the F1 scores of the multiple models.
[0183] In a possible implementation, when the sample graphic data is graphic data, when the model training module 460 is used to obtain a plurality of target sample data after filtering the sample graphic data set, the model training module 460 is used to:
[0184] For each sample image-text data in the sample image-text data set, the sample text data of the sample image-text data is input into a pre-trained text-image model to obtain predicted image data;
[0185] For each sample graphic data, respectively encode the predicted picture data and the sample picture data in the sample graphic data, and calculate a first distance between the encoded predicted picture vector and the sample picture vector;
[0186] The sample image and text data whose first distance is greater than a preset distance threshold in the sample image and text data set are filtered out to determine a plurality of target sample data.
[0187] In a possible implementation, when the sample graphic data is text-based graphic data, when the model training module 460 is used to obtain a plurality of target sample data after filtering the sample graphic data set, the model training module 460 is used to:
[0188] For each sample image-text data in the sample image-text data set, the sample image data in the sample image-text data is input into a pre-trained image-to-text model to obtain predicted text data;
[0189] For each sample graphic data, the predicted text data and the sample text data in the sample graphic data are encoded respectively, and a second distance between the encoded predicted text vector and the sample text vector is calculated;
[0190] The sample image and text data whose second distance is greater than a preset distance threshold in the sample image and text data set are filtered out to determine a plurality of target sample data.
[0191] In a possible implementation, when the sample graphic data is graphic data generated from graphic data, when the model training module 460 is used to obtain a plurality of target sample data after filtering the sample graphic data set, the model training module 460 is used to:
[0192] For each sample image-text data in the sample image-text data set, the sample text data of the sample image-text data is input into a pre-trained text-graph model, and after obtaining the predicted image data, a first distance between the encoded predicted image vector and the sample image vector is calculated;
[0193] For each sample image-text data in the sample image-text data set, input the sample image data of the sample image-text data into a pre-trained image-to-text model, and after obtaining the predicted text data, calculate the second distance between the encoded predicted text vector and the sample text vector;
[0194] Determine a first sample data set whose first distance is less than a preset distance threshold in the sample image and text data set, and a second sample data set whose second distance is less than the preset distance threshold in the sample image and text data set;
[0195] A plurality of sample graphic data included in the intersection of the first sample data set and the second sample data set is determined as a plurality of target sample data.
[0196] The apparatus for determining the quality of graphic data provided in the embodiment of the present application obtains the generated target graphic data; inputs the target image data in the target graphic data into a pre-trained first scene graph generation model to obtain a first scene graph corresponding to the target image data; inputs the target text data in the target graphic data into a pre-trained second scene graph generation model to obtain a second scene graph corresponding to the target text data; calculates the target F1 score between the first scene graph and the second scene graph; if the target F1 score is greater than a preset score threshold, determines that the data quality of the target graphic data meets the preset data quality standard. In this way, the target image data and the target text data in the target graphic data obtain the corresponding first scene graph and the second scene graph, and the quality of the graphic data is determined directly through the generated first scene graph and the second scene graph, which helps to improve the accuracy of the quality determination of the graphic data.
[0197] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown in , the electronic device 600 includes a processor 610 , a memory 620 and a bus 630 .
[0198] The memory 620 stores machine-readable instructions executable by the processor 610. When the electronic device 600 is running, the processor 610 communicates with the memory 620 via the bus 630. When the machine-readable instructions are executed by the processor 610, the above-mentioned Figure 1 The steps of the method for determining the quality of graphic data in the method embodiment shown, and the specific implementation manner can be referred to the method embodiment, which will not be repeated here.
[0199] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the method for determining the quality of graphic data in the method embodiment shown, and the specific implementation manner can be referred to the method embodiment, which will not be repeated here.
[0200] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0201] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0202] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0203] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0204] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0205] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for determining the quality of graphic data, characterized in that: The determination method comprises: Obtaining generated target graphic data; the target graphic data is generated by a text-to-graph model and / or a graph-to-text model; or generated by a graphic-to-text model; or extracted from a web page; or is graphic data corresponding to a generated scene graph; Input the target image data in the target graphic data into a pre-trained first scene graph generation model to obtain a first scene graph corresponding to the target image data; the first scene graph generation model is a CV-SGG model trained based on the image data in the target sample data and the corresponding labels; Input the target text data in the target graphic data into a pre-trained second scene graph generation model to obtain a second scene graph corresponding to the target text data; the second scene graph generation model is a Text-SGG model trained based on the text data in the target sample data and the corresponding labels; wherein the first scene graph generation model and the second scene graph generation model are trained using the same label system; Calculating a target F1 score between the first scene graph and the second scene graph to determine the data quality of the target graphic data according to the first scene graph and the second scene graph; If the target F1 score is greater than a preset score threshold, it is determined that the data quality of the target graphic data meets the preset data quality standard; When the target graph-text data is a pair, calculating a target F1 score between the first scene graph and the second scene graph includes: Calculating the precision and recall corresponding to the first scene graph generation model and the second scene graph generation model; Determining the target F1 score based on the precision and the recall; When the target image-text data is a plurality of pairs, a plurality of first scene graphs and a plurality of second scene graphs are generated; and the calculating of the target F1 score between the first scene graph and the second scene graph includes: Calculate the corresponding model F1 score of each first scene graph and each second scene graph after being output from the first scene graph generation model and the second scene graph generation model; Determine an average of the F1 scores of the multiple models as the target F1 score; The first scene graph generation model and the second scene graph generation model are trained by the following steps: Obtaining multiple target sample data after filtering the sample image and text data set; Labeling each of the target sample data to obtain a label corresponding to each of the target sample data; wherein the label corresponding to the target sample data includes a scene graph label, a picture style label, and a picture attribute label; Inputting the image data and the corresponding labels in the target sample data into a pre-built first neural network, training the first neural network, and determining that the training of the first neural network is completed when the loss function value of the first neural network is less than a first preset threshold value, thereby obtaining the first scene graph generation model; The text data and the corresponding labels in the target sample data are input into a pre-constructed second neural network, and the second neural network is trained. When the loss function value of the second neural network is less than a second preset threshold, it is determined that the training of the second neural network is completed, and the second scene graph generation model is obtained.
2. The determination method according to claim 1, characterized in that: When the sample graphic data is graphic data, the step of obtaining a plurality of target sample data after filtering the sample graphic data set includes: For each sample image-text data in the sample image-text data set, the sample text data of the sample image-text data is input into a pre-trained text-image model to obtain predicted image data; For each sample graphic data, respectively encode the predicted picture data and the sample picture data in the sample graphic data, and calculate a first distance between the encoded predicted picture vector and the sample picture vector; The sample image and text data whose first distance is greater than a preset distance threshold in the sample image and text data set are filtered out to determine a plurality of target sample data.
3. The determination method according to claim 1, characterized in that: When the sample graphic data is text-generated graphic data, the step of obtaining a plurality of target sample data after filtering the sample graphic data set includes: For each sample image-text data in the sample image-text data set, the sample image data in the sample image-text data is input into a pre-trained image-to-text model to obtain predicted text data; For each sample graphic data, the predicted text data and the sample text data in the sample graphic data are encoded respectively, and a second distance between the encoded predicted text vector and the sample text vector is calculated; The sample image and text data whose second distance is greater than a preset distance threshold in the sample image and text data set are filtered out to determine a plurality of target sample data.
4. The determination method according to claim 1, characterized in that: When the sample graphic data is graphic data generated from graphic data, the step of obtaining a plurality of target sample data after filtering the sample graphic data set includes: For each sample image-text data in the sample image-text data set, the sample text data of the sample image-text data is input into a pre-trained text-graph model, and after obtaining the predicted image data, a first distance between the encoded predicted image vector and the sample image vector is calculated; For each sample image-text data in the sample image-text data set, input the sample image data of the sample image-text data into a pre-trained image-to-text model, and after obtaining the predicted text data, calculate the second distance between the encoded predicted text vector and the sample text vector; Determine a first sample data set whose first distance is less than a preset distance threshold in the sample image and text data set, and a second sample data set whose second distance is less than the preset distance threshold in the sample image and text data set; A plurality of sample graphic data included in the intersection of the first sample data set and the second sample data set is determined as a plurality of target sample data.
5. A device for determining the quality of graphic data, characterized in that: The determining device comprises: A data acquisition module is used to acquire the generated target graphic data; the target graphic data is generated by a text-to-graph model and / or a graph-to-text model; or is generated by a graphic-to-text model; or is extracted from a web page; or is graphic data corresponding to a generated scene graph; A first scene graph generation module, used for inputting target image data in the target graphic data into a pre-trained first scene graph generation model to obtain a first scene graph corresponding to the target image data; the first scene graph generation model is a CV-SGG model obtained by training based on the image data in the target sample data and the corresponding labels; A second scene graph generation module is used to input the target text data in the target graphic data into a pre-trained second scene graph generation model to obtain a second scene graph corresponding to the target text data; the second scene graph generation model is a Text-SGG model trained based on the text data in the target sample data and the corresponding labels; wherein the first scene graph generation model and the second scene graph generation model are trained using the same label system; A score calculation module, used to calculate a target F1 score between the first scene graph and the second scene graph, so as to determine the data quality of the target graphic data according to the first scene graph and the second scene graph; A quality determination module, configured to determine that the data quality of the target graphic data meets a preset data quality standard if the target F1 score is greater than a preset score threshold; When the target graph-text data is a pair, when the calculation module is used to calculate the target F1 score between the first scene graph and the second scene graph, the calculation module is used to: Calculating the precision and recall corresponding to the first scene graph generation model and the second scene graph generation model; Determining the target F1 score based on the precision and the recall; When the target image-text data is a plurality of pairs, a plurality of first scene graphs and a plurality of second scene graphs are generated; when the calculation module is used to calculate the target F1 score between the first scene graph and the second scene graph, the calculation module is used to: Calculate the corresponding model F1 score of each first scene graph and each second scene graph after being output from the first scene graph generation model and the second scene graph generation model; Determine an average of the F1 scores of the multiple models as the target F1 score; The determining device further includes a model training module, and the model training module is used to train the first scene graph generation model and the second scene graph generation model through the following steps: Obtaining multiple target sample data after filtering the sample image and text data set; Labeling each of the target sample data to obtain a label corresponding to each of the target sample data; wherein the label corresponding to the target sample data includes a scene graph label, a picture style label, and a picture attribute label; Inputting the image data and the corresponding labels in the target sample data into a pre-built first neural network, training the first neural network, and determining that the training of the first neural network is completed when the loss function value of the first neural network is less than a first preset threshold value, thereby obtaining the first scene graph generation model; The text data and the corresponding labels in the target sample data are input into a pre-constructed second neural network, and the second neural network is trained. When the loss function value of the second neural network is less than a second preset threshold, it is determined that the training of the second neural network is completed, and the second scene graph generation model is obtained.
6. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for determining the quality of graphic data as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for determining the quality of graphic and text data as claimed in any one of claims 1 to 4 are executed.
