Image classification device, image classification method, image classification program, image feature learning device, image feature learning method, and image feature learning program
By extracting and synthesizing low-resolution and high-resolution feature vectors of images, combined with feature frequency transformation and filter technology, the accuracy problem of additional learning and small-scale image learning in image classification is solved, achieving high-precision image classification and avoiding Catastrophic forgetting and overfitting.
Patent Information
- Application Number
- CN202380017734.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-01-28
- Filing Date
- 2023-01-26
- Publication Date
- 2024-09-06
AI Technical Summary
In image classification, the existing technology, especially in additional learning and small-scale image learning, does not have high classification accuracy, making it difficult to effectively avoid the problems of catastrophic forgetting and over-fitting.
The feature extraction unit is used to extract low-resolution summary feature vectors and high-resolution detailed feature vectors, and the summary feature ranging unit and detailed feature ranging unit calculate summary distance vectors and detailed distance vectors, and synthesize distance vectors for image classification. , combined with feature frequency transformation and filter technology, generates low-frequency and high-frequency feature vectors, and uses cosine distance to make classification decisions.
It improves the accuracy of image classification, reduces the risk of catastrophic forgetting and overfitting, and is able to classify basic and additional categories with high accuracy in the synthetic classification space, maintaining the knowledge learned in the past.
Smart Images

