Patent Description:
With the wide application of image recognition technology, image data become the essential basic data in image processing. The processing of basic data sets is the key step in image processing technology. One of the most important and difficult tasks is to let the computer understand the image semantics, and image annotation is the key technology. Image annotation includes single-tag annotation and multi-tag annotation. For example, an image includes features of blue sky, white cloud and grassland. If only the feature of blue sky on the image is annotated, the image annotation is single-tag annotation. If the three features of blue sky, white cloud and grassland on the image are annotated, the image annotation is multi-tag annotation.

In the related technology, the image annotation process is almost completely manual. Since single-tag annotation only needs annotating one tag while multi-tag annotation needs annotating multiple tags, the acquisition of image data sets in the multi-tag annotation becomes more complicated as compared with the acquisition of image data sets in the single-tag annotation. Especially for images with many features, the number of tags for multi-tag annotation increases drastically with the increase of the number of images. A lot of manpower and material resources are consumed to annotate a complete multi-tag data set. <NPL>, discloses an automatic tag propagation tool, which enriches an initial tag with other related tags by using the tag recommendation based on the word co-occurrence analysis and includes Dice, Cosine and Mutual information.

The disclosure provides an annotation method and device, and a storage medium as defined by the claims.

It should be understood that the above general description and the following detailed description are only exemplary and explanatory, rather than limiting the disclosure.

The accompanying drawings, which are incorporated in and constitute a part of this description, illustrate embodiments consistent with the disclosure and along with the description, serve to explain the principles of the disclosure.

Exemplary embodiments are described in detail herein, examples of which are illustrated in the accompanying drawings. The implementations set forth in the following description of exemplary embodiments do not represent all implementations consistent with the disclosure. Instead, they are merely examples of apparatuses and methods in accordance with aspects related to the disclosure as recited in the appended claims.

<FIG> is a flowchart of an annotation method according to one exemplary embodiment. As illustrated in <FIG>, the method includes the following operations.

At block S11, a first probability value that a first sample image is annotated with an Nth tag when the first sample image is annotated with an Mth tag is determined based on first tag information of a first image set. M and N are unequal and are positive integers.

Here, the first image set may be an image set in a certain application scenario. For example, the image set may be a face image set in a face recognition application scenario, and the image set may be a license plate image set in a license plate recognition application scenario. The first tag information may be tag information corresponding to image features in the first image. For example, the first image is a landscape picture, and the landscape picture includes image features such as grassland, blue sky and white cloud. If the image features grass, blue sky and white cloud in the landscape picture are annotated respectively by tag <NUM>, tag <NUM> and tag <NUM>, the first tag information includes tag <NUM> indicating grass, tag <NUM> indicating blue sky and tag <NUM> indicating white cloud.

The first tag information may be expressed by a feature vector. For example, the feature vector of the first tag information of the landscape picture is expressed as X={<NUM>, <NUM>, <NUM>}, where <NUM>, <NUM>, <NUM> are respectively tag values corresponding to tag <NUM>, tag <NUM> and tag <NUM>. Here, the Mth tag and the Nth tag are different types of tags.

Here, taking a landscape picture set as an example of the first image set, the process of determining the first probability value is described. The landscape picture set includes picture A, picture B and picture C. The pictures in the landscape picture set include three image features including grassland, blue sky and white cloud. It should be noted that the landscape picture may only include one or two of the three image features, or all of the three image features are annotated.

Table <NUM> illustrates the situation that the landscape pictures are annotated, "/" represents that the image feature is not annotated or the landscape picture does not contain the corresponding feature. Here, it should be noted that the tag values may be set flexibly according to needs. In this example, referring to <FIG>, the tag values of tag <NUM>, tag <NUM> and tag <NUM> respectively corresponding to grassland, blue sky and white cloud are respectively set to be <NUM>, <NUM> and <NUM>.

