A method and system for matching image blocks and labels based on a three-dimensional graph model

Through the method based on the three-part graph model, the problem of high manual time-consuming and machine learning challenges in image annotation is solved, efficient matching of fine-grained image blocks and labels is achieved, imitating human observation methods, and improving annotation accuracy and efficiency.

CN114596434BActive Publication Date: 2024-10-15SHANDONG UNIV OF FINANCE & ECONOMICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210253087.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-15
Publication Date
2024-10-15
Estimated Expiration
2042-03-15

AI Technical Summary

Technical Problem

Existing technologies suffer from high manual time-consuming, high cost and ambiguity problems in image annotation. Machine learning faces the challenge of the semantic gap between low-level visual features and high-level semantic labels, as well as the correspondence between labels and image areas in training data.

Method used

Using a method based on the tripartite graph model, the correlation matrix of image blocks and labels is constructed through information diffusion, the image blocks are clustered and a visual word set is generated. The visual word-image bipartite graph and the image-label bipartite graph are combined to construct a ranking matrix to Matching the labels of image patches mimics the way humans see and captures shared and complementary information across visual and language modalities.

Benefits of technology

It achieves fine-grained image annotation, imitates human thinking, improves the accuracy and efficiency of image block and label matching, and reduces the cost of manual annotation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114596434B_ABST
    Figure CN114596434B_ABST
Patent Text Reader

Abstract

The present invention provides an image block and label matching method and system based on a trigraph model, comprising: obtaining an image set and its corresponding label set; dividing each image in the image set into a number of image blocks, clustering all the image blocks, taking the centroid of each cluster as a visual word, and obtaining a visual word set; obtaining a visual word-image bipartite graph based on the image set and the visual word set; obtaining an image-label bipartite graph based on the image set and the label set; combining the visual word-image bipartite graph and the image-label bipartite graph into a trigraph model; calculating a correlation matrix between visual words and labels based on the trigraph model; for each image, constructing a sorting matrix based on the correlation matrix between visual words and labels, and matching the labels of all image blocks in each image based on the sorting matrix. The internal connection between image blocks and labels is fully discovered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image block and label matching, and in particular relates to an image block and label matching method and system based on a trigraph model. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] In recent years, many users share images on social networking sites every day. Therefore, there is an increasing need to effectively understand the semantics of images, which is of great benefit to improving the performance of image retrieval, recommendation and management. Due to the importance of understanding image semantics, image annotation has attracted more and more research interests in the field of computer vision.

[0004] Image annotation can be done by machines or humans, however, manual execution of such tasks is time-consuming, costly, and subject to certain ambiguities. For example, different people may have completely different understandings of an object in the same image due to differences in educational background, way of thinking, and even life experiences. Machines face two major challenges in image annotation tasks: the first is to narrow the semantic gap between low-level visual features and high-level semantic labels; the second is to learn the correspondence between labels and image regions in the training data. However, traditional methods assign multiple labels to the entire image without analyzing the correspondence in fine-grained data. Summary of the invention

[0005] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides an image block and label matching method and system based on a trigraph model, constructs a trigraph model, and fully discovers the internal connection between image blocks and labels through information diffusion.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] A first aspect of the present invention provides an image block and label matching method based on a trigraph model, comprising:

[0008] Get the image set and its corresponding label set;

[0009] Each image in the image set is divided into several image blocks, all the image blocks are clustered, and the centroid of each cluster is used as a visual word to obtain a visual word set;

[0010] Based on the image set and the visual word set, a visual word-image bipartite graph is obtained; based on the image set and the label set, an image-label bipartite graph is obtained; the visual word-image bipartite graph and the image-label bipartite graph are combined into a tripartite graph model;

[0011] Based on the three-part graph model, the correlation matrix between visual words and labels is calculated;

[0012] For each image, a ranking matrix is ​​constructed based on the correlation matrix between visual words and labels, and the labels of all image patches in each image are matched based on the ranking matrix.

