Learning apparatus that adjusts training set used for machine learning, electronic apparatus, learning method, control method for electronic apparatus, and storage medium
A learning apparatus includes an adjustment unit configured to, for a training set including a plurality of pieces of training data, adjust the number of pieces of training data included in the training set such that feature values of the plurality of pieces of training data have a predetermined distribution, and a training unit configured to perform machine learning using the training set to generate a learned model.
1 . A learning apparatus comprising:
(i) at least one memory configured to store computer-executable instructions and at least one processor configured to execute the computer-executable instructions stored in the at least one memory, (ii) at least one circuit, or both (i) and (ii) that implement:
an adjustment unit configured to, for a training set including a plurality of pieces of training data, adjust the number of pieces of training data included in the training set such that feature values of the plurality of pieces of training data have a predetermined distribution; and
a training unit configured to perform machine learning using the training set to generate a learned model, wherein
the training data is a decoded image for training, which is obtained by encoding and decoding an uncompressed image,
the learned model outputs, when the decoded image is input to the learned model, a restored image obtained by restoring the decoded image,
the feature value is a pixel difference value of the decoded image,
the adjustment unit adjusts the number of pieces of training data included in the training set by obtaining a decoded image and extracting the pixel difference value from the decoded image,
wherein the pixel difference value is a difference between a maximum pixel value and a minimum pixel value of the obtained decoded image,
wherein the adjustment unit classifies the obtained decoded image into one of a plurality of sections of pixel difference values based on the extracted pixel difference value,
wherein the adjustment unit determines whether a current number of decoded images included in the training set in the one section is less than a target number corresponding to the one section in the predetermined distribution,
wherein the adjustment unit adds the obtained decoded image to the training set in response to determining that the current number is less than the target number,
wherein the training unit performs the machine learning using all decoded images included as training data in the training set,
wherein, after the training unit has performed the machine learning using all decoded images included as training data in the training set, the adjustment unit updates the training set by obtaining another decoded image, extracting another pixel difference value from the another decoded image, and adding the another decoded image to the training set based on the another pixel difference value so that the feature values of decoded images included in the training set have the predetermined distribution, and
wherein the training unit further performs the machine learning using the updated training set.
2 . The learning apparatus according to claim 1 , wherein
the adjustment unit adjusts the number of pieces of training data such that the feature values have a first distribution in which a ratio of the training data increases as the feature value of the training data increases.
3 . The learning apparatus according to claim 2 , wherein
the adjustment unit adds, after the machine learning is performed using the plurality of pieces of training data included in the training set, training data with feature values equal to or greater than a predetermined value.
4 . The learning apparatus according to claim 2 , wherein
the adjustment unit makes an adjustment that makes the distribution of the feature values of the plurality of pieces of training data average, after the machine learning is performed using all of the training data included in the training set.
5 . The learning apparatus according to claim 1 , wherein
the adjustment unit adjusts, for each of a plurality of training sets, a number of pieces of training data included in the training set such that feature values of the plurality of pieces of training data have a predetermined distribution; and
each of a plurality of training units performs machine learning using a corresponding training set.
6 . The learning apparatus according to claim 5 , wherein
an inference process is carried out by switching the plurality of learned models that are obtained through machine learning performed by the respective training units.
7 . The learning apparatus according to claim 6 , wherein
the inference process is carried out by switching to any of the plurality of learned models according to a feature value of data that is subject to inference.
8 . The learning apparatus according to claim 5 , wherein
the training set includes a plurality of pieces of training data having the feature values smaller than a predetermined threshold value or a plurality of pieces of training data having the feature values equal to or greater than the predetermined threshold value.
9 . The learning apparatus according to claim 1 , wherein
the predetermined distribution is an increasing distribution in which a target number of decoded images increases as the pixel difference value increases.
10 . An electronic apparatus comprising:
(i) at least one memory configured to store computer-executable instructions and at least one processor configured to execute the computer-executable instructions stored in the at least one memory, (ii) at least one circuit, or both (i) and (ii) that implement an inference unit configured to carry out an inference process using a learned model, wherein
the learned model is generated by machine learning using a training set including a plurality of pieces of training data, in which the number of pieces of training data has been adjusted such that feature values of the plurality of pieces of training data have a predetermined distribution,
the training data is a decoded image for training, which is obtained by encoding and decoding an uncompressed image,
the learned model outputs, when the decoded image is input to the learned model, a restored image obtained by restoring the decoded image,
the feature value is a pixel difference value of the decoded image,
the number of pieces of training data included in the training set are adjusted by obtaining a decoded image and extracting the pixel difference value
wherein the pixel difference value is a difference between a maximum pixel value and a minimum pixel value of the obtained decoded image,
wherein the obtained decoded image is classified into one of a plurality of sections of pixel difference values based on the extracted pixel difference value,
wherein whether a current number of decoded images included in the training set in the one section is less than a target number corresponding to the one section in the predetermined distribution is determined,
wherein the obtained decoded image is added to the training set in response to it being determined that the current number is less than the target number,
wherein the machine learning is performed using all decoded images included as training data in the training set,
wherein, after the machine learning is performed using all decoded images included as training data in the training set, the training set is updated by obtaining another decoded image, extracting another pixel difference value from the another decoded image, and adding the another decoded image to the training set based on the another pixel difference value so that the feature values of decoded images included in the training set have the predetermined distribution, and
wherein the machine learning is further performed using the updated training set.
11 . A learning method comprising:
adjusting, for a training set including a plurality of pieces of training data, the number of pieces of training data included in the training set such that feature values of the plurality of pieces of training data have a predetermined distribution; and
performing machine learning using the training set to generate a learned model, wherein
the training data is a decoded image for training, which is obtained by encoding and decoding an uncompressed image, and
the learned model outputs, when the decoded image is input to the learned model, a restored image obtained by restoring the decoded image,
the feature value is a pixel difference value of the decoded image,
the adjusting adjusts the number of pieces of training data included in the training set by obtaining a decoded image and extracting the pixel difference value from the decoded image,
wherein the pixel difference value is a difference between a maximum pixel value and a minimum pixel value of the obtained decoded image,
wherein the obtained decoded image is classified into one of a plurality of sections of pixel difference values based on the extracted pixel difference value,
wherein whether a current number of decoded images included in the training set in the one section is less than a target number corresponding to the one section in the predetermined distribution is determined,
wherein the obtained decoded image is added to the training set in response to it being determined that the current number is less than the target number,
wherein the machine learning is performed using all decoded images included as training data in the training set,
wherein, after the machine learning is performed using all decoded images included as training data in the training set, the training set is updated by obtaining another decoded image, extracting another pixel difference value from the another decoded image, and adding the another decoded image to the training set based on the another pixel difference value so that the feature values of decoded images included in the training set have the predetermined distribution, and
wherein the machine learning is further performed using the updated training set.
12 . A control method for an electronic apparatus, comprising:
obtaining a learned model from a learning apparatus that, for a training set including a plurality of pieces of training data, adjusts the number of pieces of training data included in the training set such that feature values of the plurality of pieces of training data have a predetermined distribution, performs machine learning using the training set in which the number of pieces of training data has been adjusted, and generates the learned model; and
carrying out an inference process using the obtained learned model, wherein
the training data is a decoded image for training, which is obtained by encoding and decoding an uncompressed image,
the obtained learned model outputs, when the decoded image is input to the obtained learned model, a restored image obtained by restoring the decoded image,
the feature value is a pixel difference value of the decoded image,
the learning apparatus adjusts the number of pieces of training data included in the training set by obtaining a decoded image and extracting the pixel difference value from the decoded image,
wherein the pixel difference value is a difference between a maximum pixel value and a minimum pixel value of the obtained decoded image,
wherein the obtained decoded image is classified into one of a plurality of sections of pixel difference values based on the extracted pixel difference value,
wherein whether a current number of decoded images included in the training set in the one section is less than a target number corresponding to the one section in the predetermined distribution is determined,
wherein the obtained decoded image is added to the training set in response to it being determined that the current number is less than the target number,
wherein the machine learning is performed using all decoded images included as training data in the training set,
wherein, after the machine learning is performed using all decoded images included as training data in the training set, the training set is updated by obtaining another decoded image, extracting another pixel difference value from the another decoded image, and adding the another decoded image to the training set based on the another pixel difference value so that the feature values of decoded images included in the training set have the predetermined distribution, and
wherein the machine learning is further performed using the updated training set.
13 . A non-transitory computer-readable storage medium storing a computer-executable program that executes a learning method, the learning method comprising:
adjusting, for a training set including a plurality of pieces of training data, the number of pieces of training data included in the training set such that feature values of the plurality of pieces of training data have a predetermined distribution; and
performing machine learning using the training set to generate a learned model, wherein
the training data is a decoded image for training, which is obtained by encoding and decoding an uncompressed image, and
the learned model outputs, when the decoded image is input to the learned model, a restored image obtained by restoring the decoded image,
the feature value is a pixel difference value, a pixel mean value, or a pixel variance value of the decoded image,
the adjusting adjusts the number of pieces of training data included in the training set by obtaining a decoded image and extracting the pixel difference value from the decoded image,
wherein the pixel difference value is a difference between a maximum pixel value and a minimum pixel value of the obtained decoded image,
wherein the obtained decoded image is classified into one of a plurality of sections of pixel difference values based on the extracted pixel difference value,
wherein whether a current number of decoded images included in the training set in the one section is less than a target number corresponding to the one section in the predetermined distribution is determined,
wherein the obtained decoded image is added to the training set in response to it being determined that the current number is less than the target number,
wherein the machine learning is performed using all decoded images included as training data in the training set,
wherein, after the machine learning is performed using all decoded images included as training data in the training set, the training set is updated by obtaining another decoded image, extracting another pixel difference value from the another decoded image, and adding the another decoded image to the training set based on the another pixel difference value so that the feature values of decoded images included in the training set have the predetermined distribution, and
wherein the machine learning is further performed using the updated training set.
14 . A non-transitory computer-readable storage medium storing a computer-executable program that executes a control method for an electronic apparatus, the control method comprising:
obtaining a learned model from a learning apparatus that, for a training set including a plurality of pieces of training data, adjusts the number of pieces of training data included in the training set such that feature values of the plurality of pieces of training data have a predetermined distribution, performs machine learning using the training set in which the number of pieces of training data has been adjusted, and generates the learned model; and
carrying out an inference process using the obtained learned model, wherein
the training data is a decoded image for training, which is obtained by encoding and decoding an uncompressed image,
the obtained learned model outputs, when the decoded image is input to the obtained learned model, a restored image obtained by restoring the decoded image,
the feature value is a pixel difference value of the decoded image,
the learning apparatus adjusts the number of pieces of training data included in the training set by obtaining a decoded image and extracting the pixel difference value from the decoded image,
wherein the pixel difference value is a difference between a maximum pixel value and a minimum pixel value of the obtained decoded image,
wherein the obtained decoded image is classified into one of a plurality of sections of pixel difference values based on the extracted pixel difference value,
wherein whether a current number of decoded images included in the training set in the one section is less than a target number corresponding to the one section in the predetermined distribution is determined,
wherein the obtained decoded image is added to the training set in response to it being determined that the current number is less than the target number,
wherein the machine learning is performed using all decoded images included as training data in the training set,
wherein, after the machine learning is performed using all decoded images included as training data in the training set, the training set is updated by obtaining another decoded image, extracting another pixel difference value from the another decoded image, and adding the another decoded image to the training set based on the another pixel difference value so that the feature values of decoded images included in the training set have the predetermined distribution, and
wherein the machine learning is further performed using the updated training set.