Image classification device, image classification method, and image classification program

The image classification device improves accuracy by using average feature vectors and cosine similarity calculations to fine-tune weight matrices, addressing catastrophic forgetting and overfitting, and enabling effective learning with small datasets, thus enhancing performance in continuous and few-shot learning scenarios.

WO2024190158A1PCT designated stage expired Publication Date: 2024-09-19JVC KENWOOD CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2024/003705
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-14
Filing Date
2024-02-05
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

Existing image classification technologies face challenges in maintaining high accuracy during continuous learning and few-shot learning, where the learning of new tasks leads to 'catastrophic forgetting' of old tasks, and require large datasets for training, resulting in overfitting and poor generalization with small datasets.

Method used

The proposed solution involves an image classification device and method that uses feature extraction units to output deep and shallow feature vectors, calculates average feature vectors and matrices, and employs cosine similarity calculations to improve classification accuracy by fine-tuning weight matrices with average feature vectors, allowing for efficient learning with small datasets and maintaining performance across additional classes.

Benefits of technology

This approach enhances image classification accuracy for additional learning and small-shot scenarios by suppressing intra-class variance and improving classification performance without requiring extensive retraining, making it suitable for both small and large datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2024003705_19092024_PF_FP_ABST
    Figure JP2024003705_19092024_PF_FP_ABST
Patent Text Reader

Abstract

A feature extraction unit (510) outputs first and second feature vectors of an input image. Average first and second feature calculation units (520a, 520b) average the first and second feature vectors of a certain class to calculate average first and second feature vectors, and aggregate the average first and second feature vectors of all classes to obtain average first and second feature matrixes. First and second feature similarity calculation units (532a, 532b) calculate first and second similarities from the first and second feature vectors of the input image and first and second weight matrixes. The average first and second feature calculation units (520a, 520b) replace the first and second weight matrixes of the first and second feature similarity calculation units (532a, 532b) with the average first and second feature matrixes.
Need to check novelty before this filing date? Find Prior Art

Description

Image classification device, image classification method, and image classification program

[0001] The present invention relates to image classification techniques.

[0002] Humans can learn new knowledge through long-term experience and retain previous knowledge. However, the knowledge of deep neural networks (DNNs) using convolutional neural networks (CNNs) and other neural networks is dependent on the dataset used for training. To adapt to changes in the data distribution, the DNN parameters must be retrained for the entire dataset. As DNNs learn new tasks, their estimation accuracy for previous tasks declines. Thus, continuous training of DNNs inevitably leads to catastrophic forgetting, in which the learning results of previous tasks are forgotten while learning a new task.

[0003] Incremental learning or continual learning has been proposed as a method to avoid fatal forgetting. Incremental learning is a learning method in which, when a new task or new data arises, the model is improved and learned, rather than learning from scratch.

[0004] Furthermore, humans can learn new knowledge from a small number of images. On the other hand, AI that uses deep learning, such as convolutional neural networks, relies on big data (a large number of images) for training. It is known that when AI that uses deep learning is trained with a small number of images, it falls into overfitting, which has good local performance but poor generalization performance.

[0005] Few-shot learning has been proposed as a method to avoid overfitting. Few-shot learning is a learning method that uses big data to learn basic knowledge for basic tasks, and then uses the basic knowledge to learn new knowledge from a small number of images for a new task.

[0006] Few-shot class incremental learning is a method that solves the problems of both continuous learning and few-shot learning (Non-Patent Document 1). Another method of few-shot learning is a technology that normalizes feature vectors and weight vectors and uses cosine similarity (Non-Patent Document 2).

[0007] Tao, Xiaoyu, et al. "Few-shot class-incremental learning." Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition. 2020.Chen, Wei-Yu, et al. "A closer look at few-shot classification." arXiv preprint arXiv:1904.04232 (2019).

[0008] The prior art has had a problem in that the accuracy of image classification is not sufficiently high when additional learning or learning a small number of images is performed.

[0009] The present embodiment has been made in view of the above circumstances, and its purpose is to provide an image classification technique that can improve the accuracy of image classification through additional learning or learning of a small number of images.

[0010] In order to solve the above problem, an image classification device according to one aspect of the present embodiment includes a feature extraction unit that outputs a first feature vector of an input image and outputs a second feature vector that is a feature vector different from the first feature vector, an average first feature calculation unit that averages the first feature vectors of a certain class to calculate an average first feature vector and combines the average first feature vectors of all classes to obtain an average first feature matrix, an average second feature calculation unit that averages the second feature vectors of a certain class to calculate an average second feature vector and combines the average second feature vectors of all classes to obtain an average second feature matrix, a first feature similarity calculation unit that calculates a first similarity from the first feature vector of the input image and a first weight matrix, and a second feature similarity calculation unit that calculates a second similarity from the second feature vector of the input image and a second weight matrix. The average first feature calculation unit replaces the first weight matrix of the first feature similarity calculation unit with the average first feature matrix, and the average second feature calculation unit replaces the second weight matrix of the second feature similarity calculation unit with the average second feature matrix. In the above description, an example of "first" is "deep layer" or "first deep layer" in the embodiment, and an example of "second" is "shallow layer" or "second deep layer" in the embodiment.

[0011] Another aspect of this embodiment is an image classification method. This method includes a feature extraction step of outputting a first feature vector of an input image and a second feature vector that is different from the first feature vector, an average first feature calculation step of averaging the first feature vectors of a certain class to calculate an average first feature vector and combining the average first feature vectors of all classes to obtain an average first feature matrix, an average second feature calculation step of averaging the second feature vectors of a certain class to calculate an average second feature vector and combining the average second feature vectors of all classes to obtain an average second feature matrix, a first feature similarity calculation step of calculating a first similarity from the first feature vector of the input image and a first weight matrix, and a second feature similarity calculation step of calculating a second similarity from the second feature vector of the input image and a second weight matrix. The average first feature calculation step replaces the first weight matrix of the first feature similarity calculation step with the average first feature matrix, and the average second feature calculation step replaces the second weight matrix of the second feature similarity calculation step with the average second feature matrix. In the above description, an example of "first" is "deep layer" or "first deep layer" in the embodiment, and an example of "second" is "shallow layer" or "second deep layer" in the embodiment.