[0013] Furthermore, each element in the visual word-image bipartite graph represents an inclusion relationship between an image in the image set and a visual word in the visual word set.

[0014] Furthermore, each element in the image-label bipartite graph represents an inclusion relationship between an image in the image set and a label in the label set.

[0015] Furthermore, the specific method of matching the labels of all image blocks in each image based on the sorting matrix is:

[0016] For a certain image, all elements in the sorting matrix are sorted in ascending order to obtain an index sorting vector;

[0017] Based on the index sorting vector and the sorting matrix, construct the initial visual word-label matching matrix;

[0018] According to the two rules, the initial visual word-label matching matrix is ​​scanned to obtain the final matching matrix of visual words and labels. The label of each image block is obtained by combining the visual words corresponding to each image block of the image.

[0019] Furthermore, the i-th element in the first column of the initial visual word-label matching matrix represents the row subscript of the i-th element in the index sorting vector in the sorting matrix, and the i-th element in the second column of the initial visual word-label matching matrix represents the column subscript of the i-th element in the index sorting vector in the sorting matrix.

[0020] Furthermore, the two rules include: each visual word is matched only once; and the number of visual words assigned to each tag cannot exceed the number of visual words that the tag can be assigned.

[0021] Furthermore, the number of visual words that can be assigned to each label is calculated based on the number of labels and the number of visual words.

[0022] A second aspect of the present invention provides an image block and label matching system based on a trigraph model, comprising:

[0023] A data acquisition module is configured to: acquire an image set and its corresponding label set;

[0024] A visual word set building module is configured to: divide each image in the image set into a number of image blocks, cluster all the image blocks, and take the centroid of each cluster as a visual word to obtain a visual word set;

[0025] A trigraph model building module is configured to: obtain a visual word-image bipartite graph based on an image set and a visual word set; obtain an image-label bipartite graph based on an image set and a label set; and combine the visual word-image bipartite graph and the image-label bipartite graph into a trigraph model;

[0026] A correlation matrix building module, which is configured to: calculate a correlation matrix between visual words and labels based on a trigraph model;

[0027] The label matching module is configured to: for each image, construct a sorting matrix based on the correlation matrix between visual words and labels, and match labels of all image patches in each image based on the sorting matrix.

[0028] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-mentioned method for matching image blocks and labels based on a trigraph model.

[0029] A fourth aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the method for matching image blocks and labels based on a three-part graph model as described above are implemented.

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] The present invention provides an image block and label matching method based on a trigraph model, which provides label annotation for fine-grained images by learning the correlation between an image and a set of labels. It well imitates the way humans think. When observing an image, they first focus on the partial area of ​​interest. Therefore, the present invention provides label annotation by deeply analyzing the correlation between image blocks and labels, and fully captures the shared and complementary information between visual and language modalities. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0033] Figure 1 is a schematic diagram of a three-part graph model according to the first embodiment of the present invention;

[0034] Figure 2is a flow chart of correlation matrix construction in Embodiment 1 of the present invention;

[0035] Figure 3 This is a schematic diagram of generating image block-label pairs according to the first embodiment of the present invention;

[0036] Figure 4 This is a graph showing the accuracy of image block annotations for the Corel5K image set according to the first embodiment of the present invention;

[0037] Figure 5 This is a graph showing the accuracy of image block annotation of the NUS WIDE 25K ​​image set according to the first embodiment of the present invention;

[0038] Figure 6 This is a graph showing the accuracy of image block annotation for the NUS WUDE 5K image set according to the first embodiment of the present invention. DETAILED DESCRIPTION

[0039] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0040] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0041] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0042] Embodiment 1

[0043] This embodiment provides an image block and label matching method based on a three-part graph model, constructs a three-part graph model, and fully discovers the internal connection between image blocks and labels through information diffusion, specifically including the following steps:

