Training of label recognition model, method and device for recognizing image labels

By training a label recognition model for sample image collections containing multiple sizes of images, the problem of ignoring other features other than main features in the prior art is solved, and the accuracy and publicity quality of image label recognition are improved.

CN114565016BActive Publication Date: 2025-04-22GUANGZHOU YOUMI INFORMATION TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210081701.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-24
Publication Date
2025-04-22
Estimated Expiration
2042-01-24

AI Technical Summary

Technical Problem

When the prior art recognizes image tags in game advertising pictures or videos, other features other than main features are easily ignored, resulting in a decrease in the accuracy of tag recognition and publicity quality.

Method used

The target tag recognition model is trained to identify image tags of multiple size images by determining a model training method that includes a preset size range, including style tags and element tags.

Benefits of technology

Improve the accuracy and efficiency of image tag recognition, enhance the quality of game promotion, and ensure that all features except the main features are considered when identifying image tags.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565016B_ABST
    Figure CN114565016B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for training a label recognition model and identifying image labels. The method includes: determining a sample image set, the sample image set includes at least one sample image in a preset size range, training a predetermined label recognition model according to the sample image set to obtain a target label recognition model, and the target label recognition model is used to identify the image label of the image to be identified. It can be seen that the implementation of the present invention can train a label recognition model by using sample images of various sizes with style labels and element labels, and then obtain a label recognition model that identifies image labels of images of various sizes, thereby reducing the situation in which only the image labels corresponding to the main features in the image are considered when identifying image labels, while ignoring the image labels corresponding to other features except the main features, thereby improving the accuracy and efficiency of image label recognition and the quality of publicity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of model training technology, and in particular to a method and device for training a label recognition model and recognizing image labels. Background Art

[0002] With the continuous development of the game industry, there are now many types of games on the market. In order to attract more user attention, most game companies will promote their games through game advertising pictures or game videos. They will also extract game tags from the game advertising pictures or game videos to promote to players who are interested in specific game tags.

[0003] At present, games with various labels can be classified in advance to identify game tags in game advertisements or game videos that match the pre-classified game tags based on the pre-classified game tags. However, this method tends to ignore other features in the game advertisements or game videos except the main features when identifying game tags, resulting in only identifying game tags corresponding to the main features in the image in the pre-classified game tags when identifying game tags, without considering game tags corresponding to other features, thereby reducing the accuracy of game tag recognition and the quality of game promotion. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method and device for training a label recognition model and recognizing image labels, so as to obtain a label recognition model that recognizes image labels of images of various sizes, reduce the situation in which only image labels corresponding to main features in the image are considered when recognizing image labels, and image labels corresponding to other features except the main features are ignored, thereby improving the accuracy and efficiency of image label recognition and enhancing the quality of publicity.