[0012] Any combination of the above components, and conversion of the expression of this embodiment into a method, device, system, recording medium, computer program, etc. are also valid aspects of this embodiment.

[0013] According to this embodiment, it is possible to provide an image classification technique that can improve the accuracy of image classification through additional learning or learning of a small number of images.

[0014] 1 is a configuration diagram of an image classification learning device according to an embodiment. FIG. 1 is a flowchart explaining an overall flow of learning by the image classification learning device of FIG. 1. FIG. 1 is a configuration diagram related to learning of base classes of the image classification learning device of FIG. 1. FIG. 2 is a flowchart explaining detailed operation of the image classification learning device of FIG. 1 for learning base classes using a basic dataset. FIG. 3 is a diagram explaining deep feature vectors and shallow feature vectors. FIG. 4 is a flowchart explaining a method for calculating an average deep feature matrix and an average shallow feature matrix. FIG. 4 is an example of a configuration related to learning additional classes of an image classification learning device. FIG. 5 is another example of a configuration related to learning additional classes of an image classification learning device. FIG. 6 is yet another example of a configuration related to learning additional classes of an image classification learning device. FIG. 7 is a flowchart explaining detailed operation of the image classification learning device 500 for one example of learning additional classes using an additional dataset. FIG. 8 is a flowchart explaining detailed operation of the image classification learning device for another example of learning additional classes using an additional dataset. FIG. 9 is a flowchart explaining detailed operation of the image classification learning device for yet another example of learning additional classes using an additional dataset. FIG. 10 is a configuration diagram of an image classification device. FIG. 11 is a flowchart explaining detailed operation of the image classification device. FIG. 11 is a configuration diagram of an image additional classification device. FIG. 12 is a flowchart explaining detailed operation of the image classification device.

[0015] 1 is a configuration diagram of an image classification learning device 500 according to an embodiment. Image classification learning device 500 performs few-shot class additional learning, which involves learning a base class consisting of a large amount of training data and then continuing to learn an additional class consisting of a small amount of training data.

[0016] The image classification learning apparatus 500 includes a feature extraction unit 510, an average deep feature calculation unit 520a, an average shallow feature calculation unit 520b, a classification unit 530, a deep similarity scaling unit 540a, a shallow similarity scaling unit 540b, a learning unit 550, an integrated similarity calculation unit 560, and a classification determination unit 570. The classification unit 530 includes a deep feature similarity calculation unit 532a and a shallow feature similarity calculation unit 532b. The learning unit 550 includes a deep loss calculation unit 552a, a shallow loss calculation unit 552b, a loss weighting addition unit 554, and an optimization unit 556.

[0017] 2 is a flowchart illustrating the overall flow of learning by image classification learning device 500. The configuration and operation of image classification learning device 500 will be described with reference to FIGS.

[0018] First, we describe the basic training dataset and the additional training dataset.

[0019] The basic training dataset is a supervised dataset containing a large number of basic classes (e.g., 100 to 1000 classes), each of which is composed of a large number of images (e.g., 3000 images). The basic training dataset is assumed to have a sufficient amount of data for learning a general classification task alone. Here, the number of basic classes is assumed to be 60.

[0020] In contrast, the additional training dataset is a supervised dataset that includes a small number of additional classes (e.g., about 1 to 10 classes), each of which is composed of a small number of images (e.g., about 1 to 10 images). Although the number of images is assumed here, a large number of images may be used as long as the class is small. Here, the number of additional classes is assumed to be 5.

[0021] Using the basic training data set, the weight vectors of the basic classes of the feature extraction unit 510 and the classification unit 530 are trained based on cosine similarity (S501). The training session in which training is performed using the basic training data set is referred to as session 0. This is also referred to as the initial session.

[0022] The weight vectors of the basic classes of the trained feature extractor 510 and classifier 530 are not updated during additional training.

[0023] Classify the image into the learned basic classes (S502). This step is not necessarily performed.

[0024] Next, the additional learning session s is repeated L times (s=1, 2, . . . , L).

[0025] The weight vectors of the additional classes of the additional session s of the classifier 530 are learned based on the cosine distance using the additional training data set s (S503).

[0026] The learned basic classes and the additional classes are classified (S504). This step does not necessarily have to be performed.

[0027] s is incremented by 1, and the process returns to step S503. Steps S503 to S504 are repeated until s=L, and when s exceeds L, the process ends.

[0028] Here, L = 8. In this case, after the end of additional learning session 1, 65 classes will have been learned, after the end of additional learning session 2, 70 classes, and after the end of additional session 8, 100 classes will have been learned.

[0029] Fig. 3 is a configuration diagram related to base class learning of image classification learning device 500. Fig. 4 is a flowchart explaining detailed operations of image classification learning device 500 for base class learning using a base data set. The base class learning operations of image classification learning device 500 will be explained in detail with reference to Figs. 3 and 4.

[0030] Learning is repeated N times in batch size units (b = 1, 2, ..., N). For example, the batch size is 128. Epochs are repeated M times (e = 1, 2, ..., M). The number of epochs is 400.

[0031] When an image is input to the feature extraction unit 510, a deep feature vector and a shallow feature vector are extracted (S510).

[0032] First, we will explain deep feature vectors and shallow feature vectors.