[0044] Step 1, obtain an image set and its corresponding label set, divide each image in the image set into several blocks, cluster all image blocks, take the centroid of each cluster as a visual word, and obtain a visual word set; based on the image set and the visual word set, obtain a visual word-image bipartite graph; based on the image set and the label set, obtain an image-label bipartite graph; combine the visual word-image bipartite graph and the image-label bipartite graph into a tripartite graph model; based on the tripartite graph model, calculate the correlation matrix between visual words and labels.

[0045] Specifically, each image in the training dataset is divided into v*v image blocks, and then all image blocks are clustered. The centroid of each cluster is regarded as a visual word. The centroid of a cluster is the visual word corresponding to all image blocks in the cluster, and each image block is represented as the visual word closest to it. Therefore, the three-part graph model contains three types of elements: visual words, images, and labels. Assume is a set of visual words, For a set of images, is a set of labels. It can be described as two adjacent matrices and Represent the visual word-image bipartite graph and the image-label bipartite graph respectively, where each element in the visual word-image bipartite graph represents the inclusion relationship between an image in the image set and a visual word in the visual word set, that is, if the jth image I j Contains the i-th visual word V i , then a ij ∈MA (the element in the i-th row and j-th column of MA) is set to 1, otherwise a ij = 0; Similarly, each element in the image-label bipartite graph represents the inclusion relationship between an image in the image set and a label in the label set, that is, if the kth label T k Labeled image I j , then b jk ∈MB is set to 1, otherwise b jk =0.

[0046] like Figure 1 As shown in the figure, the visual word-image-label tripartite graph model has 41 visual words, 10 images and 11 labels. In order to effectively mine the relationship between visual words, images and labels, the present invention proposes a two-stage information diffusion method, which quantizes each visual word or label into a vector, constructs a vector set, and updates the vector set through tripartite graph diffusion.

[0047] For the target visual word V g , Define the initial vector set originating from the image as That is, the gth row of the MA matrix. After the first stage of information diffusion on the visual word-image bipartite graph, the origin vector diffused from the visual word is defined as Each sight word V i The origin value vr assigned from the image it belongs to i The calculation is as follows:

[0048]

[0049] in, is the jth dimension I j Similarly, after the first stage of information diffusion on the image-label bipartite graph, the origin vector diffused from the visual word is defined as Each label T k The origin value tr assigned from the image it belongs to k The calculation is as follows:

[0050]

[0051] in, I j Then, the jth dimension updated in the second stage of information diffusion is as follows.

[0052]

[0053] in and They refer to V i and T j The number of adjacent images.

[0054] Target sight word V g The corresponding updated image origin vector is For the target label T p , Set the initial image origin vector to That is, the pth column of MB. Similar to the calculation process of the image origin vector of the target visual word, the target label T can be obtained. p Corresponding to the updated image origin vector Next, use the Euclidean distance to estimate V g and T p The correlations between them are as follows.

[0055]

[0056] The matrix recording the correlation between visual words and labels is expressed as VT gp It is the g-th row and p-th column of VT.

[0057] like Figure 2 As shown in FIG. 1 , the offline calculation is aimed at constructing the matrix VT. In the offline calculation, the images in the training dataset are pre-divided into image blocks, and then the features of these image blocks are clustered; a tripartite graph is constructed to use the image as a bridge to construct the correlation between the visual words and the labels; the vector is calculated. and The method is shown in formula (3). After bidirectional diffusion, the matrix VT is constructed. Next, the fine-grained correspondence inference process between image blocks and labels is summarized. The online inference calculation process is as follows: Figure 3 shown.

[0058] exist Figure 3 In , an example image with 9 patches, 6 visual words and 4 labels is provided. Using the algorithm, patch-label pairs are generated from VTPair*, namely (P1, sky), (P2, sky), (P3, sky), (P4, sky), (P5, sun), (P6, sea), (P7, beach), (P8, beach), (P9, beach). Patches belonging to the same visual word match the same label.