It can be seen that all of picture A, picture B and picture C in the landscape picture set are annotated with <NUM>. In this case, both of picture B and picture C are annotated with <NUM>, and thus the first probability value that the picture is annotated with <NUM> is <NUM>/<NUM>. Only picture C is annotated with <NUM>, and thus the first probability value that the picture is annotated with <NUM> is <NUM>/<NUM>. In this way, it is determined that, when a picture is annotated with <NUM>, the first probability value that the picture is annotated with <NUM> is <NUM>/<NUM> and the first probability value that the picture is annotated with <NUM> is <NUM>/<NUM>.

Picture B and picture C in the landscape picture set are annotated with <NUM>. In this case, both of picture B and picture C are annotated with <NUM>, and thus the first probability value that the picture is annotated with <NUM> is <NUM>. Only picture C is annotated with <NUM>, and thus the first probability value that the picture is annotated with <NUM> is <NUM>/<NUM>. In this way, it is determined that, when a picture is annotated with <NUM>, the first probability value that the picture is annotated with <NUM> is <NUM> and the first probability value that the picture is annotated with <NUM> is <NUM>/<NUM>.

Picture C in the landscape picture set is annotated with <NUM>. In this case, picture C is annotated with <NUM>, and thus the first probability value that the picture is annotated with <NUM> is <NUM>. Picture C is annotated with <NUM>, and thus the first probability value that the picture is annotated with <NUM> is <NUM>. In this way, it is determined that, when a picture is annotated with <NUM>, the first probability value that the picture is annotated with <NUM> is <NUM>, and the first probability value that the picture is annotated with <NUM> is <NUM>. The above determination of the first probability value will be used in subsequent operation S12.

In block S12, the first probability value is added to second tag information of a second sample image annotated with the Mth tag in a second image set.

Here, the second tag information may be expressed by a feature vector. Also taking the landscape picture set as an example, a process of adding the first probability value is described. The landscape picture set includes picture A, picture B and picture C. The pictures in the landscape picture set include three image features including grassland, blue sky and white cloud. Table <NUM> illustrates the situation that the landscape pictures are annotated before the first probability value is added. "/" represents that the image feature is not annotated or the picture does not contain the corresponding feature. Here, it should be noted that the tag values <NUM>, <NUM> and <NUM> in Table <NUM> may be set flexibly according to the needs.

Here, the second tag information of picture A, picture B and picture C in the landscape picture set before the first probability value is added is expressed by feature vectors. The feature vectors corresponding to picture A, picture B and picture C are respectively represented as A={<NUM>, <NUM>, <NUM>}, B={<NUM>, <NUM>, <NUM>},and C={<NUM>, <NUM>, <NUM>}. Here, the unannotated image feature is expressed as <NUM> in the feature vector.

Based on the determination process of the first probability value in operation S11, the following contents can be derived.

When picture A is annotated with <NUM>, the first probability value that picture A is annotated with <NUM> is <NUM>/<NUM>, and the first probability value that picture A is annotated with <NUM> is <NUM>/<NUM>.

When picture B is annotated with <NUM>, the first probability value that picture B is annotated with <NUM> is <NUM>, and the first probability value that picture B is annotated with <NUM> is <NUM>/<NUM>.

When picture C is annotated with <NUM>, the first probability value that picture C is annotated with <NUM> is <NUM>, and the first probability value that picture C is annotated with <NUM> is <NUM>.

According to the above contents, the second tag information of picture A after the first probability value is added is represented as A={<NUM>, <NUM>/<NUM>, <NUM>/<NUM>}.

The second tag information of picture B after the first probability value is added is represented as B={<NUM>, <NUM>, <NUM>/<NUM>}.

The second tag information of picture C after the first probability value is added is represented as C={<NUM>, <NUM>, <NUM>}.

Table <NUM> illustrates the situation that the landscape pictures are annotated after the first probability value is added.

Here, referring to <FIG>, taking a face recognition application scenario, a method for applying the image set obtained in the embodiment of the disclosure to face recognition training is disclosed. The method includes the following operations.

In operation <NUM>, a face picture set is acquired and face features of face pictures in the face picture set are annotated to obtain a first image set. The face features include eyes, nose, mouth, hair, etc. Here, each face feature corresponds to a tag. For example, eyes correspond to tag <NUM>, nose corresponds to tag <NUM>, etc..