[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a training method for a label recognition model, the method comprising:

[0006] Determine a sample image set, wherein the sample image set includes at least one sample image within a preset size range, and image tags corresponding to all the sample images in the sample image set include at least one style tag and / or at least one element tag;

[0007] According to the sample image set, a predetermined label recognition model is trained to obtain a target label recognition model, and the target label recognition model is used to recognize image labels of images to be recognized.

[0008] As an optional implementation, in the first aspect of the present invention, training a predetermined label recognition model according to the sample image set to obtain a target label recognition model includes:

[0009] According to a preset image processing strategy, determine sample adjustment parameters corresponding to all the sample images in the sample image set, wherein the sample adjustment parameters include at least two parameter values;

[0010] Dividing all the sample images in the sample image set according to all the parameter values ​​and the number of all the parameter values ​​to obtain subsample image sets having the same number as all the parameter values, each of the subsample image sets including at least one sample image, and the sample images included in each of the subsample image sets in all the subsample image sets are different;

[0011] Selecting one of the subsample image sets from all the subsample image sets as a starting subsample image set, determining a predetermined label recognition model as a starting label recognition model, and training the starting label recognition model based on the starting subsample image set to obtain a trained label recognition model;

[0012] The trained label recognition model is updated as the initial label recognition model, and one of the sub-sample image sets is selected from the remaining sub-sample image sets as the initial sub-sample image set, and the operation of training the initial label recognition model based on the initial sub-sample image set to obtain the trained label recognition model is re-performed;

[0013] Determine the label recognition model corresponding to the last sub-sample image set as the target label recognition model.

[0014] As an optional implementation, in the first aspect of the present invention, the sample adjustment parameter includes a size adjustment parameter, and all the parameter values ​​included in the size adjustment parameter are used to adjust the image size of the sample image in the sample image set;

[0015] The step of dividing all the sample images in the sample image set according to all the parameter values ​​and the number of all the parameter values ​​to obtain a sub-sample image set having the same number as all the parameter values ​​comprises:

[0016] Dividing all the sample images in the sample image set into sub-sample image sets whose number is the same as all the parameter values, and adjusting the image sizes of all the sample images in the sub-sample image set according to the parameter value corresponding to each sub-sample image set; or,

[0017] Adjust the image sizes of all the sample images in the sample image set according to all the parameter values ​​to obtain the adjusted sample image set;

[0018] The sample images having the same image size among all the sample images in the adjusted sample image set are divided into the same sub-sample image set.

[0019] As an optional implementation manner, in the first aspect of the present invention, one of the sub-sample image sets selected from all the sub-sample image sets is a sub-sample image set with the largest image size among all the sub-sample image sets;

[0020] Furthermore, in the process of training the label recognition model, the image size corresponding to the sub-sample image set selected at a later time is smaller than the image size corresponding to the sub-sample image set selected at a previous time.

[0021] As an optional implementation manner, in the first aspect of the present invention, determining the label recognition model corresponding to the last sub-sample image set as the target label recognition model includes:

[0022] Using the label recognition model corresponding to the last sub-sample image set, identify the image labels corresponding to all other sample images in the other sample image sets, and calculate the deviation value of the image label corresponding to each of the other sample images using a preset loss function;

[0023] Determining a loss value of a label recognition model corresponding to the last sub-sample image set according to deviation values ​​of image labels corresponding to all other sample images in the other sample image set;

[0024] When the loss value of the label recognition model corresponding to the last sub-sample image set is within a preset loss range, determining the label recognition model corresponding to the last sub-sample image set as the target label recognition model;

[0025] When the loss value of the label recognition model corresponding to the last sub-sample image set is not within the preset loss range, the model parameters of the label recognition model are optimized to obtain the optimized label recognition model, and the optimized label recognition model is updated to the pre-constructed label recognition model to re-execute the operation of training the starting label recognition model based on the starting sub-sample image set to obtain the label recognition model corresponding to the last sub-sample image set, until the loss value of the trained label recognition model is within the preset loss range, and the trained label recognition model is determined to be the target label recognition model.

[0026] As an optional implementation manner, in the first aspect of the present invention, determining the sample image set includes:

[0027] Acquire a sample material image, wherein the sample material image has at least one element tag;

[0028] Acquire a first sample image, and generate a second sample image according to the sample material image and the first sample image, wherein the image label corresponding to the second sample image is the element label of the sample material image;

[0029] Performing style migration on the second sample image according to a predetermined style label and a pre-constructed style migration model to obtain a third sample image, wherein the style label of the third sample image is different from the style label of the second sample image;

[0030] A sample image set is generated according to the second sample image and the third sample image.

[0031] A second aspect of the present invention discloses a method for identifying an image tag, the method comprising:

[0032] Acquire at least one image to be identified of a target object;

[0033] Input each of the images to be identified into a target label recognition model to obtain an image label corresponding to each of the images to be identified;

[0034] The image labels corresponding to each of the to-be-recognized images are merged to generate a target image label for the target object.

[0035] As an optional implementation, in the second aspect of the present invention, inputting each of the to-be-recognized images into a target label recognition model to obtain an image label corresponding to each of the to-be-recognized images includes:

[0036] Identify the image label corresponding to each of the to-be-identified images through a target label recognition model, and determine the confidence level of the image label corresponding to each of the to-be-identified images;

[0037] Determining a confidence threshold of each of the image labels, and for each of the images to be identified, comparing the confidence of the image label corresponding to the image to be identified with the confidence threshold of the image label corresponding to the image to be identified;

[0038] For each of the images to be identified, when the confidence of the image label corresponding to the image to be identified is greater than the confidence threshold of the image label corresponding to the image to be identified, the target label recognition model outputs the image label corresponding to the image to be identified.

[0039] A third aspect of the present invention discloses a training device for a label recognition model, the device comprising:

[0040] A determination module, configured to determine a sample image set, wherein the sample image set includes at least one sample image within a preset size range, and image labels corresponding to all the sample images in the sample image set include at least one style label and / or at least one element label;

[0041] The training module is used to train a predetermined label recognition model according to the sample image set to obtain a target label recognition model, wherein the target label recognition model is used to recognize the image label of the image to be recognized.

[0042] As an optional implementation, in the third aspect of the present invention, the specific method of training the predetermined label recognition model according to the sample image set in the training module to obtain the target label recognition model is:

[0043] According to a preset image processing strategy, the sample adjustment parameters corresponding to all the sample images in the sample image set are determined, and the sample adjustment parameters include at least two parameter values; according to all the parameter values ​​and the number of all the parameter values, all the sample images in the sample image set are divided to obtain sub-sample image sets with the same number as all the parameter values, each of the sub-sample image sets includes at least one sample image, and the sample images included in each of the sub-sample image sets in all the sub-sample image sets are different; one of the sub-sample image sets is selected from all the sub-sample image sets as the starting sub-sample image set, and a predetermined label recognition model is determined as the starting label recognition model, and the starting label recognition model is trained based on the starting sub-sample image set to obtain a trained label recognition model; the trained label recognition model is updated to the initial label recognition model, and one of the sub-sample image sets is selected from the remaining sub-sample image sets as the initial sub-sample image set, and the operation of training the starting label recognition model based on the starting sub-sample image set to obtain the trained label recognition model is re-executed; and the label recognition model corresponding to the last sub-sample image set is determined to be the target label recognition model.

[0044] As an optional implementation, in the third aspect of the present invention, the sample adjustment parameter includes a size adjustment parameter, and all the parameter values ​​included in the size adjustment parameter are used to adjust the image size of the sample image in the sample image set;

[0045] In the training module, all the sample images in the sample image set are divided according to all the parameter values ​​and the number of all the parameter values ​​to obtain a sub-sample image set with the same number as all the parameter values. The specific method is:

[0046] Divide all the sample images in the sample image set into sub-sample image sets with the same number as all the parameter values, and adjust the image size of all the sample images in the sub-sample image set according to the parameter value corresponding to each sub-sample image set; or adjust the image size of all the sample images in the sample image set according to all the parameter values ​​to obtain the adjusted sample image set; divide the sample images with the same image size among all the sample images in the adjusted sample image set into the same sub-sample image set.

[0047] As an optional embodiment, in the third aspect of the present invention, one of the subsample image sets selected from all the subsample image sets is a subsample image set with the largest image size among all the subsample image sets; and, in the process of training the label recognition model, the image size corresponding to the subsample image set selected at a later time is smaller than the image size corresponding to the subsample image set selected at a previous time.

[0048] As an optional implementation, in the third aspect of the present invention, the specific manner of determining in the training module that the label recognition model corresponding to the last sub-sample image set is the target label recognition model is:

[0049] The image labels corresponding to all other sample images in the other sample image sets are identified by the label recognition model corresponding to the last subsample image set, and the deviation value of the image label corresponding to each of the other sample images is calculated by a preset loss function; the loss value of the label recognition model corresponding to the last subsample image set is determined according to the deviation value of the image labels corresponding to all the other sample images in the other sample image sets; when the loss value of the label recognition model corresponding to the last subsample image set is within a preset loss range, the label recognition model corresponding to the last subsample image set is determined to be the target label recognition model; when the loss value of the label recognition model corresponding to the last subsample image set is not within the preset loss range, the model parameters of the label recognition model are optimized to obtain an optimized label recognition model, and the optimized label recognition model is updated to the pre-constructed label recognition model, so as to re-execute the operation of training the starting label recognition model based on the starting subsample image set to obtain the label recognition model corresponding to the last subsample image set, until the loss value of the trained label recognition model is within the preset loss range, the trained label recognition model is determined to be the target label recognition model.

[0050] As an optional implementation, in the third aspect of the present invention, the specific manner of determining the sample image set in the determination module is:

[0051] A sample material image is obtained, wherein the sample material image has at least one element label; a first sample image is obtained, and a second sample image is generated based on the sample material image and the first sample image, wherein the image label corresponding to the second sample image is the element label of the sample material image; style transfer is performed on the second sample image based on a predetermined style label and a pre-constructed style transfer model to obtain a third sample image, wherein the style label of the third sample image is different from the style label of the second sample image; a sample image set is generated based on the second sample image and the third sample image.

[0052] A fourth aspect of the present invention discloses a device for identifying image tags, the device comprising:

[0053] An acquisition module, used to acquire at least one image to be identified of a target object;

[0054] A recognition module, used for inputting each of the images to be recognized into a target label recognition model to obtain an image label corresponding to each of the images to be recognized;

[0055] A generation module is used to merge the image labels corresponding to each of the images to be identified to generate a target image label for the target object.

[0056] As an optional implementation, in the fourth aspect of the present invention, the recognition module inputs each of the images to be recognized into the target label recognition model, and obtains the image label corresponding to each of the images to be recognized in a specific manner as follows:

[0057] Through the target label recognition model, the image label corresponding to each image to be recognized is identified, and the confidence of the image label corresponding to each image to be recognized is determined; the confidence threshold of each image label is determined, and for each image to be recognized, the confidence of the image label corresponding to the image to be recognized and the confidence threshold of the image label corresponding to the image to be recognized are compared; for each image to be recognized, when the confidence of the image label corresponding to the image to be recognized is greater than the confidence threshold of the image label corresponding to the image to be recognized, the target label recognition model outputs the image label corresponding to the image to be recognized.

[0058] A fifth aspect of the present invention discloses another training device for a label recognition model, the device comprising:

[0059] A memory storing executable program code;

[0060] a processor coupled to the memory;

[0061] The processor calls the executable program code stored in the memory to execute the training method of the label recognition model disclosed in the first aspect of the present invention.

[0062] A sixth aspect of the present invention discloses another device for identifying image tags, the device comprising:

[0063] A memory storing executable program code;

[0064] a processor coupled to the memory;

[0065] The processor calls the executable program code stored in the memory to execute the method for identifying image tags disclosed in the second aspect of the present invention.

[0066] The seventh aspect of the present invention discloses a computer storable medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the training method of the label recognition model disclosed in the first aspect of the present invention.

[0067] The eighth aspect of the present invention discloses a computer storable medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the method for identifying image tags disclosed in the second aspect of the present invention.

[0068] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0069] In an embodiment of the present invention, a sample image set is determined, the sample image set includes at least one sample image in a preset size range, and the image labels corresponding to all the sample images in the sample image set include at least one style label and / or at least one element label; based on the sample image set, a predetermined label recognition model is trained to obtain a target label recognition model, and the target label recognition model is used to identify the image label of the image to be identified. It can be seen that the implementation of the present invention can train a label recognition model by using sample images of various sizes including style labels and element labels, and then can obtain a label recognition model that recognizes image labels of images of various sizes, thereby reducing the situation in which only the image labels corresponding to the main features in the image are considered when identifying image labels, while ignoring the image labels corresponding to other features except the main features, thereby improving the accuracy and efficiency of image label recognition and enhancing the quality of publicity. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0071] Figure 1 It is a flowchart of a training method for a label recognition model disclosed in an embodiment of the present invention;

[0072] Figure 2 It is a flowchart of another method for training a label recognition model disclosed in an embodiment of the present invention;

[0073] Figure 3 It is a flowchart of a method for identifying image tags disclosed in an embodiment of the present invention;

[0074] Figure 4 It is a structural schematic diagram of a training device for a label recognition model disclosed in an embodiment of the present invention;

[0075] Figure 5 is a schematic diagram of the structure of a device for identifying image tags disclosed in an embodiment of the present invention;

[0076] Figure 6 It is a structural schematic diagram of another training device for a label recognition model disclosed in an embodiment of the present invention;

[0077] Figure 7 It is a schematic diagram of the structure of another device for identifying image tags disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0078] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0079] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0080] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0081] The present invention discloses a method and device for training a label recognition model and recognizing image labels, which can obtain a label recognition model for recognizing image labels of images of various sizes, reduce the situation where other labels unrelated to pre-classified image labels are ignored when recognizing image labels, improve the accuracy of recognizing image labels, and enhance the quality of publicity. The following are detailed descriptions.

