Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
An image processing apparatus comprises one or more processors, and one or more memories storing executable instructions which, when executed by the one or more processors, cause the image capturing control apparatus to function as: a first acquiring unit configured to acquire a degree of training of a training target in a training model, a second acquiring unit configured to acquire, based on degrees of training of a plurality of training targets, a sampling probability of an image of each of the plurality of training targets, and a training unit configured to perform training of the training model, based on a sampling image that is sampled from images of the plurality of training targets based on the sampling probability acquired by the second acquiring unit.
1 . An image processing apparatus comprising:
one or more processors; and
one or more memories storing executable instructions which, when executed by the one or more processors, cause the image capturing control apparatus to:
acquire a feature vector of a training target by inputting an image of the training target to a training model configured to extract a feature vector;
acquire a degree of training of the training model with respect to the training target based on the acquired feature vector;
acquire, based on degrees of training of a plurality of training targets, a sampling probability of an image of each of the plurality of training targets in mini-batch training;
select a sampling image that is sampled from images of the plurality of training targets based on the sampling probability acquired;
perform training of the training model based on the selected sampling image; and
perform second recognition of a person based on a face image of the person recognized through first recognition, a captured image including the person, and a training model trained.
2 . The image processing apparatus according to claim 1 , wherein the instructions, when executed by the one or more processors, further cause the apparatus to:
acquire, as a degree of training of the training model with respect a training target of interest, a degree of training that is lower as the number of representative vectors increases, the representative vectors being taken from representative vectors of the plurality of training targets and each having a distance to a feature vector obtained based on a single sampling image contained in the training target of interest and the training model that is smaller than a threshold value.
3 . The image processing apparatus according to claim 1 , wherein the instructions, when executed by the one or more processors, further cause the apparatus to:
acquire, as a degree of training of the training model with respect to a training target of interest, a degree of training that is lower as the number of representative vectors increases, the representative vectors being taken from representative vectors of the plurality of training targets and each having a distance to a representative vector of the training target of interest that is smaller than a threshold value.
4 . The image processing apparatus according to claim 1 , wherein the instructions, when executed by the one or more processors, further cause the apparatus to:
acquire a higher sampling probability as a sampling probability of a training target with a lower degree of training.
5 . The image processing apparatus according to claim 1 , wherein the instructions, when executed by the one or more processors, further cause the apparatus to:
acquire a probability of performing processing on the sampling image, based on a degree of training of the training model with respect to the sampling image; and
perform processing on the sampling image in accordance with the probability of performing the processing on the sampling image.
6 . The image processing apparatus according to claim 5 , wherein the instructions, when executed by the one or more processors, further cause the apparatus to:
generate an array including a flag value indicating to perform the processing and a flag value indicating not to perform the processing based on the probability of performing the processing, and determines whether to perform image processing on the sampling image in accordance with the flag value selected from the array.
7 . The image processing apparatus according to claim 6 , wherein the first recognition is recognition using recognition information indicating an individual input by a user.
8 . The image processing apparatus according to claim 1 , wherein the instructions, when executed by the one or more processors, further cause the apparatus to:
generate an array of the number of elements corresponding to the sampling probability of each of the plurality of training targets, and performs training based on an image corresponding to a training target selected from the array.
9 . An image processing method performed by an image processing apparatus, the method comprising:
acquiring a feature vector of a training target by inputting an image of the training target to a training model configured to extract a feature vector;
acquiring a degree of training of the training model with respect to the training target based on the acquired feature vector;
acquiring, based on degrees of training of a plurality of training targets, a sampling probability of an image of each of the plurality of training targets in mini-batch training;
selecting a sampling image that is sampled from images of the plurality of training targets based on the sampling probability acquired;
performing training of the training model based on the selected sampling image; and
performing second recognition of a person based on a face image of the person recognized through first recognition, a captured image including the person, and a training model trained.
10 . A non-transitory computer-readable storage medium storing a computer program for causing a computer to:
acquire a feature vector of a training target by inputting an image of the training target to a training model configured to extract a feature vector;
acquire a degree of training of the training model with respect to the training target based on the acquired feature vector;
acquire, based on degrees of training of a plurality of training targets, a sampling probability of an image of each of the plurality of training targets in mini-batch training;
perform training of the training model, based on a sampling image that is sampled from images of the plurality of training targets based on the sampling probability acquired;
select a sampling image that is sampled from images of the plurality of training targets based on the sampling probability acquired;
perform training of the training model based on the selected sampling image; and
perform second recognition of a person based on a face image of the person recognized through first recognition, a captured image including the person, and a training model trained.
11 . The image processing apparatus according to claim 1 , wherein the image of the training target with higher sampling probability are more likely to be selected as the sampling image.
12 . The image processing apparatus according to claim 1 , wherein the instructions, when executed by the one or more processors, further cause the apparatus to:
perform the training of the training model based on not images other than the selected sampling image among the images of the plurality of training targets but the selected sampling image.