In operation <NUM>, a first probability value that a first sample image is annotated with an Nth tag when the first sample image is annotated with an Mth tag is determined based on first tag information of a first image set. M and N are unequal and are positive integers. Here, the first tag information includes information for annotating face features.

In operation <NUM>, the first probability value is added to second tag information of a second sample image annotated with the Mth tag in a second image set to obtain the updated second image set.

In operation <NUM>, a face recognition model is trained by using the updated second image set as a training sample for the face recognition model.

In the embodiment of the disclosure, a first probability value that a first sample image is annotated with an Nth tag when the first sample image is annotated with an Mth tag is determined based on first tag information of a first image set. Therefore, an associated relationship between the Mth tag and the Nth tag can be established through the first probability value. The first probability value is added to second tag information of a second sample image annotated with the Mth tag in a second image set. In this way, since the associated relationship between the Mth tag and the Nth tag is established through the first probability value, the first probability value can be directly added to the second tag information of the second sample images annotated with the Mth tag in the second image set based on the associated relationship, without annotating based on image features manually recognized, thereby improving annotation efficiency in multi-tag images.

<FIG> is a flowchart of an annotation method according to one exemplary embodiment. As illustrated in <FIG>, before operation S11 that the first probability value that the first sample image is annotated with the Nth tag when the first sample image is annotated with the Mth tag is determined based on the first tag information of the first image set, the method further includes the following operations.

In block S21, a third image set in a target application scenario is acquired.

Here, the target application scenario includes a face recognition application scenario and may include any scenario such as a license plate recognition application scenario, in which the annotated image sample set is to be applied. Taking the face recognition application scenario as an example, the third image set may include a plurality of face pictures. The face pictures may be shot in a specific lighting environment, at a specific shooting angle and a specific distance. For example, a face image sample set is obtained in an application scenario having light intensity of 1000lux, a camera lens shooting angle of <NUM> degrees upwards relative to the horizontal plane, and a shooting distance from the person to the camera of <NUM> meter. Here, the third image set may be an existing data set.

At block S22, different image features of images in the third image set are annotated by different types of tags to obtain the first image set.

Here, the image features may include one or more of the following features: texture features, color features, shape features or the like in the images. Here, the different types of tags may be tags corresponding to different tag values. Taking a face image as an example, a face image may include eyes, nose, mouth, hair and other shape features, which may be expressed as <NUM>, <NUM>, <NUM> and <NUM> respectively. A face image may also include features including black hairs and yellow skin, and the color features of black and yellow may be expressed as <NUM> and <NUM> respectively. Here, all different image features in the images in the third image set may be annotated.

<FIG> is a flowchart of an annotation method according to one exemplary embodiment. As illustrated in <FIG>, the method further includes operations as follows.

At block S31, the second sample images in the second image set are classified according to the type of tag to obtain subsets of the second image set. All of the sample images in the same subset are annotated with the Mth tag.

For example, the second sample images in the second image set include A1, A2, A3, A4, A5, A6, A7, A8 and A9. Taking the landscape picture as an example of the second sample images, the landscape image has three image features including blue sky, white cloud and grassland. The above pictures are respectively expressed by feature vectors as follows.

A first dimension, a second dimension and a third dimension of the feature vector are respectively used to indicate whether blue sky, white cloud and grassland are annotated. Specifically, a value of each dimension represents whether the corresponding image feature is annotated. <NUM> represents that the image feature corresponding to the dimension is annotated, and <NUM> represents that the image feature corresponding to the dimension is not annotated. After the images in the second image set are classified according to the type of tag annotated, the second image set includes three subsets including a first subset, a second subset and a third subset. The first subset includes A1, A3, A5 and A9; the second subset includes A4 and A7; and the third subset includes A2, A6 and A8.

The operation S12 that the first probability value is added to the second tag information of the second sample image annotated with the Mth tag in the second image set includes an operation as follows.