[0082] Embodiment 1

[0083] See also Figure 1 , Figure 1 is a flow chart of a method for training a label recognition model disclosed in an embodiment of the present invention. Figure 1 The training method of the tag recognition model described above can be applied to a server or a terminal device, and the embodiment of the present invention does not limit this. Figure 1 As shown, the training method of the label recognition model may include the following operations:

[0084] Step 101: determine a sample image set.

[0085] Among them, the sample image set may include at least one sample image within a preset size range, the preset size range may be a range of image sizes set artificially, the sample image may be a sample image used to train a label recognition model, the sample image may be obtained from an advertising picture or a video, and the image labels corresponding to all sample images in the sample image set may include at least one style label and / or at least one element label. The image label may be used to annotate features in the image, the style label may be used to annotate style features of the image style in the image, the style features may be image features associated with the image style, the element label may be used to annotate element features of the image elements in the image, the image style may include scene style, picture style, etc. The scene style may include styles corresponding to scenes such as two-dimensional scenes and three-dimensional scenes, the picture style may include cartoon style, simple style, realistic style, etc., and the image elements may be objects in the image, such as trees, buildings, people, etc.

[0086] In practical applications, at least one sample image within a preset size range can be obtained through the Internet, or the advertising image or video obtained from the Internet can be adjusted through image processing technology to obtain at least one sample image within a preset size range, and then a sample image set can be obtained based on at least one sample image within the preset size range.

[0087] In a specific implementation, the user's business needs for image style and / or image elements can also be determined, and then, based on the user's business needs for image style and / or image elements, sample images related to the user's business needs for image style and / or image elements can be obtained to generate a sample image set related to the user's business needs for image style and / or image elements.

[0088] In an optional embodiment, step 101 may include the following sub-steps:

[0089] Sub-step 11, obtaining a sample material image.

[0090] The sample material image may have at least one element tag.

[0091] In practical applications, at least one sample material image can be obtained through the Internet, and each sample image has at least one element tag. Advertising images or videos obtained from the Internet can also be adjusted through image processing technology to obtain at least one sample material image within a preset size range, and each sample image has at least one element tag.

[0092] Sub-step 12: acquiring a first sample image, and generating a second sample image according to the sample material image and the first sample image.

[0093] The first sample image may be an unprocessed sample image, the image label corresponding to the second sample image may be an element label of the sample material image, and the second sample image may be an image combining the sample material image and the first sample image.

[0094] After obtaining the sample material image, at least one sample material image within a preset size range can be obtained through the Internet, or the advertising image or video obtained from the Internet can be adjusted through image processing technology to obtain at least one sample material image within a preset size range, and a second sample image can be generated based on the sample material image and the first sample image.

[0095] In practical applications, due to the small number of sample material images with certain specific element labels, it is difficult to train based on sample material images with the specific element labels. Even if the model is trained with sample material images with the specific element labels, the accuracy of the trained model in identifying the specific element labels is also low. Therefore, a second sample image can be generated based on the sample material image and the first sample image, and the second sample image has the element label of the sample material image, so as to obtain a second sample image with the element labels of all sample material images and train the label recognition model to improve the accuracy of the trained label recognition model in identifying image labels.

[0096] As an optional implementation, the sample material image can be directly pasted into the first sample image to obtain the second sample image, or the image element corresponding to the element label in the sample material image can be extracted and pasted into the first sample image to obtain the second sample image. The sample material image or the image element corresponding to the element label in the sample material image can also be processed, such as image enlargement, reduction, color dithering, rotation, horizontal flipping, affine transformation and other operations, and the sample material image or the image element corresponding to the element label in the sample material image after image processing can be pasted into the first sample image to obtain the second sample image. The layer processing technology can also be used to place the sample material image or the image element corresponding to the element label in the sample material image on the top layer, and the first sample image on the bottom layer, and synthesize the sample material image or the image element corresponding to the element label in the sample material image and the first sample image to obtain the second sample image.

[0097] Sub-step 13: performing style transfer on the second sample image according to the predetermined style label and the pre-built style transfer model to obtain a third sample image.

[0098] The style transfer model may be used to perform style transfer on the sample image, and the style label of the third sample image may be different from the style label of the second sample image.

[0099] After the second sample image is obtained, style transfer may be performed on the second sample image according to a predetermined style label and a pre-constructed style transfer model to obtain a third sample image.

[0100] In practical applications, a style material image corresponding to a predetermined style label can be obtained, and the style material image and the second sample image can be input into a pre-constructed style transfer model, and then the style transfer model can extract the image style in the style material image and perform style transfer on the second sample image to obtain a third sample image, that is, the third sample image has the image style corresponding to the style material image, and the style label of the sample image is the style label corresponding to the style material image. Alternatively, a style transfer model corresponding to each style label can be pre-constructed, and then the second sample image can be style transferred according to the style transfer model corresponding to each style label to obtain a third sample image, that is, the third sample image has the style label in the style transfer model.

[0101] In an optional embodiment, an image copy of the second sample image may be generated to perform style transfer on the image copy of the second sample image according to a predetermined style label and a pre-built style transfer model to obtain a third sample image.

[0102] Sub-step 14: generating a sample image set according to the second sample image and the third sample image.

[0103] After the second sample image and the third sample image are obtained, a sample image set may be generated according to the second sample image and the third sample image.

[0104] In practical applications, since different second sample images have different element labels, and different third sample images have different style labels, the sample image set may include at least one element label and at least one style label, so that the label recognition model can be trained according to the sample image set.

[0105] Step 102: training a predetermined label recognition model based on the sample image set to obtain a target label recognition model.

[0106] The target label recognition model may be used to recognize the image label of an image to be recognized, and the image to be recognized may be an image to be recognized according to the needs of the user.

[0107] After obtaining the sample image set, the predetermined label recognition model can be trained to obtain a target label recognition model.

[0108] In practical applications, since the sample image set may include at least one element label and at least one style label, training the label recognition model based on the sample image set can enable the trained label recognition model to recognize image labels in images, and the label recognition model can recognize image labels in images of different sizes, thereby improving the accuracy of the target label recognition model in identifying element labels and style labels in images.

[0109] Moreover, when identifying image labels in an image, image labels can be identified by identifying image elements in the image. However, when identifying image elements in an image, it is easy to identify element features with larger areas in the image, while element features with smaller areas are easily lost in the identification process, which reduces the accuracy of identifying image labels. Therefore, training a label recognition model based on a sample image set including sample images within a preset size range can enable the trained label recognition model to recognize image labels in images of different sizes, such as image labels in larger images, image labels in smaller images, and image labels in a smaller area in a large image. As a result, the trained label recognition model can recognize image labels in images with smaller areas, thereby improving the accuracy of the target label recognition model in identifying element labels and style labels in images.

[0110] It can be seen that this optional embodiment can determine a sample image set, the sample image set includes at least one sample image in a preset size range, and the image labels corresponding to all sample images in the sample image set include at least one style label and / or at least one element label; according to the sample image set, a predetermined label recognition model is trained to obtain a target label recognition model, and the target label recognition model is used to identify the image label of the image to be identified. It can be seen that the implementation of the present invention can train a label recognition model by using sample images of various sizes including style labels and element labels, and then can obtain a label recognition model that recognizes image labels of images of various sizes, thereby reducing the situation in which only the image labels corresponding to the main features in the image are considered when identifying image labels, while ignoring the image labels corresponding to other features except the main features, thereby improving the accuracy and efficiency of image label recognition and the quality of publicity.

[0111] Embodiment 2

[0112] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of another method for training a tag recognition model disclosed in an embodiment of the present invention. Figure 2 The training method of the tag recognition model described above can be applied to a server or a terminal device, and the embodiment of the present invention does not limit this. Figure 2 As shown, the training method of the label recognition model may include the following operations:

[0113] Step 201: determine a sample image set.

[0114] Step 202: Determine sample adjustment parameters corresponding to all sample images in the sample image set according to a preset image processing strategy.