[0033] FIG. 5 is a diagram illustrating deep feature vectors and shallow feature vectors.

[0034] The feature extraction unit 510 includes ResNet-18 convolution layers CONV1 to CONV5, GAP1 (Global Average Pooling), and GAP2. GAP converts the feature maps output from the convolution layers into feature vectors. GAP1 receives the 7x7 512-channel feature map from CONV5 and outputs a 512-dimensional deep feature vector. GAP2 receives the 14x14 256-channel feature map from CONV4 and outputs a 256-dimensional shallow feature vector. CONV3, CONV2, and CONV1 output a 28x28 128-channel feature map, a 56x56 64-channel feature map, and a 112x112 64-channel feature map, respectively.

[0035] The deep feature vector has a low resolution of 7x7 in terms of the feature map, and contains general information about the entire image because it is convolved over a wide range of the entire image. On the other hand, the shallow feature vector has a high resolution of 14x14 in terms of the feature map, and contains detailed information about local areas of the image because it is convolved over a narrow range of the image. On the other hand, the deep feature vector contains a feature vector with higher dimensions than the shallow feature vector.

[0036] The feature extraction unit 510 may be a deep learning network with multiple weight parameters other than ResNet-18, such as VGG16 or ResNet-34, and the dimensions of the feature vector may be other than 512 or 256. Furthermore, the feature map input to GAP2 may be other than CONV4, such as CONV3 or CONV2. While the feature extraction unit 510 outputs two feature vectors here, it may also output one or three or more feature vectors. Here, the feature map output from the CONV4 layer is used as the shallow layer feature vector. However, for example, the layer feature map to be used may be determined in an initial session. For example, in an initial session, all of CONV1 through CONV4 are trained as shallow layer feature vectors, and the accuracy is measured, and the output of the layer that provides the optimal classification result is selected as the shallow layer feature vector.

[0037] The deep feature vector output from GAP1 of the feature extraction unit 510 is input to the deep feature similarity calculation unit 532a.

[0038] The shallow layer feature vector output from GAP2 of the feature extraction unit 510 is input to the shallow layer feature similarity calculation unit 532b.

[0039] The deep layer feature similarity calculation unit 532 a and the shallow layer feature similarity calculation unit 532 b have the same configuration, and therefore will be collectively referred to as the feature similarity calculation unit 532 in the description.

[0040] The feature similarity calculation unit 532 has a weight matrix of a linear layer (fully connected layer) for deriving cosine similarity. The weight matrix has weights of (D x NC) dimensions. Here, D is a weight vector with the same number of dimensions as the feature vector input to the linear layer. In the case of the deep feature similarity calculation unit, D = 512, and in the case of the deep feature similarity calculation unit, D = 256. Furthermore, NC is the number of classes. Here, NC is set to 100, which is the sum of the base classes and additional classes. NC may be equal to or greater than the sum of the base classes and additional classes.

[0041] The input feature vector is normalized, and the normalized feature vector is input to the linear layer. At this time, the weight vector of the linear layer is also normalized. As a result, the NC-dimensional cosine similarity between the feature vector and the weight vector of each class to be classified is derived. By normalizing the feature vector and calculating the cosine similarity, it is possible to suppress intra-class variance and improve classification accuracy.

[0042] The deep feature similarity calculation unit 532a calculates a deep cosine similarity from the input deep feature vector and the deep weight vector of each class, and outputs the calculated deep cosine similarity to the deep similarity scaling unit 540a (S511a).

[0043] The deep similarity scaling unit 540a scales the input deep cosine similarity by a factor of α using the deep learning parameter, and outputs the deep cosine similarity (S512a).

[0044] The shallow layer feature similarity calculation unit 532b calculates shallow layer cosine similarity from the input shallow layer feature vector and the shallow layer weight vector of each class, and outputs it to the shallow layer similarity scaling unit 540b (S511b).

[0045] The shallow similarity scaling unit 540b scales the input shallow cosine similarity by a factor of α using the shallow learning parameter, and outputs the shallow cosine similarity (S512b).

[0046] Here, the deep learning parameters and shallow learning parameters are scaled using the same value α, but they may also be scaled using different values ​​α1 and α2.

[0047] The deep loss calculation unit 552a calculates the deep cross-entropy loss, which is the loss between the deep cosine similarity and the correct label (correct class) of the input image (S513a).

[0048] The shallow layer loss calculation unit 552b calculates the shallow layer cross-entropy loss, which is the loss between the shallow layer cosine similarity and the correct label (correct class) of the input image (S513b).

[0049] The loss weighting addition unit 554 performs weighted addition of the deep cross-entropy loss Ld and the shallow cross-entropy loss Ls to calculate the combined cross-entropy loss L (S514). Here, λ is a predetermined value between 0 and 1, for example, 0.2. Here, 0.2 is used as λ, but which value between 0 and 1 to use may be determined in the initial session. For example, in the initial session, all values ​​of λ from 0 to 1 in increments of 0.05 are trained to measure the accuracy, and the value that provides the optimal classification result may be selected as λ. With this configuration, the initial session may be performed by offline processing, and the additional sessions may be performed by online processing. L = (1 - λ) * Ld + λ * Ls

[0050] The optimization unit 556 optimizes the weight parameters of the convolution layer of the feature extraction unit 510 and the weight matrix of the feature similarity calculation unit 532 by backpropagation using an optimization method such as stochastic gradient descent (SGD) or Adam so as to minimize the combined cross-entropy loss (S515). Note that the feature similarity calculation unit 532 is essentially the classification unit 530.

[0051] When the learning (epoch) is completed, the average deep feature calculation unit 520a calculates an average deep feature matrix, and the average shallow feature calculation unit 520b calculates an average shallow feature matrix (S516).