At S32, taking the subset as a processing unit, the first probability value is added to second tag information of the second sample images annotated with the Mth tag in the subset in bulk. For example, each subset is processed separately. For each of the subsets, the first probability value is added to second tag information of the second sample images annotated with the Mth tag in each subset in bulk.

Here, taking the subset as a processing unit, the first probability value is added in bulk to second tag information of the second sample images annotated with the Mth tag in the subset, the second sample images having the same type of tag can be processed in bulk, thereby improving the processing efficiency. For example, since A1, A3, A5 and A9 in the first subset all include tag <NUM> corresponding to the first dimension, the same first probability value is added to the tag corresponding to the second dimension and the tag corresponding to the third dimension in bulk, so as to improve the adding efficiency.

<FIG> is a flowchart of an annotation method according to one exemplary embodiment. As illustrated in <FIG>, the Nth tag includes P different sub-tags, and the operation that the first probability value that the first sample image is annotated with the Nth tag when the first sample image is annotated with the Mth tag is determined based on the first tag information of the first image set includes an operation as follows.

At S41, the first probability value that the first sample image is annotated with the P sub-tags when the first sample image is annotated with the Mth tag is determined based on the first tag information of the first image set. The first probability value includes a probability value that the first sample image is annotated with any one of the sub-tags when the first sample image is annotated with the Mth tag. P is a positive integer greater than <NUM>.

Here, also taking the landscape image as an example, the first sample images include three image features including blue sky, white cloud and grassland. The first image set includes three first sample images including picture A, picture B and picture C, and the annotation situation is illustrated in Table <NUM>.

It can be seen that, when the first sample image is annotated with the tag corresponding to grassland, pictures annotated with the sub-tag corresponding to blue sky include picture A, picture B and picture C, and thus the probability value that the first sample image is annotated with the sub-tag <NUM> is <NUM>. Pictures annotated with the sub-tag corresponding to white cloud include picture A and picture C, and thus the probability value that the first sample image is annotated with the sub-tag <NUM> is <NUM>/<NUM>. That is to say, the first probability value includes <NUM> and <NUM>/<NUM>.

Here, it is determined that, when the first sample image is annotated with the tag corresponding to grassland, the probability value that the first sample image is annotated with blue sky is <NUM>, and the probability value that the first sample image is annotated with white cloud is <NUM>/<NUM>. When the second image sample is annotated with grassland, blue sky and white cloud in the second image sample can be annotated respectively by the probabilities <NUM> and <NUM>/<NUM>. Here, the existing data set with multiple tags can be effectively utilized.

<FIG> is a flowchart of an annotation method according to one embodiment. As illustrated in <FIG>, the operation S11 that the first probability value that the first sample image is annotated with the Nth tag when the first sample image is annotated with the Mth tag is determined based on the first tag information of the first image set includes operations as follows.

At block S51, the first sample images annotated with the Mth tag and the number of the first sample images annotated with the Mth tag as a first number are acquired based on the tag information of the first sample images in the first image set. The first number is the number of the first sample images in the first image set which are annotated with the Mth tag.

Here, taking the landscape picture as an example, the Mth tag may be the tag corresponding to the image feature of grassland. Assuming that there are <NUM> first sample images annotated with the tag of grassland in the first image set, the first number is <NUM>.

At block S52, the number of the first sample images annotated with the Nth tag as a second number is acquired from the first sample images annotated with the Mth tag. The second number is the number of the first sample images annotated with the Nth tag.

Here, assuming that the Nth tag is the tag corresponding to blue sky, and assuming that the number of the first sample images annotated with the tag of blue sky in the first sample images annotated with the tag of grassland is <NUM>, the second number is <NUM>.

At block S53, the first probability value is determined based on a ratio of the second number to the first number.

Based on the first number and the second number, the first probability value is represented as <NUM>/<NUM>=<NUM>/<NUM>.

<FIG> is a flowchart of an annotation method according to one exemplary embodiment. As illustrated in <FIG>, the method further includes the following operations.

At block S61, an associated relationship table among the Mth tag, the Nth tag and the first probability value is established.