[0115] Among them, the image processing strategy may be a strategy for performing image processing on all sample images in a sample image set, the image processing strategy may include an image size adjustment strategy, an image resolution adjustment strategy, an image pixel adjustment strategy, etc., the sample adjustment parameters may include a size adjustment parameter corresponding to the image size adjustment strategy, a resolution adjustment parameter corresponding to the image resolution adjustment strategy, a pixel adjustment parameter corresponding to the image pixel adjustment strategy, etc., the sample adjustment parameters may include at least two parameter values, all parameter values ​​included in the size adjustment parameter may be used to adjust the image size of the sample images in the sample image set, all parameter values ​​included in the size adjustment parameter may be proportional values ​​for adjusting the image size of the sample images in the sample image set, and the sizes of all parameter values ​​in the size adjustment parameter are associated with a preset size range, all parameter values ​​included in the resolution adjustment parameter may be used to adjust the resolution of the sample images in the sample image set, and all parameter values ​​included in the pixel adjustment parameter may be used to adjust the pixels of the sample images in the sample image set.

[0116] After obtaining the sample image set, at least one strategy for performing image processing on all sample images in the sample image set can be determined from the pre-set image processing strategies, and the sample adjustment parameters corresponding to each strategy can be determined as the sample adjustment parameters corresponding to all sample images in the sample image set.

[0117] In practical applications, the actual needs of the user can be determined, and the strategy corresponding to the actual needs of the user can be selected from the image processing strategy to determine the sample adjustment parameters corresponding to all sample images in the sample image set according to the strategy corresponding to the actual needs of the user. The sample adjustment parameters corresponding to all sample images in the sample image set can also be determined according to all strategies in the image processing strategy.

[0118] Step 203: divide all sample images in the sample image set according to all parameter values ​​and the number of all parameter values ​​to obtain a sub-sample image set with the same number as all parameter values.

[0119] Each sub-sample image set may include at least one sample image, and the sample images included in each sub-sample image set in all the sub-sample image sets may be different.

[0120] After determining the sample adjustment parameters corresponding to all sample images in the sample image set, the parameter values ​​of the sample adjustment parameters corresponding to all sample images in the sample image set can be determined, and all parameter value types can be determined to determine the number of all parameter values ​​based on all parameter value types, and then all sample images in the sample image set can be divided according to the number of parameter values ​​to obtain a sub-sample image set with the same number as all parameter values.

[0121] In practical applications, all sample images in the sample image set can be divided equally according to the number of parameter values, or unequally. For example, the number of parameter values ​​can be 4, that is, the sample adjustment parameter has four different parameter values, and the number of all sample images in the sample image set can be 100, that is, the sample image set contains 100 sample images. Further, all sample images in the sample image set can be divided equally according to the number of parameter values, that is, 100 sample images are divided equally to obtain 4 sub-sample image sets, and the number of sample images contained in each sub-sample image set can be 25. Alternatively, all sample images in the sample image set can be divided unequally according to the number of parameter values ​​to obtain 4 sub-sample image sets, and the number of sample images contained in each sub-sample image set can be different.

[0122] In an optional embodiment, step 203 may include the following sub-steps:

[0123] All sample images in a sample image set are divided into sub-sample image sets whose number is the same as all parameter values, and the image sizes of all sample images in the sub-sample image set are adjusted according to the parameter values ​​corresponding to each sub-sample image set; or, the image sizes of all sample images in a sample image set are adjusted according to all parameter values ​​to obtain an adjusted sample image set, and sample images with the same image size among all sample images in the adjusted sample image set are divided into the same sub-sample image set.

[0124] After determining the number of all parameter values, all sample images in the sample image set can be divided into sub-sample image sets with the same number as all parameter values, and the image sizes of all sample images in the sub-sample image set can be adjusted according to the parameter values ​​corresponding to each sub-sample image set, and the image sizes of the sample images contained in each sub-sample image set are different.

[0125] For example, the parameter value can be 32, 64, 96, and 128, then the number of parameter values ​​can be 4, and the number of all sample images in the sample image set can be 100, and then all sample images in the sample image set can be divided into 4 sub-sample image sets, and each sub-sample image set can be set to correspond to a different parameter value in turn, that is, the first sub-sample image set can correspond to a parameter value of 32, the second sub-sample image set can correspond to a parameter value of 96, and so on, and then the parameter value corresponding to each sub-sample image set can be set, and the image size of all sample images of the sub-sample image set can be reduced according to the parameter value corresponding to each sub-sample image set.

[0126] Alternatively, after determining all parameter value types, the image sizes of all sample images in the sample image set can be adjusted according to all parameter values ​​to obtain an adjusted sample image set, and sample images with the same image sizes in all sample images in the adjusted sample image set are divided into the same sub-sample image set, and the image sizes of the sample images contained in each sub-sample image set are different.

[0127] In practical applications, the image sizes of all sample images in the sample image set can be adjusted in turn according to all parameter values, or the number of adjustments for each parameter value can be determined based on the actual needs of the user to adjust the image sizes of all sample images in the sample image set according to the number of adjustments for each parameter value.

[0128] For example, when the sample adjustment parameter is a pixel adjustment parameter, the parameter value in the sample adjustment parameter may include 32 pixels, 64 pixels, 96 pixels, and 128 pixels, and the number of parameter values ​​may be 4. At this time, assuming that the number of all sample images in the sample image set is 100, the image sizes of all sample images in the sample image set may be adjusted and reduced according to the values ​​of 32 pixels, 64 pixels, 96 pixels, and 128 pixels in sequence to obtain an adjusted sample image set, and the sample images in the adjusted sample image set that are reduced in size (such as length and / or width) based on the parameter value of 32 pixels are divided into the same sub-sample image set, and the sample images in the adjusted sample image set that are reduced in size based on the parameter value of 64 pixels are divided into the same sub-sample image set, and so on, so as to obtain a sub-sample image set with the same number as all parameter values.

[0129] For another example, when the sample adjustment parameter is a size adjustment parameter, the parameter values ​​in the sample adjustment parameter may include 1 times, 2 times, 3 times, and 4 times, and the number of parameter values ​​may be 4. At this time, assuming that the number of all sample images in the sample image set may be 100, the image sizes of all sample images in the sample image set may be adjusted and reduced according to the values ​​of 1 times, 2 times, 3 times, and 4 times in sequence to obtain an adjusted sample image set, and the sample images in the adjusted sample image set whose sizes (such as length and / or width) are reduced based on the parameter value of 1 times are divided into the same sub-sample image set, and the sample images in the adjusted sample image set whose sizes are reduced based on the parameter value of 2 times are divided into the same sub-sample image set, and so on, so as to obtain a sub-sample image set with the same number as all parameter values.

[0130] In an optional embodiment, when the sample adjustment parameters include a pixel adjustment parameter and a size adjustment parameter, a parameter value that meets the preset conditions can be set as a parameter value for the size adjustment parameter, and a parameter value that does not meet the preset conditions can be set as a parameter value for the pixel adjustment parameter. For example, the parameter values ​​in the sample adjustment parameters can include 1, 2, 32, and 64. A parameter value less than 4 can be set as a parameter value for the size adjustment parameter, such as 1 and 2 in 1, 2, 32, and 64 can be multiples of the parameter value of the size adjustment parameter. A parameter value greater than 4 can be set as a parameter value for the pixel adjustment parameter, such as 32 and 64 in 1, 2, 32, and 64 can be the number of pixels of the parameter value of the pixel adjustment parameter. Then, the operation of adjusting the image sizes of all sample images in the sample image set as described above to obtain a sub-sample image set with the same number as all parameter values ​​can be performed according to the determined parameter values.

[0131] Step 204, select one of the sub-sample image sets from all the sub-sample image sets as the starting sub-sample image set, determine a predetermined label recognition model as the starting label recognition model, and train the starting label recognition model based on the starting sub-sample image set to obtain a trained label recognition model.

[0132] The initial sub-sample image set may be the first sub-sample image set to be trained among all sub-sample image sets.

[0133] After obtaining a sub-sample image set with the same number as all parameter values, one of the sub-sample image sets can be selected from all the sub-sample image sets as the starting sub-sample image set, and a predetermined label recognition model can be determined as the starting label recognition model, and the starting label recognition model can be trained based on the starting sub-sample image set to obtain a trained label recognition model.

[0134] Step 205, updating the trained label recognition model to the initial label recognition model, selecting one of the sub-sample image sets from the remaining sub-sample image sets as the initial sub-sample image set, and re-executing the operation of training the initial label recognition model based on the initial sub-sample image set to obtain the trained label recognition model.