[0059] Step 2: For an image input into the three-part image model, the image corresponds to m image blocks, n labels and l visual words, that is, the image corresponds to the image block set Tag Collection And the visual word set of the image after feature clustering . Each visual word corresponds to At least one image block in the image; construct a sorting matrix The element RO gp is the index of the element sorting position in the matrix VT (Formula 4) that records the correlation between visual words and labels, that is, by sorting the elements containing T p All elements in the matrix VT column are arranged in ascending order to generate the sorted index matrix RO. Figure 3 ,The first element "251" of the sorting matrix RO means that in the matrix VT, the relevance values ​​of the column where the word "beach" is located are sorted, and the visual word "18" is ranked "251" in this column.

[0060] Step 3: Based on the number of labels and the number of visual words, calculate the number of visual words that each label can be assigned. Specifically, in order to ensure the diversity of fine-grained image and label matching, define the vector To preset the maximum number of visual words allowed to be assigned to each label, all elements of wa are initialized to 0. The number of visual words wa that can be assigned to the kth label is k There are two ways to calculate If the sum of the elements of wa is less than 1, then wa k =1; otherwise wa k for The integer lower bound of ; after all elements are calculated, if the sum of all elements in wa is less than l, then wa1 = l-sum(wa)+wa1.

[0061] Step 4: Construct index sort vector All elements of RO are recorded in ascending order, that is, all elements in the sorting matrix are arranged in ascending order to obtain an index sorting vector.

[0062] Step 5: Based on the index sorting vector and the sorting matrix, construct the initial visual word-label matching matrix; scan the initial visual word-label matching matrix according to the two rules to obtain the final matching matrix between visual words and labels. Among them VTPair i1 and VTPair i2 Represents element r i In the row and column subscripts of RO, that is, the i-th element of the first column in the initial visual word-label matching matrix represents the row subscript of the i-th element in the index sorting vector in the sorting matrix, and the i-th element of the second column in the initial visual word-label matching matrix represents the column subscript of the i-th element in the index sorting vector in the sorting matrix; by scanning VTPair from top to bottom to select "visual word-label" pairs, the final matching matrix of visual words and labels is generated According to two rules: a) each visual word is matched only once, and b) the number of visual words assigned to each label cannot exceed the label allocation quota wa.

[0063] Step 6: Combine the visual words corresponding to each image block of the image to obtain the label of each image block. Specifically, T y It is the same as P in VTPair* x The labels that match the corresponding visual words can be obtained from the “image block-label” pair {(P x ,T y )|x∈{1,2,…,m},y∈{1,2,…,m}}, where P x and T y Match each other.

[0064] For the time complexity of the tripartite graph construction, constructing the matrix VT (offline training calculation module) requires time; inferring the correspondence between image patches and labels (online inference computation) requires time; for and It can be seen that the online inference calculation module runs very fast.

[0065] like Figure 4 , Figure 5 and Figure 6 As shown, the image block annotation accuracy of Corel5K, NUS WIDE 25K ​​and NUS WIDE 5K image sets are respectively.

[0066] The present invention proposes a fine-grained correspondence inference method, which is an unsupervised algorithm based on a tripartite graph model and is used to match fine-grained images and labels.

[0067] Embodiment 2

[0068] This embodiment provides an image block and label matching system based on a three-part graph model, which specifically includes the following modules:

[0069] A data acquisition module is configured to: acquire an image set and its corresponding label set;

[0070] A visual word set building module is configured to: divide each image in the image set into a number of image blocks, cluster all the image blocks, and take the centroid of each cluster as a visual word to obtain a visual word set;

[0071] A trigraph model building module is configured to: obtain a visual word-image bipartite graph based on an image set and a visual word set; obtain an image-label bipartite graph based on an image set and a label set; and combine the visual word-image bipartite graph and the image-label bipartite graph into a trigraph model;

[0072] A correlation matrix building module, which is configured to: calculate a correlation matrix between visual words and labels based on a trigraph model;