[0052] The average deep feature calculation unit 520a replaces the weight matrix of the deep feature similarity calculation unit 532a with the average deep feature matrix (S517a).

[0053] The average shallow layer feature calculation unit 520b replaces the weight matrix of the shallow layer feature similarity calculation unit 532b with the average shallow layer feature matrix (S517b).

[0054] 6 is a flowchart illustrating a method for calculating the average deep feature matrix and the average shallow feature matrix, which will be described below. The method for calculating the average deep feature matrix and the average shallow feature matrix by the average deep feature calculation unit 520a and the average shallow feature calculation unit 520b will be described.

[0055] Here, the number of basic classes is K. For c = 1, 2, ..., K, the average deep feature vector and the average shallow feature vector are calculated for each class. All image data of a certain class c included in the basic training dataset is input to the feature extraction unit 510, and the deep feature vectors and shallow feature vectors of all images are calculated, thereby obtaining the calculated deep feature vectors and shallow feature vectors of all images (S520).

[0056] All deep feature vectors for a certain class c are averaged to obtain an average deep feature vector (S521a).

[0057] All shallow feature vectors for a certain class c are averaged to obtain an average shallow feature vector (S521b).

[0058] The average deep feature vectors of all classes are combined to obtain an average deep feature matrix (S522a).

[0059] The average shallow feature vectors of all classes are combined to obtain an average shallow feature matrix (S522b).

[0060] Here, the average deep feature vectors of all classes are combined into a (D × NC)-dimensional average deep feature matrix, and the weight matrix of the deep feature similarity calculation unit 532a is replaced with the average deep feature matrix. Also, the average shallow feature vectors of all classes are combined into an average shallow feature matrix, and the weight matrix of the shallow feature similarity calculation unit 532b is replaced with the average shallow feature matrix.

[0061] Without being limited to this, the weight matrix of the deep feature similarity calculation unit may be replaced with the average deep feature vector for some classes. Similarly, the weight matrix of the shallow feature similarity calculation unit may be replaced with the average shallow feature vector for some classes.

[0062] In this way, by using the average deep feature matrix and average shallow feature matrix obtained using the feature extraction unit 510 trained by taking into account the entire image and a partial region of the image as the weight matrix for the deep feature similarity calculation unit 532a and the weight matrix for the shallow feature similarity calculation unit 532b, a classifier that is not dependent on the learning process, such as batch size, can be obtained. Furthermore, the calculation of the average deep feature matrix and the average shallow feature matrix is ​​independent of the amount of data and can be used for both small amounts of data and big data.

[0063] Fig. 7A shows an example of a configuration related to additional class learning in image classification learning device 500. Fig. 8A is a flowchart explaining detailed operations of image classification learning device 500 for an example of additional class learning using an additional dataset. The operations of additional class learning in image classification learning device 500 will be explained in detail with reference to Figs. 7A and 8A.

[0064] The feature extraction unit 510 has the same configuration and parameters as the feature extraction unit 510 obtained during learning of the base class.

[0065] Here, the number of additional classes is L, and additional class c (c = 1, 2, ... L) has N (i = 1, 2, ..., N) pieces of image data. When the N pieces of image data of additional class c are input to feature extraction unit 510, deep feature vectors and shallow feature vectors are extracted for each piece of image data and output to average deep feature calculation unit 520a and average shallow feature calculation unit 520b, respectively (S530).

[0066] The average deep feature calculation unit 520a calculates an average deep feature vector by averaging the deep feature vectors output from the feature extraction unit 510 (S530-1a). The average shallow feature calculation unit 520b calculates an average shallow feature vector by averaging the shallow feature vectors output from the feature extraction unit 510 (S530-1b).

[0067] The average deep feature calculation unit 520a compiles the average deep feature vectors of the additional classes to obtain an average deep feature matrix, and the average shallow feature calculation unit 520b compiles the average shallow feature vectors of the additional classes to obtain an average shallow feature matrix (S531).

[0068] The weight matrix of the additional class in the deep feature similarity calculation unit 532a is replaced with the average deep feature matrix (S532a).

[0069] The weight matrix of the additional class in the shallow layer feature similarity calculation unit 532b is replaced with the average shallow layer feature matrix (S532b).

[0070] As described above, there is no need to learn the image data of the additional class, and a classification unit that supports additional learning can be generated simply by calculating the average deep feature vector and the average shallow feature vector of the image data of the additional class and substituting them as a weight matrix. Of course, it is not necessary to use all the image data of the base class and the additional class as the image data of the additional class for calculating the average deep feature vector, and only some of the image data may be used.

[0071] The weight matrix of the deep feature similarity calculation unit 532a and the weight matrix of the shallow feature similarity calculation unit 532b generated in this manner may replace the weight matrix of the deep feature similarity calculation unit 532a and the weight matrix of the shallow feature similarity calculation unit 532b of the image classification device 580 of Figure 9 or the image additional classification device 590 of Figure 11.

[0072] Here, in order to learn the base classes, the feature extraction unit 510 used is a feature extraction unit 510 having the same configuration and parameters as the feature extraction unit 510 obtained during learning of the base classes. If it is not necessary to classify the base classes, the feature extraction unit 510 does not need to have the same configuration and parameters as the feature extraction unit 510 obtained during learning of the base classes, and any parameters may be used as long as the trained feature extraction unit 510 has multiple layers.

[0073] Fig. 7B shows another example of a configuration related to training an additional class in image classification learning apparatus 500. Fig. 8B is a flowchart illustrating detailed operations of image classification learning apparatus 500 for another example of training an additional class using an additional dataset. Another example of operations of image classification learning apparatus 500 for training an additional class will be described in detail with reference to Figs. 7B and 8B.

[0074] The feature extraction unit 510 has the same configuration and parameters as the feature extraction unit 510 obtained during learning of the base class.