[0135] After obtaining the trained label recognition model, the trained label recognition model can be updated to the initial label recognition model, and one of the sub-sample image sets can be selected from the remaining sub-sample image sets as the initial sub-sample image set, and the operation of training the starting label recognition model based on the starting sub-sample image set to obtain the trained label recognition model can be re-executed.

[0136] As an optional implementation, one of the subsample image sets selected from all subsample image sets can be a subsample image set with the largest image size among all subsample image sets, and, in the process of training the label recognition model, the image size corresponding to the subsample image set selected later can be smaller than the image size corresponding to the subsample image set selected previously.

[0137] In practical applications, one of the subsample image sets selected from all subsample image sets can be the subsample image set with the largest image size in all subsample image sets, and during the first training, the starting label recognition model is trained based on the subsample image set with the largest image size, and then the label recognition model can be trained for the image style in the large-size image and the image labels corresponding to all image elements. Since the area of ​​all image elements in the large-size image is also large, the recognition rate of all image elements in the large-size image can be improved, and even image elements with a small proportion in the large-size image can be accurately recognized, thereby improving the accuracy of the trained label recognition model in recognizing the image style in the large-size image and the image labels corresponding to all image elements.

[0138] In the subsequent training, since the label recognition model obtained after the first training can recognize the image style and all image elements in the large-size image, the initial label recognition model can be trained based on the sub-sample image set with gradually decreasing image size, that is, the previously trained label recognition model can be trained for the image style in the small-size image and the image labels corresponding to all image elements, which can improve the recognition rate of all image elements in the small-size image on the basis of recognizing all image elements in the large-size image, thereby improving the accuracy of the trained label recognition model in recognizing the image style in the small-size image and the image labels corresponding to all image elements. Secondly, in order to reduce the amount of calculation and improve the efficiency of model training, images with smaller image sizes are usually used for testing when testing the loss value of the model. Therefore, when training the model, using sample images with gradually decreasing image sizes for training can improve the accuracy of the final model in recognizing small-size images, making the final model more suitable for the input of small-size images.

[0139] Step 206: determine that the label recognition model corresponding to the last sub-sample image set is the target label recognition model.

[0140] After the initial label recognition model is trained based on the last sub-sample image set, the label recognition model corresponding to the last sub-sample image set may be determined as the target label recognition model.

[0141] In practical applications, the predetermined label recognition model may be trained for at least one round, and the above steps 202 to 206 may be steps for training the label recognition model in each round, and the target label recognition model may be obtained after each round of training the label recognition model.

[0142] In an optional embodiment, step 206 may further include the following sub-steps:

[0143] Sub-step 21, identifying the image labels corresponding to all other sample images in other sample image sets through the label recognition model corresponding to the last sub-sample image set, and calculating the deviation value of the image label corresponding to each other sample image through a preset loss function.

[0144] Among them, the other sample image set can be an image set used to determine the loss value of the label recognition model, the other sample images can be images used to determine the loss value of the label recognition model, the loss function can be used to determine the loss value of the label recognition model, and the deviation value of the image label corresponding to each other sample image can be the degree of deviation between the image label corresponding to each other sample image in the other sample image set and the correct image label corresponding to the other sample image when identifying the image label corresponding to the other sample image.

[0145] After the starting label recognition model is trained based on the last sub-sample image set, the label recognition model corresponding to the last sub-sample image set can be used to identify the image labels corresponding to all other sample images in other sample image sets, and the deviation value of the image label corresponding to each other sample image can be calculated through a preset loss function.

[0146] Sub-step 22, determining the loss value of the label recognition model corresponding to the last sub-sample image set according to the deviation values ​​of the image labels corresponding to all other sample images in the other sample image sets.

[0147] Among them, the loss value of the label recognition model corresponding to the last sub-sample image set can be expressed as the accuracy of the label recognition model in recognizing the image label.

[0148] After obtaining the deviation values ​​of the image labels corresponding to all other sample images in other sample image sets, the loss value of the label recognition model corresponding to the last sub-sample image set can be determined based on the deviation values ​​of the image labels corresponding to all other sample images in other sample image sets.

[0149] As an optional implementation, the loss value of the label recognition model corresponding to the last sub-sample image set can be determined as follows:

[0150] Determine the weight values ​​of the image labels corresponding to all sample images in the sample image set; determine the loss value of the label recognition model corresponding to the last sub-sample image set based on the deviation values ​​of the image labels corresponding to all sample images in the sample image set and the weight values ​​of the image labels corresponding to all sample images in the sample image set.

[0151] The weight value of each image label may be a ratio of the number of sample images corresponding to the image label in all sample images.

[0152] In practical applications, the weight values ​​of the image labels corresponding to all sample images in the sample image set can be determined, and then the deviation values ​​of the image labels corresponding to all sample images in the sample image set and the weight values ​​of the image labels corresponding to all sample images in the sample image set can be weightedly calculated to obtain the result of the weighted calculation, and the result of the weighted calculation can be the loss value of the label recognition model corresponding to the last sub-sample image set.

[0153] Sub-step 23, when the loss value of the label recognition model corresponding to the last sub-sample image set is within a preset loss range, determining that the label recognition model corresponding to the last sub-sample image set is the target label recognition model.

[0154] Among them, the preset loss range can be a range of loss values ​​set manually, or it can be obtained by gradual convergence in multiple iterative training. The preset loss range can be used to determine whether the convergence of the label recognition model corresponding to the last sub-sample image set is at minimum convergence.

[0155] After obtaining the loss value of the label recognition model corresponding to the last sub-sample image set, it can be determined whether the loss value of the label recognition model corresponding to the last sub-sample image set is within the preset loss range. When the loss value of the label recognition model corresponding to the last sub-sample image set is within the preset loss range, the convergence of the label recognition model corresponding to the last sub-sample image set can be determined to be at the minimum convergence, and then the label recognition model corresponding to the last sub-sample image set is determined to be the target label recognition model.

[0156] In practical applications, we can determine whether the convergence of the label recognition model is at the minimum convergence by determining whether the loss value of the label recognition model corresponding to the last sub-sample image set is within the preset loss range, and then determine whether the accuracy of the label recognition model in identifying image labels can be further improved, based on the accuracy of the label recognition model in identifying image labels.

[0157] In a specific implementation, the difference between the loss values ​​of the label recognition model corresponding to the last sub-sample image set in two adjacent trainings can be determined, and then the range corresponding to the minimum convergence of the label recognition model can be predicted based on the difference between the loss values ​​of the label recognition model corresponding to the last sub-sample image set in two adjacent trainings, which is the preset loss range.

[0158] As an optional implementation, the preset loss range can be used to determine whether the accuracy of the label recognition model corresponding to the last sub-sample image set in identifying image labels meets the actual needs of the user. Further, when the loss value of the label recognition model corresponding to the last sub-sample image set is within the preset loss range, it can be determined that the accuracy of the label recognition model corresponding to the last sub-sample image set in identifying image labels meets the actual needs of the user, and the label recognition model corresponding to the last sub-sample image set can be determined as the target label recognition model.

[0159] Sub-step 24, when the loss value of the label recognition model corresponding to the last sub-sample image set is not within the preset loss range, optimize the model parameters of the label recognition model to obtain the optimized label recognition model, and update the optimized label recognition model to a pre-built label recognition model to re-executing the operation of training the starting label recognition model based on the starting sub-sample image set to obtain the label recognition model corresponding to the last sub-sample image set, until the loss value of the label recognition model corresponding to the last sub-sample image set is within the preset loss range, and determine that the label recognition model corresponding to the last sub-sample image set is the target label recognition model.

[0160] Among them, model parameters may include learning rate, number of training times, number of iterations and other parameters.

[0161] When the loss value of the label recognition model corresponding to the last sub-sample image set is not within the preset loss range, it can be determined that the convergence of the label recognition model is not at the minimum convergence, and further it can be determined that the accuracy of the label recognition model in identifying image labels can be further improved. The model parameters of the label recognition model can be optimized to obtain an optimized label recognition model, and the optimized label recognition model can be updated to a pre-built label recognition model to re-executing the operation of training the starting label recognition model based on the starting sub-sample image set to obtain the label recognition model corresponding to the last sub-sample image set, until the loss value of the label recognition model corresponding to the last sub-sample image set is within the preset loss range, the label recognition model corresponding to the last sub-sample image set is determined to be the target label recognition model to ensure the accuracy of the label recognition model corresponding to the last sub-sample image set in identifying image labels.

