Image feature determination method and device
By dividing the image feature map into multiple image blocks and performing feature fusion, the problem of insufficient feature expression ability of the image block feature vector is solved and the effect of image classification is improved.
Patent Information
- Application Number
- CN202310226502.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2024-09-10
AI Technical Summary
In the image classification task, the existing visual computers have insufficient feature vector feature expression ability of the extracted image blocks, resulting in poor classification results.
Divide the image feature map into multiple image blocks, find other image blocks that are most similar to each image block, and generate a fusion feature vector with strong feature expression ability through feature fusion.
It improves the feature expression ability of image feature extraction and improves the effect of image classification.
Smart Images

Figure CN118628877A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to a method and device for determining image features. Background Art
[0002] When completing classification tasks, existing visual computers need to first extract feature maps, which contain both feature objects and non-feature objects. During the classification and recognition process, the feature maps need to be converted into a series of small image blocks, and the vectors of the image blocks are used as basic data. However, the feature expression ability of the vectors of the image blocks determined in this way is not high, resulting in poor subsequent classification results. Therefore, how to obtain the vectors of image blocks with higher feature expression ability has become an urgent problem to be solved. Summary of the invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an image feature determination method and device, which divides a feature map into multiple image blocks, and finds other image blocks in the multiple image blocks that are most similar to each image block in terms of features, and then aggregates and fuses the feature vectors of each image block in the multiple image blocks and other image blocks that are most similar to its features, so as to obtain feature vectors of multiple image blocks with strong feature expression capabilities.
[0004] In order to achieve the above objectives, the technical solutions provided by the embodiments of the present disclosure are as follows:
[0005] In a first aspect, a method for determining image features is provided, comprising:
[0006] Get the feature map of the image;
[0007] Dividing the feature map into a plurality of image blocks, and converting the feature map of each image block in the plurality of image blocks into a first feature vector;
[0008] Determine, from the multiple image blocks, k image blocks whose similarity parameters with the target image block are greater than or equal to a preset similarity parameter, where k is greater than or equal to 1, and the target image block is any image block among the multiple image blocks;
[0009] Based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameter corresponding to the target image block itself and the similarity parameters corresponding to the k image blocks, feature fusion is performed to obtain a fused feature vector of the target image block.
[0010] In a second aspect, an image feature determination device is provided, comprising:
[0011] An acquisition module, used to acquire a feature map of an image;
[0012] A confirmation module, configured to determine, from the multiple image blocks, k image blocks whose similarity parameters with a target image block are greater than or equal to a preset similarity parameter, where k is greater than or equal to 1, and the target image block is any image block among the multiple image blocks;
[0013] A feature fusion module is used to perform feature fusion based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameter corresponding to the target image block itself, and the similarity parameters corresponding to the k image blocks, so as to obtain a fused feature vector of the target image block.
[0014] In a third aspect, an electronic device is provided, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the image feature determination method as described in the first aspect or any one of its optional embodiments is implemented.
[0015] In a fourth aspect, a computer-readable storage medium is provided, comprising: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the image feature determination method as described in the first aspect or any optional embodiment thereof is implemented.
[0016] The image feature determination method and device provided by the embodiment of the present disclosure obtains the feature map of the image, divides the feature map into multiple image blocks; and converts the feature map of each image block in the multiple image blocks into a corresponding feature vector; determines k image blocks whose similarity parameters with the target image block are greater than or equal to the preset similarity parameters from the multiple image blocks; and performs feature fusion based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, and the similarity parameters corresponding to the k image blocks, so as to obtain the fused feature vector of the target image block. Through such a scheme, in the process of image feature extraction, considering that the feature expression ability of the feature map may be weak, the feature map is divided into multiple image blocks, and other image blocks in the multiple image blocks that are most similar to each image block feature are found, and then the feature vectors of each image block in the multiple image blocks and other image blocks that are most similar to its features are aggregated and fused to obtain the feature vectors of multiple image blocks with strong feature expression ability after fusion. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 A flowchart of a method for determining image features provided by an embodiment of the present disclosure;
[0020] Figure 2 A flowchart for obtaining an image feature map provided by an embodiment of the present disclosure;
[0021] Figure 3 A schematic diagram of a relationship between a visualized target image block and k image blocks provided in an embodiment of the present disclosure;
[0022] Figure 4 A flowchart of a method for determining a fusion feature vector of an image block provided by an embodiment of the present disclosure;
[0023] Figure 5 A schematic diagram of the structure of an image feature determination device provided in an embodiment of the present disclosure;
[0024] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0026] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0027] At present, when existing visual computers complete classification tasks, they need to first extract feature maps, which contain both feature objects and non-feature objects. During the classification and recognition process, the feature maps need to be converted into a series of small image blocks, and the vectors of the image blocks are used as basic data. However, the feature expression ability of the vectors of the image blocks determined in this way is not high, resulting in poor classification results when these image blocks are used for classification operations later.
[0028] In order to solve the above problems, the embodiment of the present disclosure provides an image feature determination method and device, which can obtain the feature map of the image, divide the feature map into multiple image blocks; and convert the feature map of each image block in the multiple image blocks into a corresponding feature vector; determine k image blocks whose similarity parameters with the target image block are greater than or equal to the preset similarity parameters from the multiple image blocks; based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameters corresponding to the target image block itself, and the similarity parameters corresponding to the k image blocks, perform feature fusion to obtain a fused feature vector of the target image block. Through such a scheme, in the process of image feature extraction, considering that the feature expression ability of the feature map may be weak, the feature map is divided into multiple image blocks, and other image blocks in the multiple image blocks that are most similar to each image block feature are found, and then the feature vectors of each image block in the multiple image blocks and other image blocks that are most similar to its features are aggregated and fused to obtain the feature vectors of the fused multiple image blocks with strong feature expression ability.
[0029] Figure 1 A flowchart of a method for determining image features provided in an embodiment of the present disclosure.
[0030] like Figure 1 As shown, the image feature confirmation method includes but is not limited to the following steps:
[0031] 101. Obtain a feature map of the image.
[0032] In some embodiments, when performing an image classification task, a feature map is used to perform the classification, and the feature map is obtained after feature extraction based on the image.
[0033] Before performing an image classification task, it is necessary to first acquire an image and perform feature extraction based on the image to obtain a feature map of the image. The feature map includes feature objects and other objects (such as background, etc.) except the feature objects. In order to improve the expressiveness of image features in the disclosed embodiment, after acquiring the feature map of the image, the feature map can be further processed based on the image feature determination method provided in the disclosed embodiment, that is, the following methods 102 to 104 are executed, and then the image classification task is performed to obtain a better classification effect.
[0034] Figure 2 A flowchart for obtaining an image feature map is provided in an embodiment of the present disclosure.
[0035] like Figure 2 As shown, the method for obtaining the feature map includes but is not limited to the following steps:
[0036] 201. Obtain an image.
[0037] In some embodiments, the above image may be a picture captured by a current camera or mobile device, or a picture resource in local storage.
[0038] 202. Input the image into the feature extraction network to obtain a feature map output by the feature extraction network.
[0039] In some embodiments, the acquired image is input into a feature extraction network (Backbone) to obtain a feature map of the image. Among them, the feature extraction network (Backbone) is a convolutional neural network that uses a convolutional neural network to process the input image, generate a deep feature map, and then use various algorithms to complete the region generation and loss calculation. It is the architecture of the entire detection algorithm. Among them, convolutional neural networks (CNN) are a type of feedforward neural networks (Feedforward Neural Networks) that include convolution calculations and have a deep structure, and are one of the representative algorithms of deep learning. Convolutional neural networks have representation learning capabilities and can perform shift-invariant classification on input information according to their hierarchical structure, so they are also called "Shift-Invariant Artificial Neural Networks (SIANN)".
[0040] It should be noted that the feature map of the image extracted based on the feature extraction network (Backbone) is only an exemplary description. In practical applications, the present application is not limited to extracting feature maps from images through Backbone, and the image can also be processed through other networks with feature extraction functions to obtain the feature map of the image. Furthermore, the present application is not limited to feature extraction based on a network model, and other methods can also be used to extract features and obtain the feature map of the image.
[0041] In the above embodiment, a feature extraction network is used to generate a feature map of an image, which provides input data resources for a subsequent network for determining image features.
[0042] 102. Divide the feature map into multiple image blocks, and convert the feature map of each image block in the multiple image blocks into a corresponding feature vector.
[0043] In some embodiments, the feature map obtained in step 101 is divided into n*n image blocks according to width and height, where n is defined according to actual needs. Here is an example, assuming that the size of the feature map obtained is 100*100, it can be divided into 10*10 image blocks according to actual needs. In other words, the feature map is divided into multiple small image blocks, and then the multiple image blocks are converted into corresponding feature vectors.
[0044] For example, assume that the size of the image block in the feature map is 10*10*3, where 10 is the width and height of the image block, and 3 is the number of channels. Generally, the number of channels depends on the type of image. If it is color, that is, the image is of RGB type, the number of channels is fixed to 3. If it is gray, the number of channels is 1. The number of channels of the feature map can be determined by feature extraction. After calculation, the feature vector of the image block is 3*10 2 The 3 in the vector is the number of channels.
[0045] 103. Determine, from the multiple image blocks, k image blocks whose similarity parameters with the target image block are greater than or equal to a preset similarity parameter.
[0046] In some embodiments, the feature vectors corresponding to the multiple image blocks obtained in step 102 can be used to calculate the similarity parameters of each two image blocks through cosine distance and / or Euclidean distance. The smaller the cosine distance and / or Euclidean distance of the feature vectors corresponding to the two image blocks, the higher the similarity of the two image blocks. Among them, the cosine distance is also called cosine similarity, which is to calculate the cosine value of the angle between two vectors, and use the cosine value of the angle between the two vectors as a measure of the size of the difference between two individuals. The Euclidean distance is also called the Euclidean distance, which is the most common distance metric and measures the absolute distance between two points in a multidimensional space.
[0047] In some embodiments, after calculating the similarity parameter between every two image blocks, k image blocks whose similarity parameter with the target image block is greater than or equal to the preset similarity parameter are determined from the multiple image blocks. Wherein, k is greater than or equal to 1, and the target image block is any image block among the multiple image blocks. The preset similarity parameter is a parameter used to characterize the similarity between two image blocks, and is defined according to actual conditions. If the similarity parameter of the image blocks is greater than or equal to the preset parameter, it means that the features of these image blocks are similar.
[0048] Exemplarily, the feature map is divided into 4 image blocks, where the image blocks are represented by p1, p2, p3, and p4 respectively. p1 is used as the target image block. The similarity parameters between each of the 4 image blocks and the target image block are as follows: the similarity parameter of the p1 image block is 1, the similarity parameter of the p2 image block is 0.3, the similarity parameter of the p3 image block is 0.6, and the similarity parameter of the p4 image block is 0.7. The preset similarity parameter is 0.5. If p1 itself is the target image block, there are two image blocks whose similarity parameters with p1 are greater than or equal to the preset similarity parameters, namely p3 and p4. It should be noted that the similarity parameter between the target image block and itself must be 1, and the similarity parameter between the target image block and itself is required in the calculation process of the subsequent steps.
[0049] In some embodiments, the relationship between the k image blocks whose similarity parameters between the plurality of image blocks and the target image block are greater than or equal to the preset similarity parameter can be represented by a graph. Figure 3 A diagram showing the relationship between a visualized target image block and k image blocks provided by an embodiment of the present disclosure. Figure 3 The edge in refers to the similarity parameter of the image block. Figure 3 The circles in are image blocks. Figure 3 In the figure, there are 6 image blocks with the most similar features or the highest similarity parameters to the target image block A, among which the similarity parameter of image block G is 0.6, the similarity parameter of image block H is 0.5, the similarity parameter of image block B is 0.7, the similarity parameter of image block E is 0.9, the similarity parameter of image block F is 0.8, and the similarity parameter of image block I is 0.7; in addition, image blocks with lower similarity parameters to the target image block A are not shown in the figure.
[0050] 104. Perform feature fusion based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameter corresponding to the target image block itself, and the similarity parameters corresponding to the k image blocks to obtain a fused feature vector of the target image block.
[0051] In some embodiments, the feature vector corresponding to the target image block obtained in steps 101 to 103, the feature vectors corresponding to the k image blocks, the similarity parameters corresponding to the target image block itself, and the similarity parameters corresponding to the k image blocks can be used to obtain a fused feature vector of the target image block by the following method.
[0052] For example, Figure 4 A flowchart of a method for determining an image block fusion feature vector provided in an embodiment of the present disclosure.
[0053] like Figure 4 As shown, the method for determining the fusion feature vector of the image block includes but is not limited to the following steps:
[0054] 401. Based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameter corresponding to the target image block itself, and the similarity parameters corresponding to the k image blocks, feature fusion is performed to obtain a fused feature vector of the target image block.
[0055] In some embodiments, a graph convolution operation is performed based on the feature vector corresponding to the target image block, the feature vectors corresponding to k image blocks, the similarity parameters corresponding to the target image block itself, and the similarity parameters corresponding to the k image blocks. The method for obtaining the aggregate feature vector corresponding to the target image block can be based on the feature vector of the image block and the weighted sum of the similarity parameters corresponding to the target image block and the k image blocks. Among them, the graph convolution operation can actually be regarded as a weighted summation process, in which each pixel in the image area used is multiplied by each element of the convolution kernel (weight matrix) respectively, and the sum of all products is used as the new value of the center pixel of the area. The convolution kernel is when an input image is given during image processing, and the pixels in a small area of the input image are weighted averaged to become each corresponding pixel in the output image, where the weights are defined by a function, which is called the convolution kernel.
[0056] In some embodiments, based on the similarity parameter corresponding to the target image block itself and the similarity parameter corresponding to the k image blocks, the weights of the k image blocks and the target image block are determined, wherein the similarity parameter corresponding to the k image blocks and the target image block itself can be used as the weights of the corresponding k image blocks and the target image block, or the weights of the k image blocks and the target image block can be set according to the similarity parameter corresponding to the k image blocks and the target image block themselves, that is, the larger the similarity parameter value of the image block, the larger the assigned weight, but the sum of the weights of the target image block and the k image blocks should be equal to 1. The general weight value ranges from 0 to 1. That is, the similarity parameter corresponding to the target image block itself and the similarity parameter corresponding to the k image blocks are normalized to obtain the weights of the target image block and the k image blocks.
[0057] In some embodiments, based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the weights of the k image blocks and the target image block, a weighted sum is performed to obtain an aggregate feature vector corresponding to the target image block. Exemplarily, assuming that there are n image blocks, the feature vectors of the n image blocks are represented by p1, p2, p3,,, pn respectively, and there are two image blocks with the most similar features to the image block corresponding to the target image block p1, and the feature vectors of these two image blocks are p2 and p3 respectively; the weight of the image block corresponding to p1 is 0.4, the weight of the image block corresponding to p1 is 0.35, and the weight of the image block corresponding to p3 is 0.2. After weighted summation, the aggregate feature vector of the image block corresponding to the target image block p1 can be expressed as: p1′=p1*0.4+p2*0.35+p3*0.25.
[0058] 402. Fuse the feature vector of the target image block and the aggregated feature vector of the target image block to obtain a fused feature vector of the target image block.
[0059] In some embodiments, the aggregated feature vector of the target image block calculated in step 401 and the feature vector corresponding to the target image block are added and summed, and the average result is used as the aggregated feature vector of the target image block. Exemplarily, the target image block is an image block among any multiple image blocks, and the feature vector of the target image block is p1. After the graph convolution operation, the aggregated feature vector of the target image block is p1′. It should be noted that the dimension of the feature vector of the target image block and the aggregated feature vector of the target image block are the same, and the elements or values under the same dimension can be fused by averaging to obtain the fused feature vector of the target image block. The fused feature vector of the target image block can be represented by p1", p1" = (p1+p1′) / 2.
[0060] In some embodiments, step 401 and step 402 are executed in a loop N times, and after step 402 is executed for the first N-1 times, the fused feature vector of the target image block is used as the feature vector of the target image block, and the above step 1 is continued to be executed, and after step 402 is executed for the Nth time, the fused feature vector of the target image block is obtained.
[0061] Exemplarily, there are 4 image blocks in the feature map, which are represented by p1, p2, p3, and p4 respectively. The most similar graphic blocks to p1 are p2 and p3 respectively. The feature vector of p1 is represented by A, the feature vector of p2 is represented by B, and the feature vector of p3 is represented by C. Here, taking the above steps 401 to 402 being cycled three times to obtain the fused feature vector of p1 as an example, in the first fusion process, firstly, the result A1 of aggregating the feature vectors of p1 and p2 and p3 is used as the first aggregated feature vector of p1, and then the result A2 of adding A1 to A is used as the first fused feature vector of p1. In the second fusion process, the result A3 of aggregating A2 with the feature vectors of p2 and p3 is used as the second aggregated feature vector of p1, and then the result A4 of adding A3 to A is used as the second fused feature vector of p1. In the third fusion process, A4 is aggregated with the feature vectors of p2 and p3 to obtain the third aggregated feature vector A5 of p1, and then the result A6 of adding A5 to A is used as the third fused feature vector of p1.
[0062] In the above embodiment, the aggregated feature vector of the target image block is obtained by calculation, and then the feature vector of the target image block and the aggregated feature vector of the target image block are fused to obtain the fused feature vector of the target image block. In order to improve the feature expression capability of the target image block, the fused feature vector of the target image block is further aggregated with the feature vectors of k image blocks to obtain the aggregated feature vector of the target image block again. The aggregated feature vector of the target image block obtained again is fused with the feature vector of the target image block to obtain the fused feature vector of the second image block. This step is performed N times until the optimized fused feature vector of the target image block is obtained. At this time, the fused feature vector of the target image block has a stronger feature expression capability. Among them, N can be defined according to actual needs, and N is greater than or equal to 1.
[0063] In some embodiments, after the feature vector of the target image block and the aggregated feature vector of the target image block are fused to obtain the fused feature vector of the target image block, the fused feature vector of the target image block is input into a feedforward neural network to obtain the target feature vector of the target image block output by the feedforward neural network, thereby further improving the feature expression capability of the image block. Among them, the feedforward network is the simplest neural network, in which each neuron is arranged in layers, and each neuron is only connected to the neurons in the previous layer. The output of the previous layer is received and output to the next layer, and there is no feedback between the layers. It is one of the most widely used and fastest growing artificial neural networks.
[0064] In some embodiments, a target feature map corresponding to the image is determined based on the target feature vector of the target image block and the target feature vectors of other image blocks. That is, the multiple target image block feature vectors output by the forward feedback network are further operations on the fusion vector of the target image block to enhance the feature expression capability of the image block.
[0065] In some embodiments, the target feature map corresponding to the image is determined based on the target feature vector of the target image block and the target feature vectors of other image blocks. That is, the target feature map generated by the feature vector of the target image block output by the feedforward network can be used for image classification.
[0066] In the above embodiment, the feature map is divided into multiple image blocks and the feature vector of each image block is determined, and then other image blocks that are most similar to each image block are found from the multiple image blocks, and then the feature vectors of each image block and other image blocks that are most similar to it are fused to obtain fused feature vectors of the multiple image blocks. The feature vectors of these fused image blocks have stronger feature expression capabilities.
[0067] Figure 5 A schematic diagram of the structure of an image feature determination device is provided for an embodiment of the present disclosure.
[0068] like Figure 5 As shown, the image feature determination device includes the following modules:
[0069] The acquisition module 501 is used to acquire a feature map of an image.
[0070] The determination module 502 is used to determine, from the multiple image blocks, k image blocks whose similarity parameters with the target image block are greater than or equal to a preset similarity parameter, where k is greater than or equal to 1, and the target image block is any image block among the multiple image blocks.
[0071] The feature fusion module 503 is used to perform feature fusion based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameter corresponding to the target image block itself, and the similarity parameters corresponding to the k image blocks, so as to obtain a fused feature vector of the target image block.
[0072] In some embodiments, the above-mentioned image feature determination device also includes a classification module 504, which is used to determine the target feature map corresponding to the image based on the target feature vector of the target image block and the target feature vectors of other image blocks; and perform image classification based on the target feature map.
[0073] In some embodiments, the determination module 502 is specifically used to: determine the weights of the k image blocks and the target image block based on the similarity parameter corresponding to the target image block itself and the similarity parameters corresponding to the k image blocks; and perform weighted summation based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, and the weights of the k image blocks and the target image block to obtain an aggregated feature vector corresponding to the target image block.
[0074] In some embodiments, the determination module 502 is further used to: input the fused feature vector of the target image block into a feedforward neural network to obtain a target feature vector of the target image block output by the feedforward neural network.
[0075] In some embodiments, the feature fusion module 503 is specifically used for: Step 1: performing a graph convolution operation based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameter corresponding to the target image block itself, and the similarity parameter corresponding to the k image blocks to obtain an aggregated feature vector corresponding to the target image block; Step 2: fusing the feature vector of the target image block and the aggregated feature vector of the target image block to obtain a fused feature vector of the target image block; looping through Step 1 and Step 2 for N or more times, and after executing Step 2 for the first N-1 times, using the fused feature vector of the target image block as the feature vector of the target image block, and continuing to execute Step 1 above, and after executing Step 2 for the Nth time, obtaining the fused feature vector of the target image block.
[0076] In some embodiments, the feature fusion vector 503 is specifically used to add the feature vector of the target image block and the aggregated feature vector of the target image block to obtain a fused feature vector of the target image block.
[0077] In some embodiments, the similarity parameter is characterized by cosine distance and / or Euclidean distance.
[0078] Figure 6 An electronic device is provided for an embodiment of the present disclosure, the electronic device comprising: a processor 601, a memory, and a computer program stored 602 on the memory 602 and executable on the processor 601, wherein the computer program implements each process of the image feature determination method in the above method embodiment when executed by the processor 601. The same technical effect can be achieved, and it will not be described here to avoid repetition.
[0079] An embodiment of the present invention provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the various processes of the image feature determination method in the above method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0080] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0081] In the present disclosure, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0082] In the present disclosure, memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0083] In the present disclosure, computer-readable media include permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, and the information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0084] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for determining image features, characterized in that: include: Get the feature map of the image; Dividing the feature map into a plurality of image blocks, and converting the feature map of each image block in the plurality of image blocks into a corresponding feature vector; Determine, from the multiple image blocks, k image blocks whose similarity parameters with the target image block are greater than or equal to a preset similarity parameter, where k is greater than or equal to 1, and the target image block is any image block among the multiple image blocks; Based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameter corresponding to the target image block itself and the similarity parameters corresponding to the k image blocks, feature fusion is performed to obtain a fused feature vector of the target image block.
2. The method according to claim 1, characterized in that The performing feature fusion based on the feature vector corresponding to the target image block, the similarity parameter corresponding to the target image block itself, and the similarity parameters corresponding to the k image blocks to obtain a fused feature vector of the target image block includes: Step 1: Based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameter corresponding to the target image block itself, and the similarity parameters corresponding to the k image blocks, a graph convolution operation is performed to obtain an aggregated feature vector corresponding to the target image block; Step 2: fusing the feature vector of the target image block and the aggregated feature vector of the target image block to obtain a fused feature vector of the target image block; Execute step 1 and step 2 for N or more times in a loop. After executing step 2 for the first N-1 times, use the fused feature vector of the target image block as the feature vector of the target image block, and continue to execute step 1. After executing step 2 for the Nth time, obtain the fused feature vector of the target image block.
3. The method according to claim 2, characterized in that The performing a graph convolution operation based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameter corresponding to the target image block itself, and the similarity parameter corresponding to the k image blocks to obtain an aggregated feature vector corresponding to the target image block includes: Determining weights of the k image blocks and the target image block based on the similarity parameter corresponding to the target image block itself and the similarity parameters corresponding to the k image blocks; Based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, and the weights of the k image blocks and the target image block, a weighted sum is performed to obtain an aggregated feature vector corresponding to the target image block.
4. The method according to claim 1, characterized in that: The step of fusing the feature vector of the target image block with the aggregated feature vector of the target image block to obtain a fused feature vector of the target image block includes: Calculating a summed average result of the feature vector of the target image block and the aggregated feature vector of the target image block; The summed average result is determined as the fusion feature vector of the target image block.
5. The method according to claim 1, characterized in that After fusing the feature vector of the target image block with the aggregated feature vector of the target image block to obtain a fused feature vector of the target image block, the method further includes: The fused feature vector of the target image block is input into a feedforward neural network to obtain a target feature vector of the target image block output by the feedforward neural network.
6. The method according to claim 5, characterized in that After inputting the fused feature vector of the target image block into the feedforward neural network to obtain the target feature vector of the target image block output by the feedforward neural network, the method further includes: Determine a target feature map corresponding to the image based on the target feature vector of the target image block and the target feature vectors of other image blocks; Image classification is performed based on the target feature map.
7. The method according to claim 1, characterized in that The similarity parameter is characterized by cosine distance and / or Euclidean distance.
8. An image feature determination device, characterized in that: include: An acquisition module, used to acquire a feature map of an image; A determination module, configured to determine, from the multiple image blocks, k image blocks whose similarity parameters with a target image block are greater than or equal to a preset similarity parameter, where k is greater than or equal to 1, and the target image block is any image block among the multiple image blocks; A feature fusion module is used to perform feature fusion based on the feature vector corresponding to the target image block, the feature vectors corresponding to the k image blocks, the similarity parameter corresponding to the target image block itself, and the similarity parameters corresponding to the k image blocks, so as to obtain a fused feature vector of the target image block.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the image feature determination method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image feature determination method according to any one of claims 1 to 7 is implemented.