[0075] Image data of N additional classes (i=1, 2, . . . , N) are input to the feature extraction unit 510, which extracts deep feature vectors and shallow feature vectors for each image data (S530).

[0076] The average deep feature vectors of the additional classes are combined to obtain an average deep feature matrix, and the average shallow feature vectors of the additional classes are combined to obtain an average shallow feature matrix (S531).

[0077] The weight matrix of the additional class in the deep feature similarity calculation unit 532a is replaced with the average deep feature matrix obtained in S531 (S532a).

[0078] The weight matrix of the additional class in the shallow layer feature similarity calculation unit 532b is replaced with the average shallow layer feature matrix obtained in S531 (S532b).

[0079] Image data of N (i=1, 2, ..., N) additional classes are input to the feature extraction unit 510 over M (e=1, 2, ..., M) epochs. The number of epochs is set to 30.

[0080] The deep feature similarity calculation unit 532a calculates a deep cosine similarity from the input deep feature vector and the average deep feature vector of each class, and outputs the calculated deep cosine similarity to the deep similarity scaling unit 540a (S533a).

[0081] The shallow layer feature similarity calculation unit 532b calculates shallow layer cosine similarity from the input shallow layer feature vector and the average shallow layer feature vector of each class, and outputs the calculated shallow layer cosine similarity to the shallow layer similarity scaling unit 540b (S533b).

[0082] The deep similarity scaling unit 540a scales the input deep cosine similarity by a factor of α using the deep learning parameter, and outputs the deep cosine similarity (S534a).

[0083] The shallow similarity scaling unit 540b scales the input shallow cosine similarity by a factor of α using the shallow learning parameter, and outputs the shallow cosine similarity (S534b).

[0084] The deep loss calculation unit 552a calculates the deep cross-entropy loss, which is the loss between the deep cosine similarity and the correct label (correct class) of the input image (S535a).

[0085] The shallow layer loss calculation unit 552b calculates the shallow layer cross-entropy loss, which is the loss between the shallow layer cosine similarity and the correct label (correct class) of the input image (S535b).

[0086] The loss weighting addition unit 554 performs weighted addition of the deep cross-entropy loss Ld and the shallow cross-entropy loss Ls to calculate the combined cross-entropy loss L (S536), where λ is a predetermined value between 0 and 1, e.g., 0.2. L = (1 - λ) * Ld + λ * Ls

[0087] The optimization unit 556 optimizes the weight matrix of the feature similarity calculation unit 532 by backpropagation using an optimization method such as stochastic gradient descent (SGD) or Adam so as to minimize the combined cross-entropy loss (S537).

[0088] Here, the learning rate used in training the additional class is set to be smaller than the learning rate used in training the base class, and the number of epochs used in training the additional class is set to be smaller than the number of epochs used in training the base class.

[0089] As described above, it is possible to generate a classification unit 530 that is compatible with additional learning by simply calculating the average feature vector of image data of the additional class, substituting it as the weight matrix for the feature similarity calculation unit 532, and then performing fine tuning (adjusted learning). This is the same as learning using the average feature vector as the initial value of the weight matrix for the feature similarity calculation unit 532. This may result in a weight vector that is more appropriate than the average feature vector.

[0090] Here, both the weight matrix of the additional class of the deep feature similarity calculation unit 532a and the weight matrix of the additional class of the shallow feature similarity calculation unit 532b are replaced with the average feature vector and then fine-tuned, but it is also possible to fine-tune only one of them.

[0091] In addition, although both the weight matrix of the additional class of the deep feature similarity calculation unit 532a and the weight matrix of the additional class of the shallow feature similarity calculation unit 532b are replaced with the average feature vector here, it is also possible to replace only one of them with the average feature vector. If replacement with the average feature vector is not required, for example, the weight matrix of the additional class is initialized with a random value.

[0092] As described above, by changing the learning characteristics of the deep feature similarity calculation unit 532a and the shallow feature similarity calculation unit 532b, it is possible to change the learning tendencies of the deep feature similarity calculation unit 532a and the shallow feature similarity calculation unit 532b, and when these units are combined, the possibility of improving accuracy increases, thereby enabling improvement of accuracy.

[0093] The weight matrix of the deep feature similarity calculation unit 532a and the weight matrix of the shallow feature similarity calculation unit 532b generated in this manner may replace the weight matrix of the deep feature similarity calculation unit 532a and the weight matrix of the shallow feature similarity calculation unit 532b of the image classification device 580 of Figure 9 or the image additional classification device 590 of Figure 11.

[0094] Here, in order to learn the base classes, the feature extraction unit 510 used is a feature extraction unit 510 having the same configuration and parameters as the feature extraction unit 510 obtained during learning of the base classes. If it is not necessary to classify the base classes, the feature extraction unit 510 does not need to have the same configuration and parameters as the feature extraction unit 510 obtained during learning of the base classes, and any parameters may be used as long as the trained feature extraction unit 510 has multiple layers.

[0095] As described above, by using average feature vectors for multiple resolutions, i.e., deep layers (low resolution) and shallow layers (high resolution), as weight vectors, it is possible to express the image features by using high-resolution average feature vectors, even for images whose image features cannot be expressed by low-resolution average feature vectors.

[0096] Fig. 7C shows yet another example of a configuration related to training an additional class in image classification learning apparatus 500. Fig. 8C is a flowchart illustrating detailed operations of image classification learning apparatus 500 for yet another example of training an additional class using an additional dataset. Yet another example of operations of image classification learning apparatus 500 for training an additional class will be described with reference to Figs. 7C and 8C.