[0162] In practical applications, when the loss value of the label recognition model corresponding to the last sub-sample image set in each round of iteration is not within the preset loss range, and the above-mentioned operation of training the starting label recognition model based on the starting sub-sample image set is re-executed, iterative training can be performed according to the starting sub-sample image set determined in the previous round of training, or the sample adjustment parameters corresponding to all sample images in the sample image set can be re-determined according to a preset image processing strategy, and then the parameter values ​​and the number of parameter values ​​different from the previous round of training can be determined, and all sample images in the sample image set can be re-divided, so as to obtain a starting sub-sample image set different from the previous round of training, so as to complete the iterative training according to the starting sub-sample image set different from the previous round of training.

[0163] For example, the sample adjustment parameters determined according to a preset image processing strategy in the previous round of training may be an image resolution adjustment strategy, while in this round of training, the sample adjustment parameters corresponding to all sample images in the sample image set may be re-determined as an image size adjustment strategy according to the preset image processing strategy; the sample adjustment parameters determined in the previous round of training may be an image size adjustment strategy, and the determined parameter values ​​may include 32 and 64, while the sample adjustment parameters determined in this round of training may also be an image size adjustment strategy, and the determined parameter values ​​may include the same as or different from the parameter values ​​in the previous round of training, such as the parameter values ​​determined in this round of training may include 96 and 128, and the determined parameter values ​​may also be different from the combination of parameter values ​​in the previous round of training, such as a combination of 32, 64, and 96.

[0164] It can be seen that this optional embodiment can determine a sample image set, determine the sample adjustment parameters corresponding to all sample images in the sample image set according to a preset image processing strategy, the sample adjustment parameters include at least two parameter values, divide all sample images in the sample image set according to all parameter values ​​and the number of all parameter values, and obtain a sub-sample image set with the same number as all parameter values, each sub-sample image set includes at least one sample image, and the sample images included in each sub-sample image set in all sub-sample image sets are different, select one of the sub-sample image sets from all sub-sample image sets as the starting sub-sample image set, and determine a predetermined label recognition model as the starting label recognition model, and train the starting label recognition model based on the starting sub-sample image set to obtain a trained label recognition model, update the trained label recognition model to the initial label recognition model, and select one of the sub-sample image sets from the remaining sub-sample image sets as the initial sub-sample image set, and re-perform the operation of training the starting label recognition model based on the starting sub-sample image set to obtain the trained label recognition model, and determine the label recognition model corresponding to the last sub-sample image set as the target label recognition model. It can be seen that the implementation of the present invention can train a label recognition model through sample images of various sizes including style labels and element labels, and then obtain a label recognition model that recognizes image labels of images of various sizes, thereby reducing the situation where only image labels corresponding to main features in the image are considered when recognizing image labels, while ignoring image labels corresponding to other features except the main features, thereby improving the accuracy and efficiency of image label recognition and enhancing the quality of publicity.

[0165] Embodiment 3

[0166] See also Figure 3 , Figure 3 is a flow chart of a method for identifying image tags disclosed in an embodiment of the present invention. Figure 3 The method for identifying image tags described above can be applied to a server or a terminal device, and the embodiment of the present invention does not limit this. Figure 3 As shown, the method for identifying image tags may include the following operations:

[0167] Step 301: Acquire at least one image to be recognized of a target object.

[0168] The target object may be determined based on the user's business needs.

[0169] In practical applications, the business needs of the user may be obtained, a target object associated with the business needs of the user may be determined, and then at least one image to be identified for the target object may be obtained.

[0170] For example, if a user wants to know the game features of medieval games, the user's business demand may be a demand for medieval games, and then games related to medieval games may be determined from all games, and at least one image to be identified in all games related to medieval games may be obtained.

[0171] In an optional embodiment, after determining the target object associated with the user's business needs, relevant videos for the target object can also be obtained, and then the first frame image and the Nth frame image in the video for the target object can be extracted, and the first frame image and the Nth frame image can be determined as images to be identified.

[0172] The Nth frame may be the first frame image of the Nth second set manually.

[0173] Step 302: input each image to be identified into a target label recognition model to obtain an image label corresponding to each image to be identified.

[0174] After obtaining at least one image to be identified, each image to be identified may be input into a target label recognition model, and then the target label recognition model may identify an image label corresponding to each image to be identified.

[0175] In practical applications, the target label recognition model may be trained using the method of Embodiment 1 or Embodiment 2.

[0176] Step 303: merge the image labels corresponding to each image to be identified to generate a target image label for the target object.

[0177] After obtaining the image label corresponding to each image to be identified, the image label corresponding to each image to be identified may be merged to generate a target image label for the target object.

[0178] In an optional embodiment, when the image to be identified is an image obtained based on a video, a target image tag for the target object may be generated, and the target image tag may be determined to be a video tag of the video.

[0179] In an optional embodiment, step 302 may include the following sub-steps:

[0180] Sub-step 41, identifying the image label corresponding to each image to be identified through the target label identification model, and determining the confidence of the image label corresponding to each image to be identified.

[0181] The confidence level can be based on the reliability of the image label corresponding to the image to be identified by the target label recognition model.

[0182] After obtaining at least one image to be identified, the target label recognition model can be used to identify the image label corresponding to each image to be identified, and the confidence of the image label corresponding to each image to be identified can be determined.

[0183] Sub-step 42, determining a confidence threshold of each image tag, and for each image to be identified, comparing the confidence of the image tag corresponding to the image to be identified with the confidence threshold of the image tag corresponding to the image to be identified.

[0184] The confidence threshold may be manually set or obtained based on the loss value corresponding to each image label in the target label recognition model.

[0185] After determining the confidence of the image label corresponding to each image to be identified, the confidence threshold of each image label in the target recognition label model can be determined, and for each image to be identified, the confidence of the image label corresponding to the image to be identified and the confidence threshold of the image label corresponding to the image to be identified can be compared.

[0186] Sub-step 43, for each image to be identified, when the confidence of the image label corresponding to the image to be identified is greater than the confidence threshold of the image label corresponding to the image to be identified, the target label recognition model outputs the image label corresponding to the image to be identified.

[0187] After determining the confidence of the image label corresponding to each image to be identified, for each image to be identified, when the confidence of the image label corresponding to the image to be identified is greater than the confidence threshold of the image label corresponding to the image to be identified, it can be considered that the reliability of the image label identified by the target label recognition model is high, and then the target label recognition model can output the image label corresponding to the image to be identified. When the confidence of the image label corresponding to the image to be identified is less than the confidence threshold of the image label corresponding to the image to be identified, it can be considered that the reliability of the image label identified by the target label recognition model is low, that is, there is a possibility of unreliable identification, and then the image labels with confidence less than the confidence threshold can be filtered.

[0188] In practical applications, since the target label recognition model can identify at least one image label in the image to be identified, it can then determine the reliability of each identified image label to output an image label with higher reliability and filter out image labels with higher reliability from all identified image labels, thereby improving the accuracy of identifying image labels and enhancing the quality of publicity.

[0189] It can be seen that this optional embodiment can obtain at least one image to be identified of the target object, input each image to be identified into the target label recognition model, obtain the image label corresponding to each image to be identified, merge the image labels corresponding to each image to be identified, and generate the target image label for the target object. It can be seen that the implementation of the present invention can identify the image label corresponding to the image based on the target label recognition model, improve the accuracy of identifying the image label, and enhance the quality of the publicity.

[0190] Embodiment 4

[0191] See also Figure 4 , Figure 4 : is a schematic diagram of a structure of a training device for a label recognition model disclosed in an embodiment of the present invention. Figure 4 The training device of the label recognition model described above can be applied to a server or a terminal device, and the embodiment of the present invention does not limit this. Figure 4 As shown, the sending device of the network interaction room may include:

[0192] A determination module 401 is used to determine a sample image set, where the sample image set includes at least one sample image within a preset size range, and image tags corresponding to all sample images in the sample image set include at least one style tag and / or at least one element tag;

[0193] The training module 402 is used to train a predetermined label recognition model according to a sample image set to obtain a target label recognition model, and the target label recognition model is used to recognize the image label of the image to be recognized.

[0194] As an optional implementation, the training module 402 trains the predetermined label recognition model according to the sample image set to obtain the target label recognition model in the following specific manner:

