Generating datasets for training machine learning models
An apparatus for generating datasets for training machine learning models includes: a receiving unit configured to receive video data comprising sequential image frames; a storage unit configured to store a plurality of the sequential image frames; and a selecting unit configured to select, for a target image frame, a subset of stored image frames, the subset providing contextual data relating to the target image frame for the machine learning model. The selecting unit is configured to successively generate sampling values, wherein a difference between successive sampling values increases with each successively generated sampling value; and the selecting unit is configured to select a given image frame from the stored image frames in dependence upon whether a number of sequential image frames between the given image frame and the target image frame coincides with one of the successively generated sampling values.
1 . An apparatus for generating data for training machine learning models, comprising:
a receiving unit configured to receive video data comprising sequential image frames;
a storage unit configured to store a plurality of the sequential image frames; and
a selecting unit configured to select, for a target image frame, a subset of stored image frames, the subset providing contextual data relating to the target image frame for the machine learning model;
wherein
the selecting unit is configured to successively generate sampling values, wherein a difference between successive sampling values increases with each successively generated sampling value; and
with each successively generated sampling value, the selecting unit is configured to select a respective image frame from the stored image frames,
wherein a frame number of the respective image frame coincides with a latest successively generated sampling value.
2 . An apparatus according to claim 1 , wherein the frame number of the respective image frame is relative to one selected from the list consisting of:
i. the target image frame; and
ii. a previously selected image frame.
3 . An apparatus according to claim 1 , wherein the selecting unit is configured to successively generate sampling values by using a sampling function, the sampling function being a mathematical function.
4 . An apparatus according to claim 3 , wherein an extent to which the difference between successive sampling values increases with each successively generated sampling value is responsive to a respective value of one or more sampling parameters comprised within the sampling function.
5 . An apparatus according to claim 4 , wherein at least one of the sampling parameters is at least one of a coefficient, a base and an exponent.
6 . An apparatus according to claim 4 , comprising a value determining unit configured to determine, based on image content of the target image frame, the respective values of one or more of the sampling parameters.
7 . An apparatus according to claim 4 , wherein if a given sampling parameter is a base or an exponent, then the value of the given sampling parameter is greater than one.
8 . An apparatus according to claim 1 , comprising a frame nominating unit configured to determine whether a particular image frame of the stored image frames is to be the target image frame, the frame nominating unit being to do so based on one or more indicia pertaining to the particular image frame.
9 . An apparatus according to claim 8 , wherein one or more of the indicia pertaining to the particular image frame comprises metadata associated therewith.
10 . An apparatus according to claim 8 , wherein one or more of the indicia pertaining to the particular image frame comprises image content of the particular image frame.
11 . An apparatus according to claim 8 , wherein one or more of the indicia pertaining to the particular image frame comprises an amount of data of particular image frame.
12 . An apparatus according to claim 1 , comprising an output unit configured to output the subset of stored image frames to a machine learning model in order to train the machine learning model.
13 . An apparatus according to claim 1 , wherein the storage unit is a circular buffer.
14 . A method of generating data for training machine learning models, comprising:
receiving video data comprising sequential image frames;
storing a plurality of the sequential image frames; and
selecting, for a target image frame, a subset of stored image frames, the subset providing contextual data relating to the target image frame for the machine learning model;
wherein the selecting step comprises:
successively generating sampling values,
wherein a difference between successive sampling values increases with each successively generated sampling value; and
with each successively generated sampling value, selecting a respective image frame from the stored image frames,
wherein a frame number of the respective image frame coincides with a latest successively generated sampling value.
15 . One or more non-transitory computer-readable media that store instructions which, when executed by one or more computer processors, cause the one or more computer processors to perform operations comprising:
generating a training dataset for training an imitation learning model, comprising:
obtaining a sequence of image frames;
selecting a target image frame from the sequence of images frames;
storing the target image frame in the training dataset;
selecting an initial number N;
until a desired quantity of image frames from the sequence are stored in the training dataset, iteratively:
incrementing number N according to a linear function;
selecting an image frame of the multiple sequential image frames that is earlier or later in the sequence than a most recently stored image frame, and that is associated with the number N; and
storing the selected image frame in the training dataset; and
training the imitation learning model based at least on the generated training dataset.
16 . The media of claim 15 , wherein storing the selected image frame comprises skipping storing number N other image frames in the sequence that are between the selected image frame and the most recently stored image frame.
17 . The media of claim 15 , wherein the imitation model enables an agent to imitation actions of a human player in a video game.
18 . The media of claim 15 , wherein, in sequential iterations, the number N is incremented by adding 1, then 2, then 3, then 4.
19 . The media of claim 15 , wherein the selected image frame is later in the sequence than the most recently stored image frame.