Figure CN118613841A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to image classification technology and image feature learning technology. Background Art
[0002] People can learn new knowledge through long-term experience and can maintain past knowledge. On the other hand, the knowledge of Convolutional Neural Network (CNN) depends on the data set used in learning. In order to adapt to changes in data distribution, it is necessary to relearn the parameters of CNN for the entire data set. In CNN, as new tasks are learned, the accuracy of inferences about past tasks decreases. In this way, if continuous learning is performed in CNN, catastrophic forgetting, in which the learning results of past tasks are forgotten when learning new tasks, cannot be avoided.
[0003] As a method to avoid catastrophic forgetting, incremental learning (or continual learning) has been proposed. Continuous learning is a learning method that does not learn a model from scratch when a new task or new data is generated, but improves the current learned model to perform learning.
[0004] In addition, humans can learn new knowledge from a small number of images. On the other hand, artificial intelligence using deep learning such as convolutional neural networks relies on big data (a large number of images) used in learning. It is known that when artificial intelligence using deep learning is learned with a small number of images, it falls into overfitting with good local performance but poor generalization performance.
[0005] As a method to avoid overfitting, few-shot learning has been proposed. Few-shot learning is a learning method that uses big data to learn basic knowledge in basic tasks and uses the basic knowledge to learn new knowledge from a small number of images in new tasks.
[0006] As a method to solve the problems of both continuous learning and few-shot learning, there is few-shot class incremental learning (Non-Patent Document 1). In addition, as a method of few-shot learning, there is a technology that uses the cosine distance between a feature vector and a weight vector (Non-Patent Document 2).
[0007] Prior art literature
[0008] Non-patent literature
[0009] Non-patent literature 1: Tao, Xiaoyu, et al. "Few-shot class-incremental learning." Proceedings of the IEEE / CVF Conference on Computer Vision and PatternRecognition. 2020.
[0010] Non-patent literature 2: Chen, Wei-Yu, et al. "A closer look at few-shot classification." arXiv preprint arXiv:1904.04232 (2019). Summary of the invention
[0011] In the prior art, there is a problem that the image classification accuracy is not high enough for additional learning or learning with a small number of images.
[0012] The present invention has been made in view of such a situation, and an object of the present invention is to provide an image classification technology and an image feature learning technology that can improve the classification accuracy of images for additional learning or learning of a small number of images.
[0013] In order to solve the above-mentioned problems, an image classification device of a certain mode of the present embodiment includes: a feature extraction unit, which extracts a low-resolution summary feature vector and a high-resolution detailed feature vector of an input image; a summary feature ranging unit, which maintains summary weight vectors of various categories and calculates a summary distance vector based on the summary feature vector and the summary weight vector; a detailed feature ranging unit, which maintains detailed weight vectors of various categories and calculates a detailed distance vector based on the detailed feature vector and the detailed weight vector; a feature distance synthesis unit, which synthesizes the summary distance vector and the detailed distance vector to calculate a synthesized distance vector; and a classification unit, which determines the category of the input image based on the synthesized distance vector.
[0014] Another method of the present embodiment is also an image classification device. The device includes: a feature extraction unit configured to extract a feature vector of an input image; a feature frequency conversion unit configured to convert the feature vector to a frequency domain to generate a low-frequency feature vector and a high-frequency feature vector; a low-frequency feature distance measurement unit configured to maintain a low-frequency weight vector for each category and calculate a low-frequency distance vector based on the low-frequency feature vector and the low-frequency weight vector; a high-frequency feature distance measurement unit configured to maintain a high-frequency weight vector for each category and calculate a high-frequency distance vector based on the high-frequency feature vector and the high-frequency weight vector; a feature distance synthesis unit configured to synthesize the low-frequency distance vector and the high-frequency distance vector to calculate a synthesized distance vector; and a classification unit configured to determine the category of the input image based on the synthesized distance vector.
[0015] Another mode of the present embodiment is also an image classification device. The device includes: a filter unit that converts an input image into a frequency domain to divide the input image into a low-frequency component and a high-frequency component; a low-frequency feature extraction unit that extracts a low-frequency feature vector from the low-frequency component; a high-frequency feature extraction unit that extracts a high-frequency feature vector from the high-frequency component; a low-frequency feature distance measurement unit that maintains a low-frequency weight vector for each category and calculates a low-frequency distance vector from the low-frequency feature vector and the low-frequency weight vector; a high-frequency feature distance measurement unit that maintains a high-frequency weight vector for each category and calculates a high-frequency distance vector from the high-frequency feature vector and the high-frequency weight vector; a feature distance synthesis unit that synthesizes the low-frequency distance vector and the high-frequency distance vector to calculate a synthesized distance vector; and a classification unit that determines the category of the input image based on the synthesized distance vector.
[0016] Another mode of the present embodiment is an image classification method. The method includes: a feature extraction step, extracting a low-resolution summary feature vector and a high-resolution detailed feature vector of an input image; a summary feature ranging step, maintaining summary weight vectors of various categories, and calculating summary distance vectors based on the summary feature vectors and the summary weight vectors; a detailed feature ranging step, maintaining detailed weight vectors of various categories, and calculating detailed distance vectors based on the detailed feature vectors and the detailed weight vectors; a feature distance synthesis step, synthesizing the summary distance vector and the detailed distance vector to calculate a synthesized distance vector; and a classification step, determining the category of the input image based on the synthesized distance vector.
[0017] In order to solve the above-mentioned problems, an image classification device of a certain mode of the present embodiment includes: a feature extraction unit, which extracts a feature vector of an input image; a feature distance measurement unit of a basic class, which maintains a weight vector of the basic class, and calculates a distance vector of the basic class based on the feature vector and the weight vector of the basic class; a feature distance measurement unit of an additional class, which maintains a weight vector of the additional class, and calculates a distance vector of the additional class based on the feature vector and the weight vector of the additional class; a scaling unit, which scales the distance vector of the additional class using a scaling value calculated based on the distance vector of the basic class and the distance vector of the additional class; and a classification unit, which determines the class of the input image based on the distance vector of the basic class and the scaled distance vector of the additional class.
[0018] The feature extraction unit can extract a low-resolution summary feature vector and a high-resolution detailed feature vector of the input image. The feature distance measurement unit for each category may include: a summary feature distance measurement unit that maintains a summary weight vector for each category and calculates a summary distance vector based on the summary feature vector and the summary weight vector; and a detailed feature distance measurement unit that maintains a detailed weight vector for each category and calculates a detailed distance vector based on the detailed feature vector and the detailed weight vector.
[0019] The image classification device may further include a feature frequency conversion unit for converting the feature vector into a frequency domain to generate a low-band feature vector and a high-band feature vector. The feature measurement unit for each category may include: a low-frequency feature measurement unit that stores a low-frequency weight vector for each category and calculates a low-frequency distance vector based on the low-frequency feature vector and the low-frequency weight vector; and a high-frequency feature measurement unit that stores a high-frequency weight vector for each category and calculates a high-frequency distance vector based on the high-frequency feature vector and the high-frequency weight vector.
[0020] The image classification device may further include a filter unit that converts the input image into a frequency domain and divides it into a low-frequency component and a high-frequency component. The feature extraction unit may include: a low-frequency feature extraction unit for extracting a low-frequency feature vector from the low-frequency component; and a high-frequency feature extraction unit for extracting a high-frequency feature vector from the high-frequency component, wherein the feature distance measurement unit for each category may include: a low-frequency feature distance measurement unit for maintaining a low-frequency weight vector for each category and calculating a low-frequency distance vector based on the low-frequency feature vector and the low-frequency weight vector; and a high-frequency feature distance measurement unit for maintaining a high-frequency weight vector for each category and calculating a high-frequency distance vector based on the high-frequency feature vector and the high-frequency weight vector.
[0021] The image classification device may also include a learning unit, which learns a feature extraction unit and a feature distance measurement unit of the basic category for the input image of the basic category, and learns a feature distance measurement unit of the additional category for the input image of the additional category, so as to minimize the loss calculated from the distance vector and the correct solution category of the input image.
[0022] Another mode of the present embodiment is an image classification method. The method includes: a feature extraction step, extracting a feature vector of an input image; a feature distance measurement step of a basic class, maintaining a weight vector of the basic class, and calculating a distance vector of the basic class based on the feature vector and the weight vector of the basic class; a feature distance measurement step of an additional class, maintaining a weight vector of the additional class, and calculating a distance vector of the additional class based on the feature vector and the weight vector of the additional class; a scaling step, scaling the distance vector of the additional class using a scaling value calculated based on the distance vector of the basic class and the distance vector of the additional class; and a classification step, determining the class of the input image based on the distance vector of the basic class and the scaled distance vector of the additional class.
[0023] In order to solve the above-mentioned problems, an image feature learning device according to a certain mode of the present embodiment comprises: a feature extraction unit, which extracts a low-resolution summary feature vector and a high-resolution detailed feature vector of an input image; and a summary feature ranging unit, which maintains summary weight vectors of each category and calculates a summary distance vector based on the summary feature vector and the summary weight vector of each category; a detailed feature ranging unit, which maintains detailed weight vectors of each category and calculates a detailed distance vector based on the detailed feature vector and the detailed weight vector of each category; and a summary loss calculation unit, which calculates a summary loss based on the summary distance vector and a correct label of the input image, and calculates a detailed loss based on the detailed distance vector and the correct label of the input image, and when weighting the summary loss and the detailed loss, the weight of the summary loss is made greater than the weight of the detailed loss; a loss weighting addition unit, which adds the weighted summary loss and the weighted detailed loss to calculate a total loss; and an optimization unit, which learns the feature extraction unit, the summary feature ranging unit, and the detailed feature ranging unit based on the total loss.
[0024] Another aspect of the present embodiment is an image feature learning method. The method includes: a feature extraction step, extracting a low-resolution summary feature vector and a high-resolution detailed feature vector of an input image; and a summary feature ranging step, maintaining summary weight vectors of each category, calculating summary distance vectors based on the summary feature vectors and the summary weight vectors of each category, and a detailed feature ranging step, maintaining detailed weight vectors of each category, and calculating detailed distance vectors based on the detailed feature vectors and the detailed weight vectors of each category; a summary loss calculation step, calculating summary loss based on the summary distance vector and the correct label of the input image, and a detailed loss calculation step, calculating detailed loss based on the detailed distance vector and the correct label of the input image; and, including: a loss addition step, adding the weighted summary loss to the weighted detailed loss to calculate the total loss; and an optimization step, learning the parameters of the feature extraction step, the summary feature ranging step, and the detailed feature ranging step based on the total loss.
[0025] In addition, any combination of the above-described constituent elements and any form of expression of the present embodiment in the form of a method, an apparatus, a system, a recording medium, a computer program, etc. may also be practiced as additional forms of the present embodiment.
[0026] According to the present embodiment, it is possible to provide an image classification technology that can improve the classification accuracy of images for additional learning or learning of a small number of images. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a diagram showing the configuration of the image classification device according to the first embodiment.
[0028] Figure 2 This is a flowchart illustrating the overall flow of learning by the image classification device.
[0029] Figure 3 This is a diagram for explaining the detailed structure of an image classification device in basic category learning.
[0030] Figure 4 This is a flowchart illustrating the detailed operation of the image classification device in learning basic categories.
[0031] Figure 5 This is a diagram showing the structure of the feature distance measuring unit.
[0032] Figure 6 This is a diagram for explaining the detailed structure of an image classification device in learning of additional categories.
[0033] Figure 7 This is a flowchart showing the steps of calculating the scaling value of the additional category in the scaling setting unit.
[0034] Figure 8 This is a diagram illustrating the detailed structure of an image classification device that predicts and classifies the categories of images included in a test data set.
[0035] Fig. 9 It is a diagram showing the configuration of an image classification device according to the second embodiment.
[0036] Fig.10 This is a flowchart illustrating the overall flow of learning by the image classification device.
[0037] Fig.11 This is a diagram for explaining the detailed structure of an image classification device in basic category learning.
[0038] Fig.12 This is a flowchart illustrating the detailed operation of the image classification device in learning basic categories.
[0039] Fig.13 This is a diagram for explaining the detailed structure of an image classification device in basic category classification.
[0040] Fig.14 This is a flowchart for explaining the detailed operation of the image classification device in the classification of basic categories.
[0041] Fig.15 A diagram for explaining the detailed structure and operation of an image classification device in learning of additional categories.
[0042] Fig.16 This is a diagram illustrating the detailed structure of an image classification device that predicts and classifies the categories of images included in a test data set.
[0043] Fig.17 This is a diagram showing the configuration of an image classification device according to the third embodiment.
[0044] Fig.18 (a) and Fig.18 (b) is a diagram showing an example of division into two frequency regions, a low frequency region and a high frequency region.
[0045] Fig.19 It is a diagram showing the configuration of an image classification device according to a fourth embodiment.
[0046] Fig. 20 It is a diagram showing the configuration of an image classification device according to the fifth embodiment.
[0047] Fig.21 This is a flowchart for explaining the detailed operation of the image classification device according to the fifth embodiment. DETAILED DESCRIPTION
[0048] (First Embodiment)
[0049] Figure 1 1 is a block diagram of the image classification device 100 according to the first embodiment. The image classification device 100 performs a few-sample class addition learning for continuously learning an additional class including a small amount of training data after learning a basic class including a large amount of training data.
[0050] The image classification device 100 includes a feature extraction unit 10 , a local classification unit 20 , an overall classification unit 60 , a learning unit 70 , and a scaling setting unit 80 .
[0051] The partial classification section 20 includes a partial classification section 20B of a basic category for session 0 and partial classification sections 20N1 and 20N2 of additional categories for session 1 and session 2 .
[0052] The local classification unit 20B of the basic category of session 0 includes a feature distance measuring unit 22B. The local classification units 20N1 and 20N2 of the additional categories of session 1 and session 2 include feature distance measuring units 22N1 and 22N2 and scaling units 28N1 and 28N2.
[0053] Here, a case where the basic categories of session 0 are learned and then the additional categories of session 1 and session 2 are learned is described, but the number of additional categories is arbitrary.
[0054] Figure 2 2 is a flowchart illustrating the overall flow of learning by the image classification device 100. Figure 1 and Figure 2 The configuration and operation of the image classification device 100 will be described.
[0055] The basic training dataset contains a plurality of basic categories (eg, about 100 to 1000 categories), each of which is a supervised dataset consisting of a plurality of images (eg, 3000 images). It is assumed that the basic training dataset is a sufficient amount of data for learning a general classification task alone.
[0056] In contrast, the additional training data set includes a small number of additional categories (e.g., about 1 to 10 categories), and each additional category is a supervised data set consisting of a small number of images (e.g., about 1 to 10 images). In addition, here, it is assumed that it is a small number of images, but as long as it is a small number of categories, it can also be a large number of images.
[0057] The test data set can include all the categories of the basic categories and the additional categories learned before the additional learning session, and can include images not included in the basic training data set and the additional training data set. In addition, the test data set is an unsupervised data set consisting of about 100 images for each category. Here, each category is set to about 100 images, but each category can be any number of images. It is a data set for investigating generalization performance, and is also called real-shot data.
[0058] Here, the test data set includes all the basic categories and the additional categories learned before the additional learning session i, but the test data set may also include only the basic categories and a part of the additional categories learned before the additional learning session i.
[0059] The feature extraction unit 10 and the weight matrix of the basic category are learned based on the cosine distance using the basic training data set (S1). The learning session i is set to 0. This is also called the initial session.
[0060] If the learning of the feature extraction unit 10 and the weight matrix of the basic class is completed, the weight matrix of the basic class is regularized (S2). Thus, the learned feature extraction unit 10 and the weight matrix of the basic class are obtained for actual use. The learned feature extraction unit 10 and the weight matrix of the basic class are not updated during additional learning. This normalization step can also be set in Figure 4 The basic categories of learning are shown at the end.
[0061] The images of the basic categories that have been learned and included in the test data set are classified (S3). In the case where the test data set cannot be prepared, the image data of the categories that have been learned and included in the training data set are classified. If the basic categories do not need to be classified, this step does not need to be performed.
[0062] Next, the learning session i of continuous learning is repeated N times (i=1, 2, . . . , N).
[0063] Using the additional training dataset, weight matrices for additional categories of additional session i are learned based on cosine distance (S4).
[0064] When the learning is completed, the learned weight matrix is regularized and stored (S5).
[0065] Using the regularized weight matrix of the basic category of session 0 and the weight matrix of the additional category of session i, the scaling value of the additional category of session i is calculated (S6).
[0066] The learned basic categories and additional categories included in the test data set are classified (S7).
[0067] Increase i by 1, return to step S4, repeat steps S4 to S7 until i=N. If i exceeds N, end.
[0068] Detailed description Figure 2 The configuration and operation of the image classification device 100 in the learning of the basic categories shown in step S1. Figure 3 This is a diagram for explaining the detailed configuration of the image classification device 100 in the process of learning basic categories. Figure 4 1 is a flowchart for explaining the detailed operation of the image classification device 100 in learning the basic categories. Figure 3 and Figure 4 The learning of basic categories in session 0 by the image classification device 100 will be described.
[0069] The learning is repeated N times in units of the batch size. For example, the batch size is 128, and the learning (back propagation) is repeated as many times as required for 400 epochs.
[0070] The feature extraction unit 10 includes CONV1 to CONV5 and GAP1 (Global Average Pooling) which are convolutional layers of ResNet-18. GAP converts the feature map output from the convolutional layer into a feature vector. A 7×7 512-channel feature map is input to GAP1, and a 512-dimensional feature vector is output (S10).
[0071] The feature extraction unit 10 may be a deep learning network other than ResNet-18, such as VGG16, ResNet-34, and the dimension of the feature vector may be other than 512 dimensions.
[0072] The feature vector output from the GAP1 of the feature extraction unit 10 is input to the feature distance measuring unit 22B of the local classification unit 20B of the basic class.
[0073] Since the feature distance measuring unit 22B of the local classification unit 20B of the basic category and the feature distance measuring units 22N1 and 22N2 of the local classification units 20N1 and 20N2 of the additional category have the same configuration, they are collectively referred to as the feature distance measuring unit 22 for description.
[0074] Figure 5 2 is a diagram showing the configuration of the feature distance measuring unit 22. The feature distance measuring unit 22 includes a regularization unit 24 and a weight matrix unit 26.
[0075] The regularization unit 24 normalizes the input feature vector by L2 regularization.
[0076] The weight matrix unit 26 has weights of the linear layer (fully connected layer). It has a 512-dimensional weight vector for each classification category and a (512×NC)-dimensional weight matrix. Here, NC is the number of categories, but it can also be a number greater than the number of categories.
[0077] The weight matrix is regularized by the Euclidean norm (L2 regularization) (S12).
[0078] The input feature vector is input to the regularization unit 24 and normalized, and the normalized feature vector is input to the weight matrix unit 26. The weight matrix unit 26 calculates and outputs the NC-dimensional cosine distance vector (S14) as the cosine distance (cosine similarity) between the feature vector and the weight vector of each category to be classified. Afterwards, the cosine distance can also be replaced by the cosine similarity. By normalizing the feature vector to calculate the cosine distance, the intra-class variance is suppressed and the classification accuracy is improved.
[0079] The weights are regularized using the method described in the following paper.
[0080] Salimans, Tim, and Durk P. Kingma. "Weight normalization: A simple reparameterization to accelerate training of deep neural networks." Advances in neural information processing systems 29 (2016): 901-909.
[0081] The learning unit 70 calculates the cross entropy loss, which is the loss between the cosine distance vector and the correct solution category (labeled category) of the input image. In order to minimize the cross entropy loss, the weight matrix of the linear layer of the feature extraction unit 10 and the feature ranging unit 22B is learned by back propagation using an optimization method such as stochastic gradient descent (SGD) and Adam (S16).
[0082] Figure 6 This is a diagram for explaining the detailed structure of the image classification device 100 in the learning of additional categories. Here, for the sake of convenience, it is assumed that the learning of the basic categories of session 0 and the additional categories of session 1 is completed, and the case of learning the additional categories of session 2 is explained, but the same is true for the learning of additional categories in any session i=1, 2, ..., N.
[0083] In the learning of the additional category, the feature extraction unit 10 does not perform learning. In the learning of the additional category 2 in session 2, the local classification unit 20B of the basic category of session 0 and the local classification unit 20N1 of the additional category in session 1 are not learned. In the learning of the additional category in session 2, only the local classification unit 20N2 of the additional category in session 2 becomes the learning object.
[0084] exist Figure 6 In the example, except that the feature extraction unit 10 is not learned and the scaling value is calculated using the output of the local classification unit 20B of the basic category in session 0, the detailed structure and operation of each part of the image classification device 100 in the learning of the additional category are roughly the same as the detailed structure and operation of each part in the learning of the basic category, so the differences are mainly explained here.
[0085] The difference is that an additional training data set of a small number of images is used in a small number of categories. This is generally called few-shot learning, and learning is performed with N-way and K-samples. N represents the number of categories, and K represents the number of images. Generally, there are 5-way and 5-samples, 5-way and 1-sample, 10-way and 5-samples, etc.
[0086] Since there is a small amount of data, the batch size in the learning of the additional category is smaller than that of the basic category. For example, the batch size of the additional category is about N ways × M (M = 1 to K). Data expansion is performed on a small amount of data to increase the amount of data to L times (for example, L = 10) before learning.
[0087] The feature ranging unit 22N2 of the local classification unit 20N2 of the additional class in session 2 holds the weight matrix of the additional class as a weight matrix, and the number of classes is the number of additional classes.
[0088] The scaling unit 28N2 of the additional-category local classifying unit 20N2 of session 2 holds the scaling value input from the scaling setting 80 .
[0089] However, at this point, regarding the additional category, the classification accuracy based on the local classification unit 20N2 in the local classification space of the additional category is sufficient, but the classification accuracy based on the overall classification unit 60 in the synthetic classification space combining the basic category and the additional category is insufficient.
[0090] Figure 71 is a flowchart showing a calculation procedure of the scaling value of the additional category by the scaling setting unit 80. The scaling value α of the additional category of session 2 is calculated using the weight matrix of the basic category of session 0 and the weight matrix of the additional category of session 2 after regularization.
[0091] The definitions are as follows.
[0092] N: The total number of images contained in the additional training dataset for session 2
[0093] Nb: Number of categories of the basic category
[0094] Nn: Number of additional categories for session 2
[0095] Steps S20 to S28 are performed on the i-th image (i=1, 2, . . . , N).
[0096] The feature extraction unit 10 outputs a feature vector ( S20 ).
[0097] Regarding basic categories b (b=1, 2, . . . , Nb), the basic category feature distance measuring unit 22B of session 0 calculates cosine distances between weight vectors and feature vectors of all basic categories (S22).
[0098] The scaling setting unit 80 selects and stores the largest cosine distance among all basic categories ( S24 ).
[0099] Regarding additional categories n (n=1, 2, . . . , Nn), the feature distance measuring unit 22N2 of the additional categories of session 2 calculates the cosine distances between the weight vectors and the feature vectors of all the additional categories (S26).
[0100] The scaling setting unit 80 selects the largest cosine distance among all the additional categories and stores it ( S28 ).
[0101] Increase i by 1, return to step S20, repeat steps S20 to S28 until i=N. If i exceeds N, go to step S30.
[0102] The scaling setting unit 80 calculates the average value of the selected maximum cosine distances for each of the basic category and the additional category ( S30 ).
[0103] The scaling setting unit 80 calculates a scaling value of the cosine distance of the additional class based on the average value of the cosine distance of the basic class and the average value of the cosine distance of the additional class ( S32 ).
[0104] For all images included in the additional training dataset of session 2, execute Figure 7As long as the average value of the cosine distances output by the local classification unit 20B of the basic category of session 0 and the local classification unit 20N2 of the additional category of session 2 can be calculated for all images included in the additional training data set of session 2, it is not limited to Figure 7 steps.
[0105] The scaled value of the cosine distance for the additional category is obtained by the following formula.
[0106] Scaling value of cosine distance of additional category = average value of cosine distance of basic category ÷ average value of cosine distance of additional category × γ
[0107] Here, γ is a predetermined value. Here, for example, γ=1.0. If γ is increased, it is easier to select the additional category, and if γ is decreased, it is harder to select the additional category. In this way, γ can be set according to the importance of the basic category and the additional category.
[0108] As described above, according to the image classification device 100 of the present embodiment, by calculating and using the scaling value calculated based on the average value of the cosine distance of the basic category and the average value of the cosine distance of the additional category in each session, it is possible to eliminate the mismatch between the cosine distance of the basic category learned using big data and the cosine distance of the additional category learned using a small amount of data, and make the output level of the local classification unit consistent. In addition, by using the cosine distance of the basic category as a reference to scale the cosine distance of each additional category, it is possible to suppress the deviation of the cosine distance between additional sessions where the variance of the feature becomes larger. Thus, it is possible to classify the basic category and the additional category with high accuracy in the synthetic classification space without relying on the amount of data and learning conditions of the basic category and the additional category. Here, the average value of the cosine distance is used, but it may also be other statistics such as the central value, the maximum value, the minimum value, the total value, etc. that can represent the characteristics of the cosine distance.
[0109] Here, a scaling value calculated based on the average value of the cosine distance of the basic category and the average value of the cosine distance of the additional category is used, but the scaling value may also be a specified value. For example, the specified value is weighted according to the degree of learning of the weight matrix of the basic category and the degree of learning of the weight matrix of the additional category. The degree of learning is the ratio of the total number of images used in the learning of the weight matrix of the basic category to the total number of images used in the learning of the weight matrix of the additional category. The greater the total number of images used in the learning of the weight matrix of the basic category compared to the total number of images used in the learning of the weight matrix of the additional category, the larger the specified value.
[0110] Figure 81 is a diagram for explaining the detailed structure of the image classification device 100 for predicting and classifying the categories of images included in the test data set. Here, the case where learning is completed until the basic category of session 0, the additional category of session 1, and the additional category of session 2 is explained. Here, in order to simplify the description, the scaling unit is not provided in the local classification unit 20B of the basic category, but the scaling unit may be provided in the local classification unit 20B.
[0111] The image input to the feature extraction unit 10 is processed in each convolution layer, and the feature vector output from GAP1 is input to the feature ranging unit 22B of the local classification unit 20B of the basic category and the feature ranging units 22N1 and 22N2 of the local classification units 20N1 and 20N2 of the additional category.
[0112] The feature distance measuring units 22B, 22N1, and 22N2 calculate the cosine distance between the weight vector and the feature vector input from GAP1, and calculate a cosine distance vector having a dimension equal to the number of classes.
[0113] The feature distance measuring unit 22B of the basic class of session 0 outputs the cosine distance vector to the overall classification unit 60 .
[0114] The feature distance measuring units 22N1 and 22N2 of the additional category of session 1 and session 2 output the calculated cosine distance vectors to the scaling units 28N1 and 28N2, respectively.
[0115] The scaling units 28N1 and 28N2 for adding categories of session 1 and session 2 scale the cosine distances input from the feature distance measuring units 22N1 and 22N2 by their respective scaling values and output the scaled values to the overall classification unit 60 .
[0116] The overall classification unit 60 selects a category with the largest cosine similarity (ie, the shortest cosine distance) from the cosine distance vectors of the basic category of session 0, the additional category of session 1, and the additional category of session 2, and outputs the determined category.
[0117] As described above, according to the image classification device 100 of the present embodiment, by pre-storing the regularized weight matrices of all the categories of the basic category and the additional category, the categories learned in the past are not forgotten.
[0118] In addition, the image can be easily classified simply by comparing the feature vector of the input image with the weight vector of each category.
[0119] In addition, by applying a scaling value calculated from the average of the cosine distances of the basic category and the average of the cosine distances of the additional category to the cosine distance of the additional category, the level of the cosine distances of the basic category learned using big data and the additional category learned using a small amount of data can be made consistent. As a result, in the synthetic classification space, the basic category and the additional category can be accurately classified.
[0120] (Second Embodiment)
[0121] Fig. 9 2 is a block diagram of an image classification device 200 according to the second embodiment. The description of the common configuration and operation with the first embodiment will be appropriately omitted.
[0122] The image classification device 200 includes a feature extraction unit 210 , a local classification unit 220 , an overall classification unit 260 , a learning unit 270 , and a scaling setting unit 280 .
[0123] Feature vectors of a plurality of resolutions are output from the feature extraction unit 210. Here, as an example of feature vectors of a plurality of resolutions, a low-resolution general feature vector and a high-resolution detailed feature vector are given.
[0124] The local classification unit 220 includes a local classification unit 220B of a basic category for session 0 and a local classification unit 220N1 of an additional category for session 1 .
[0125] The local classification unit 220B of the basic category of session 0 includes a general feature distance measurement unit 222Ba, a detailed feature distance measurement unit 222Bb, and a feature distance synthesis unit 230B. The local classification unit 220N1 of the additional category of session 1 includes a general feature distance measurement unit 222N1a, a detailed feature distance measurement unit 222N1b, a general feature scaling unit 228N1a, a detailed feature scaling unit 228N1b, and a feature distance synthesis unit 230N1.
[0126] Here, a case where additional categories for session 1 are learned after basic categories for session 0 are learned is described, but the number of additional categories is arbitrary.
[0127] The learning unit 270 includes a general feature learning unit 270 a and a detailed feature learning unit 270 b .
[0128] The zoom setting unit 280 includes a general zoom setting unit 280 a and a detailed zoom setting unit 280 b .
[0129] Fig.10 2 is a flowchart illustrating the overall flow of learning by the image classification device 200. Fig. 9 and Fig.10 The configuration and operation of the image classification device 200 will be described.
[0130] Using the basic training data set, the feature extraction unit 210 and the basic category's summary weight matrix and detailed weight matrix are learned based on the cosine distance (S201). The learning session i is set to 0. This is also called the initial session.
[0131] If the learning of the feature extraction unit 210, the basic category summary weight matrix and the detailed weight matrix is completed, the basic category summary weight matrix and the detailed weight matrix are regularized (S202). Thus, the learned feature extraction unit 210, the basic category summary weight matrix and the detailed weight matrix are obtained for actual use. The learned feature extraction unit 210, the basic category summary weight matrix and the detailed weight matrix are not updated during additional learning. This normalization step can also be set in Fig.12 The basic categories of learning are shown at the end.
[0132] The images of the learned basic categories included in the test data set are classified (S203). If the test data set cannot be prepared, the image data of the learned categories included in the training data set are classified.
[0133] Next, the learning session i of continuous learning is repeated N times (i=1, 2, . . . , N).
[0134] Using the additional training data set, a summary weight matrix and a detailed weight matrix of additional categories of the additional session i are learned based on the cosine distance ( S204 ).
[0135] When the learning is completed, the learned summary weight matrix and detailed weight matrix are regularized and stored (S205).
[0136] The scaling values of the general cosine distance and the detailed cosine distance are calculated ( S206 ).
[0137] The learned basic categories and additional categories included in the test data set are classified (S207).
[0138] Increase i by 1, return to step S14, repeat steps S24 to S27 until i=N. If i exceeds N, end.
[0139] Will explain in detail Fig.10 The configuration and operation of the image classification device 200 in basic category learning shown in step S201. Fig.11 This is a diagram for explaining the detailed configuration of the image classification device 200 in the learning of basic categories. Fig.12 2 is a flowchart for explaining the detailed operation of the image classification device 200 in learning the basic categories. Fig.11 and Fig.12 The learning of basic categories in session 0 by the image classification device 200 will be described.
[0140] The basic operation is the same as that of Embodiment 1. The difference from Embodiment 1 is that GAP2 is added to the feature extraction unit 210, a detailed feature ranging unit 222Bb is added to the local classification unit 220B of the basic category, and a detailed feature learning unit 270b is added to the learning unit 270. The detailed feature learning unit 270b learns only the detailed feature ranging unit 222Bb. Here, the general feature learning unit 270a causes the feature extraction unit 210 and the general feature ranging unit 222Ba to learn, and the detailed feature learning unit 270b causes the detailed feature ranging unit 222Bb to learn, but it is also possible that the general feature learning unit 270a causes the general feature ranging unit 222Ba to learn, and the detailed feature learning unit 270b causes the feature extraction unit 210 and the detailed feature ranging unit 222Bb to learn. Alternatively, the general feature learning unit 270a may cause the feature extraction unit 210 and the general feature distance measuring unit 222Ba to perform learning, and the detailed feature learning unit 270b may cause the feature extraction unit 210 and the detailed feature distance measuring unit 222Bb to perform learning.
[0141] The feature extraction unit 210 includes CONV1 to CONV5, GAP1 and GAP2, which are convolutional layers of ResNet-18. GAP converts the feature map output by the convolutional layer into a feature vector. A 7×7 512-channel feature map is input to GAP1, and a 512-dimensional summary feature vector is output. The output of CONV4 is input to GAP2. A 14×14 256-channel feature map is input to GAP2, and a 256-dimensional detailed feature vector is output (S210).
[0142] The feature extraction unit 210 can be a deep learning network other than ResNet-18, such as VGG16 and ResNet-34, and the dimension of the feature vector can also be a combination other than 512 and 256. In addition, the feature map input to GAP2 can also be a convolutional layer other than CONV4, such as CONV3 and CONV2. There can also be more than 3 GAPs.
[0143] The general feature vector output from GAP1 of the feature extraction unit 210 is output to the general feature distance measuring unit 222Ba of the basic class local classification unit 220B, and the detailed feature vector output from GAP2 of the feature extraction unit 210 is output to the detailed feature distance measuring unit 222Bb of the basic class local classification unit 220B.
[0144] The general feature ranging unit 222Ba of the local classification unit 220B of the basic category and the general feature ranging units 222N1a and 222N2a of the local classification units 220N1 and 220N2 of the additional category have the same structure, so they are collectively referred to as the general feature ranging unit 222a for explanation. The detailed feature ranging unit 222Bb of the local classification unit 220B of the basic category and the detailed feature ranging units 222N1b and 222N2b of the local classification units 220N1 and 220N2 of the additional category have the same structure, so they are collectively referred to as the detailed feature ranging unit 222b for explanation.
[0145] The configuration of the general feature distance measuring unit 222a and the detailed feature distance measuring unit 222b is as follows: Figure 5 The feature distance measuring unit 22 of the first embodiment shown has the same configuration as that of the first embodiment, and includes a regularization unit and a weight matrix unit.
[0146] The normalization unit of the summary feature ranging unit 222a normalizes the input summary feature vector by L2 regularization. The weight matrix unit of the summary feature ranging unit 222a includes a linear layer, has a 512-dimensional summary weight vector for each category, and has a (512×NC)-dimensional summary weight matrix (NC is the number of categories). The summary weight matrix is regularized by the Euclidean norm (L2 regularization) (S212).
[0147] The normalization unit of the detailed feature ranging unit 222b normalizes the input detailed feature vector by L2 regularization. The weight matrix unit of the detailed feature ranging unit 222b includes a linear layer, a detailed weight vector with 512 dimensions for each category, and a detailed weight matrix with (512×NC) dimensions. The detailed weight matrix is regularized by the Euclidean norm (L2 regularization) (S212).
[0148] The input summary feature vector is input to the regularization unit of the summary feature distance measurement unit 222a and normalized, and the normalized summary feature vector is input to the weight matrix unit of the summary feature distance measurement unit 222a. The weight matrix unit of the summary feature distance measurement unit 222a calculates the cosine distance (cosine similarity) between the summary feature vector and the summary weight vector of each category, that is, the NC-dimensional summary cosine distance vector and outputs it (S214).
[0149] The input detailed feature vector is input to the regularization unit of the detailed feature distance measurement unit 222b and normalized, and the normalized detailed feature vector is input to the weight matrix unit of the detailed feature distance measurement unit 222b. The weight matrix unit of the detailed feature distance measurement unit 222b calculates the cosine distance (cosine similarity) between the detailed feature vector and the detailed weight vector of each category, that is, the NC-dimensional detailed cosine distance vector and outputs it (S216).
[0150] The summary feature learning unit 270a calculates the cross entropy loss, which is the loss between the summary cosine distance vector and the correct solution category (labeled category) of the input image, and optimizes the feature extraction unit 210 and the summary weight matrix to minimize the cross entropy loss (S218).
[0151] The detailed feature learning unit 270b calculates the cross entropy loss, which is the loss between the detailed cosine distance vector and the correct solution class (labeled class) of the input image, and optimizes the detailed weight matrix to minimize the cross entropy loss (S220).
[0152] Fig.13 This is a diagram for explaining the detailed structure of the image classification device 200 in the classification of the basic category. Fig.14 2 is a flowchart for explaining the detailed operation of the image classification device 200 in the classification of the basic category. Fig.13 and Fig.14 Classification based on the basic categories by the image classification device 200 will be described.
[0153] The feature extraction unit 210 outputs a general feature vector from GAP1 and outputs a detailed feature vector from GAP2 ( S230 ).
[0154] The general feature distance measuring unit 222Ba calculates the cosine distance between the general feature vector and the general weight vector of each category, that is, the general cosine distance of NC dimension, and outputs it ( S232 ).
[0155] The detailed feature distance measuring unit 222Bb calculates the cosine distance between the detailed feature vector and the detailed weight vector of each category, that is, the NC-dimensional detailed cosine distance, and outputs it ( S234 ).
[0156] The feature distance synthesis unit 230B adds the summary cosine distance vector Da and the detailed cosine distance vector Db to calculate an NC-dimensional synthesized cosine distance vector ( S236 ). The feature distance synthesis unit 230B outputs the synthesized cosine distance vector to the overall classification unit 260 .
[0157] Here, the summary cosine distance vector Da and the detailed cosine distance vector Db are simply added, but they may be weightedly added as shown in the following equation: The weight parameter α is set to a predetermined value between 0 and 1, and is set to 0.7 in this case.
[0158] Dc=αDa+(1-α)Db
[0159] The weighting parameter α can also be changed according to the position of the feature map that is the input of GAP2. For example, the closer the position of the feature map that is the input of GAP2 is to GAP1, the smaller α is set, and the farther the position of the feature map that is the input of GAP2 is from GAP1, the larger α is set.
[0160] The overall classification unit 260 selects a class having the shortest cosine distance from among the composite cosine distances of the classes, and outputs the determined class ( S238 ).
[0161] Fig.15 This is a diagram for explaining the detailed structure and operation of the image classification device 200 in the learning of additional categories. Here, for the sake of convenience, it is assumed that the learning of the basic categories of session 0 is completed, and the case of learning the additional categories of session 1 is explained, but the same is true for the learning of additional categories in any session i=1, 2, ..., N.
[0162] In learning the additional category, the feature extraction unit 210 does not perform learning. In learning the additional category of session 1, the local classification unit 220B of the basic category of session 0 does not perform learning. In learning the additional category of session 1, only the local classification unit 220N1 of the additional category of session 1 becomes the learning object.
[0163] The detailed structure and operation of learning the additional category are the same as those of learning the basic category, except that the feature extraction unit 210 is not made to learn. In addition, the basic structure and operation of learning the additional category in Implementation 2 are the same as those in Implementation 1, except that they are separated from the outline in detail. Here, only the differences are described.
[0164] The summary scaling setting unit 280a calculates the scaling value of the summary cosine distance of the additional category of session 1 based on the average value of the summary cosine distance of the basic category output from the summary feature ranging unit 222Ba of the basic category of session 0 and the average value of the summary cosine distance of the additional category output from the summary feature ranging unit 222N1a of the additional category of session 1, and outputs it to the summary feature scaling unit 228N1a of the additional category of session 1.
[0165] The detailed scaling setting unit 280b calculates the scaling value of the detailed cosine distance of the additional category of session 1 based on the average value of the detailed cosine distance of the basic category output from the detailed feature ranging unit 222Bb of the basic category of session 0 and the average value of the detailed cosine distance of the additional category output from the detailed feature ranging unit 222N1b of the additional category of session 1, and outputs it to the detailed feature scaling unit 228N1b of the additional category of session 1.
[0166] The scaling value of the summary cosine distance of the additional category and the scaling value of the detailed cosine distance of the additional category are calculated by the following formula.
[0167] Scaling value of the summary cosine distance of the additional category = average value of the summary cosine distance of the basic category ÷ average value of the summary cosine distance of the additional category × γa
[0168] Scaling value of detailed cosine distance of additional category = average value of detailed cosine distance of basic category ÷ average value of detailed cosine distance of additional category × γb
[0169] Here, γa and γb are specified values. γa and γb may be the same value or different values. When γb is larger than γa, an additional category is selected that prioritizes detailed features, and when γb is smaller than γa, an additional category is selected that prioritizes summary features. For example, by setting γa=1.0 and γb=1.1, an additional category is selected that prioritizes detailed features, and by setting γa=1.1 and γb=1.0, an additional category is selected that prioritizes summary features. In addition, by setting γa=γb=1.0, summary features and detailed features can be processed equally.
[0170] Fig.16 This is a diagram for explaining the detailed structure of the image classification device 200 for predicting and classifying the categories of images included in the test data set. Here, the case where learning is completed until the basic category of session 0, the additional category of session 1, and the additional category of session 2 is described.
[0171] The image input to the feature extraction unit 210 is processed in each convolutional layer, and the summary feature vector output from GAP1 is input to the summary feature ranging unit 222Ba of the local classification unit 220B of the basic category of session 0, and the summary feature ranging units 222N1a and 222N2a of the local classification units 220N1 and 220N2 of the additional categories of session 1 and session 2.
[0172] The detailed feature vector output from GAP2 is input to the detailed feature ranging unit 222Bb of the local classification unit 220B of the basic category of session 0, and the detailed feature ranging units 222N1b and 222N2b of the local classification units 220N1 and 220N2 of the additional categories of sessions 1 and 2.
[0173] The general feature distance measuring units 222Ba, 222N1a, and 222N2a calculate the general cosine distance between the general weight vector and the general feature vector input from GAP1, and calculate an NC-dimensional general cosine distance vector.
[0174] The detailed feature distance measuring units 222Bb, 222N1b, and 222N2b calculate the detailed cosine distance between the detailed weight vector and the detailed feature vector input from GAP2, and calculate an NC-dimensional detailed cosine distance vector.
[0175] The feature distance synthesis unit 230B of the basic category of conversation 0 adds or weighted-adds the general cosine distance vector and the detailed cosine distance vector to calculate a synthesized cosine distance vector, and outputs the synthesized cosine distance vector to the overall classification unit 260 .
[0176] The summary feature distance measuring units 222N1a and 222N2a of the additional category of session 1 and session 2 output the calculated summary cosine distance vectors to the summary feature scaling units 228N1a and 228N2a, respectively.
[0177] The detailed feature distance measuring units 222N1b and 222N2b of the additional category of session 1 and session 2 output the calculated detailed cosine distance vectors to the detailed feature scaling units 228N1b and 228N2b, respectively.
[0178] The general feature scaling units 228N1a and 228N2a of the additional categories of session 1 and session 2 scale the general cosine distance vectors input from the general feature distance measuring units 222N1a and 222N2a with their respective scaling values and output the scaled vectors to the feature distance synthesis units 230N1 and 230N2.
[0179] The detailed feature scaling units 228N1b and 228N2b of the additional categories of session 1 and session 2 scale the detailed cosine distance vectors input from the detailed feature ranging units 222N1b and 222N2b with their respective scaling values and output the scaled detailed cosine distance vectors to the feature distance synthesis units 230N1 and 230N2.
[0180] The feature distance synthesis units 230N1 and 230N2 of the additional category 2 of session 1 and session 2 respectively add or perform weighted addition on the general cosine distance vector and the detailed cosine distance vector to calculate a synthesized cosine distance vector, and output the synthesized cosine distance vector to the overall classification unit 260 .
[0181] The overall classification unit 260 selects a category with the largest cosine similarity (ie, the shortest cosine distance) from the combined cosine distance vectors of the basic category of session 0, the additional category of session 1, and the additional category of session 2, and outputs the determined category.
[0182] As described above, according to the image classification device 200 of this embodiment, by storing the regularized general weight matrices and detailed weight matrices of all the basic categories and the additional categories, the categories learned in the past are not forgotten.
[0183] In addition, the image can be easily classified simply by comparing the feature vector of the input image with the weight vector of each category.
[0184] In addition, by using both the summary weight matrix and the detailed weight matrix, the features of the input image can be classified by evaluating both the summary features as conceptual features and the detailed features as specific features separately by cosine distance, and a higher-precision classification can be performed in the additional session i. In a certain category, the accuracy is improved by using more conceptual features, and in other categories, the accuracy is improved by using more specific features. In particular, in the case where classification is difficult using only summary features, the effect can be obtained by using detailed features.
[0185] In addition, by calculating and utilizing the scaling values calculated from the average values of the cosine distances of the basic category and the cosine distances of the additional category separately in the summary feature and the detailed feature, the variance within the category can be further suppressed even in the additional category with a small amount of data where the variance of the feature becomes large. Thus, in the synthetic classification space, the basic category and the additional category can be classified.
[0186] In this embodiment, in order to support additional learning for the few-sample class, the general feature ranging unit stores all general weight matrices of the basic class and the additional class, and the detailed feature ranging unit stores all detailed weight matrices of the basic class and the additional class.
[0187] In the few-sample learning, for the next learning session, the summary feature distance measurement unit and the detailed feature distance measurement unit do not need to store the weight matrices of the basic category and the additional category, and only the feature extraction unit is retained. In addition, in the feature distance synthesis unit, the scaling value α of the basic category and the scaling value α of the additional category can be set to different values.
[0188] Furthermore, in order to support the technology of expanding few-shot classification learning called generalized few shot learning, the general feature ranging unit and the detailed feature ranging unit may store the weight matrix of the basic class and not store the weight matrix of the additional class.
[0189] In addition, in the second embodiment, in order to eliminate the mismatch between the cosine distances of the basic category learned using big data and the additional category learned using a small amount of data, a scaling value calculated from the average value of the cosine distances of the basic category and the average value of the cosine distances of the additional category is calculated in each session and used, thereby making the output level of the local classification unit consistent. As a variation of the second embodiment, the scaling configuration may also be omitted from the second embodiment.
[0190] (Third Embodiment)
[0191] Fig.172 is a block diagram of an image classification device 300 according to the third embodiment. The description of the same structure as the second embodiment will be appropriately omitted.
[0192] The image classification device 300 includes a feature extraction unit 310 , a feature frequency conversion unit 312 , a local classification unit 320 , a global classification unit 360 , a learning unit 370 , and a scaling setting unit 380 .
[0193] In the second embodiment, as an example of feature vectors of multiple resolutions, the feature extraction unit 210 generates a summary feature vector and a detailed feature vector, but in the third embodiment, the difference is that the feature frequency conversion unit 312 performs a frequency conversion on the feature vector output by the feature extraction unit 310 to generate a low-frequency feature vector and a high-frequency feature vector.
[0194] The local classification unit 320 includes a local classification unit 320B of a basic category for session 0 and a local classification unit 320N1 of an additional category for session 1 .
[0195] The local classification unit 320B of the basic category of session 0 includes a low-frequency feature ranging unit 322Ba, a high-frequency feature ranging unit 322Bb, and a feature distance synthesis unit 330B. The local classification unit 320N1 of the additional category of session 1 includes a low-frequency feature ranging unit 322N1a, a high-frequency feature ranging unit 322N1b, a low-frequency feature scaling unit 328N1a, a high-frequency feature scaling unit 328N1b, and a feature distance synthesis unit 330N1.
[0196] The learning unit 370 includes a low-frequency feature learning unit 370 a and a high-frequency feature learning unit 370 b .
[0197] The scaling setting section 380 includes a low-frequency scaling setting section 380 a and a high-frequency scaling setting section 380 b .
[0198] In order to explain the configuration below without distinguishing between the basic category and the additional category, the symbol "B" representing the basic category of session 0 and the symbols "N1" and "N2" representing the additional categories of session 1 and session 2 are omitted.
[0199] The configuration of the feature extraction unit 310 is the same as the configuration of the feature extraction unit 10 in the first embodiment.
[0200] The feature frequency transformation unit 312 applies a two-dimensional DCT (discrete cosine transform) to each of the 7×7 feature maps, transforms the feature quantity into the frequency domain and divides it into two frequency regions, a low-frequency domain and a high-frequency domain, converts the low-frequency domain feature quantity into one dimension to generate a low-frequency feature vector, and converts the high-frequency domain feature quantity into one dimension to generate a high-frequency feature vector.
[0201] Fig.18 (a) and Fig.18(b) is a diagram showing an example of division into two frequency regions, low frequency and high frequency. The low frequency region is a filled region, and the high frequency region is a shaded region. Fig.18 In the case of (a), the feature frequency conversion unit 312 converts the low-frequency feature quantity into one dimension to generate a 2048-dimensional low-frequency feature vector, and converts the high-frequency feature quantity into one dimension to generate a 25088-dimensional high-frequency feature vector.
[0202] like Fig.18 As shown in (b), the low-frequency region can be a DC component, and all frequency components do not need to be included in the low-frequency region and the high-frequency region. In addition, the low-frequency region can be extended to the higher frequency side. In addition, if it can be divided into a low-frequency region and a high-frequency region, it is also possible to use a two-dimensional FFT (Fourier transform) instead of a two-dimensional DCT.
[0203] The feature frequency conversion section 312 supplies the low-frequency feature vector to the low-frequency feature ranging section 322 a of the local classification section 320 , and supplies the high-frequency feature vector to the high-frequency feature ranging section 322 b of the local classification section 320 .
[0204] The low-frequency feature ranging unit 322a includes a linear layer with weights of the number of categories NC. The linear layer has a 2048-dimensional low-frequency weight vector for each category as an example, and a (2048×NC)-dimensional low-frequency weight matrix. The low-frequency feature ranging unit 322a inputs the low-frequency feature vector normalized by L2 regularization into the linear layer, and calculates an NC-dimensional low-frequency cosine distance vector, which is the cosine distance (cosine similarity) between the low-frequency feature vector and the low-frequency weight vector of each category.
[0205] The high-frequency feature ranging unit 322b includes a linear layer with weights of the number of categories NC. The linear layer has a 25088-dimensional high-frequency weight vector for each category as an example, and a (25088×NC)-dimensional high-frequency weight matrix. The high-frequency feature ranging unit 322b inputs the high-frequency feature vector normalized by L2 regularization to the linear layer, and calculates the cosine distance (cosine similarity) between the high-frequency feature vector and the high-frequency weight vector of each category, that is, the NC-dimensional high-frequency cosine distance vector.
[0206] Regarding the subsequent configuration and processing, the “general feature vector” and “detailed feature vector” of the second embodiment are simply replaced by “low-frequency feature vector” and “high-frequency feature vector” in the third embodiment, and thus description thereof is omitted.
[0207] As described above, according to the image classification device 300 of this embodiment, by calculating the cosine distance (cosine similarity) between the feature vectors of multiple frequency components output from the feature frequency conversion unit 312 and the weight vector of the learned category, and synthesizing the cosine distance of each resolution in which the intra-class variance is suppressed, it is possible to evaluate the similarity of both the low-frequency component and the high-frequency component, compared with the cosine distance calculated based on a single feature vector and the weight vector of the learned category, and to perform classification with high accuracy.
[0208] In addition, the low-frequency component and the high-frequency component are also interpreted as the feature average component and the feature edge component, respectively. That is, by utilizing the features of both the low-frequency component and the high-frequency component, the features of the input image are classified using both the average feature and the shape feature, thereby enabling more accurate classification.
[0209] In addition, by storing the regularized low-frequency weight matrices and high-frequency weight matrices of all categories of the base category and the additional categories, the categories learned in the past will not be forgotten.
[0210] In addition, by using both the low-frequency weight matrix and the high-frequency weight matrix to classify the features of the input image by evaluating both the average feature and the shape feature, more accurate classification can be performed even in an additional session.
[0211] (Fourth Embodiment)
[0212] Fig.19 2 is a block diagram of an image classification device 400 according to a fourth embodiment. The same reference numerals as those in the third embodiment are used to denote the same components as those in the third embodiment, and description thereof will be omitted.
[0213] The image classification device 400 includes a low-pass filter 402 , a high-pass filter 404 , a feature extraction unit 410 , a local classification unit 320 , a global classification unit 360 , a learning unit 370 , and a scaling setting unit 380 .
[0214] In the third embodiment, the feature frequency conversion unit 312 performs frequency conversion on the feature vector output by the feature extraction unit 310 to generate a low-frequency feature vector and a high-frequency feature vector, but in the fourth embodiment, the difference is that the low-pass filter 402 and the high-pass filter 404 convert the input image into a low-frequency image and a high-frequency image, respectively, and provide them to the feature extraction unit 410.
[0215] In order to explain the configuration below without distinguishing between the basic category and the additional category, the symbol "B" representing the basic category of session 0 and the symbols "N1" and "N2" representing the additional categories of session 1 and session 2 are omitted.
[0216] The low-pass filter 402 transforms the input image into the frequency domain by FFT, removes frequency components higher than a predetermined frequency, and transforms it into an image composed of components below a predetermined frequency, i.e., a low-frequency image, by inverse FFT. The low-pass filter 402 outputs the low-frequency image to the low-frequency feature extraction unit 410a of the feature extraction unit 410.
[0217] The low-frequency feature extraction unit 410 a has the same configuration as the feature extraction unit 10 , and outputs a 512-dimensional low-frequency feature vector to the low-frequency feature distance measuring unit 322 a of the local classification unit 320 , as an example.
[0218] The high-pass filter 404 transforms the input image into the frequency domain by FFT, removes frequency components lower than a predetermined frequency, and transforms it into an image composed of components above a predetermined frequency, i.e., a high-frequency image, by inverse FFT. The high-pass filter 404 outputs the high-frequency image to the high-frequency feature extraction unit 410b of the feature extraction unit 410.
[0219] The high-frequency feature extraction unit 410 b has the same configuration as the feature extraction unit 10 , and outputs a 512-dimensional high-frequency feature vector to the high-frequency feature distance measuring unit 322 b of the local classification unit 320 , as an example.
[0220] Regarding the subsequent configuration and processing, the “general feature vector” and “detailed feature vector” of the second embodiment are simply replaced by “low-frequency feature vector” and “high-frequency feature vector” in the fourth embodiment, and thus the description thereof is omitted.
[0221] (Fifth Embodiment)
[0222] Fig. 20 It is a diagram showing the configuration of an image classification device 500 according to the fifth embodiment. Fig.21 1 is a flowchart for explaining the detailed operation of the image classification device 500 according to the fifth embodiment. The description of the configuration and operation common to the second embodiment is appropriately omitted. Fig. 20 feature distance synthesis unit 223. In addition, this embodiment is described based on the differences from embodiment 2, but this embodiment is not limited to embodiment 2, and can also be applied to embodiments 3 and 4. When this embodiment is applied to embodiments 3 and 4, in this embodiment, the "low frequency" and "high frequency" of embodiments 3 and 4 are replaced with "overview" and "details", respectively. In addition, the image classification device 500 may also be referred to as an "image feature learning device" when referring to the characteristics of the structure and action during learning.
[0223] The general feature ranging unit 222Ba of the local classification unit 220B of the basic category and the general feature ranging units 222N1a and 222N2a of the local classification units 220N1 and 220N2 of the additional category have the same structure, so they are collectively referred to as the general feature ranging unit 222a for explanation. The detailed feature ranging unit 222Bb of the local classification unit 220B of the basic category and the detailed feature ranging units 222N1b and 222N2b of the local classification units 220N1 and 220N2 of the additional category have the same structure, so they are collectively referred to as the detailed feature ranging unit 222b for explanation.
[0224] In the second embodiment, the feature extraction unit 210 and the general feature distance measuring unit 222a are learned by the general feature learning unit 270a, and the detailed feature distance measuring unit 222b is learned by the detailed feature learning unit 270b. In the fifth embodiment, the feature extraction unit 210, the general feature distance measuring unit 222a, and the detailed feature distance measuring unit 222b are learned by the learning unit 550.
[0225] The learning unit 550 includes a summary loss calculation unit 552 a , a detailed loss calculation unit 552 b , a loss weighted addition unit 554 , and an optimization unit 556 .
[0226] The feature extraction unit 210 extracts a general feature vector and a detailed feature vector from an input image ( S510 ).
[0227] The general feature vector output from GAP1 of the feature extraction unit 210 is output to the general feature distance measuring unit 222 a of the local classification unit 220 , and the detailed feature vector output from GAP2 of the feature extraction unit 210 is output to the detailed feature distance measuring unit 222 b of the local classification unit 220 .
[0228] The general feature ranging unit 222a and the detailed feature ranging unit 222b include a regularization unit and a weight matrix unit. The normalization unit of the general feature ranging unit 222a normalizes the input general feature vector by L2 regularization, and the normalization unit of the detailed feature ranging unit 222b normalizes the input detailed feature vector by L2 regularization (S511).
[0229] The input summary feature vector is input to the regularization unit of the summary feature ranging unit 222a and normalized, and the normalized summary feature vector is input to the weight matrix unit of the summary feature ranging unit 222a. The weight matrix unit of the summary feature ranging unit 222a calculates the cosine distance (cosine similarity) between the summary feature vector and the summary weight vector of each category, that is, the NC-dimensional summary cosine distance vector and outputs it (S512a).
[0230] The input detailed feature vector is input to the regularization unit of the detailed feature distance measurement unit 222b and normalized, and the normalized detailed feature vector is input to the weight matrix unit of the detailed feature distance measurement unit 222b. The weight matrix unit of the detailed feature distance measurement unit 222b calculates the cosine distance (cosine similarity) between the detailed feature vector and the detailed weight vector of each category, that is, the NC-dimensional detailed cosine distance vector and outputs it (S512b).
[0231] The summary loss calculation unit 552a calculates the summary cross entropy loss which is the loss between the summary cosine distance vector and the correct answer label (correct answer class) of the input image (S513a).
[0232] The detailed loss calculation unit 552b calculates the detailed cross entropy loss which is the loss between the detailed cosine distance vector and the correct answer label (correct answer class) of the input image (S513b).
[0233] The loss weighted addition unit 554 performs weighted addition of the summary cross entropy loss Ld and the detailed cross entropy loss Ls to calculate the total cross entropy loss L (S514). Here, λ is set to a specified value between 0 and 1, for example, 0.2. Here, 0.2 is used as λ, but for example, it is also possible to decide which value between 0 and 1 to use in the initial session. For example, in the initial session, all values of every 0.05 scale from 0 to 1 can be learned as λ to measure accuracy, and the value that can obtain the best classification result can be selected as λ. If it is configured in this way, the initial session can also be performed by offline processing, and the additional session can be performed by online processing.
[0234] L=(1-λ)*Ld+λ*Ls
[0235] The optimization unit 556 uses optimization methods such as stochastic gradient descent (SGD) and Adam to optimize the weight matrices of the feature extraction unit 210, the summary feature ranging unit 222a and the detailed feature ranging unit 222b in a back-propagation manner to minimize the total cross entropy loss (S515).
[0236] When calculating the total cross entropy loss, the summary cross entropy loss of the entire convolution object is prioritized over the detailed cross entropy loss of a partial region of the convolution object. When the summary cross entropy loss is prioritized, the above-mentioned λ uses a value from 0 to less than 0.5. That is, when weighting the summary cross entropy loss and the detailed cross entropy loss, the weighting coefficient of the summary cross entropy loss is made greater than the weighting coefficient of the detailed cross entropy loss, and the weighted summary cross entropy loss and the weighted detailed cross entropy loss are added. In this way, learning can be performed while giving priority to the object as a whole and also taking into account a partial region of the object. More specifically, when the overall features of multiple objects in an image are similar, but the features of a partial region between the objects are different, appropriate learning can be achieved.
[0237] The various processes of the image classification devices 100, 200, 300, 400, and 500 described above can of course be implemented as a device using hardware such as a CPU and a memory, and can also be implemented by firmware stored in a ROM (read-only memory), a flash memory, or software such as a computer. The firmware program and software program can be recorded in a readable recording medium such as a computer and provided, and can also be sent and received with a server through a wired or wireless network, and can also be sent and received as a data broadcast of a terrestrial wave or satellite digital broadcast.
[0238] The present invention has been described above based on the embodiments. The embodiments are illustrative only, and a person skilled in the art will appreciate that various modifications are possible in the combination of these components and processing steps, and such modifications are also within the scope of the present invention.
[0239] Industrial availability
[0240] The present invention can be used in image classification technology.
[0241] Explanation of symbols
[0242] 10 feature extraction unit, 20, 20B, 20N, 20N local classification unit, 22, 22B, 22N1, 22N2 feature distance measurement unit, 24 regularization unit, 26 weight matrix unit, 28N1, 28N2 scaling unit, 60 overall classification unit, 70 learning unit, 80 scaling setting unit, 100 image classification device, 200 image classification device, 210 feature extraction unit, 220, 220B, 220N1, 220N2 local classification unit, 222Ba, 222N1a, 222N2a summary feature distance measurement unit, 222Bb, 222N1b, 222N2b detailed feature distance measurement unit, 228N1a, 228N2a summary feature scaling unit, 228N1b, 228N2b detailed feature scaling unit, 230B, 230N1, 230N2 feature distance synthesis unit, 26 0 overall classification unit, 270 learning unit, 270a summary feature learning unit, 270b detailed feature learning unit, 280 scaling setting unit, 280a summary scaling setting unit, 280b detailed scaling setting unit, 300 image classification device, 310 feature extraction unit, 312 feature frequency conversion unit, 320 local classification unit, 322a low-frequency feature ranging unit, 322b high-frequency feature ranging unit, 360 overall classification unit, 370 learning unit, 380 scaling setting unit, 400 image classification device, 402 low-pass filter, 404 high-pass filter, 410 feature extraction unit, 410a low-frequency feature extraction unit, 410b high-frequency feature extraction unit, 500 image classification device, 550 learning unit, 552a summary loss calculation unit, 552b detailed loss calculation unit 554 loss weighted addition unit 556 optimization unit.
Claims
1. An image classification device, characterized in that: include: A feature extraction unit extracts a low-resolution summary feature vector and a high-resolution detailed feature vector of an input image; A summary feature distance measuring unit, which maintains summary weight vectors of various categories and calculates summary distance vectors based on the summary feature vectors and the summary weight vectors; A detailed feature distance measuring unit, which maintains detailed weight vectors for each category and calculates a detailed distance vector based on the detailed feature vectors and the detailed weight vectors; a feature distance synthesis unit that synthesizes the summary distance vector and the detailed distance vector to calculate a synthesized distance vector; as well as The classifying unit determines a class of the input image based on the synthesized distance vector.
2. An image classification device, characterized in that: include: A feature extraction unit extracts feature vectors of input images; A feature frequency conversion unit, which converts the feature vector into a frequency domain and generates a low-frequency feature vector and a high-frequency feature vector; A low-frequency feature distance measuring unit, which maintains low-frequency weight vectors of various categories and calculates a low-frequency distance vector according to the low-frequency feature vectors and the low-frequency weight vectors; A high-frequency feature distance measuring unit, which maintains high-frequency weight vectors of various categories and calculates a high-frequency distance vector according to the high-frequency feature vectors and the high-frequency weight vectors; a feature distance synthesis unit, synthesizing the low-frequency distance vector and the high-frequency distance vector to calculate a synthetic distance vector; as well as The classifying unit determines a class of the input image based on the synthesized distance vector.
3. An image classification device, characterized in that: Include: The filter part transforms the input image into the frequency domain and divides it into low-frequency components and high-frequency components; A low-frequency feature extraction unit extracts a low-frequency feature vector from the low-frequency component; A high-frequency feature extraction unit extracts a high-frequency feature vector from the high-frequency component; A low-frequency feature distance measuring unit, which maintains low-frequency weight vectors of various categories and calculates a low-frequency distance vector according to the low-frequency feature vectors and the low-frequency weight vectors; A high-frequency feature distance measuring unit, which maintains high-frequency weight vectors of various categories and calculates a high-frequency distance vector according to the high-frequency feature vectors and the high-frequency weight vectors; a feature distance synthesis unit, synthesizing the low-frequency distance vector and the high-frequency distance vector to calculate a synthesized distance vector; as well as The classifying unit determines a class of the input image based on the synthesized distance vector.
4. The image classification device according to any one of claims 1 to 3, characterized in that: It also includes a learning unit, which learns the feature extraction unit, the outline feature ranging unit and the detailed feature ranging unit for the input image of the basic category, and learns the outline feature ranging unit and the detailed feature ranging unit for the input image of the additional category, so that the loss calculated based on the synthetic distance vector and the correct solution category of the input image is minimized.
5. An image classification method, characterized in that: include: A feature extraction step, extracting a low-resolution summary feature vector and a high-resolution detailed feature vector of the input image; A summary feature distance measurement step, maintaining summary weight vectors for each category, and calculating summary distance vectors based on the summary feature vectors and the summary weight vectors; A detailed feature distance measurement step, maintaining a detailed weight vector for each category, and calculating a detailed distance vector based on the detailed feature vector and the detailed weight vector; a feature distance synthesis step of synthesizing the summary distance vector and the detailed distance vector to calculate a synthesized distance vector; as well as The classification step determines the category of the input image based on the synthesized distance vector.
6. An image classification program, characterized in that Have your computer perform the following steps: A feature extraction step, extracting a low-resolution summary feature vector and a high-resolution detailed feature vector of the input image; A summary feature distance measurement step, maintaining summary weight vectors for each category, and calculating summary distance vectors based on the summary feature vectors and the summary weight vectors; A detailed feature distance measurement step, maintaining a detailed weight vector for each category, and calculating a detailed distance vector based on the detailed feature vector and the detailed weight vector; a feature distance synthesis step of synthesizing the summary distance vector and the detailed distance vector to calculate a synthesized distance vector; as well as The classification step determines the category of the input image based on the synthesized distance vector.
7. An image classification device, characterized in that: include: A feature extraction unit extracts feature vectors of input images; A basic category feature distance measuring unit, which maintains a basic category weight vector and calculates a basic category distance vector based on the feature vector and the basic category weight vector; A feature distance measuring unit for the additional category, which holds a weight vector for the additional category and calculates a distance vector for the additional category based on the feature vector and the weight vector for the additional category; a scaling unit, which scales the distance vector of the additional category using a scaling value calculated based on the distance vector of the basic category and the distance vector of the additional category; as well as The classifying unit determines the class of the input image based on the distance vector of the basic class and the scaled distance vector of the additional class.
8. The image classification device according to claim 7, characterized in that: The feature extraction unit extracts a low-resolution general feature vector and a high-resolution detailed feature vector of the input image. The feature ranging unit for each category includes: an outline feature ranging unit, which maintains an outline weight vector for each category and calculates an outline distance vector based on the outline feature vector and the outline weight vector; and a detailed feature ranging unit, which maintains a detailed weight vector for each category and calculates a detailed distance vector based on the detailed feature vector and the detailed weight vector.
9. The image classification device according to claim 7, characterized in that: It also includes a feature frequency conversion unit, which converts the feature vector into a frequency domain and generates a low-frequency feature vector and a high-frequency feature vector. The feature ranging unit for each category includes: a low-frequency feature ranging unit, which maintains the low-frequency weight vector of each category and calculates the low-frequency distance vector according to the low-frequency feature vector and the low-frequency weight vector; and a high-frequency feature ranging unit, which maintains the high-frequency weight vector of each category and calculates the high-frequency distance vector according to the high-frequency feature vector and the high-frequency weight vector.
10. The image classification device according to claim 7, characterized in that: It also includes a filter unit that transforms the input image into the frequency domain and divides it into low-frequency components and high-frequency components. The feature extraction unit includes: a low-frequency feature extraction unit, which extracts a low-frequency feature vector from the low-frequency component; and a high-frequency feature extraction unit, which extracts a high-frequency feature vector from the high-frequency component. The feature ranging unit for each category includes: a low-frequency feature ranging unit, which maintains the low-frequency weight vector of each category and calculates the low-frequency distance vector based on the low-frequency feature vector and the low-frequency weight vector; and a high-frequency feature ranging unit, which maintains the high-frequency weight vector of each category and calculates the high-frequency distance vector based on the high-frequency feature vector and the high-frequency weight vector.
11. The image classification device according to any one of claims 7 to 10, characterized in that: It also includes a learning unit, which learns the feature extraction unit and the feature ranging unit of the basic category for the input image of the basic category, and learns the feature ranging unit of the additional category for the input image of the additional category, so that the loss calculated based on the distance vector and the correct solution category of the input image is minimized.
12. An image classification method, characterized in that: include: Feature extraction step, extracting feature vectors of the input image; A feature distance measurement step of the basic category, maintaining a weight vector of the basic category, and calculating a distance vector of the basic category according to the feature vector and the weight vector of the basic category; A feature distance measurement step of the additional category, maintaining a weight vector of the additional category, and calculating a distance vector of the additional category based on the feature vector and the weight vector of the additional category; A scaling step of scaling the distance vector of the additional category using a scaling value calculated based on the distance vector of the basic category and the distance vector of the additional category; as well as The classification step determines the category of the input image based on the distance vector of the basic category and the scaled distance vector of the additional category.
13. An image classification program, characterized in that Have your computer perform the following steps: Feature extraction step, extracting feature vectors of the input image; A feature distance measurement step of the basic category, maintaining a weight vector of the basic category, and calculating a distance vector of the basic category according to the feature vector and the weight vector of the basic category; A feature distance measurement step of the additional category, maintaining a weight vector of the additional category, and calculating a distance vector of the additional category based on the feature vector and the weight vector of the additional category; A scaling step of scaling the distance vector of the additional category using a scaling value calculated based on the distance vector of the basic category and the distance vector of the additional category; as well as The classification step determines the category of the input image based on the distance vector of the basic category and the scaled distance vector of the additional category.
14. An image feature learning device, characterized in that: include: A feature extraction unit extracts a low-resolution summary feature vector and a high-resolution detailed feature vector of an input image; A summary feature distance measuring unit, which maintains a summary weight vector for each category and calculates a summary distance vector based on the summary feature vector and the summary weight vector for each category; A detailed feature distance measuring unit, which maintains a detailed weight vector for each category and calculates a detailed distance vector based on the detailed feature vector and the detailed weight vector for each category; A summary loss calculation unit, which calculates summary loss according to the summary distance vector and the correct label of the input image; A detailed loss calculation unit, which calculates a detailed loss according to the detailed distance vector and the correct label of the input image; a loss weighted addition unit that, when weighting the summary loss and the detailed loss, makes the weight of the summary loss greater than the weight of the detailed loss, and adds the weighted summary loss and the weighted detailed loss to calculate a total loss; as well as The optimization unit learns the feature extraction unit, the general feature distance measurement unit, and the detailed feature distance measurement unit based on the total loss.
15. An image feature learning device, characterized in that: include: A feature extraction unit extracts feature vectors of input images; A feature frequency conversion unit, which converts the feature vector into a frequency domain and generates a summary feature vector and a detailed feature vector; A summary feature distance measuring unit, which maintains summary weight vectors of various categories and calculates summary distance vectors based on the summary feature vectors and the summary weight vectors; A detailed feature distance measuring unit, which maintains detailed weight vectors for each category and calculates a detailed distance vector based on the detailed feature vectors and the detailed weight vectors; A summary loss calculation unit, which calculates the summary loss according to the summary distance vector and the correct label of the input image; A detailed loss calculation unit, which calculates a detailed loss according to the detailed distance vector and a correct label of the input image; a loss weighted addition unit that, when weighting the summary loss and the detailed loss, makes the weight of the summary loss greater than the weight of the detailed loss, and adds the weighted summary loss and the weighted detailed loss to calculate a total loss; as well as The optimization unit learns the feature extraction unit, the general feature distance measurement unit, and the detailed feature distance measurement unit based on the total loss.
16. An image feature learning device, characterized in that: include: The filtering part converts the input image into the frequency domain and divides it into a summary component and a detailed component; A summary feature extraction unit extracts summary feature vectors from the summary components; A detailed feature extraction unit extracts a detailed feature vector from the detailed component; A summary feature distance measuring unit, which maintains summary weight vectors of various categories and calculates summary distance vectors based on the summary feature vectors and the summary weight vectors; A detailed feature distance measuring unit, which maintains detailed weight vectors for each category and calculates a detailed distance vector based on the detailed feature vectors and the detailed weight vectors; A summary loss calculation unit, which calculates the summary loss according to the summary distance vector and the correct label of the input image; A detailed loss calculation unit, which calculates a detailed loss according to the detailed distance vector and a correct label of the input image; a loss weighted addition unit that, when weighting the summary loss and the detailed loss, makes the weight of the summary loss greater than the weight of the detailed loss, and adds the weighted summary loss and the weighted detailed loss to calculate a total loss; as well as The optimization unit learns the feature extraction unit, the general feature distance measurement unit, and the detailed feature distance measurement unit based on the total loss.
17. The image feature learning device according to any one of claims 14 to 16, characterized in that: The summary feature distance measuring unit calculates a summary cosine distance vector based on the summary feature vector and the summary weight vectors of each category. The detailed feature distance measuring unit calculates a detailed cosine distance vector based on the detailed feature vector and the detailed weight vectors of each category. The summary loss calculation unit calculates a summary cross entropy loss based on the summary cosine distance vector and the correct label of the input image. The detailed loss calculation unit calculates a detailed cross entropy loss based on the detailed cosine distance vector and the correct label of the input image. The loss weighted addition unit weights the summary cross entropy loss and the detailed cross entropy loss so that the weight of the summary cross entropy loss is greater than the weight of the detailed cross entropy loss, and calculates a total cross entropy loss by adding the weighted summary cross entropy loss and the weighted detailed cross entropy loss. The optimization unit learns the feature extraction unit, the general feature ranging unit, and the detailed feature ranging unit based on the total cross entropy loss.
18. An image feature learning method, characterized in that: include: A feature extraction step, extracting a low-resolution summary feature vector and a high-resolution detailed feature vector of the input image; A summary feature distance measurement step, maintaining a summary weight vector for each category, and calculating a summary distance vector based on the summary feature vector and the summary weight vector for each category; A detailed feature distance measurement step, maintaining a detailed weight vector for each category, and calculating a detailed distance vector based on the detailed feature vector and the detailed weight vector for each category; A summary loss calculation step, calculating the summary loss according to the summary distance vector and the correct label of the input image; A detailed loss calculation step, calculating a detailed loss according to the detailed distance vector and the correct label of the input image; a loss adding step, when weighting the summary loss and the detailed loss, making the weight of the summary loss greater than the weight of the detailed loss, and adding the weighted summary loss and the weighted detailed loss to calculate the total loss; as well as The optimization step learns parameters of the feature extraction step, the general feature ranging step, and the detailed feature ranging step based on the total loss.
19. An image feature learning program, characterized in that: Have your computer perform the following steps: A feature extraction step, extracting a low-resolution summary feature vector and a high-resolution detailed feature vector of the input image; A summary feature distance measurement step, maintaining a summary weight vector for each category, and calculating a summary distance vector based on the summary feature vector and the summary weight vector for each category; A detailed feature distance measurement step, maintaining a detailed weight vector for each category, and calculating a detailed distance vector based on the detailed feature vector and the detailed weight vector for each category; A summary loss calculation step, calculating the summary loss according to the summary distance vector and the correct label of the input image; A detailed loss calculation step, calculating a detailed loss according to the detailed distance vector and the correct label of the input image; a loss adding step, when weighting the summary loss and the detailed loss, making the weight of the summary loss greater than the weight of the detailed loss, and adding the weighted summary loss and the weighted detailed loss to calculate the total loss; as well as The optimization step learns parameters of the feature extraction step, the general feature ranging step, and the detailed feature ranging step based on the total loss.