[0097] Here, instead of using the average feature vector of multiple resolutions, such as deep layers (low resolution) and shallow layers (high resolution), the average feature vector of multiple groups at the same resolution is used. In this case, images of a certain class are divided into multiple groups, and the average feature vector is calculated for each group to obtain multiple average feature vectors. When dividing images of a certain class into multiple groups, the division may be random, but by classifying them based on predetermined characteristics using principal component analysis or the like, it is possible to calculate an average feature vector according to the predetermined characteristics.

[0098] The feature extraction unit 510 has the same configuration and parameters as the feature extraction unit 510 obtained during learning of the base class.

[0099] Here, we will explain the case where the image data is divided into two groups. The image data of N additional classes (i = 1, 2, ..., N) divided into two groups are input to the feature extraction unit 510, and the feature extraction unit 510 extracts a first deep feature vector and a second deep feature vector for each image data (S540).

[0100] The first average deep feature vectors of the additional classes in the first group are combined to obtain a first average deep feature matrix, and the second average deep feature vectors of the additional classes in the second group are combined to obtain a second average deep feature matrix (S541).

[0101] The weight matrix of the additional class in the first deep feature similarity calculation unit 532a is replaced with the first average deep feature matrix (S542a).

[0102] The weight matrix of the additional class in the second deep feature similarity calculation unit 533a is replaced with the second average deep feature matrix (S542b).

[0103] Image data of N (i=1, 2, ..., N) additional classes divided into two groups are input to the feature extraction unit 510 over M (e=1, 2, ..., M) epochs. The number of epochs is set to 30.

[0104] The first deep feature similarity calculation unit 532a calculates a first deep cosine similarity from the input first deep feature vector and the first average deep feature vector of each class, and outputs the first deep similarity to the first deep similarity scaling unit 540a (S543a).

[0105] The second deep feature similarity calculation unit 533a calculates a second deep cosine similarity from the input second deep feature vector and the second average deep feature vector of each class, and outputs the second deep similarity to the second deep similarity scaling unit 541a (S543b).

[0106] The first deep similarity scaling unit 540a scales the input first deep cosine similarity by a factor of α using the first deep learning parameter, and outputs the first deep cosine similarity (S544a).

[0107] The second deep similarity scaling unit 541a scales the input second deep cosine similarity by a factor of α using the second deep learning parameter, and outputs the second deep cosine similarity (S544b).

[0108] The first deep loss calculation unit 552a calculates a first deep cross-entropy loss, which is the loss between the first deep cosine similarity and the correct label (correct class) of the input image (S545a).

[0109] The second deep loss calculation unit 553a calculates a second deep cross-entropy loss, which is the loss between the second deep cosine similarity and the correct label (correct class) of the input image (S545b).

[0110] The loss weighting addition unit 554 performs a weighted addition of the first deep layer cross-entropy loss Ld1 and the second deep layer cross-entropy loss Ld2 to calculate a combined cross-entropy loss L (S546), where λ is a predetermined value between 0 and 1. L = (1 - λ) * Ld1 + λ * Ld2

[0111] The optimization unit 556 optimizes the weight matrix of the feature similarity calculation unit 532 by backpropagation using an optimization method such as stochastic gradient descent (SGD) or Adam so as to minimize the combined cross-entropy loss (S547).

[0112] As described above, by using the average feature vectors of multiple groups as weight vectors, even for images whose features cannot be expressed by a single average feature vector, the average feature vectors of multiple groups can be used to express the features of the image. Note that although the feature extraction unit 510 extracts deep feature vectors here, the feature extraction unit 510 may also extract shallow feature vectors.

[0113] Fig. 9 is a configuration diagram of an image classification device 580. The image classification device 580 in Fig. 9 is composed of components necessary for classification by the image classification learning device 500. Fig. 10 is a flowchart explaining the detailed operation of the image classification device 580. The classification operation of the image classification device 580 will be explained in detail with reference to Figs. 9 and 10.

[0114] The feature extraction unit 510 has the same configuration and parameters as the feature extraction unit obtained during training of the base class.

[0115] It is assumed that the weight matrix of the base class in the weight matrix of the deep feature similarity calculation unit 532a is replaced with the average deep feature matrix calculated by the calculation method shown in Fig. 6. It is assumed that the weight matrix of the additional class in the weight matrix of the deep feature similarity calculation unit 532a is replaced with the average deep feature matrix calculated by the calculation method shown in Figs. 7A and 8A. It is assumed that the weight matrix of the base class in the weight matrix of the shallow feature similarity calculation unit 532b is replaced with the average shallow feature matrix calculated by the calculation method shown in Fig. 6. It is assumed that the weight matrix of the additional class in the weight matrix of the shallow feature similarity calculation unit 532b is similarly replaced with the average shallow feature matrix calculated by the calculation method shown in Figs. 7A and 8A.

[0116] When an input image is input to the feature extraction unit 510, a deep feature vector and a shallow feature vector are extracted (S550).

[0117] The deep feature similarity calculation unit 532a calculates a deep cosine similarity for each class from the input deep feature vector and the deep weight vector of each class contained in the average deep feature matrix, and outputs the calculated deep cosine similarity to the deep similarity scaling unit 540a (S551a).

[0118] The shallow layer feature similarity calculation unit 532b calculates shallow layer cosine similarity for each class from the input shallow layer feature vector and the shallow layer weight vector of each class contained in the average shallow layer feature matrix, and outputs it to the shallow layer similarity scaling unit 540b (S551b).

[0119] The deep similarity scaling unit 540a scales the input deep cosine similarity by β times using the deep association parameter, and outputs the deep cosine similarity of each class (S552a).

[0120] The shallow layer similarity scaling unit 540b scales the input shallow layer cosine similarity by γ times using the recall shallow layer parameter, and outputs the shallow layer cosine similarity of each class (S552b).