[0195] According to a preset image processing strategy, sample adjustment parameters corresponding to all sample images in a sample image set are determined, and the sample adjustment parameters include at least two parameter values; according to all parameter values ​​and the number of all parameter values, all sample images in the sample image set are divided to obtain sub-sample image sets with the same number as all parameter values, each sub-sample image set includes at least one sample image, and the sample images included in each sub-sample image set in all sub-sample image sets are different; one of the sub-sample image sets is selected from all sub-sample image sets as a starting sub-sample image set, and a predetermined label recognition model is determined as a starting label recognition model, and the starting label recognition model is trained based on the starting sub-sample image set to obtain a trained label recognition model; the trained label recognition model is updated to an initial label recognition model, and one of the sub-sample image sets is selected from the remaining sub-sample image sets as an initial sub-sample image set, and the training of the starting label recognition model based on the starting sub-sample image set is re-executed to obtain a trained label recognition model; and the label recognition model corresponding to the last sub-sample image set is determined to be a target label recognition model.

[0196] As an optional implementation, the sample adjustment parameter includes a size adjustment parameter, and all parameter values ​​included in the size adjustment parameter are used to adjust the image size of the sample image in the sample image set;

[0197] In the training module 402, all sample images in the sample image set are divided according to all parameter values ​​and the number of all parameter values ​​to obtain a sub-sample image set with the same number as all parameter values ​​in a specific manner:

[0198] Divide all sample images in a sample image set into sub-sample image sets with the same number as all parameter values, and adjust the image sizes of all sample images in the sub-sample image set according to the parameter value corresponding to each sub-sample image set; or, adjust the image sizes of all sample images in a sample image set according to all parameter values ​​to obtain an adjusted sample image set; and divide sample images with the same image size among all sample images in the adjusted sample image set into the same sub-sample image set.

[0199] As an optional implementation, one of the sub-sample image sets selected from all sub-sample image sets is the sub-sample image set with the largest image size among all sub-sample image sets; and, in the process of training the label recognition model, the image size corresponding to the sub-sample image set selected last time is smaller than the image size corresponding to the sub-sample image set selected last time.

[0200] As an optional implementation, the specific method of determining the label recognition model corresponding to the last sub-sample image set as the target label recognition model in the training module 402 is:

[0201] The image labels corresponding to all other sample images in other sample image sets are identified through the label recognition model corresponding to the last sub-sample image set, and the deviation value of the image label corresponding to each other sample image is calculated through a preset loss function; the loss value of the label recognition model corresponding to the last sub-sample image set is determined according to the deviation value of the image labels corresponding to all other sample images in other sample image sets; when the loss value of the label recognition model corresponding to the last sub-sample image set is within a preset loss range, the label recognition model corresponding to the last sub-sample image set is determined to be the target label recognition model; when the label recognition model corresponding to the last sub-sample image set is not within the preset loss range, the model parameters of the label recognition model are optimized to obtain the optimized label recognition model, and the optimized label recognition model is updated to the pre-constructed label recognition model to re-execute the operation of training the starting label recognition model based on the starting sub-sample image set to obtain the label recognition model corresponding to the last sub-sample image set, until the loss value of the label recognition model corresponding to the last sub-sample image set is within the preset loss range, the label recognition model corresponding to the last sub-sample image set is determined to be the target label recognition model.

[0202] As an optional implementation, the specific method of determining the sample image set in the determination module 401 is:

[0203] A sample material image is obtained, where the sample material image has at least one element label; a first sample image is obtained, and a second sample image is generated based on the sample material image and the first sample image, where the image label corresponding to the second sample image is the element label of the sample material image; style transfer is performed on the second sample image based on a predetermined style label and a pre-constructed style transfer model to obtain a third sample image, where the style label of the third sample image is different from the style label of the second sample image; a sample image set is generated based on the second sample image and the third sample image.

[0204] It can be seen that this optional embodiment can determine a sample image set, the sample image set includes at least one sample image in a preset size range, and the image labels corresponding to all sample images in the sample image set include at least one style label and / or at least one element label; according to the sample image set, a predetermined label recognition model is trained to obtain a target label recognition model, and the target label recognition model is used to identify the image label of the image to be identified. It can be seen that the implementation of the present invention can train a label recognition model by using sample images of various sizes including style labels and element labels, and then can obtain a label recognition model that recognizes image labels of images of various sizes, thereby reducing the situation in which only the image labels corresponding to the main features in the image are considered when identifying image labels, while ignoring the image labels corresponding to other features except the main features, thereby improving the accuracy and efficiency of image label recognition and the quality of publicity.

[0205] Embodiment 5

[0206] See also Figure 5 , Figure 5 is a schematic diagram of a structure of a device for identifying image tags disclosed in an embodiment of the present invention. Figure 5 The device for identifying image tags described above can be applied to a server or a terminal device, and the embodiment of the present invention does not limit this. Figure 5 As shown, the device for identifying image tags may include:

[0207] An acquisition module 501 is used to acquire at least one image to be recognized of a target object;

[0208] The recognition module 502 is used to input each image to be recognized into the target label recognition model to obtain the image label corresponding to each image to be recognized;

[0209] The generation module 503 is used to merge the image labels corresponding to each image to be identified to generate a target image label for the target object.

[0210] As an optional implementation, the recognition module 502 inputs each image to be recognized into the target label recognition model, and obtains the image label corresponding to each image to be recognized in the following specific manner:

[0211] Through the target label recognition model, the image label corresponding to each image to be recognized is identified, and the confidence of the image label corresponding to each image to be recognized is determined; the confidence threshold of each image label is determined, and for each image to be recognized, the confidence of the image label corresponding to the image to be recognized and the confidence threshold of the image label corresponding to the image to be recognized are compared; for each image to be recognized, when the confidence of the image label corresponding to the image to be recognized is greater than the confidence threshold of the image label corresponding to the image to be recognized, the target label recognition model outputs the image label corresponding to the image to be recognized.

[0212] It can be seen that this optional embodiment can obtain at least one image to be identified of the target object, input each image to be identified into the target label recognition model, obtain the image label corresponding to each image to be identified, merge the image labels corresponding to each image to be identified, and generate the target image label for the target object. It can be seen that the implementation of the present invention can identify the image label corresponding to the image based on the target label recognition model, improve the accuracy of identifying the image label, and enhance the quality of the publicity.

[0213] Embodiment 6

[0214] See also Figure 6 , Figure 6 FIG. 1 is a schematic diagram of the structure of another training device for a label recognition model disclosed in an embodiment of the present invention. Figure 6 As shown, the training device of the label recognition model may include:

[0215] A memory 601 storing executable program codes;

[0216] a processor 602 coupled to the memory 601;

[0217] The processor 602 calls the executable program code stored in the memory 601 to execute the steps in the training method of the label recognition model described in the first embodiment of the present invention or the second embodiment of the present invention.

[0218] Embodiment 7

[0219] See also Figure 7 , Figure 7 FIG. 1 is a schematic diagram of another structure of a device for intelligently controlling and identifying image tags disclosed in an embodiment of the present invention. Figure 7 As shown, the device for identifying image tags may include:

[0220] A memory 701 storing executable program codes;

[0221] a processor 702 coupled to the memory 701;

[0222] The processor 702 calls the executable program code stored in the memory 701 to execute the steps in the method for identifying image tags described in the third embodiment of the present invention.

[0223] Embodiment 8

[0224] An embodiment of the present invention discloses a computer-storable medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps in the training method of the label recognition model described in Embodiment 1 of the present invention or Embodiment 2 of the present invention, and execute the steps in the method of recognizing image labels described in Embodiment 3 of the present invention.

[0225] Embodiment 9

[0226] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the training method of the label recognition model described in Embodiment 1 or Embodiment 2, and to execute the steps in the method for identifying image labels described in Embodiment 3 of the present invention.

[0227] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0228] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0229] Finally, it should be noted that the training of the label recognition model and the method and device for identifying image labels disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, and are only used to illustrate the technical scheme of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical schemes described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical schemes from the spirit and scope of the technical schemes of the embodiments of the present invention.

Claims