Here, still taking the landscape picture as an example, the landscape pictures include tag <NUM> for annotating grassland, tag <NUM> for annotating blue sky, and tag <NUM> for annotating white cloud. When the first sample image is annotated with tag <NUM>, the first probability value that the first sample image is annotated with tag <NUM> is <NUM>/<NUM>. When the first sample image is annotated with tag <NUM>, the first probability value that the first sample image is annotated with tag <NUM> is <NUM>/<NUM>. When the first sample image is annotated with tag <NUM>, the first probability value that the first sample image is annotated with tag <NUM> is <NUM>/<NUM>. When the first sample image is annotated with tag <NUM>, the first probability value that the first sample image is annotated with tag <NUM> is <NUM>/<NUM>. When the first sample image is annotated with tag <NUM>, the first probability value that the first sample image is annotated with tag <NUM> is <NUM>/<NUM>. When the first sample image is annotated with tag <NUM>, the first probability value that the first sample image is annotated with tag <NUM> is <NUM>/<NUM>. The associated relationship table can be shown in Table <NUM> below.

At block S62, the associated relationship table is stored.

Here, the data in Table <NUM> may be sequentially stored in a storage unit.

The operation that the first probability value is added to the second tag information of the second sample image annotated with the Mth tag in the second image set includes an operation as follows.

At block S63, the first probability value that the first sample image is annotated with the Nth tag when the first sample image is annotated with the Mth tag is queried from the associated relationship table, and the first probability value is added to the second tag information of the second sample image annotated with the Mth tag in the second image set.

Here, the first probability value that the first sample image is annotated with the Nth tag when the first sample image is annotated with the Mth tag is queried from the associated relationship table. The Mth tag and the Nth tag may be used as query index numbers to query from the associated relationship table. For example, taking Table <NUM> as an example, when the Mth tag is <NUM> and the Nth tag is <NUM>, the queried first probability value is <NUM>/<NUM>.

<FIG> is a block diagram of an annotation device according to an exemplary embodiment. As illustrated in <FIG>, the device includes a determination module <NUM> and an adding module <NUM>.

The determination module <NUM> is configured to determine, based on first tag information of a first image set, a first probability value that a first sample image is annotated with an Nth tag when the first sample image is annotated with an Mth tag. M and N are unequal and are positive integers.

The adding module <NUM> is configured to add the first probability value to second tag information of a second sample image annotated with the Mth tag in a second image set.

The device further includes an acquisition module <NUM> and an annotation module <NUM>.

The acquisition module <NUM> is configured to acquire a third image set in a target application scenario. The third image set includes third sample images.

The annotation module <NUM> is configured to annotate different image features of the third sample images by different types of tags to obtain the first image set.

The device further includes a classification module <NUM>.

The classification module <NUM> is configured to classify the second sample images in the second image set according to the type of tag, to obtain subsets of the second image set. All of the sample images in the same subset are annotated with the Mth tag.

The adding module <NUM> is further configured to, with taking the subset as a processing unit, add the first probability value to the second tag information of the second sample images annotated with the Mth tag in the subset in bulk.

The Nth tag includes P different sub-tags, and the determination module <NUM> is further configured to determine, based on the first tag information of the first image set, the first probability value that the first sample image is annotated with the P sub-tags when the first sample image is annotated with the Mth tag. The first probability value includes a probability value that the first sample image is annotated with any one of the sub-tags when the first sample image is annotated with the Mth tag. P is a positive integer greater than <NUM>.

The determination module <NUM> is further configured to acquire, based on the tag information of the first sample images in the first image set, the first sample images annotated with the Mth tag and the number of the first sample images annotated with the Mth tag as a first number; acquire, from the first sample images annotated with the Mth tag, the number of the first sample images annotated with the Nth tag as a second number; determine the first probability value based on a ratio of the second number to the first number.

The device further includes an association module <NUM>. The association module <NUM> is configured to establish an associated relationship table among the Mth tag, the Nth tag and the first probability value, and store the associated relationship table.