[0121] The integrated similarity calculation unit 560 calculates the total cosine similarity of each class by adding the deep cosine similarity and the shallow cosine similarity (S553).

[0122] The integrated similarity calculation unit 560 weights the total cosine similarity of the additional class (S554). The weighting parameter is w. If the accuracy of the additional class is to be relatively higher than that of the base class, w>1.0 is set, and if the accuracy of the base class is to be relatively higher than that of the additional class, w<1.0 is set. If the accuracy of the base class and the accuracy of the additional class are to be equal, w=1.0 is set.

[0123] Here, the deep learning parameter and shallow learning parameter during learning are the same parameter α, while the deep recall parameter β and shallow recall parameter γ during classification are different parameters. Generally, the processing load during learning is greater than during classification. For this reason, deep and shallow layers are adjusted during classification rather than during learning. Of course, α = β = γ may be used, or α ≠ β = γ, α = γ ≠ β, or α ≠ β ≠ γ may be used. If there are no problems with processing efficiency, the deep learning parameter and shallow learning parameter may be set to different values ​​and adjusted during learning.

[0124] 1, 3, and 9, the configuration may be such that the shallow layer feature similarity calculation unit 532b, shallow layer similarity scaling unit 540b, shallow layer loss calculation unit 552b, and loss weighting addition unit 554 are not included. In this case, the deep learning parameter and the deep recollection parameter are set to different values ​​α≠β. By setting α so that β=1, it is possible to reduce the scaling process during classification. For example, the learning parameter α is set to be equal to or greater than the recollection parameter β, such as α=20 and β=1. Setting α to a large value is done to increase the resolution of the cosine similarity during learning. Since an already learned deep cosine similarity is used during classification, scaling is not essential and weak scaling can be used.

[0125] The classification determination unit 570 selects the class having the maximum total cosine similarity from the total cosine similarities of the classes (S555).

[0126] Fig. 11 is a configuration diagram of an image additional classification device 590. The image additional classification device 590 of Fig. 11 has a configuration in which the configuration of Fig. 7A for obtaining an average deep feature matrix and an average shallow feature matrix is ​​added to the image classification device 580 of Fig. 9. Fig. 12 is a flowchart explaining detailed operations of the image additional classification device 590. The operation of classifying additional classes in the image additional classification device 520 will be explained in detail with reference to Figs. 11 and 12.

[0127] The feature extraction unit 510 has the same configuration and parameters as the feature extraction unit 510 obtained during learning of the base class.

[0128] The additional learning session s is repeated L times (s=1, 2, . . . , L).

[0129] Image data of N additional classes (i=1, 2, . . . , N) are input to the feature extraction unit 510, which extracts deep feature vectors and shallow feature vectors for each image data (S560).

[0130] The average deep feature vectors of the additional classes are combined to obtain an average deep feature matrix, and the average shallow feature vectors of the additional classes are combined to obtain an average shallow feature matrix (S561).

[0131] The weight matrix of the additional class in the deep feature similarity calculation unit 532a is replaced with the average deep feature matrix (S562a).

[0132] The weight matrix of the additional class in the shallow layer feature similarity calculation unit 532b is replaced with the average shallow layer feature matrix (S562b).

[0133] When an input image is input to the feature extraction unit 510, a deep feature vector and a shallow feature vector are extracted (S563).

[0134] The deep feature similarity calculation unit 532a calculates a deep cosine similarity for each class from the input deep feature vector and the average deep feature vector of each class, and outputs the calculated deep cosine similarity to the deep similarity scaling unit 540a (S564a).

[0135] The shallow layer feature similarity calculation unit 532b calculates shallow layer cosine similarity for each class from the input shallow layer feature vector and the average shallow layer feature vector of each class, and outputs the calculated shallow layer cosine similarity to the shallow layer similarity scaling unit 540b (S564b).

[0136] The deep similarity scaling unit 540a scales the input deep cosine similarity by β times using the deep association parameter, and outputs the deep cosine similarity of each class (S565a).

[0137] The shallow layer similarity scaling unit 540b scales the input shallow layer cosine similarity by γ times using the recall shallow layer parameter, and outputs the shallow layer cosine similarity of each class (S565b).

[0138] The integrated similarity calculation unit 560 calculates the total cosine similarity for each class by adding the deep cosine similarity and the shallow cosine similarity (S566). Here, the deep cosine similarity and the shallow cosine similarity are simply added, but the calculation method is not limited to this. For example, weighted addition, multiplication, etc. may also be used.

[0139] The integrated similarity calculation unit 560 weights the total cosine similarity of the added class (S567). The weighting parameter is set to w.

[0140] The classification determination unit 570 selects the class with the largest total cosine similarity from the total cosine similarities of each class (S568). Here, the class with the largest total cosine similarity is selected from the total cosine similarities, but the selection method is not limited to this. For example, the top multiple classes may be selected.

[0141] This allows the additional classes to be classified without requiring very heavy loss calculations or optimization processes. While Fig. 11 shows an example in which the average deep feature matrix and the average shallow feature matrix are calculated for the additional classes assuming that the content of the base classes remains unchanged, if the content of the base classes changes, the average deep feature matrix and the average shallow feature matrix may be calculated for the base classes.

[0142] Note that the deep similarity scaling unit 540a and the shallow similarity scaling unit 540b, and the first deep similarity scaling unit 540a and the second deep similarity scaling unit 541a are not essential in each embodiment. A configuration may be provided in which either the deep similarity scaling unit 540a or the shallow similarity scaling unit 540b is not present, or both are not present. A configuration may be provided in which either the first deep similarity scaling unit 540a or the second deep similarity scaling unit 541a is not present, or both are not present.