1. A training method for a label recognition model, characterized in that: The method comprises: Determine a sample image set, wherein the sample image set includes at least one sample image within a preset size range, and image tags corresponding to all the sample images in the sample image set include at least one style tag and / or at least one element tag; According to the sample image set, a predetermined label recognition model is trained to obtain a target label recognition model, wherein the target label recognition model is used to recognize image labels of the images to be recognized; The step of training a predetermined label recognition model according to the sample image set to obtain a target label recognition model includes: According to a preset image processing strategy, determine sample adjustment parameters corresponding to all the sample images in the sample image set, wherein the sample adjustment parameters include at least two parameter values; Dividing all the sample images in the sample image set according to all the parameter values ​​and the number of all the parameter values ​​to obtain subsample image sets having the same number as all the parameter values, each of the subsample image sets including at least one sample image, and the sample images included in each of the subsample image sets in all the subsample image sets are different; Selecting one of the subsample image sets from all the subsample image sets as a starting subsample image set, determining a predetermined label recognition model as a starting label recognition model, and training the starting label recognition model based on the starting subsample image set to obtain a trained label recognition model; Updating the trained label recognition model to the starting label recognition model, selecting one of the subsample image sets from the remaining subsample image sets as the starting subsample image set, and re-executing the operation of training the starting label recognition model based on the starting subsample image set to obtain the trained label recognition model; Determine the label recognition model corresponding to the last sub-sample image set as the target label recognition model; The step of determining the label recognition model corresponding to the last sub-sample image set as the target label recognition model includes: Using the label recognition model corresponding to the last sub-sample image set, identify the image labels corresponding to all other sample images in the other sample image sets, and calculate the deviation value of the image label corresponding to each of the other sample images using a preset loss function; Determining a loss value of a label recognition model corresponding to the last sub-sample image set according to deviation values ​​of image labels corresponding to all other sample images in the other sample image set; When the loss value of the label recognition model corresponding to the last sub-sample image set is within a preset loss range, determining the label recognition model corresponding to the last sub-sample image set as the target label recognition model; When the loss value of the label recognition model corresponding to the last sub-sample image set is not within the preset loss range, the model parameters of the label recognition model are optimized to obtain the optimized label recognition model, and the optimized label recognition model is updated to the pre-constructed label recognition model to re-execute the operation of training the starting label recognition model based on the starting sub-sample image set to obtain the label recognition model corresponding to the last sub-sample image set, until the loss value of the trained label recognition model is within the preset loss range, and the trained label recognition model is determined to be the target label recognition model.

2. The training method of the label recognition model according to claim 1, characterized in that: The sample adjustment parameters include size adjustment parameters, and all the parameter values ​​included in the size adjustment parameters are used to adjust the image size of the sample images in the sample image set; The step of dividing all the sample images in the sample image set according to all the parameter values ​​and the number of all the parameter values ​​to obtain a sub-sample image set having the same number as all the parameter values ​​comprises: Dividing all the sample images in the sample image set into sub-sample image sets whose number is the same as all the parameter values, and adjusting the image sizes of all the sample images in the sub-sample image set according to the parameter value corresponding to each sub-sample image set; or, Adjust the image sizes of all the sample images in the sample image set according to all the parameter values ​​to obtain the adjusted sample image set; The sample images having the same image size among all the sample images in the adjusted sample image set are divided into the same sub-sample image set.

3. The training method of the label recognition model according to claim 2, characterized in that: One of the sub-sample image sets selected from all the sub-sample image sets is a sub-sample image set with the largest image size among all the sub-sample image sets; Furthermore, in the process of training the label recognition model, the image size corresponding to the sub-sample image set selected at a later time is smaller than the image size corresponding to the sub-sample image set selected at a previous time.

4. The training method of the label recognition model according to claim 1, characterized in that: The step of determining a sample image set comprises: Acquire a sample material image, wherein the sample material image has at least one element tag; Acquire a first sample image, and generate a second sample image according to the sample material image and the first sample image, wherein the image label corresponding to the second sample image is the element label of the sample material image; Performing style migration on the second sample image according to a predetermined style label and a pre-constructed style migration model to obtain a third sample image, wherein the style label of the third sample image is different from the style label of the second sample image; A sample image set is generated according to the second sample image and the third sample image.

5. A method for identifying image labels, characterized in that: The method comprises: Acquire at least one image to be identified of a target object; Input each of the images to be identified into a target label recognition model to obtain an image label corresponding to each of the images to be identified; the target label recognition model is a target label recognition model obtained by the label recognition model training method according to any one of claims 1 to 4; The image labels corresponding to each of the to-be-recognized images are merged to generate a target image label for the target object.

6. The method for identifying image tags according to claim 5, characterized in that: The step of inputting each of the images to be identified into a target label recognition model to obtain an image label corresponding to each of the images to be identified includes: Identify the image label corresponding to each of the to-be-identified images through a target label recognition model, and determine the confidence level of the image label corresponding to each of the to-be-identified images; Determining a confidence threshold of each of the image labels, and for each of the images to be identified, comparing the confidence of the image label corresponding to the image to be identified with the confidence threshold of the image label corresponding to the image to be identified; For each of the images to be identified, when the confidence of the image label corresponding to the image to be identified is greater than the confidence threshold of the image label corresponding to the image to be identified, the target label recognition model outputs the image label corresponding to the image to be identified.

7. A training device for a label recognition model, characterized in that: The device comprises: A determination module, configured to determine a sample image set, wherein the sample image set includes at least one sample image within a preset size range, and image labels corresponding to all the sample images in the sample image set include at least one style label and / or at least one element label; A training module, used for training a predetermined label recognition model according to the sample image set to obtain a target label recognition model, wherein the target label recognition model is used to recognize image labels of images to be recognized; In the training module, the predetermined label recognition model is trained according to the sample image set to obtain the target label recognition model in the following specific manner: According to a preset image processing strategy, the sample adjustment parameters corresponding to all the sample images in the sample image set are determined, and the sample adjustment parameters include at least two parameter values; according to all the parameter values ​​and the number of all the parameter values, all the sample images in the sample image set are divided to obtain sub-sample image sets with the same number as all the parameter values, each of the sub-sample image sets includes at least one sample image, and the sample images included in each of the sub-sample image sets in all the sub-sample image sets are different; one of the sub-sample image sets is selected from all the sub-sample image sets as the starting sub-sample image set, and a predetermined label recognition model is determined as the starting label recognition model, and the starting label recognition model is trained based on the starting sub-sample image set to obtain a trained label recognition model; the trained label recognition model is updated to the starting label recognition model, and one of the sub-sample image sets is selected from the remaining sub-sample image sets as the starting sub-sample image set, and the operation of training the starting label recognition model based on the starting sub-sample image set to obtain a trained label recognition model is re-executed; the label recognition model corresponding to the last sub-sample image set is determined to be the target label recognition model; The specific method of determining the label recognition model corresponding to the last sub-sample image set as the target label recognition model in the training module is: The image labels corresponding to all other sample images in the other sample image sets are identified by the label recognition model corresponding to the last subsample image set, and the deviation value of the image label corresponding to each of the other sample images is calculated by a preset loss function; the loss value of the label recognition model corresponding to the last subsample image set is determined according to the deviation value of the image labels corresponding to all the other sample images in the other sample image sets; when the loss value of the label recognition model corresponding to the last subsample image set is within a preset loss range, the label recognition model corresponding to the last subsample image set is determined to be the target label recognition model; when the loss value of the label recognition model corresponding to the last subsample image set is not within the preset loss range, the model parameters of the label recognition model are optimized to obtain an optimized label recognition model, and the optimized label recognition model is updated to the pre-constructed label recognition model, so as to re-execute the operation of training the starting label recognition model based on the starting subsample image set to obtain the label recognition model corresponding to the last subsample image set, until the loss value of the trained label recognition model is within the preset loss range, the trained label recognition model is determined to be the target label recognition model.

8. A device for identifying image tags, characterized in that: The device comprises: An acquisition module, used to acquire at least one image to be identified of a target object; A recognition module, used for inputting each of the images to be recognized into a target label recognition model to obtain an image label corresponding to each of the images to be recognized; the target label recognition model is a target label recognition model obtained by the label recognition model training method according to any one of claims 1 to 4; A generation module is used to merge the image labels corresponding to each of the images to be identified to generate a target image label for the target object.

Citation Information

Patent Citations

  • Method for implanting advertisement into video and computer equipment

    CN110163640A

  • Detection model training method and device, computer equipment and storage medium

    CN110599503A

  • Training method of image recognition model, and image recognition method and device

    CN112990390A

  • Training method and device, image quality determination method and device, and electronic equipment

    CN113592807A