[0073] The label matching module is configured to: for each image, construct a sorting matrix based on the correlation matrix between visual words and labels, and match labels of all image patches in each image based on the sorting matrix.

[0074] It should be noted here that each module in this embodiment corresponds to each step in Example 1 one by one, and the specific implementation process is the same, which will not be repeated here.

[0075] Embodiment 3

[0076] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the image block and label matching method based on a three-part graph model as described in the first embodiment above are implemented.

[0077] Embodiment 4

[0078] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the method for matching image blocks and labels based on a three-part graph model as described in the first embodiment are implemented.

[0079] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0080] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0081] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0082] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0083] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0084] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for matching image blocks and labels based on a three-part graph model, characterized in that: include: Get the image set and its corresponding label set; Each image in the image set is divided into several image blocks, all the image blocks are clustered, and the centroid of each cluster is used as a visual word to obtain a visual word set; Based on the image set and the visual word set, a visual word-image bipartite graph is obtained; based on the image set and the label set, an image-label bipartite graph is obtained; the visual word-image bipartite graph and the image-label bipartite graph are combined into a tripartite graph model; Based on the three-part graph model, the correlation matrix between visual words and labels is calculated; For each image, a ranking matrix is ​​constructed based on the correlation matrix between visual words and labels, and the labels of all image patches in each image are matched based on the ranking matrix.

2. The image block and label matching method based on the trigraph model according to claim 1, characterized in that: Each element in the visual word-image bipartite graph represents an inclusion relationship between an image in the image set and a visual word in the visual word set.

3. The image block and label matching method based on the trigraph model according to claim 1, characterized in that: Each element in the image-label bipartite graph represents an inclusion relationship between an image in the image set and a label in the label set.

4. The image block and label matching method based on the trigraph model according to claim 1, characterized in that: The specific method of matching the labels of all image blocks in each image based on the sorting matrix is ​​as follows: For a certain image, all elements in the sorting matrix are sorted in ascending order to obtain an index sorting vector; Based on the index sorting vector and the sorting matrix, construct the initial visual word-label matching matrix; According to the two rules, the initial visual word-label matching matrix is ​​scanned to obtain the final matching matrix of visual words and labels. The label of each image block is obtained by combining the visual words corresponding to each image block of the image.

5. The image block and label matching method based on the trigraph model as claimed in claim 4, characterized in that: The i-th element of the first column in the initial visual word-label matching matrix represents the row subscript of the i-th element in the index sorting vector in the sorting matrix, and the i-th element of the second column in the initial visual word-label matching matrix represents the column subscript of the i-th element in the index sorting vector in the sorting matrix.

6. The image block and label matching method based on the trigraph model according to claim 4, characterized in that: The two rules include: each visual word is matched only once; the number of visual words assigned to each tag cannot exceed the number of visual words that the tag can be assigned.

7. The image block and label matching method based on the trigraph model according to claim 5, characterized in that: The number of visual words that each label can be assigned is calculated based on the number of labels and the number of visual words.

8. An image block and label matching system based on a three-part graph model, characterized in that: include: A data acquisition module is configured to: acquire an image set and its corresponding label set; A visual word set building module is configured to: divide each image in the image set into a number of image blocks, cluster all the image blocks, and take the centroid of each cluster as a visual word to obtain a visual word set; A trigraph model building module is configured to: obtain a visual word-image bipartite graph based on an image set and a visual word set; obtain an image-label bipartite graph based on an image set and a label set; and combine the visual word-image bipartite graph and the image-label bipartite graph into a trigraph model; A correlation matrix building module, which is configured to: calculate a correlation matrix between visual words and labels based on a trigraph model; The label matching module is configured to: for each image, construct a sorting matrix based on the correlation matrix between visual words and labels, and match labels of all image patches in each image based on the sorting matrix.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the image block and label matching method based on a three-part graph model as described in any one of claims 1 to 7 are implemented.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the image block and label matching method based on the trigraph model as described in any one of claims 1 to 7 are implemented.