[0143] That is, if the deep similarity scaling unit 540a is not present, the deep cosine similarity calculated by the deep feature similarity calculation unit 532a is output to the deep loss calculation unit 552a or the integrated similarity calculation unit 560. If the first deep similarity scaling unit 540a is not present, the first deep cosine similarity calculated by the first deep feature similarity calculation unit 532a is output to the first deep loss calculation unit 552a. If the shallow similarity scaling unit 540b is not present, the shallow cosine similarity calculated by the shallow feature similarity calculation unit 532b is output to the shallow loss calculation unit 552b or the integrated similarity calculation unit 560. If the second deep similarity scaling unit 541a is not present, the second deep cosine similarity calculated by the second deep feature similarity calculation unit 533a is output to the second deep loss calculation unit 553a.

[0144] The various processes of the image classification learning device 500, image classification device 580, and image additional classification device 590 described above can naturally be realized as devices using hardware such as a CPU and memory, but can also be realized by firmware stored in a ROM (read-only memory) or flash memory, or software for a computer, etc. The firmware program or software program can be provided by being recorded on a computer-readable recording medium, or can be transmitted and received with a server via a wired or wireless network, or can be transmitted and received as data broadcasting via terrestrial or satellite digital broadcasting.

[0145] The present invention has been described above based on the embodiments. The embodiments are merely examples, and it will be understood by those skilled in the art that various modifications are possible in the combination of the components and treatment processes, and that such modifications are also within the scope of the present invention.

[0146] The present invention can be used in image classification technology.

[0147] 500 Image classification learning device, 510 Feature extraction unit, 520a Average deep feature calculation unit, 520b Average shallow feature calculation unit, 530 Classification unit, 532a Deep feature similarity calculation unit, 532b Shallow feature similarity calculation unit, 540a Deep similarity scaling unit, 540b Shallow similarity scaling unit, 550 Learning unit, 552a Deep loss calculation unit, 552b Shallow loss calculation unit, 554 Loss weighting addition unit, 556 Optimization unit, 560 Integrated similarity calculation unit, 570 Classification determination unit, 580 Image classification device, 590 Image additional classification device.

Claims

1. An image classification device comprising: a feature extraction unit that outputs a first feature vector of an input image and outputs a second feature vector which is a feature vector different from the first feature vector; an average first feature calculation unit that averages the first feature vectors of a certain class to calculate an average first feature vector and combines the average first feature vectors of all classes to obtain an average first feature matrix; an average second feature calculation unit that averages the second feature vectors of a certain class to calculate an average second feature vector and combines the average second feature vectors of all classes to obtain an average second feature matrix; a first feature similarity calculation unit that calculates a first similarity from the first feature vector of the input image and a first weighting matrix; and a second feature similarity calculation unit that calculates a second similarity from the second feature vector of the input image and a second weighting matrix, wherein the average first feature calculation unit replaces the first weighting matrix of the first feature similarity calculation unit with the average first feature matrix, and the average second feature calculation unit replaces the second weighting matrix of the second feature similarity calculation unit with the average second feature matrix.

2. The image classification device according to claim 1, wherein the first feature vector and the second feature vector have different resolutions.

3. The image classification device described in claim 1 or 2, further comprising: an integrated similarity calculation unit that adds up the first similarity and the second similarity to calculate a total similarity; and a classification determination unit that determines a class of the input image based on the total similarity.

4. The image classification device of claim 1 or 2, further comprising: a first loss calculation unit that calculates a first loss from the first similarity and a correct label of the input image; a second loss calculation unit that calculates a second loss from the second similarity and a correct label of the input image; a loss weighting addition unit that adds the first loss and the second loss to calculate a combined loss; and an optimization unit that optimizes a first weighting matrix of the first feature similarity calculation unit and a second weighting matrix of the second feature similarity calculation unit so as to minimize the combined loss.

5. An image classification method comprising: a feature extraction step of outputting a first feature vector of an input image and outputting a second feature vector which is a feature vector different from the first feature vector; an average first feature calculation step of averaging the first feature vectors of a certain class to calculate an average first feature vector and combining the average first feature vectors of all classes to obtain an average first feature matrix; an average second feature calculation step of averaging the second feature vectors of a certain class to calculate an average second feature vector and combining the average second feature vectors of all classes to obtain an average second feature matrix; a first feature similarity calculation step of calculating a first similarity from the first feature vector of the input image and a first weighting matrix; and a second feature similarity calculation step of calculating a second similarity from the second feature vector of the input image and a second weighting matrix, wherein the average first feature calculation step replaces the first weighting matrix of the first feature similarity calculation step with the average first feature matrix, and the average second feature calculation step replaces the second weighting matrix of the second feature similarity calculation step with the average second feature matrix.

6. An image classification program for causing a computer to execute the following steps: a feature extraction step of outputting a first feature vector of an input image and outputting a second feature vector which is a feature vector different from the first feature vector; an average first feature calculation step of averaging the first feature vectors of a certain class to calculate an average first feature vector and combining the average first feature vectors of all classes to obtain an average first feature matrix; an average second feature calculation step of averaging the second feature vectors of a certain class to calculate an average second feature vector and combining the average second feature vectors of all classes to obtain an average second feature matrix; a first feature similarity calculation step of calculating a first similarity from the first feature vector of the input image and a first weighting matrix; and a second feature similarity calculation step of calculating a second similarity from the second feature vector of the input image and a second weighting matrix, wherein the average first feature calculation step replaces the first weighting matrix of the first feature similarity calculation step with the average first feature matrix, and the average second feature calculation step replaces the second weighting matrix of the second feature similarity calculation step with the average second feature matrix.

Citation Information

Patent Citations

  • Augmenting layer-based object detection with deep convolutional neural networks

    JP2017146957A

  • Image processing system, method for performing multi-label meaning edge detection in image, and non-transitory computer-readable storage medium

    JP2018195293A