The determination module <NUM> is further configured to query, from the associated relationship table, the first probability value that the first sample image is annotated with the Nth tag when the first sample image is annotated with the Mth tag, and add the first probability value to second tag information of a second sample image annotated with the Mth tag in the second image set.

<FIG> is a block diagram of an annotation device according to an exemplary embodiment. As illustrated in <FIG>, the device includes a processor <NUM> and a memory <NUM> configured to store computer service capable of running on the processor <NUM>. The processor <NUM> is configured to run the computer service to execute the following operations: determining, based on first tag information of a first image set, a first probability value that a first sample image is annotated with an Nth tag when the first sample image is annotated with an Mth tag, where M and N are unequal and are positive integers; adding the first probability value to second tag information of a second sample image annotated with the Mth tag in a second image set.

The processor <NUM> is further configured to run the computer program to execute the following operations: acquiring a third image set in a target application scenario, where the third image set includes third sample images; annotating different image features of the third sample images by different types of tags to obtain the first image set.

The processor <NUM> is further configured to run the computer program to execute the following operations: classifying the second sample images in the second image set according to the type of tag to obtain subsets of the second image set, where all of the sample images in the same subset are annotated with the Mth tag; and taking the subset as a processing unit, adding in bulk the first probability value to the second tag information of the second sample images annotated with the Mth tag in the subset.

The processor <NUM> is further configured to run the computer program to execute the following operations: when the Nth tag includes P different sub-tags, determining, based on the first tag information of the first image set, the first probability value that the first sample image is annotated with the P sub-tags when the first sample image is annotated with the Mth tag, where the first probability value includes a probability value that the first sample image is annotated with any one of the sub-tags when the first sample image is annotated with the Mth tag. P is a positive integer greater than <NUM>.

The processor <NUM> is further configured to run the computer program to execute the following operations: acquiring, based on the tag information of the first sample images in the first image set, the first sample images annotated with the Mth tag and the number of the first sample images annotated with the Mth tag as a first number; acquiring, from the first sample images annotated with the Mth tag, the number of the first sample images annotated with the Nth tag as a second number; determining the first probability value based on a ratio of the second number to the first number.

The processor <NUM> is further configured to run the computer program to execute the following operations: establishing an associated relationship table among the Mth tag, the Nth tag and the first probability value; storing the associated relationship table; querying, from the associated relationship table, the first probability value that the first sample image is annotated with the Nth tag when the first sample image is annotated with the Mth tag, and adding the first probability value to the second tag information of the second sample image annotated with the Mth tag in the second image set.

The embodiment of the disclosure further provides a storage medium having stored thereon computer-executable instructions, which, when executed by a processor, implement the annotation method according to any one of the embodiments of the disclosure.

Other implementation solutions of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the present disclosure. This present application is intended to cover any variations, uses, or adaptations of the present disclosure conforming to the general principles thereof and including such departures from the present disclosure as come within known or customary practice in the art. The specification and embodiments are exemplary, and the scope of the invention is indicated by the following claims.

Claim 1:
A computer-implemented annotation method, applied to a computer comprising a processor and a memory, the annotation method comprising:
determining (S11), by the processor, based on first tag information of a first image set, a first probability value that a first sample image is annotated with an Nth tag when the first sample image is annotated with an Mth tag, wherein M and N are unequal and are positive integers; characterized in that the annotation method further comprises:
adding (S12), by the processor, the first probability value to second tag information of a second sample image, annotated with the Mth tag, in a second image set, to annotate the Nth tag in the second sample image by using the first probability value;
wherein determining (S11), by the processor, based on the first tag information of the first image set, the first probability value that the first sample image is annotated with the Nth tag when the first sample image is annotated with the Mth tag comprises:
acquiring (S51), by the processor, based on the first tag information of the first sample images in the first image set, the first sample images annotated with the Mth tag and the number of the first sample images annotated with the Mth tag as a first number;
acquiring (S52), by the processor, from the first sample images annotated with the Mth tag, the number of the first sample images annotated with the Nth tag as a second number; and
determining (S53) the first probability value based on a ratio of the second number to the first number,
wherein the second image set is used as a training sample to train a face recognition model.