Learning device, learning method, and program
The learning device addresses the limitation of existing models by incorporating both temporal and spatial relationships in human motion prediction through data masking and loss function calculation, enhancing the model's versatility.
Patent Information
- Application Number
- JP2023520717
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-05-14
- Publication Date
- 2024-09-26
- Estimated Expiration
- 2041-05-14
AI Technical Summary
Existing learning models for human motion prediction fail to account for both temporal and spatial relationships among human body structures.
A learning device that includes a data processing unit to mask and replace human motion data, and a pre-learning unit to calculate a loss function and update weights based on the error between predicted and true data, learning a model that considers both temporal and spatial relationships.
Enables the learning of a versatile model that effectively incorporates both temporal and spatial relationships in human motion prediction.
Smart Images

Figure 0007556460000001 
Figure 0007556460000006 
Figure 0007556460000002
Abstract
Description
[Technical field]
[0001] The present invention relates to a learning device, an estimation device, a learning method, an estimation method, and a program for learning a model. [Background technology]
[0002] An example of a conventional technique for predicting human movements is given in Non-Patent Document 1. [Prior art documents] [Non-patent literature]
[0003] [Non-Patent Document 1] Yujun Cai et al., "Learning Progressive Joint Propagation for Human Motion Prediction", Computer Vision -ECCV 2020, 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part VII, pp. 226-242 Summary of the Invention [Problem to be solved by the invention]
[0004] Non-Patent Document 1 only considers unidirectional relationships in time, and is unable to learn relationships in spatial human body structures, which are important when dealing with human motion.
[0005] Therefore, an object of the present invention is to provide a learning device capable of learning a highly versatile pre-learning model that takes into account both temporal and spatial relationships. [Means for solving the problem]
[0006] The learning device of the present invention includes a data processing unit and a pre-learning unit.
[0007] The data processing unit acquires human motion data, masks the entire data in a first time group of the human motion data, and masks randomly selected joints in a part of the data in a second time group (a time different from the first time group). The pre-learning unit calculates a loss function from the error between predicted data, which is data obtained by predicting the masked data using the pre-learning model, and the true value, and learns the pre-learning model by updating the weights of the pre-learning model. Effect of the Invention
[0008] According to the learning device of the present invention, it is possible to learn a highly versatile pre-learning model that takes into account both temporal relationships and spatial relationships. [Brief description of the drawings]
[0009] [Figure 1] FIG. 2 is a block diagram showing the functional configuration of a learning device, a fine tuning device, and an estimation device according to the first embodiment. [Diagram 2] 4 is a flowchart showing the operations of the learning device, the fine tuning device, and the estimation device according to the first embodiment. [Diagram 3] FIG. 2 is a block diagram showing the functional configuration of a data processing unit of the learning device according to the first embodiment. [Figure 4] 4 is a flowchart showing the operation of a data processing unit of the learning device according to the first embodiment. [Diagram 5] FIG. 1 is a diagram illustrating human motion data, masks, and tokens. [Figure 6] A diagram showing examples of temporal and spatial masks. [Figure 7] 6 is a diagram illustrating an example of a feature vector after embedding processing generated by the data processing unit; [Figure 8] FIG. 2 is a block diagram showing the functional configuration of a pre-learning unit of the learning device according to the first embodiment. [Figure 9] 4 is a flowchart showing the operation of a pre-learning unit of the learning device according to the first embodiment. [Figure 10] FIG. 2 is a diagram showing an example of the functional configuration of a computer. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, an embodiment of the present invention will be described in detail. Note that components having the same functions are given the same reference numbers and duplicated explanations will be omitted. EXAMPLES
[0011] Hereinafter, the functional configurations of the learning device 1, the fine tuning device 2, and the estimation device 3 of the first embodiment will be described with reference to FIG.
[0012] <Learning device 1> As shown in the figure, the learning device 1 of this embodiment includes a data processing unit 11, a pre-learning unit 12, and a pre-learning model database 13.
[0013] The data processing unit 11 acquires human motion data as pre-learning data, masks the entire data in a first time group of the human motion data, masks some randomly selected joints in the data in a second time group (a time different from the first time group), and replaces a portion of the human motion data with a corresponding portion of other human motion data (S11). Data including human posture information (such as the coordinates and joint angles of each joint, and bone lengths) is generally used as the human motion data, but the format of the data is not limited. When the human motion data includes information on joints, the number of joints can be set arbitrarily.
[0014] The pre-learning unit 12 calculates a loss function from the error between the predicted data, which is data predicted by the pre-learning model for the data to be masked, and the true value, updates the weights of the pre-learning model, calculates a loss function from the error between the result of predicting whether the human motion data is continuous or discontinuous using the pre-learning model, and the true value, updates the weights of the pre-learning model, and learns the pre-learning model (S12).
[0015] The pre-trained model database 13 stores the trained pre-trained model (S13).
[0016] <Fine tuning device 2> The fine tuning device 2 includes a pre-trained model database 21, a fine tuning unit 22, and a fine tuning model database 23.
[0017] The pre-learned model database 21 stores the pre-learned model learned by the learning device 1 (S21).
[0018] The fine-tuning unit 22 updates the pre-learned model learned by the learning device 1 with fine-tuning data corresponding to the task to obtain a fine-tuning model (S22). The fine-tuning data depends on the task to be fine-tuned. For example, in the case of a classification task of human motion, the fine-tuning data is a pair of human motion data and a label for each data. In this case, the fine-tuning unit 22 predicts a class distribution using the human motion data as an input of the model, calculates a cross-entropy error with the true value label, updates the weights, and outputs the weights of the network. The fine-tuning model database 23 stores the learned fine-tuning model.
[0019] <Estimation device 3> The estimation device 3 includes a fine-tuning model database 31 and an estimation unit 32 .
[0020] The fine tuning model database 31 stores the fine tuning models learned by the fine tuning device 2.
[0021] The estimation unit 32 acquires input data with unknown labels (for example, in the case of a human motion classification task, only human motion data), estimates a class distribution based on a fine-tuning model, and outputs an estimated label (estimated value) (S32).
[0022] Hereinafter, the detailed functional configuration and detailed operation of the data processing unit 11 of the learning device 1 will be described with reference to FIGS.
[0023] <Learning device 1, data processing unit 11, S11> As shown in FIG. 3, the data processing unit 11 includes a motion replacement unit 111, a mask replacement unit 112, and a token insertion unit 113.
[0024] The motion replacement unit 111 divides the input human motion data into a first half (motion A) and a second half (motion B), and replaces the second half (motion B) with another motion data in the data set with a predetermined probability (e.g., 50%) (S111). An example of division into motion A and motion B is shown in FIG.
[0025] The mask replacement unit 112 replaces a predetermined percentage of the input human motion data (e.g., 15% of the data) with a mask (S112). There are two types of masks: temporal masks and spatial masks (see Figs. 5 and 6 for examples of the temporal mask and spatial mask).
[0026] Temporal mask: a mask in the time direction that is applied to a certain time t 1 When masking, at time t 1 All Pose values are replaced with the values of the temporal mask. The temporal mask is used to predict joint angles from poses at previous and next times.
[0027] Spatial mask: a mask for a spatial direction that is applied at a certain time t 2 When masking, at time t 2A random percentage of the joints in the joints are randomly selected and replaced with the value of the spatial mask. The spatial mask is a mask for learning the consistency of a human posture when only one posture is viewed, and is a mask for predicting joint angles. Note that the spatial mask may or may not refer to postures at previous and subsequent times.
[0028] The timing of using the temporal mask and the spatial mask and the combination of the masks are arbitrary. The mask replacement unit 112 does not necessarily have to use both the temporal mask and the spatial mask. For example, only the spatial mask may be used, or only the temporal mask may be used. For example, the first 50 epochs may be learned using only the temporal mask, and the following 50 epochs may be learned using both masks. Note that the setting of 50 epochs is merely an example, and any value can be set as the number of epochs.
[0029] The token insertion unit 113 inserts a token into the human motion data (S113). Examples of tokens include [CLS] and [SEP]. As shown in FIG. 5, the token insertion unit 113 inserts [CLS] at the beginning of the human motion data, [SEP] between motions A and B, and [SEP] at the end of the human motion data. t are expressed in terms of the number of joints × degrees of freedom.
[0030] The data processing unit 11 performs embedding on the data after the processes in steps S111 to S113, and outputs the sum of the vectors after the embedding process.
[0031] The data processing unit 11 executes the following steps 1 to 4 as the embedding process.
[0032] 1. Pose Embedding 2. Position Embedding 3.Segment Embedding 4.Token Embedding A value such as 0 is assigned to [CLS], 1 to [SEP], 2 to the temporal mask, 3 to the spatial mask, and 4 to [POSE], and the feature vector is converted (see FIG. 7 for an output example). The pre-learning unit 12 receives the feature vector after the embedding process, and learns the model by executing MLM (= Masked Language Modeling) and NSP (= Next Sentence Prediction) tasks. The detailed functional configuration and operation of the pre-learning unit 12 will be described below with reference to FIG. 8 and FIG. 9.
[0033] <Learning device 1, pre-learning unit 12, S12> As shown in FIG. 8, the pre-learning unit 12 includes a mask pre-replacement data prediction unit 121, a motion continuity prediction unit 122, a loss function calculation unit 123, a weight update unit 124, and a true value storage unit 125.
[0034] The mask-previous data prediction unit 121 outputs a prediction of the original value of Pose replaced with a mask based on a pre-learning model (S121).
[0035] The motion continuity prediction unit 122 predicts whether motion A and motion B are continuous / discontinuous based on the pre-learning model (S122).
[0036] The loss function calculation unit 123 calculates a loss function from the error between the predicted pose and the true pose for the result of step S121. Any loss function may be used. For example, L1 distance or L2 distance may be used as the loss function. In addition, the loss function calculation unit 123 prepares a one-hot vector, such as 0 for continuity and 1 for discontinuity, as a true value for the result of step S122, performs binary classification, and calculates the loss function using cross entropy as the loss function (S123).
[0037] The weight update unit 124 updates the weights of the model so as to minimize the loss function (S124).
[0038] The true value storage unit 125 stores the true value used in step S123.
[0039] <Additional Notes> The device of the present invention has, as a single hardware entity, an input section to which a keyboard or the like can be connected, an output section to which a liquid crystal display or the like can be connected, a communication section to which a communication device (e.g., a communication cable) capable of communicating with the outside of the hardware entity can be connected, a CPU (which may also have a central processing unit, cache memory, registers, etc.), memories such as RAM and ROM, an external storage device such as a hard disk, and buses connecting the input section, output section, communication section, CPU, RAM, ROM, and external storage device so that data can be exchanged between them. If necessary, the hardware entity may also be provided with a device (drive) capable of reading and writing a recording medium such as a CD-ROM. A physical entity equipped with such hardware resources is, for example, a general-purpose computer.
[0040] The external storage device of the hardware entity stores the programs required to realize the above-mentioned functions and the data required in the processing of these programs (not limited to the external storage device, but for example the programs may be stored in a ROM, which is a read-only storage device). Data obtained by the processing of these programs is stored appropriately in the RAM, the external storage device, etc.
[0041] In the hardware entity, each program stored in an external storage device (or ROM, etc.) and the data required to process each program are loaded into memory as necessary, and interpreted, executed, and processed by the CPU as appropriate, so that the CPU realizes a predetermined function (each of the components represented as the above, "units," "means," etc.).
[0042] The present invention is not limited to the above-described embodiment, and can be modified as appropriate without departing from the spirit of the present invention. In addition, the processes described in the above-described embodiment are not limited to being executed in chronological order according to the order described, but may be executed in parallel or individually depending on the processing capacity of the device that executes the processes or as necessary.
[0043] As described above, when the processing functions of the hardware entities (the devices of the present invention) described in the above embodiments are realized by a computer, the processing contents of the functions that the hardware entities should have are described by a program. Then, by executing this program on a computer, the processing functions of the hardware entities are realized on the computer.
[0044] The various processes described above can be implemented by loading a program for executing each step of the above method into the recording unit 10020 of the computer 10000 shown in FIG. 10, and operating the control unit 10010, input unit 10030, output unit 10040, etc.
[0045] The program describing the processing contents can be recorded on a computer-readable recording medium. The computer-readable recording medium may be, for example, a magnetic recording device, an optical disk, a magneto-optical recording medium, a semiconductor memory, or any other suitable medium. Specifically, for example, a hard disk drive, a flexible disk, a magnetic tape, or the like can be used as the magnetic recording device, a DVD (Digital Versatile Disc), a DVD-RAM (Random Access Memory), a CD-ROM (Compact Disc Read Only Memory), a CD-R (Recordable) / RW (ReWritable), or the like can be used as the optical disk, an MO (Magneto-Optical disc), or the like can be used as the magneto-optical recording medium, and an EEP-ROM (Electrically Erasable and Programmable-Read Only Memory) or the like can be used as the semiconductor memory.
[0046] The program may be distributed, for example, by selling, transferring, lending, etc. portable recording media such as DVDs and CD-ROMs on which the program is recorded. Furthermore, the program may be distributed by storing the program in a storage device of a server computer and transferring the program from the server computer to other computers via a network.
[0047] A computer that executes such a program, for example, first stores the program recorded on a portable recording medium or the program transferred from a server computer in its own storage device. Then, when executing a process, the computer reads the program stored in its own recording medium and executes a process according to the read program. As another execution form of the program, the computer may directly read the program from the portable recording medium and execute a process according to the program, or may execute a process according to the received program each time a program is transferred from the server computer to the computer. The above-mentioned process may be executed by a so-called ASP (Application Service Provider) type service that realizes a processing function only by issuing an execution instruction and obtaining a result, without transferring a program from the server computer to the computer. Note that the program in this embodiment includes information used for processing by an electronic computer and equivalent to a program (data that is not a direct command to the computer but has a nature that specifies the processing of the computer, etc.).
[0048] In addition, in this embodiment, a hardware entity is configured by executing a specific program on a computer, but at least a part of the processing contents may be realized by hardware.
Claims
1. A data processing unit that acquires human motion data, masks the entire data in a first time group of the human motion data, masks randomly selected joints in a portion of the data in a second time group (a time different from the first time group), and replaces, with a predetermined probability, a portion of the human motion data with a corresponding portion of another portion of the human motion data; a pre-learning unit that calculates a loss function from an error between a true value and predicted data, which is data predicted by a pre-learning model for data to be masked, and updates a weight of the pre-learning model to learn the pre-learning model; calculates a loss function from an error between a true value and a result of prediction by the pre-learning model as to whether the human motion data is continuous or discontinuous, and updates the weight of the pre-learning model; Learning device.
2. A learning method executed by a learning device, comprising: a data processing step of acquiring human motion data, masking the entire data in a first time group of the human motion data, masking randomly selected joints in a portion of the data in a second time group (different from the first time group), and replacing with a predetermined probability a portion of the human motion data with a corresponding portion of another of the human motion data; A pre-learning step of calculating a loss function from an error between a true value and predicted data, which is data predicted by a pre-learning model for data to be masked, and updating weights of the pre-learning model to learn the pre-learning model, calculating a loss function from an error between a true value and a result of prediction by the pre-learning model as to whether the human motion data is continuous or discontinuous, and updating weights of the pre-learning model How to learn.
3. A program that causes a computer to function as the learning device according to claim 1.
