WO2023229094A1 - Method and apparatus for predicting actions - Google Patents

Method and apparatus for predicting actions Download PDF

Info

Publication number
WO2023229094A1
WO2023229094A1 PCT/KR2022/008848 KR2022008848W WO2023229094A1 WO 2023229094 A1 WO2023229094 A1 WO 2023229094A1 KR 2022008848 W KR2022008848 W KR 2022008848W WO 2023229094 A1 WO2023229094 A1 WO 2023229094A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
attention
layer
encoder
self
Prior art date
Application number
PCT/KR2022/008848
Other languages
French (fr)
Korean (ko)
Inventor
공다영
이준석
김만진
조민수
하성종
Original Assignee
주식회사 엔씨소프트
포항공과대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 엔씨소프트, 포항공과대학교 산학협력단 filed Critical 주식회사 엔씨소프트
Publication of WO2023229094A1 publication Critical patent/WO2023229094A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/70Labelling scene content, e.g. deriving syntactic or semantic representations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/20Movements or behaviour, e.g. gesture recognition

Definitions

  • the disclosed embodiments relate to behavior prediction technology.
  • Behavior prediction technology which predicts future behavior based on behavior observed in a video, is one of the important research areas for the development of artificial intelligence-based systems, for example, robots that provide services based on predicted human behavior. .
  • the previously proposed behavior prediction technologies have a structure of sequentially predicting the next future behavior by considering the predicted future behavior first, so if there is an error in the first predicted future behavior, the error accumulates and affects the prediction of the next future behavior. There is a problem that the prediction time takes a long time.
  • the disclosed embodiments are intended to provide an apparatus and method for behavior prediction.
  • a behavior prediction method includes generating an encoder input matrix corresponding to an input frame sequence based on features extracted from the input frame sequence; An operation of generating an encoder output matrix based on the encoder input matrix using an encoder composed of one or more encoder layers including a first self-attention layer as a sub-layer; An operation of generating a decoder output matrix based on the encoder output matrix and the action query matrix using a decoder composed of one or more decoder layers including a second self-attention layer and a cross-attention layer as sub-layers; identifying one or more behaviors observed in the input frame sequence based on the encoder output matrix; and predicting in parallel one or more future actions that will occur sequentially after the one or more actions based on the decoder output matrix.
  • the behavior query matrix may be a learnable parameter determined through learning a prediction model including the encoder and the decoder.
  • the encoder includes a plurality of encoder layers, each including the first self-attention layer as a sub-layer and performed sequentially, and the encoder output matrix may be an output matrix of the last encoder layer among the plurality of encoder layers. .
  • the first self-attention layer included in the first encoder layer among the plurality of encoder layers performs self-attention based on a matrix generated by combining the encoder input matrix and the position embedding matrix, and n ( At this time, n is a natural number of 2 ⁇ n ⁇ N, N is the number of the plurality of encoder layers), and the first self-attention layer included in the th encoder layer is the output matrix of the n-1th encoder layer among the plurality of encoder layers.
  • Self-attention can be performed based on a matrix generated by combining and the position embedding matrix.
  • the first self-attention layer may include a plurality of attention heads that each perform self-attention based on a matrix input to the first self-attention layer.
  • the decoder includes a plurality of decoder layers each including the second self-attention layer and the cross-attention layer as sub-layers and performed sequentially, and the decoder output matrix is the last decoder layer among the plurality of decoder layers. It may be an output matrix.
  • the second self-attention layer included in the first decoder layer among the plurality of decoder layers performs self-attention based on a matrix generated by combining a preset initial decoder input matrix and the action query matrix, and the plurality of decoder layers
  • the second self-attention layer included in the m decoder layer (where m is a natural number of 2 ⁇ m ⁇ M, M is the number of the plurality of decoder layers) is the m-1th decoder layer among the plurality of decoder layers.
  • Self-attention can be performed based on a matrix generated by combining the output matrix of and the behavior query matrix.
  • the second self-attention layer may include a plurality of attention heads that each perform self-attention based on a matrix input to the second self-attention layer.
  • the cross attention layer includes a first input matrix combining the encoder output matrix and a position embedding matrix, a matrix generated by performing layer normalization on the self-attention matrix generated by the second self-attention layer, and the action query matrix. Cross attention can be performed based on a second input matrix combining .
  • the cross attention layer may include a plurality of attention heads that respectively perform cross attention based on the first input matrix and the second input matrix.
  • It may further include parallelly predicting a duration for each of the one or more future actions based on the decoder output matrix.
  • a behavior prediction device includes one or more processors; and a memory storing one or more programs executed by the one or more processors, wherein the one or more processors generate an encoder input matrix corresponding to the input frame sequence based on features extracted from the input frame sequence, and Using an encoder composed of one or more encoder layers including a first self-attention layer as a sub-layer, generating an encoder output matrix based on the encoder input matrix, and including a second self-attention layer and a cross-attention layer as sub-layers Using a decoder consisting of one or more decoder layers, generate a decoder output matrix based on the encoder output matrix and a behavior query matrix, and based on the encoder output matrix, identify one or more behaviors observed in the input frame sequence, Based on the decoder output matrix, one or more future actions that will occur sequentially after the one or more actions are predicted in parallel.
  • the behavior query matrix may be a learnable parameter determined through learning a prediction model including the encoder and the decoder.
  • the encoder includes a plurality of encoder layers, each including the first self-attention layer as a sub-layer and performed sequentially, and the encoder output matrix may be an output matrix of the last encoder layer among the plurality of encoder layers. .
  • the first self-attention layer included in the first encoder layer among the plurality of encoder layers performs self-attention based on a matrix generated by combining the encoder input matrix and the position embedding matrix, and n ( At this time, n is a natural number of 2 ⁇ n ⁇ N, N is the number of the plurality of encoder layers), and the first self-attention layer included in the th encoder layer is the output matrix of the n-1th encoder layer among the plurality of encoder layers.
  • Self-attention can be performed based on a matrix generated by combining and the position embedding matrix.
  • the first self-attention layer may include a plurality of attention heads that each perform self-attention based on a matrix input to the first self-attention layer.
  • the decoder includes a plurality of decoder layers each including the second self-attention layer and the cross-attention layer as sub-layers and performed sequentially, and the decoder output matrix is the last decoder layer among the plurality of decoder layers. It may be an output matrix.
  • the second self-attention layer included in the first decoder layer among the plurality of decoder layers performs self-attention based on a matrix generated by combining a preset initial decoder input matrix and the action query matrix, and the plurality of decoder layers
  • the second self-attention layer included in the m decoder layer (where m is a natural number of 2 ⁇ m ⁇ M, M is the number of the plurality of decoder layers) is the m-1th decoder layer among the plurality of decoder layers.
  • Self-attention can be performed based on a matrix generated by combining the output matrix of and the behavior query matrix.
  • the second self-attention layer may include a plurality of attention heads that each perform self-attention based on a matrix input to the second self-attention layer.
  • the cross attention layer includes a first input matrix combining the encoder output matrix and a position embedding matrix, a matrix generated by performing layer normalization on the self-attention matrix generated by the second self-attention layer, and the action query matrix. Cross attention can be performed based on a second input matrix combining .
  • the cross attention layer may include a plurality of attention heads that respectively perform cross attention based on the first input matrix and the second input matrix.
  • the one or more processors may predict a duration for each of the one or more future actions in parallel based on the decoder output matrix.
  • future actions that will occur sequentially are predicted in parallel using the features of the frame sequence extracted from the video, so that visual information of the frame sequence is utilized to predict future actions and future actions are sequentially predicted. Accumulation of errors that occurs when making predictions can be prevented. Accordingly, the accuracy of predicting future behavior can be improved and the time required for prediction can be reduced.
  • Figure 1 is a diagram showing the configuration of an artificial neural network-based behavior prediction model according to an embodiment.
  • Figure 2 is a diagram showing the configuration of an encoder and decoder according to an embodiment.
  • Figure 3 is a diagram showing the configuration of an encoder layer according to one embodiment.
  • Figure 4 is a diagram illustrating an example of a first self-attention layer according to an embodiment.
  • Figure 5 is a diagram showing the configuration of a decoder layer according to one embodiment.
  • Figure 6 is a diagram illustrating an example of a second self-attention layer according to an embodiment.
  • Figure 7 is a diagram illustrating an example of a cross attention layer according to an embodiment.
  • Figure 8 is a flowchart of a behavior prediction method according to one embodiment.
  • FIG. 9 is a block diagram illustrating and illustrating a computing environment including a computing device according to an embodiment.
  • a matrix refers to a rectangular array composed of two or more values. Unless otherwise specified, a matrix refers to a matrix composed of multiple columns and multiple rows, as well as a matrix composed of one column and multiple rows (i.e., a column vector), and one It is used to encompass a matrix (i.e., row vector) consisting of rows and multiple columns.
  • Equation 1 Equation 1 below.
  • represents the softmax function
  • score() represents the attention score function used to calculate the attention score.
  • the attention score function may be, for example, a scaled dot-product function, but depending on the embodiment, various types of attention score functions in addition to the scaled dot-product function may be used.
  • Q represents a query matrix generated from matrix A
  • K and V represent a key matrix and a value matrix generated from matrix B, respectively.
  • Figure 1 is a diagram showing the configuration of an artificial neural network-based behavior prediction model according to an embodiment.
  • the behavior prediction model 100 includes an input unit 110, an encoder 120, a decoder 130, a behavior classification unit 140, and a behavior prediction unit 150.
  • the behavior prediction model 100 identifies the action taken by the object in a video of a moving object, such as a person or an animal, and predicts the future action to be taken by the object after the identified action. It may be an artificial neural network-based model to do this.
  • the input unit 110 generates an encoder input matrix corresponding to the input frame sequence based on features extracted from the input frame sequence.
  • the input frame sequence may include a plurality of frames sequentially extracted from at least some sections of the entire playback section of the video. For example, if a video consists of T frames, the input frame sequence may include T 0 frames sequentially sampled at a preset sampling interval from the first frame to the ⁇ T frame of the video. That is, the number T 0 of frames included in the input frame sequence can satisfy Equation 2 below.
  • Equation 2 ⁇ represents a preset sampling interval, ⁇ represents the observation rate for the video, and ⁇ can be preset to a value between 0 and 1.
  • the encoder input matrix may be generated based on features extracted from each frame included in the input frame sequence.
  • the input unit 110 may extract feature vectors for each frame included in the input frame sequence.
  • the feature vector for each frame may be a vector of a preset dimension extracted from each frame using, for example, a feature extraction model based on a convolutional neural network (CNN).
  • CNN convolutional neural network
  • the feature vector for each frame is a 3D convolutional neural network that can extract spatial and temporal features of each frame included in the input frame sequence, such as the I3D (Inflated 3D ConvNet) model. It can be extracted using
  • the method of extracting a feature vector from an input frame sequence is not necessarily limited to the above-described example, and various methods for extracting visual features of an image may be used depending on the embodiment.
  • the input unit 110 may generate an encoder input matrix based on a feature matrix composed of feature vectors for each frame included in the input frame sequence. Specifically, the input unit 110 may generate a matrix of a preset size from a feature matrix using a linear layer and then generate an encoder input matrix using an activation function.
  • the activation function is ReLU (Rectified Linear Unit)
  • the encoder input matrix can be generated according to Equation 3 below.
  • C and D are each preset hyperparameters.
  • the encoder 120 includes one or more encoder layers including a first self-attention layer as a sub-layer, and generates an encoder output matrix based on the encoder input matrix using the one or more encoder layers.
  • the first self-attention layer may be an artificial neural network that performs self-attention based on the input matrix of the encoder layer.
  • the decoder 130 includes one or more decoder layers including a second self-attention layer and a cross-attention layer as sub-layers, and generates a decoder output matrix based on the action query matrix and the encoder output matrix using the one or more decoder layers. .
  • the second self-attention layer may be an artificial neural network that performs self-attention based on a behavioral query matrix.
  • the cross attention layer may be an artificial neural network that performs cross attention based on the encoder output matrix and the action query matrix.
  • Figure 2 is a diagram showing the configuration of an encoder and decoder according to an embodiment.
  • the encoder 120 includes N encoder layers 120-1, 120-2, and 120-, each of which includes a first self-attention layer and is sequentially performed. N) may be configured.
  • each encoder layer (120-1, 120-2, 120-N) may have the same structure, and the first encoder layer (120) -1) can use the encoder input matrix X 0 generated by the input unit 110 as input.
  • the remaining encoder layers (120-2, 120-N) can use the matrix output from the previous encoder layer as input, and the encoder finally output from the encoder 120 output matrix may be a matrix output from the last encoder layer (120-N).
  • the decoder 130 includes M decoder layers 130-1, 130-2, 130-1, which each include a second self-attention layer and a cross-attention layer and are sequentially performed (where M is a natural number of 1 ⁇ M). M) may be configured.
  • each encoder layer (130-1, 130-2, 130-M) included in the decoder 130 may have the same structure, and the first decoder layer (130-1) is the initial decoder input. procession can be used as input.
  • the remaining decoder layers (130-2, 130-M) can use the matrix output from the previous decoder layer as input, and the decoder finally output from the decoder 120 output matrix may be a matrix output from the last decoder layer (130-M).
  • the number of encoder layers and decoder layers may change depending on the embodiment.
  • Figure 3 is a diagram showing the configuration of an encoder layer according to one embodiment.
  • each encoder layer 120-1, 120-2, and 120-N shown in FIG. 2 may have the same configuration as the encoder layer 310 shown in FIG. 3, for example.
  • the encoder layer 310 may include a first self-attention layer 311, layer normalization (312, 314), and a feed-forward network (FFN) (313).
  • FNN feed-forward network
  • the first self-attention layer 311 is an input matrix input to the encoder layer 310. (In this case, n is 1 ⁇ n ⁇ N) and the position embedding matrix A matrix created by combining Self-attention can be performed for . At this time, the matrix X' n-1 input to the first self-attention layer 311 can be generated by adding the input matrix X n-1 and the position embedding matrix P as shown in Equation 4 below.
  • the input matrix X n-1 input to the encoder layer 310 is the encoder input matrix X 0 generated by the input unit 110. It can be.
  • the encoder layer 310 is the second or later encoder layer (i.e., 2 ⁇ n ⁇ N)
  • the input matrix X n-1 input to the encoder layer 310 is the output matrix of the n-1th encoder layer. It can be.
  • the position embedding matrix P may be composed of T 0 position embedding vectors corresponding to T 0 frames included in the input frame sequence.
  • each of the T 0 position embedding vectors may be a D-dimensional vector indicating the position (order) within the input frame sequence of the corresponding frame among the T 0 frames included in the input frame sequence.
  • the positional embedding matrix P can be generated through positional encoding according to Equations 5 and 6 below.
  • pos represents the position within the input frame sequence
  • i represents the index of the dimension within the position embedding vector
  • the first layer normalization 312 is a self - attention matrix generated by the first self-attention layer 311 using the matrix After performing residual connection by adding the input matrix X n-1 of the encoder layer 310, layer normalization can be performed.
  • the matrix generated through first layer normalization (312) Can be expressed as Equation 7 below.
  • the matrix and the output matrix of the encoder layer 310 by performing residual concatenation by adding the input matrix can be created.
  • the output matrix X n of the encoder layer 310 can be expressed as Equation 8 below.
  • the first self-attention layer 311 includes a plurality of attention heads (attention heads) that parallelly perform self - attention on the matrix head).
  • the self-attention matrix Z generated by the first self-attention layer 311 is generated based on the output matrix of each of the plurality of attention heads using the input matrix X' n-1 of the first self-attention layer 311. It can be.
  • each attention head included in the first self-attention layer 311 generates a query matrix, key matrix, and value matrix from the matrix X' n-1 input to the first self-attention layer 311, and the generated You can generate an output matrix by performing self-attention using the query matrix, key matrix, and value matrix.
  • the output matrix Z k of the k (in this case, 1 ⁇ k ⁇ h 1 )th attention head is Equation 9 below: It can be created according to .
  • the query matrix Q k can each be generated according to Equations 10 to 12 below.
  • equations 10 to 12 and represents a weight matrix determined through learning the behavior prediction model 100, and may be different for each attention head.
  • score(Q k , K k ) may be a scaled dot-product function, for example, as in Equation 13 below, but depending on the embodiment, various types of score functions may be used in addition to the scaled dot-product function. can be used.
  • the first self-attention layer 311 can generate a self-attention matrix Z using the output matrix of each attention head. Specifically, the first self-attention layer 311 concatenates the output matrix of each attention head as shown in Equation 14 below to create a self-attention matrix. can be created.
  • Figure 4 is a diagram showing an example of a first self-attention layer according to an embodiment.
  • the number of attention heads included in the attention layer 310 is not limited to the illustrated example and may be set differently depending on the embodiment.
  • each attention head (410, 420, 430) uses the linear layer (411, 421, 431 ) to add a weight matrix to the input matrix You can generate the query matrix Q k by multiplying .
  • each attention head (410, 420, 430) uses the linear layer (412, 422, 432 ) to add a weight matrix to the input matrix You can generate the key matrix K k by multiplying .
  • each attention head (410, 420, 430) uses the linear layer (413, 423, 433 ) to add a weight matrix to the input matrix The value matrix V k can be generated by multiplying .
  • each attention head (410, 420, 430) performs attention (414, 424, 434) using the generated query matrix Q k , key matrix K k, and value matrix V k , respectively satisfying Equation 9 described above.
  • output matrices Z 1 , Z 2 and Z 3 can be generated.
  • the first self-attention layer 311 connects the output matrices Z 1 , Z 2 , and Z 3 of each attention head 410, 420, and 430 (440), and then calculates the weights using the linear layer 450. By multiplying, a self-attention matrix Z that satisfies Equation 14 described above can be generated.
  • Figure 5 is a diagram showing the configuration of a decoder layer according to one embodiment.
  • each decoder layer 130-1, 130-2, and 130-M shown in FIG. 2 may have the same configuration as the decoder layer 510 shown in FIG. 5, for example.
  • the decoder layer 510 may include a second self-attention layer 511, layer normalization 512, 514, and 516, a cross attention layer 513, and a feed-forward network 515. .
  • the second self-attention layer 511 is an input matrix input to the decoder layer 510. (In this case, m is 1 ⁇ m ⁇ M) and the action query matrix A matrix created by combining Self-attention can be performed for . At this time, the matrix Y'm -1 input to the second self-attention layer 511 can be generated by adding the input matrix Y m-1 and the action query matrix Y as shown in Equation 15 below.
  • the behavior query matrix Y is a matrix including L behavior queries, each of which is a D-dimensional vector, and is a learnable parameter determined through learning the behavior prediction model 100. Additionally, the number L of action queries included in the action query matrix is a preset hyperparameter and may be set to different values depending on the embodiment.
  • the input matrix Y m-1 input to the decoder layer 510 is the preset initial decoder input matrix It can be.
  • the initial decoder input matrix Y 0 may be, for example, a matrix in which all elements have values of 0.
  • the input matrix Y m-1 input to the decoder layer 510 is the output matrix of the m-1th decoder layer. It can be.
  • the first layer normalization 512 uses the self-attention matrix Z' generated by the second self-attention layer 511 and the input matrix Y m-1 of the decoder layer 510 using the matrix Y' m-1. After performing additive residual concatenation, layer normalization can be performed. Specifically, the matrix generated through first layer normalization (512) Can be expressed as Equation 16 below.
  • the cross attention layer 513 is a matrix that combines the matrix Y'' m-1 generated through the first layer normalization 512 and the behavior query matrix Y. and a matrix combining the encoder output matrix Cross attention can be performed on .
  • the matrix Y''' m-1 can be created by adding the input matrix Y'' m-1 and the action query matrix Y as shown in Equation 17 below, and the matrix Likewise, it can be generated by adding the encoder output matrix X N and the position embedding matrix P.
  • the second layer normalization 514 is a cross attention matrix generated by the cross attention layer 513. After performing residual concatenation by adding the matrix Y'' m-1 generated by the first layer normalization 512, layer normalization can be performed. Specifically, the matrix generated through second layer normalization (514) Can be expressed as Equation 19 below.
  • the matrix Y'''' m-1 generated through the cross attention layer 513 passes through the feed-forward network 515, and the third layer normalization 516 is the output of the feed-forward network 515.
  • Perform residual concatenation by adding the input matrix Y'''' m-1 of the feed-forward network 515 and then perform layer normalization to the output matrix of the decoder layer 510. can be created.
  • the output matrix Y m of the decoder layer 310 can be expressed as Equation 20 below.
  • the second self-attention layer 511 includes a plurality of attention heads that perform self-attention in parallel for the matrix Y'm -1 input to the second self-attention layer 511. can do.
  • the self-attention matrix generated by the second self-attention layer 511 will be generated based on the output matrix of each of the plurality of attention heads using the input matrix Y' m-1 of the second self-attention layer 511. You can.
  • each attention head included in the second self-attention layer 511 generates a query matrix, key matrix, and value matrix from the matrix Y'm -1 input to the second self-attention layer 511, and the generated You can generate an output matrix by performing self-attention using the query matrix, key matrix, and value matrix.
  • the output matrix Z' l of the l (in this case, 1 ⁇ l ⁇ h 2 )th attention head is expressed in the equation below: It can be created according to 21.
  • Equation 21 the query matrix Q'l , key matrix K'l , and value matrix V'l can be generated according to Equations 22 to 24 below, respectively.
  • equations 22 to 24 and represents a weight matrix determined through learning the behavior prediction model 100, and may be different for each attention head.
  • score(Q' l , K' l ) may be a scaled dot-product function, for example, as in Equation 25 below, but depending on the embodiment, various types of functions may be used in addition to the scaled dot-product function.
  • a score function may be used.
  • the second self-attention layer 511 uses the output matrix of each attention head to create a self-attention matrix. can be created. Specifically, the second self-attention layer 511 can generate a self-attention matrix Z' by connecting the output matrices of each attention head as shown in Equation 26 below.
  • Figure 6 is a diagram showing an example of a second self-attention layer according to an embodiment.
  • the number of attention heads included in the attention layer 511 is not limited to the illustrated example and may be set differently depending on the embodiment.
  • each attention head (610, 620, 630) uses a linear layer (611, 621, 631) to add a weight matrix to the input matrix Y'm -1. You can create the query matrix Q' l by multiplying .
  • each attention head (610, 620, 630) uses the linear layer (612, 622, 632) to add a weight matrix to the input matrix Y' m-1. You can generate the key matrix K' l by multiplying .
  • each attention head (610, 620, 630) uses the linear layer (613, 623, 633) to add a weight matrix to the input matrix Y' m-1. You can create the value matrix V' l by multiplying .
  • each attention head (610, 620, 630) performs attention (614, 624, 634) using the generated query matrix Q'l , key matrix K'l , and value matrix V'l , respectively, using the above-mentioned equation 21 It is possible to generate output matrices Z' 1 , Z' 2 and Z' 3 that satisfy.
  • the second self-attention layer 511 connects the output matrices Z' 1 , Z' 2 and Z' 3 of each attention head (610, 620, 630) (640) and then uses the linear layer (650). by weighting By multiplying, a self-attention matrix Z' that satisfies Equation 26 described above can be generated.
  • the cross attention layer 513 performs cross attention on the two matrices X' N and Y''' m-1 input to the cross attention layer 513 in parallel. It may include a plurality of attention heads. In this case, the cross attention matrix generated by the cross attention layer 513 may be generated based on the output matrix of each of the plurality of attention heads using the matrices X' N and Y''' m-1 as input.
  • each attention head included in the cross attention layer 513 generates a query matrix from matrix Y''' m-1 among the two matrices input to the cross attention layer 513, and a key from matrix You can create matrices and value matrices. Additionally, each attention head can generate an output matrix by performing cross attention using the generated query matrix, key matrix, and value matrix.
  • the output matrix Z'' u of the u (in this case, 1 ⁇ u ⁇ h 3 )th attention head is Equation 27 below: It can be created according to .
  • Equation 27 the query matrix Q'' u , the key matrix K'' u , and the value matrix V'' u can each be generated according to Equations 28 to 30 below.
  • equations 28 to 30, and represents a weight matrix determined through learning the behavior prediction model 100, and may be different for each attention head.
  • score(Q'' u , K'' u ) may be, for example, a scaled dot-product function such as Equation 31 below, but depending on the embodiment, various functions may be used in addition to the scaled dot-product function. A variety of score functions can be used.
  • the cross attention layer 513 uses the output matrix of each attention head to create a cross attention matrix. can be created. Specifically, the cross attention layer 513 can generate a cross attention matrix Z'' by connecting the output matrices of each attention head as shown in Equation 32 below.
  • Figure 7 is a diagram showing an example of a cross attention layer according to an embodiment.
  • the number of attention heads included is not limited to the example shown and may be set differently depending on the embodiment.
  • each attention head (710, 720, 730) uses a linear layer (711, 721, 731) to add a weight matrix to the input matrix Y''' m-1. You can create the query matrix Q'' u by multiplying .
  • each attention head (710, 720, 730) uses the linear layer (712, 722, 732) to add a weight matrix to the input matrix You can generate the key matrix K'' u by multiplying .
  • each attention head (710, 720, 730) uses the linear layer (713, 723, 733) to add a weight matrix to the input matrix You can create the value matrix V'' u by multiplying .
  • each attention head (710, 720, 730) performs attention (714, 724, 734) using the generated query matrix Q''u , key matrix K''u, and value matrix V''u , respectively, as described above.
  • Output matrices Z'' 1 , Z'' 2 , and Z'' 3 that satisfy Equation 27 can be generated.
  • the cross attention layer 513 connects the output matrices Z'' 1 , Z'' 2 , and Z'' 3 of each attention head (710, 720, 730) (740), and then connects the linear layer (750). using weights By multiplying, a cross attention matrix Z'' that satisfies Equation 32 described above can be generated.
  • the behavior classification unit 140 identifies one or more behaviors observed in the input frame sequence based on the encoder output matrix output from the encoder 120.
  • the encoder output matrix The action corresponding to each frame can be identified.
  • the action classification unit 140 generates a probability distribution for each of T 0 frames included in the input frame sequence for I action classes based on the encoder output matrix Based on this, the behavior corresponding to each frame can be classified into one of I behavior classes. At this time, the type and number of behavior classes may change depending on the learning data used to learn the behavior prediction model 100.
  • the behavior classification unit 140 applies a fully connected layer to the encoder output matrix A matrix representing the probability distribution of each of the 0 frames for T can be created.
  • the action prediction unit 150 predicts in parallel one or more future actions that will occur sequentially after one or more actions identified by the action classifier 140 based on the decoder output matrix output from the decoder 130. .
  • the decoder output matrix Y M consists of L D-dimensional vectors corresponding to the L behavior queries included in the behavior query matrix Y, and the behavior prediction unit 150 sequentially generates data using the decoder output matrix Y M.
  • L future actions can be predicted in parallel. At this time, predicting L future actions that will occur sequentially in parallel requires using the prediction result for the t-1th future action to predict the t (here, 2 ⁇ t ⁇ L)th future action among the L future actions. It means there is no.
  • the behavior prediction unit 150 generates a probability distribution of each of the L future actions for the I+1 action classes, and predicts each of the L future actions based on the generated probability distribution to I+ It can be classified into one behavior class.
  • I+1 behavior classes may include the above-described I behavior classes and a dummy class indicating that it does not belong to any of the I behavior classes.
  • the behavior prediction unit 150 applies a fully connected layer to the decoder output matrix Y M as shown in Equation 34 below and then applies the softmax function to obtain L for I+1 behavior classes.
  • a matrix representing the probability distribution of each of the dog's future actions can be created.
  • the behavior prediction unit 150 may predict the duration of each of one or more predicted future behaviors in parallel.
  • the action prediction unit 150 applies a fully connected layer to the decoder output matrix Y M as shown in Equation 35 below to create an L-dimensional vector containing the duration of each of the L future actions as an element. can be created.
  • the jth element d j of the L elements included in may be a value between 0 and 1 that represents the relative duration of the jth future action among the L predicted future actions,
  • the sum of the L elements included in may be 1 (i.e. ).
  • the L future actions predicted by the action prediction unit 150 are ⁇ T number of future actions from which the input frame sequence was extracted among all frames. It may be an action predicted to occur in ⁇ T frames after the frame, and the actual duration predicted for each of the L future actions may be ⁇ Td j .
  • means the preset prediction ratio of ⁇ [0, 1- ⁇ ].
  • the behavior prediction model 100 has the behavior classifier 140 identify a behavior class for the actual behavior observed in each of the T 0 frames included in the input frame sequence extracted from the ⁇ T frames. It can be learned by using it as the ground truth for the action to be performed, and by using the action class for the actual action observed in ⁇ T frames as the correct answer for the future action to be predicted by the action prediction unit 150.
  • the behavior prediction unit 150 is configured to predict the duration of the predicted future behavior along with the future behavior prediction
  • the behavior prediction model 100 predicts the actual behavior observed in the ⁇ T frames.
  • the behavior class and duration can be learned using the correct answer for the future behavior and duration to be predicted by the behavior prediction unit 150.
  • Figure 8 is a flowchart of a behavior prediction method according to one embodiment.
  • the method shown in FIG. 8 may be performed, for example, by computing device 12 shown in FIG. 9 .
  • computing device 12 generates an encoder input matrix corresponding to the input frame sequence based on features extracted from the input frame sequence (810).
  • the computing device generates an encoder output matrix based on the encoder input matrix using the encoder 120 composed of one or more encoder layers including the first self-attention layer as a sub-layer (820).
  • the computing device 12 uses the decoder 130, which is composed of one or more decoder layers including a second self-attention layer and a cross-attention layer as sub-layers, to generate a decoder output matrix based on the encoder output matrix and the action query matrix. Create (830).
  • the behavior query matrix may be a learnable parameter determined through learning the prediction model 100.
  • Computing device 12 then identifies one or more behaviors observed in the input frame sequence based on the encoder output matrix (840).
  • Computing device 12 then predicts in parallel one or more future actions that will occur sequentially after the one or more actions based on the decoder output matrix (850).
  • computing device 12 may predict the duration for each of one or more future actions in parallel based on the decoder output matrix.
  • FIG. 9 is a block diagram illustrating and illustrating a computing environment including a computing device according to an embodiment.
  • each component may have different functions and capabilities in addition to those described below, and may include additional components in addition to those described below.
  • the illustrated computing environment 10 includes a computing device 12 .
  • Computing device 12 includes at least one processor 14, a computer-readable storage medium 16, and a communication bus 18.
  • Processor 14 may cause computing device 12 to operate in accordance with the example embodiments noted above.
  • processor 14 may execute one or more programs stored on computer-readable storage medium 16.
  • the one or more programs may include one or more computer-executable instructions, which, when executed by the processor 14, cause computing device 12 to perform operations according to example embodiments. It can be.
  • Computer-readable storage medium 16 is configured to store computer-executable instructions or program code, program data, and/or other suitable form of information.
  • the program 20 stored in the computer-readable storage medium 16 includes a set of instructions executable by the processor 14.
  • computer-readable storage medium 16 includes memory (volatile memory, such as random access memory, non-volatile memory, or an appropriate combination thereof), one or more magnetic disk storage devices, optical disk storage devices, flash It may be memory devices, another form of storage medium that can be accessed by computing device 12 and store desired information, or a suitable combination thereof.
  • Communication bus 18 interconnects various other components of computing device 12, including processor 14 and computer-readable storage medium 16.
  • Computing device 12 may also include one or more input/output interfaces 22 and one or more network communication interfaces 26 that provide an interface for one or more input/output devices 24.
  • the input/output interface 22 and the network communication interface 26 are connected to the communication bus 18.
  • Input/output device 24 may be coupled to other components of computing device 12 through input/output interface 22.
  • Exemplary input/output devices 24 include, but are not limited to, a pointing device (such as a mouse or trackpad), a keyboard, a touch input device (such as a touchpad or touch screen), a voice or sound input device, various types of sensor devices, and/or imaging devices. It may include input devices and/or output devices such as display devices, printers, speakers, and/or network cards.
  • the exemplary input/output device 24 may be included within the computing device 12 as a component constituting the computing device 12, or may be connected to the computing device 12 as a separate device distinct from the computing device 12. It may be possible.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Psychiatry (AREA)
  • Social Psychology (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)

Abstract

A method and an apparatus for predicting actions are disclosed. According to one embodiment, a method for predicting actions comprises the operations of: generating, on the basis of features extracted from an input frame sequence, an encoder input matrix corresponding to the input frame sequence; generating an encoder output matrix based on the encoder input matrix by using an encoder composed of one or more encoder layers including a first self-attention layer as a sublayer; generating a decoder output matrix based on the encoder output matrix and an action query matrix by using a decoder composed of one or more decoder layers including a second self-attention layer and a cross-attention layer as sublayers; identifying, on the basis of the encoder output matrix, one or more actions observed in the input frame sequence; and predicting, in parallel, on the basis of the decoder output matrix, one or more future actions that will occur sequentially after the one or more actions.

Description

행동 예측 방법 및 장치Behavior prediction methods and devices
개시되는 실시예들은 행동 예측 기술과 관련된다.The disclosed embodiments relate to behavior prediction technology.
동영상에서 관측된 행동에 기초하여 미래에 일어날 행동을 예측하는 행동 예측 기술은 예를 들어, 예측되는 사람의 행동에 기반하여 서비스를 제공하는 로봇과 같은 인공 지능 기반 시스템 개발을 위해 중요한 연구 분야 중 하나이다. Behavior prediction technology, which predicts future behavior based on behavior observed in a video, is one of the important research areas for the development of artificial intelligence-based systems, for example, robots that provide services based on predicted human behavior. .
기존에 제안된 행동 예측 기술들은 관측한 동영상의 시각적 정보 대신 동영상에서 관측되는 행동의 레이블(label)을 이용하여 미래 행동을 예측하므로 예측 성능이 입력되는 행동의 레이블에 의존하게 된다는 문제점이 있다. Previously proposed behavior prediction techniques predict future behavior by using the label of the behavior observed in the video instead of the visual information of the observed video, so there is a problem in that prediction performance depends on the label of the input behavior.
또한, 기존에 제안된 행동 예측 기술들은 먼저 예측된 미래 행동을 고려하여 다음 미래 행동을 순차적으로 예측하는 구조를 가지고 있어 먼저 예측된 미래 행동에 오차가 있는 경우 오차가 누적되어 다음 미래 행동 예측에 영향을 미치며 예측 시간이 오래 걸린다는 문제점이 있다.In addition, the previously proposed behavior prediction technologies have a structure of sequentially predicting the next future behavior by considering the predicted future behavior first, so if there is an error in the first predicted future behavior, the error accumulates and affects the prediction of the next future behavior. There is a problem that the prediction time takes a long time.
또한, 기존에 제안된 행동 예측 기술들은 동영상에서 관측된 행동에 대한 정보를 요약된 벡터로 함축하고, 함축된 벡터를 이용하여 미래 행동을 예측하는 방식을 취하고 있으므로, 관측된 행동에 대한 정보를 세밀하게 활용하지 못하는 문제점이 있다.In addition, previously proposed behavior prediction technologies imply information about behavior observed in a video into a summarized vector and use the implied vector to predict future behavior, so information about observed behavior is collected in detail. There is a problem that prevents it from being properly utilized.
개시되는 실시예들은 행동 예측을 위한 장치 및 방법을 제공하기 위한 것이다.The disclosed embodiments are intended to provide an apparatus and method for behavior prediction.
일 실시예에 따른 행동 예측 방법은, 입력 프레임 시퀀스로부터 추출된 특징에 기초하여 상기 입력 프레임 시퀀스에 대응하는 인코더 입력 행렬을 생성하는 동작; 제1 셀프 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 인코더 레이어로 구성된 인코더를 이용하여, 상기 인코더 입력 행렬에 기초한 인코더 출력 행렬을 생성하는 동작; 제2 셀프 어텐션 레이어 및 크로스 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 디코더 레이어로 구성된 디코더를 이용하여, 상기 인코더 출력 행렬 및 행동 쿼리 행렬에 기초한 디코더 출력 행렬을 생성하는 동작; 상기 인코더 출력 행렬에 기초하여, 상기 입력 프레임 시퀀스에서 관측되는 하나 이상의 행동을 식별하는 동작; 및 상기 디코더 출력 행렬에 기초하여 상기 하나 이상의 행동 이후에 순차적으로 발생할 하나 이상의 미래 행동을 병렬적으로 예측하는 동작을 포함한다.A behavior prediction method according to an embodiment includes generating an encoder input matrix corresponding to an input frame sequence based on features extracted from the input frame sequence; An operation of generating an encoder output matrix based on the encoder input matrix using an encoder composed of one or more encoder layers including a first self-attention layer as a sub-layer; An operation of generating a decoder output matrix based on the encoder output matrix and the action query matrix using a decoder composed of one or more decoder layers including a second self-attention layer and a cross-attention layer as sub-layers; identifying one or more behaviors observed in the input frame sequence based on the encoder output matrix; and predicting in parallel one or more future actions that will occur sequentially after the one or more actions based on the decoder output matrix.
상기 행동 쿼리 행렬은, 상기 인코더 및 상기 디코더를 포함하는 예측 모델에 대한 학습을 통해 결정되는 학습 가능한 파라미터일 수 있다.The behavior query matrix may be a learnable parameter determined through learning a prediction model including the encoder and the decoder.
상기 인코더는, 각각 상기 제1 셀프 어텐션 레이어를 서브 레이어로 포함하고 순차적으로 수행되는 복수의 인코더 레이어를 포함하고, 상기 인코더 출력 행렬은, 상기 복수의 인코더 레이어 중 마지막 인코더 레이어의 출력 행렬일 수 있다.The encoder includes a plurality of encoder layers, each including the first self-attention layer as a sub-layer and performed sequentially, and the encoder output matrix may be an output matrix of the last encoder layer among the plurality of encoder layers. .
상기 복수의 인코더 레이어 중 첫 번째 인코더 레이어에 포함된 제1 셀프 어텐션 레이어는, 상기 인코더 입력 행렬과 위치 임베딩 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하고, 상기 복수의 인코더 레이어 중 n(이때, n은 2≤n≤N 인 자연수, N은 상기 복수의 인코더 레이어의 개수)번째 인코더 레이어에 포함된 제1 셀프 어텐션 레이어는, 상기 복수의 인코더 레이어 중 n-1번째 인코더 레이어의 출력 행렬과 상기 위치 임베딩 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행할 수 있다.The first self-attention layer included in the first encoder layer among the plurality of encoder layers performs self-attention based on a matrix generated by combining the encoder input matrix and the position embedding matrix, and n ( At this time, n is a natural number of 2≤n≤N, N is the number of the plurality of encoder layers), and the first self-attention layer included in the th encoder layer is the output matrix of the n-1th encoder layer among the plurality of encoder layers. Self-attention can be performed based on a matrix generated by combining and the position embedding matrix.
상기 제1 셀프 어텐션 레이어는, 각각 상기 제1 셀프 어텐션 레이어로 입력되는 행렬에 기초한 셀프 어텐션을 수행하는 복수의 어텐션 헤드를 포함할 수 있다.The first self-attention layer may include a plurality of attention heads that each perform self-attention based on a matrix input to the first self-attention layer.
상기 디코더는, 각각 상기 제2 셀프 어텐션 레이어 및 상기 크로스 어텐션 레이어를 서브 레이어로 포함하고 순차적으로 수행되는 복수의 디코더 레이어를 포함하고, 상기 디코더 출력 행렬은, 상기 복수의 디코더 레이어 중 마지막 디코더 레이어의 출력 행렬일 수 있다.The decoder includes a plurality of decoder layers each including the second self-attention layer and the cross-attention layer as sub-layers and performed sequentially, and the decoder output matrix is the last decoder layer among the plurality of decoder layers. It may be an output matrix.
상기 복수의 디코더 레이어 중 첫 번째 디코더 레이어에 포함된 제2 셀프 어텐션 레이어는, 기 설정된 초기 디코더 입력 행렬과 상기 행동 쿼리 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하고, 상기 복수의 디코더 레이어 중 m(이때, m은 2≤m≤M 인 자연수, M은 상기 복수의 디코더 레이어의 개수)번째 디코더 레이어에 포함된 제2 셀프 어텐션 레이어는, 상기 복수의 디코더 레이어 중 m-1번째 디코더 레이어의 출력 행렬과 상기 행동 쿼리 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행할 수 있다.The second self-attention layer included in the first decoder layer among the plurality of decoder layers performs self-attention based on a matrix generated by combining a preset initial decoder input matrix and the action query matrix, and the plurality of decoder layers The second self-attention layer included in the m decoder layer (where m is a natural number of 2≤m≤M, M is the number of the plurality of decoder layers) is the m-1th decoder layer among the plurality of decoder layers. Self-attention can be performed based on a matrix generated by combining the output matrix of and the behavior query matrix.
상기 제2 셀프 어텐션 레이어는, 각각 상기 제2 셀프 어텐션 레이어로 입력되는 행렬에 기초한 셀프 어텐션을 수행하는 복수의 어텐션 헤드를 포함할 수 있다.The second self-attention layer may include a plurality of attention heads that each perform self-attention based on a matrix input to the second self-attention layer.
상기 크로스 어텐션 레이어는, 상기 인코더 출력 행렬과 위치 임베딩 행렬을 결합한 제1 입력 행렬, 및 상기 제2 셀프 어텐션 레이어에 의해 생성된 셀프 어텐션 행렬에 대해 레이어 정규화를 수행하여 생성된 행렬과 상기 행동 쿼리 행렬을 결합한 제2 입력 행렬에 기초한 크로스 어텐션을 수행할 수 있다.The cross attention layer includes a first input matrix combining the encoder output matrix and a position embedding matrix, a matrix generated by performing layer normalization on the self-attention matrix generated by the second self-attention layer, and the action query matrix. Cross attention can be performed based on a second input matrix combining .
상기 크로스 어텐션 레이어는, 각각 제1 입력 행렬 및 상기 제2 입력 행렬에 기초한 크로스 어텐션을 수행하는 복수의 어텐션 헤드를 포함할 수 있다.The cross attention layer may include a plurality of attention heads that respectively perform cross attention based on the first input matrix and the second input matrix.
상기 디코더 출력 행렬에 기초하여 상기 하나 이상의 미래 행동 각각에 대한 지속 시간을 병렬적으로 예측하는 동작을 더 포함할 수 있다.It may further include parallelly predicting a duration for each of the one or more future actions based on the decoder output matrix.
일 실시예에 따른 행동 예측 장치는, 하나 이상의 프로세서; 및 상기 하나 이상의 프로세서에 의해 실행되는 하나 이상의 프로그램을 저장하는 메모리를 포함하고, 상기 하나 이상의 프로세서는, 입력 프레임 시퀀스로부터 추출된 특징에 기초하여 상기 입력 프레임 시퀀스에 대응하는 인코더 입력 행렬을 생성하고, 제1 셀프 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 인코더 레이어로 구성된 인코더를 이용하여, 상기 인코더 입력 행렬에 기초한 인코더 출력 행렬을 생성하고, 제2 셀프 어텐션 레이어 및 크로스 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 디코더 레이어로 구성된 디코더를 이용하여, 상기 인코더 출력 행렬 및 행동 쿼리 행렬에 기초한 디코더 출력 행렬을 생성하고, 상기 인코더 출력 행렬에 기초하여, 상기 입력 프레임 시퀀스에서 관측되는 하나 이상의 행동을 식별하고, 상기 디코더 출력 행렬에 기초하여, 상기 하나 이상의 행동 이후에 순차적으로 발생할 하나 이상의 미래 행동을 병렬적으로 예측한다.A behavior prediction device according to an embodiment includes one or more processors; and a memory storing one or more programs executed by the one or more processors, wherein the one or more processors generate an encoder input matrix corresponding to the input frame sequence based on features extracted from the input frame sequence, and Using an encoder composed of one or more encoder layers including a first self-attention layer as a sub-layer, generating an encoder output matrix based on the encoder input matrix, and including a second self-attention layer and a cross-attention layer as sub-layers Using a decoder consisting of one or more decoder layers, generate a decoder output matrix based on the encoder output matrix and a behavior query matrix, and based on the encoder output matrix, identify one or more behaviors observed in the input frame sequence, Based on the decoder output matrix, one or more future actions that will occur sequentially after the one or more actions are predicted in parallel.
상기 행동 쿼리 행렬은, 상기 인코더 및 상기 디코더를 포함하는 예측 모델에 대한 학습을 통해 결정되는 학습 가능한 파라미터일 수 있다.The behavior query matrix may be a learnable parameter determined through learning a prediction model including the encoder and the decoder.
상기 인코더는, 각각 상기 제1 셀프 어텐션 레이어를 서브 레이어로 포함하고 순차적으로 수행되는 복수의 인코더 레이어를 포함하고, 상기 인코더 출력 행렬은, 상기 복수의 인코더 레이어 중 마지막 인코더 레이어의 출력 행렬일 수 있다.The encoder includes a plurality of encoder layers, each including the first self-attention layer as a sub-layer and performed sequentially, and the encoder output matrix may be an output matrix of the last encoder layer among the plurality of encoder layers. .
상기 복수의 인코더 레이어 중 첫 번째 인코더 레이어에 포함된 제1 셀프 어텐션 레이어는, 상기 인코더 입력 행렬과 위치 임베딩 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하고, 상기 복수의 인코더 레이어 중 n(이때, n은 2≤n≤N 인 자연수, N은 상기 복수의 인코더 레이어의 개수)번째 인코더 레이어에 포함된 제1 셀프 어텐션 레이어는, 상기 복수의 인코더 레이어 중 n-1번째 인코더 레이어의 출력 행렬과 상기 위치 임베딩 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행할 수 있다.The first self-attention layer included in the first encoder layer among the plurality of encoder layers performs self-attention based on a matrix generated by combining the encoder input matrix and the position embedding matrix, and n ( At this time, n is a natural number of 2≤n≤N, N is the number of the plurality of encoder layers), and the first self-attention layer included in the th encoder layer is the output matrix of the n-1th encoder layer among the plurality of encoder layers. Self-attention can be performed based on a matrix generated by combining and the position embedding matrix.
상기 제1 셀프 어텐션 레이어는, 각각 상기 제1 셀프 어텐션 레이어로 입력되는 행렬에 기초한 셀프 어텐션을 수행하는 복수의 어텐션 헤드를 포함할 수 있다.The first self-attention layer may include a plurality of attention heads that each perform self-attention based on a matrix input to the first self-attention layer.
상기 디코더는, 각각 상기 제2 셀프 어텐션 레이어 및 상기 크로스 어텐션 레이어를 서브 레이어로 포함하고 순차적으로 수행되는 복수의 디코더 레이어를 포함하고, 상기 디코더 출력 행렬은, 상기 복수의 디코더 레이어 중 마지막 디코더 레이어의 출력 행렬일 수 있다.The decoder includes a plurality of decoder layers each including the second self-attention layer and the cross-attention layer as sub-layers and performed sequentially, and the decoder output matrix is the last decoder layer among the plurality of decoder layers. It may be an output matrix.
상기 복수의 디코더 레이어 중 첫 번째 디코더 레이어에 포함된 제2 셀프 어텐션 레이어는, 기 설정된 초기 디코더 입력 행렬과 상기 행동 쿼리 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하고, 상기 복수의 디코더 레이어 중 m(이때, m은 2≤m≤M 인 자연수, M은 상기 복수의 디코더 레이어의 개수)번째 디코더 레이어에 포함된 제2 셀프 어텐션 레이어는, 상기 복수의 디코더 레이어 중 m-1번째 디코더 레이어의 출력 행렬과 상기 행동 쿼리 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행할 수 있다.The second self-attention layer included in the first decoder layer among the plurality of decoder layers performs self-attention based on a matrix generated by combining a preset initial decoder input matrix and the action query matrix, and the plurality of decoder layers The second self-attention layer included in the m decoder layer (where m is a natural number of 2≤m≤M, M is the number of the plurality of decoder layers) is the m-1th decoder layer among the plurality of decoder layers. Self-attention can be performed based on a matrix generated by combining the output matrix of and the behavior query matrix.
상기 제2 셀프 어텐션 레이어는, 각각 상기 제2 셀프 어텐션 레이어로 입력되는 행렬에 기초한 셀프 어텐션을 수행하는 복수의 어텐션 헤드를 포함할 수 있다.The second self-attention layer may include a plurality of attention heads that each perform self-attention based on a matrix input to the second self-attention layer.
상기 크로스 어텐션 레이어는, 상기 인코더 출력 행렬과 위치 임베딩 행렬을 결합한 제1 입력 행렬, 및 상기 제2 셀프 어텐션 레이어에 의해 생성된 셀프 어텐션 행렬에 대해 레이어 정규화를 수행하여 생성된 행렬과 상기 행동 쿼리 행렬을 결합한 제2 입력 행렬에 기초한 크로스 어텐션을 수행할 수 있다.The cross attention layer includes a first input matrix combining the encoder output matrix and a position embedding matrix, a matrix generated by performing layer normalization on the self-attention matrix generated by the second self-attention layer, and the action query matrix. Cross attention can be performed based on a second input matrix combining .
상기 크로스 어텐션 레이어는, 각각 제1 입력 행렬 및 상기 제2 입력 행렬에 기초한 크로스 어텐션을 수행하는 복수의 어텐션 헤드를 포함할 수 있다.The cross attention layer may include a plurality of attention heads that respectively perform cross attention based on the first input matrix and the second input matrix.
상기 하나 이상의 프로세서는, 상기 디코더 출력 행렬에 기초하여 상기 하나 이상의 미래 행동 각각에 대한 지속 시간을 병렬적으로 예측할 수 있다.The one or more processors may predict a duration for each of the one or more future actions in parallel based on the decoder output matrix.
개시되는 실시예들에 따르면, 동영상으로부터 추출된 프레임 시퀀스의 특징을 이용하여 순차적으로 발생할 미래 행동을 병렬적으로 예측하므로, 미래 행동 예측에 프레임 시퀀스의 시각적 정보를 활용함과 동시에 미래 행동을 순차적으로 예측하는 경우 발생하는 오차 누적을 방지할 수 있다. 이에 따라, 미래 행동 예측의 정확도를 향상시키고 예측에 소요되는 시간을 줄일 수 있다. According to the disclosed embodiments, future actions that will occur sequentially are predicted in parallel using the features of the frame sequence extracted from the video, so that visual information of the frame sequence is utilized to predict future actions and future actions are sequentially predicted. Accumulation of errors that occurs when making predictions can be prevented. Accordingly, the accuracy of predicting future behavior can be improved and the time required for prediction can be reduced.
도 1은 일 실시예에 따른 인공 신경망(Artificial Neural Network) 기반 행동 예측 모델의 구성을 나타낸 도면이다.Figure 1 is a diagram showing the configuration of an artificial neural network-based behavior prediction model according to an embodiment.
도 2는 일 실시예에 따른 인코더 및 디코더의 구성을 나타낸 도면이다.Figure 2 is a diagram showing the configuration of an encoder and decoder according to an embodiment.
도 3은 일 실시예에 따른 인코더 레이어의 구성을 나타낸 도면이다.Figure 3 is a diagram showing the configuration of an encoder layer according to one embodiment.
도 4는 일 실시예에 따른 제1 셀프 어텐션 레이어의 일 예를 나타낸 도면이다.Figure 4 is a diagram illustrating an example of a first self-attention layer according to an embodiment.
도 5는 일 실시예에 따른 디코더 레이어의 구성을 나타낸 도면이다.Figure 5 is a diagram showing the configuration of a decoder layer according to one embodiment.
도 6은 일 실시예에 따른 제2 셀프 어텐션 레이어의 일 예를 나타낸 도면이다.Figure 6 is a diagram illustrating an example of a second self-attention layer according to an embodiment.
도 7은 일 실시예에 따른 크로스 어텐션 레이어의 일 예를 나타낸 도면이다.Figure 7 is a diagram illustrating an example of a cross attention layer according to an embodiment.
도 8은 일 실시예에 따른 행동 예측 방법의 순서도이다.Figure 8 is a flowchart of a behavior prediction method according to one embodiment.
도 9는 일 실시예에 따른 컴퓨팅 장치를 포함하는 컴퓨팅 환경을 예시하여 설명하기 위한 블록도이다.FIG. 9 is a block diagram illustrating and illustrating a computing environment including a computing device according to an embodiment.
이하, 도면을 참조하여 구체적인 실시형태를 설명하기로 한다. 이하의 상세한 설명은 본 명세서에서 기술된 방법, 장치 및/또는 시스템에 대한 포괄적인 이해를 돕기 위해 제공된다. 그러나 이는 예시에 불과하며 본 발명은 이에 제한되지 않는다.Hereinafter, specific embodiments will be described with reference to the drawings. The detailed description below is provided to provide a comprehensive understanding of the methods, devices and/or systems described herein. However, this is only an example and the present invention is not limited thereto.
실시예들을 설명함에 있어서, 관련된 공지기술에 대한 구체적인 설명이 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략하기로 한다. 그리고, 후술되는 용어들은 기능을 고려하여 정의된 용어들로서 이는 사용자, 운용자의 의도 또는 관례 등에 따라 달라질 수 있다. 그러므로 그 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다. 상세한 설명에서 사용되는 용어는 단지 실시예들을 기술하기 위한 것이며, 결코 제한적이어서는 안 된다. 명확하게 달리 사용되지 않는 한, 단수 형태의 표현은 복수 형태의 의미를 포함한다. 본 설명에서, “포함” 또는 “구비”와 같은 표현은 어떤 특성들, 숫자들, 단계들, 동작들, 요소들, 이들의 일부 또는 조합을 가리키기 위한 것이며, 기술된 것 이외에 하나 또는 그 이상의 다른 특성, 숫자, 단계, 동작, 요소, 이들의 일부 또는 조합의 존재 또는 가능성을 배제하도록 해석되어서는 안 된다.In describing the embodiments, if it is determined that a detailed description of related known technology may unnecessarily obscure the point, the detailed description will be omitted. In addition, the terms described below are terms defined in consideration of function, and may vary depending on the intention or custom of the user or operator. Therefore, the definition should be made based on the contents throughout this specification. The terminology used in the detailed description is only for describing embodiments and should in no way be limiting. Unless explicitly stated otherwise, singular forms include plural meanings. In this description, expressions such as “including” or “including” are intended to indicate certain features, numbers, steps, operations, elements, parts or combinations thereof, and one or more than those described. It should not be construed to exclude the existence or possibility of any other characteristic, number, step, operation, element, or part or combination thereof.
이하에서, 행렬은 2 이상의 값으로 구성된 직사각형 배열을 의미하며, 특별히 한정하지 않는 이상 복수의 열과 복수의 행으로 구성된 행렬뿐 아니라 하나의 열과 복수의 행으로 구성된 행렬(즉, 열 벡터) 및 하나의 행과 복수의 열로 구성된 행렬(즉, 행 벡터)을 포괄하는 의미로 사용된다. Hereinafter, a matrix refers to a rectangular array composed of two or more values. Unless otherwise specified, a matrix refers to a matrix composed of multiple columns and multiple rows, as well as a matrix composed of one column and multiple rows (i.e., a column vector), and one It is used to encompass a matrix (i.e., row vector) consisting of rows and multiple columns.
이하에서, 임의의 두 행렬
Figure PCTKR2022008848-appb-img-000001
Figure PCTKR2022008848-appb-img-000002
에 대한 어텐션(attention)은 아래 수학식 1과 같이 정의된다.
Below, any two matrices
Figure PCTKR2022008848-appb-img-000001
and
Figure PCTKR2022008848-appb-img-000002
The attention to is defined as Equation 1 below.
[수학식 1][Equation 1]
Figure PCTKR2022008848-appb-img-000003
Figure PCTKR2022008848-appb-img-000003
이때, σ는 소프트맥스(softmax) 함수, score()는 어텐션 스코어 산출을 위해 이용되는 어텐션 스코어 함수를 나타낸다. 어텐션 스코어 함수는 예를 들어, 스케일드 닷-프로덕트(scaled dot-product) 함수일 수 있으나, 실시예에 따라 스케일드 닷-프로덕트 함수 외에도 다양한 종류의 어텐션 스코어 함수가 이용될 수 있다.At this time, σ represents the softmax function and score() represents the attention score function used to calculate the attention score. The attention score function may be, for example, a scaled dot-product function, but depending on the embodiment, various types of attention score functions in addition to the scaled dot-product function may be used.
한편, Q는 행렬 A로부터 생성된 쿼리(query) 행렬을 나타내고, K 및 V는 각각 행렬 B로부터 생성된 키(key) 행렬 및 값(value) 행렬을 나타낸다.Meanwhile, Q represents a query matrix generated from matrix A, and K and V represent a key matrix and a value matrix generated from matrix B, respectively.
한편, 이하에서, 셀프 어텐션(self-attention)은 동일한 두 개의 행렬에 대한 어텐션으로 정의되며(즉, A=B인 경우), 셀프 어텐션과의 구분을 위해 상이한 두 개의 행렬에 대한 어텐션(즉, A≠B인 경우)을 크로스 어텐션(cross-attention)으로 호칭하기로 한다.Meanwhile, in the following, self-attention is defined as attention to the same two matrices (i.e., when A=B), and to distinguish it from self-attention, attention to two different matrices (i.e., (if A≠B) will be referred to as cross-attention.
도 1은 일 실시예에 따른 인공 신경망(Artificial Neural Network) 기반 행동 예측 모델의 구성을 나타낸 도면이다.Figure 1 is a diagram showing the configuration of an artificial neural network-based behavior prediction model according to an embodiment.
도 1을 참조하면, 일 실시예에 따른 행동 예측 모델(100)은 입력부(110), 인코더(120), 디코더(130), 행동 분류부(140) 및 행동 예측부(150)를 포함한다.Referring to FIG. 1, the behavior prediction model 100 according to one embodiment includes an input unit 110, an encoder 120, a decoder 130, a behavior classification unit 140, and a behavior prediction unit 150.
일 실시예에 따르면, 행동 예측 모델(100)은 예를 들어, 사람이나 동물과 같이 움직이는 객체를 촬영한 동영상에서 객체가 취한 행동을 식별하고, 식별된 행동 이후에 해당 객체가 취할 미래 행동을 예측하기 위한 인공 신경망 기반의 모델일 수 있다. According to one embodiment, the behavior prediction model 100 identifies the action taken by the object in a video of a moving object, such as a person or an animal, and predicts the future action to be taken by the object after the identified action. It may be an artificial neural network-based model to do this.
입력부(110)는 입력 프레임 시퀀스로부터 추출된 특징에 기초하여 입력 프레임 시퀀스에 대응하는 인코더 입력 행렬을 생성한다.The input unit 110 generates an encoder input matrix corresponding to the input frame sequence based on features extracted from the input frame sequence.
일 실시예에 따르면, 입력 프레임 시퀀스는 동영상의 전체 재생 구간 중 적어도 일부 구간에서 순차적으로 추출된 복수의 프레임을 포함할 수 있다. 예를 들어, 동영상이 T개의 프레임으로 구성된 경우, 입력 프레임 시퀀스는 동영상의 첫 번째 프레임에서 αT 번째 프레임 중 기 설정된 샘플링 간격으로 순차적으로 샘플링된 T0개의 프레임을 포함할 수 있다. 즉, 입력 프레임 시퀀스에 포함된 프레임의 개수 T0는 아래의 수학식 2를 만족할 수 있다.According to one embodiment, the input frame sequence may include a plurality of frames sequentially extracted from at least some sections of the entire playback section of the video. For example, if a video consists of T frames, the input frame sequence may include T 0 frames sequentially sampled at a preset sampling interval from the first frame to the αT frame of the video. That is, the number T 0 of frames included in the input frame sequence can satisfy Equation 2 below.
[수학식 2][Equation 2]
Figure PCTKR2022008848-appb-img-000004
Figure PCTKR2022008848-appb-img-000004
한편, 수학식 2에서 τ는 기 설정된 샘플링 간격, α는 동영상에 대한 관측률(observation rate)을 나타내며, α는 0에서 1 사이의 값으로 사전 설정될 수 있다. Meanwhile, in Equation 2, τ represents a preset sampling interval, α represents the observation rate for the video, and α can be preset to a value between 0 and 1.
한편, 일 실시예에 따르면, 인코더 입력 행렬은 입력 프레임 시퀀스에 포함된 각 프레임 각각에서 추출된 특징에 기초하여 생성될 수 있다. 구체적으로, 입력부(110)는 입력 프레임 시퀀스에 포함된 각 프레임에 대한 특징 벡터를 추출할 수 있다. 이때, 각 프레임에 대한 특징 벡터는 예를 들어, 컨볼루션 신경망(Convolutional Neural Network, CNN)에 기초한 특징 추출 모델을 이용하여 각 프레임으로부터 추출된 사전 설정된 차원의 벡터일 수 있다. Meanwhile, according to one embodiment, the encoder input matrix may be generated based on features extracted from each frame included in the input frame sequence. Specifically, the input unit 110 may extract feature vectors for each frame included in the input frame sequence. At this time, the feature vector for each frame may be a vector of a preset dimension extracted from each frame using, for example, a feature extraction model based on a convolutional neural network (CNN).
구체적인 예로, 각 프레임에 대한 특징 벡터는 I3D(Inflated 3D ConvNet) 모델과 같이 입력 프레임 시퀀스에 포함된 각 프레임의 공간적(spatial) 특징과 시간적(temporal) 특징을 추출할 수 있는 3차원 컨볼루션 신경망을 이용하여 추출될 수 있다. 그러나, 입력 프레임 시퀀스로부터 특징 벡터를 추출하는 방식은 반드시 상술한 예에 한정되는 것은 아니며, 실시예에 따라 이미지의 시각적(visual) 특징을 추출할 수 있는 다양한 방식이 이용될 수 있다.As a specific example, the feature vector for each frame is a 3D convolutional neural network that can extract spatial and temporal features of each frame included in the input frame sequence, such as the I3D (Inflated 3D ConvNet) model. It can be extracted using However, the method of extracting a feature vector from an input frame sequence is not necessarily limited to the above-described example, and various methods for extracting visual features of an image may be used depending on the embodiment.
한편, 일 실시예에 따르면, 입력부(110)는 입력 프레임 시퀀스에 포함된 각 프레임에 대한 특징 벡터로 구성된 특징 행렬에 기초하여 인코더 입력 행렬을 생성할 수 있다. 구체적으로, 입력부(110)는 선형 레이어를 이용하여 특징 행렬로부터 기 설정된 크기의 행렬을 생성한 후, 활성화 함수를 이용하여 인코더 입력 행렬을 생성할 수 있다. 구체적인 예로, 활성화 함수가 ReLU(Rectified Linear Unit)인 경우, 인코더 입력 행렬은 아래의 수학식 3에 따라 생성될 수 있다.Meanwhile, according to one embodiment, the input unit 110 may generate an encoder input matrix based on a feature matrix composed of feature vectors for each frame included in the input frame sequence. Specifically, the input unit 110 may generate a matrix of a preset size from a feature matrix using a linear layer and then generate an encoder input matrix using an activation function. As a specific example, when the activation function is ReLU (Rectified Linear Unit), the encoder input matrix can be generated according to Equation 3 below.
[수학식 3][Equation 3]
Figure PCTKR2022008848-appb-img-000005
Figure PCTKR2022008848-appb-img-000005
이때,
Figure PCTKR2022008848-appb-img-000006
는 특징 행렬,
Figure PCTKR2022008848-appb-img-000007
는 선형 레이어에 의해 곱해지는 가중치 행렬,
Figure PCTKR2022008848-appb-img-000008
는 인코더 입력 행렬을 나타낸다. 또한, C 및 D는 각각 사전 설정된 하이퍼파라미터(hyperparameter)이다.
At this time,
Figure PCTKR2022008848-appb-img-000006
is the feature matrix,
Figure PCTKR2022008848-appb-img-000007
is the weight matrix multiplied by the linear layer,
Figure PCTKR2022008848-appb-img-000008
represents the encoder input matrix. Additionally, C and D are each preset hyperparameters.
인코더(120)는 제1 셀프 어텐션 레이어(self-attention layer)를 서브 레이어로 포함하는 하나 이상의 인코더 레이어를 포함하고, 하나 이상의 인코더 레이어를 이용하여 인코더 입력 행렬에 기초한 인코더 출력 행렬을 생성한다.The encoder 120 includes one or more encoder layers including a first self-attention layer as a sub-layer, and generates an encoder output matrix based on the encoder input matrix using the one or more encoder layers.
일 실시예에 따르면, 제1 셀프 어텐션 레이어는 인코더 레이어의 입력 행렬에 기초한 셀프 어텐션을 수행하는 인공 신경망일 수 있다.According to one embodiment, the first self-attention layer may be an artificial neural network that performs self-attention based on the input matrix of the encoder layer.
디코더(130)는 제2 셀프 어텐션 레이어 및 크로스 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 디코더 레이어를 포함하고, 하나 이상의 디코더 레이어를 이용하여 행동 쿼리 행렬 및 인코더 출력 행렬에 기초한 디코더 출력 행렬을 생성한다.The decoder 130 includes one or more decoder layers including a second self-attention layer and a cross-attention layer as sub-layers, and generates a decoder output matrix based on the action query matrix and the encoder output matrix using the one or more decoder layers. .
일 실시예에 따르면, 제2 셀프 어텐션 레이어는 행동 쿼리 행렬에 기초한 셀프 어텐션을 수행하는 인공 신경망일 수 있다. 또한, 크로스 어텐션 레이어는 인코더 출력 행렬과 행동 쿼리 행렬에 기초한 크로스 어텐션을 수행하는 인공 신경망일 수 있다.According to one embodiment, the second self-attention layer may be an artificial neural network that performs self-attention based on a behavioral query matrix. Additionally, the cross attention layer may be an artificial neural network that performs cross attention based on the encoder output matrix and the action query matrix.
구체적으로, 도 2는 일 실시예에 따른 인코더 및 디코더의 구성을 나타낸 도면이다.Specifically, Figure 2 is a diagram showing the configuration of an encoder and decoder according to an embodiment.
도 2를 참조하면, 인코더(120)는 각각 제1 셀프 어텐션 레이어를 포함하고 순차적으로 수행되는 N(이때, N은 1≤N인 자연수)개의 인코더 레이어(120-1, 120-2, 120-N)로 구성될 수 있다. Referring to FIG. 2, the encoder 120 includes N encoder layers 120-1, 120-2, and 120-, each of which includes a first self-attention layer and is sequentially performed. N) may be configured.
일 실시예에 따르면, 인코더(120)에 포함된 인코더 레이어가 복수인 경우, 각 인코더 레이어(120-1, 120-2, 120-N)는 동일한 구조를 가질 수 있으며, 첫 번째 인코더 레이어(120-1)는 입력부(110)에 의해 생성된 인코더 입력 행렬 X0를 입력으로 이용할 수 있다. 또한, 첫 번째 인코더 레이어(120-1)를 제외한 나머지 인코더 레이어(120-2, 120-N)는 직전 인코더 레이어에서 출력되는 행렬을 입력으로 이용할 수 있으며, 인코더(120)에서 최종적으로 출력되는 인코더 출력 행렬
Figure PCTKR2022008848-appb-img-000009
은 마지막 인코더 레이어(120-N)에서 출력되는 행렬일 수 있다.
According to one embodiment, when there are a plurality of encoder layers included in the encoder 120, each encoder layer (120-1, 120-2, 120-N) may have the same structure, and the first encoder layer (120) -1) can use the encoder input matrix X 0 generated by the input unit 110 as input. In addition, except for the first encoder layer (120-1), the remaining encoder layers (120-2, 120-N) can use the matrix output from the previous encoder layer as input, and the encoder finally output from the encoder 120 output matrix
Figure PCTKR2022008848-appb-img-000009
may be a matrix output from the last encoder layer (120-N).
한편, 디코더(130)는 각각 제2 셀프 어텐션 레이어 및 크로스 어텐션 레이어를 포함하고 순차적으로 수행되는 M(이때, M은 1≤M인 자연수)개의 디코더 레이어(130-1, 130-2, 130-M)로 구성될 수 있다. Meanwhile, the decoder 130 includes M decoder layers 130-1, 130-2, 130-1, which each include a second self-attention layer and a cross-attention layer and are sequentially performed (where M is a natural number of 1≤M). M) may be configured.
일 실시예에 따르면, 디코더(130)에 포함된 각 인코더 레이어(130-1, 130-2, 130-M)는 동일한 구조를 가질 수 있으며, 첫 번째 디코더 레이어(130-1)는 초기 디코더 입력 행렬
Figure PCTKR2022008848-appb-img-000010
를 입력으로 이용할 수 있다. 또한, 첫 번째 디코더 레이어(130-1)를 제외한 나머지 디코더 레이어(130-2, 130-M)는 직전 디코더 레이어에서 출력되는 행렬을 입력으로 이용할 수 있으며, 디코더(120)에서 최종적으로 출력되는 디코더 출력 행렬
Figure PCTKR2022008848-appb-img-000011
은 마지막 디코더 레이어(130-M)에서 출력되는 행렬일 수 있다.
According to one embodiment, each encoder layer (130-1, 130-2, 130-M) included in the decoder 130 may have the same structure, and the first decoder layer (130-1) is the initial decoder input. procession
Figure PCTKR2022008848-appb-img-000010
can be used as input. In addition, except for the first decoder layer (130-1), the remaining decoder layers (130-2, 130-M) can use the matrix output from the previous decoder layer as input, and the decoder finally output from the decoder 120 output matrix
Figure PCTKR2022008848-appb-img-000011
may be a matrix output from the last decoder layer (130-M).
한편, 인코더 레이어 및 디코더 레이어의 개수는 실시예에 따라 변경될 수 있다.Meanwhile, the number of encoder layers and decoder layers may change depending on the embodiment.
도 3은 일 실시예에 따른 인코더 레이어의 구성을 나타낸 도면이다.Figure 3 is a diagram showing the configuration of an encoder layer according to one embodiment.
구체적으로, 도 2에 도시된 각 인코더 레이어(120-1, 120-2, 120-N)는 예를 들어, 도 3에 도시된 인코더 레이어(310)와 동일한 구성을 가질 수 있다.Specifically, each encoder layer 120-1, 120-2, and 120-N shown in FIG. 2 may have the same configuration as the encoder layer 310 shown in FIG. 3, for example.
도 3을 참조하면, 인코더 레이어(310)는 제1 셀프 어텐션 레이어(311), 레이어 정규화(312, 314) 및 피드-포워드 네트워크(Feed-Forward Network, FFN)(313)를 포함할 수 있다.Referring to FIG. 3, the encoder layer 310 may include a first self-attention layer 311, layer normalization (312, 314), and a feed-forward network (FFN) (313).
제1 셀프 어텐션 레이어(311)는 인코더 레이어(310)로 입력되는 입력 행렬
Figure PCTKR2022008848-appb-img-000012
(이때, n은 1≤n≤N)과 위치 임베딩 행렬
Figure PCTKR2022008848-appb-img-000013
를 결합하여 생성된 행렬
Figure PCTKR2022008848-appb-img-000014
에 대해 셀프 어텐션을 수행할 수 있다. 이때, 제1 셀프 어텐션 레이어(311)로 입력되는 행렬 X'n-1는 아래의 수학식 4와 같이 입력 행렬 Xn-1과 위치 임베딩 행렬 P를 더함으로써 생성될 수 있다.
The first self-attention layer 311 is an input matrix input to the encoder layer 310.
Figure PCTKR2022008848-appb-img-000012
(In this case, n is 1≤n≤N) and the position embedding matrix
Figure PCTKR2022008848-appb-img-000013
A matrix created by combining
Figure PCTKR2022008848-appb-img-000014
Self-attention can be performed for . At this time, the matrix X' n-1 input to the first self-attention layer 311 can be generated by adding the input matrix X n-1 and the position embedding matrix P as shown in Equation 4 below.
[수학식 4][Equation 4]
Figure PCTKR2022008848-appb-img-000015
Figure PCTKR2022008848-appb-img-000015
한편, 인코더 레이어(310)가 첫 번째 인코더 레이어인 경우(즉, n=1), 인코더 레이어(310)로 입력되는 입력 행렬 Xn-1은 입력부(110)에 의해 생성된 인코더 입력 행렬 X0일 수 있다. 또한, 인코더 레이어(310)가 두 번째 이후의 인코더 레이어인 경우(즉, 2≤n≤N), 인코더 레이어(310)로 입력되는 입력 행렬 Xn-1은 n-1 번째 인코더 레이어의 출력 행렬일 수 있다.Meanwhile, when the encoder layer 310 is the first encoder layer (i.e., n=1), the input matrix X n-1 input to the encoder layer 310 is the encoder input matrix X 0 generated by the input unit 110. It can be. Additionally, if the encoder layer 310 is the second or later encoder layer (i.e., 2≤n≤N), the input matrix X n-1 input to the encoder layer 310 is the output matrix of the n-1th encoder layer. It can be.
한편, 위치 임베딩 행렬 P는 입력 프레임 시퀀스에 포함된 T0개의 프레임에 대응하는 T0개의 위치 임베딩 벡터로 구성될 수 있다. 이때, T0개의 위치 임베딩 벡터는 각각 입력 프레임 시퀀스에 포함된 T0개의 프레임 중 대응하는 프레임의 입력 프레임 시퀀스 내 위치(순서)를 나타내는 D차원 벡터일 수 있다. 예를 들어, 위치 임베딩 행렬 P는 아래의 수학식 5 및 6에 따른 위치 인코딩(positional encoding)을 통해 생성될 수 있다.Meanwhile, the position embedding matrix P may be composed of T 0 position embedding vectors corresponding to T 0 frames included in the input frame sequence. At this time, each of the T 0 position embedding vectors may be a D-dimensional vector indicating the position (order) within the input frame sequence of the corresponding frame among the T 0 frames included in the input frame sequence. For example, the positional embedding matrix P can be generated through positional encoding according to Equations 5 and 6 below.
[수학식 5][Equation 5]
Figure PCTKR2022008848-appb-img-000016
Figure PCTKR2022008848-appb-img-000016
[수학식 6][Equation 6]
Figure PCTKR2022008848-appb-img-000017
Figure PCTKR2022008848-appb-img-000017
이때, pos는 입력 프레임 시퀀스 내 위치를 나타내며, i는 위치 임베딩 벡터 내 차원의 인덱스를 나타낸다.At this time, pos represents the position within the input frame sequence, and i represents the index of the dimension within the position embedding vector.
한편, 첫 번째 레이어 정규화(312)는 행렬 X'n-1을 이용하여 제1 셀프 어텐션 레이어(311)에 의해 생성된 셀프 어텐션 행렬
Figure PCTKR2022008848-appb-img-000018
와 인코더 레이어(310)의 입력 행렬 Xn-1을 더하는 잔차 연결(residual connection)을 수행한 후 레이어 정규화(layer normalization)를 수행할 수 있다. 구체적으로, 첫 번째 레이어 정규화(312)를 통해 생성되는 행렬
Figure PCTKR2022008848-appb-img-000019
은 아래의 수학식 7과 같이 표현될 수 있다.
Meanwhile, the first layer normalization 312 is a self - attention matrix generated by the first self-attention layer 311 using the matrix
Figure PCTKR2022008848-appb-img-000018
After performing residual connection by adding the input matrix X n-1 of the encoder layer 310, layer normalization can be performed. Specifically, the matrix generated through first layer normalization (312)
Figure PCTKR2022008848-appb-img-000019
Can be expressed as Equation 7 below.
[수학식 7][Equation 7]
Figure PCTKR2022008848-appb-img-000020
Figure PCTKR2022008848-appb-img-000020
한편, 첫 번째 레이어 정규화(312)를 통해 생성되는 행렬 X''n-1은 피드-포워드 네트워크(313)를 거치게 되며, 두 번째 레이어 정규화(313)는 피드-포워드 네트워크(313)의 출력 행렬과 피드-포워드 네트워크(313)의 입력 행렬 X''n-1을 더하는 잔차 연결을 수행한 후 레이어 정규화를 수행하여 인코더 레이어(310)의 출력 행렬
Figure PCTKR2022008848-appb-img-000021
을 생성할 수 있다. 구체적으로, 인코더 레이어(310)의 출력 행렬 Xn은 아래의 수학식 8과 같이 표현될 수 있다.
Meanwhile, the matrix and the output matrix of the encoder layer 310 by performing residual concatenation by adding the input matrix
Figure PCTKR2022008848-appb-img-000021
can be created. Specifically, the output matrix X n of the encoder layer 310 can be expressed as Equation 8 below.
[수학식 8][Equation 8]
Figure PCTKR2022008848-appb-img-000022
Figure PCTKR2022008848-appb-img-000022
한편, 일 실시예에 따르면, 제1 셀프 어텐션 레이어(311)는 제1 셀프 어텐션 레이어(311)로 입력되는 행렬 X'n-1에 대한 셀프 어텐션을 병렬적으로 수행하는 복수의 어텐션 헤드(attention head)를 포함할 수 있다. 이 경우, 제1 셀프 어텐션 레이어(311)에 의해 생성되는 셀프 어텐션 행렬 Z는 제1 셀프 어텐션 레이어(311)의 입력 행렬 X'n-1을 이용한 복수의 어텐션 헤드 각각의 출력 행렬에 기초하여 생성될 수 있다.Meanwhile, according to one embodiment, the first self-attention layer 311 includes a plurality of attention heads (attention heads) that parallelly perform self - attention on the matrix head). In this case, the self-attention matrix Z generated by the first self-attention layer 311 is generated based on the output matrix of each of the plurality of attention heads using the input matrix X' n-1 of the first self-attention layer 311. It can be.
구체적으로, 제1 셀프 어텐션 레이어(311)에 포함된 각 어텐션 헤드는 제1 셀프 어텐션 레이어(311)로 입력되는 행렬 X'n-1로부터 쿼리 행렬, 키 행렬 및 값 행렬을 생성하고, 생성된 쿼리 행렬, 키 행렬 및 값 행렬을 이용한 셀프 어텐션을 수행하여 출력 행렬을 생성할 수 있다. Specifically, each attention head included in the first self-attention layer 311 generates a query matrix, key matrix, and value matrix from the matrix X' n-1 input to the first self-attention layer 311, and the generated You can generate an output matrix by performing self-attention using the query matrix, key matrix, and value matrix.
예를 들어, 제1 셀프 어텐션 레이어(311)에 포함된 어텐션 헤드의 개수가 h1인 경우, k(이때, 1≤k≤h1)번째 어텐션 헤드의 출력 행렬 Zk는 아래의 수학식 9에 따라 생성될 수 있다.For example, if the number of attention heads included in the first self-attention layer 311 is h 1 , the output matrix Z k of the k (in this case, 1 ≤ k ≤ h 1 )th attention head is Equation 9 below: It can be created according to .
[수학식 9][Equation 9]
Figure PCTKR2022008848-appb-img-000023
Figure PCTKR2022008848-appb-img-000023
이때, 쿼리 행렬 Qk, 키 행렬 Kk 및 값 행렬 Vk는 각각 아래의 수학식 10 내지 12에 따라 생성될 수 있다.At this time, the query matrix Q k , key matrix K k , and value matrix V k can each be generated according to Equations 10 to 12 below.
[수학식 10][Equation 10]
Figure PCTKR2022008848-appb-img-000024
Figure PCTKR2022008848-appb-img-000024
[수학식 11][Equation 11]
Figure PCTKR2022008848-appb-img-000025
Figure PCTKR2022008848-appb-img-000025
[수학식 12][Equation 12]
Figure PCTKR2022008848-appb-img-000026
Figure PCTKR2022008848-appb-img-000026
수학식 10 내지 12에서,
Figure PCTKR2022008848-appb-img-000027
,
Figure PCTKR2022008848-appb-img-000028
Figure PCTKR2022008848-appb-img-000029
는 각각 행동 예측 모델(100)에 대한 학습을 통해 결정되는 가중치 행렬을 나타내며, 각 어텐션 헤드마다 상이할 수 있다.
In equations 10 to 12,
Figure PCTKR2022008848-appb-img-000027
,
Figure PCTKR2022008848-appb-img-000028
and
Figure PCTKR2022008848-appb-img-000029
represents a weight matrix determined through learning the behavior prediction model 100, and may be different for each attention head.
한편, 수학식 9에서 score(Qk,Kk)는 예를 들어, 아래 수학식 13과 같은 스케일드 닷-프로덕트 함수일 수 있으나, 실시예에 따라 스케일드 닷-프로덕트 함수 외에도 다양한 종류의 스코어 함수가 이용될 수 있다.Meanwhile, in Equation 9, score(Q k , K k ) may be a scaled dot-product function, for example, as in Equation 13 below, but depending on the embodiment, various types of score functions may be used in addition to the scaled dot-product function. can be used.
[수학식 13][Equation 13]
Figure PCTKR2022008848-appb-img-000030
Figure PCTKR2022008848-appb-img-000030
한편, 제1 셀프 어텐션 레이어(311)는 각 어텐션 헤드의 출력 행렬을 이용하여 셀프 어텐션 행렬 Z을 생성할 수 있다. 구체적으로, 제1 셀프 어텐션 레이어(311)는 아래의 수학식 14와 같이 각 어텐션 헤드의 출력 행렬을 연결(concatenation)하여 셀프 어텐션 행렬
Figure PCTKR2022008848-appb-img-000031
을 생성할 수 있다.
Meanwhile, the first self-attention layer 311 can generate a self-attention matrix Z using the output matrix of each attention head. Specifically, the first self-attention layer 311 concatenates the output matrix of each attention head as shown in Equation 14 below to create a self-attention matrix.
Figure PCTKR2022008848-appb-img-000031
can be created.
[수학식 14][Equation 14]
Figure PCTKR2022008848-appb-img-000032
Figure PCTKR2022008848-appb-img-000032
이때,
Figure PCTKR2022008848-appb-img-000033
는 행동 예측 모델(100)에 대한 학습을 통해 결정되는 가중치 행렬을 나타낸다.
At this time,
Figure PCTKR2022008848-appb-img-000033
represents a weight matrix determined through learning the behavior prediction model 100.
한편, 도 4는 일 실시예에 따른 제1 셀프 어텐션 레이어의 일 예를 나타낸 도면이다.Meanwhile, Figure 4 is a diagram showing an example of a first self-attention layer according to an embodiment.
도 4에 도시된 예에서는 설명의 편의를 위해 제1 셀프 어텐션 레이어(311)가 3개의 어텐션 헤드(410, 420, 430)를 포함(즉, h1=3)하는 것으로 가정하나, 제1 셀프 어텐션 레이어(310)에 포함된 어텐션 헤드의 개수는 도시된 예에 한정되는 것은 아니며 실시예에 따라 달리 설정될 수 있다. In the example shown in FIG. 4, for convenience of explanation, it is assumed that the first self-attention layer 311 includes three attention heads 410, 420, and 430 (i.e., h 1 = 3), but the first self-attention layer 311 includes three attention heads 410, 420, and 430. The number of attention heads included in the attention layer 310 is not limited to the illustrated example and may be set differently depending on the embodiment.
도 4를 참조하면, 각 어텐션 헤드(410, 420, 430)는 선형 레이어(411, 421, 431)를 이용하여 입력 행렬 X'n-1에_가중치 행렬
Figure PCTKR2022008848-appb-img-000034
를 곱함으로써 쿼리 행렬 Qk을 생성할 수 있다. 또한, 각 어텐션 헤드(410, 420, 430)는 선형 레이어(412, 422, 432)를 이용하여 입력 행렬 X'n-1에 가중치 행렬
Figure PCTKR2022008848-appb-img-000035
를 곱함으로써 키 행렬 Kk을 생성할 수 있다. 또한, 각 어텐션 헤드(410, 420, 430)는 선형 레이어(413, 423, 433)를 이용하여 입력 행렬 X'n-1에 가중치 행렬
Figure PCTKR2022008848-appb-img-000036
를 곱함으로써 값 행렬 Vk을 생성할 수 있다.
Referring to FIG. 4, each attention head (410, 420, 430) uses the linear layer (411, 421, 431 ) to add a weight matrix to the input matrix
Figure PCTKR2022008848-appb-img-000034
You can generate the query matrix Q k by multiplying . In addition, each attention head (410, 420, 430) uses the linear layer (412, 422, 432 ) to add a weight matrix to the input matrix
Figure PCTKR2022008848-appb-img-000035
You can generate the key matrix K k by multiplying . In addition, each attention head (410, 420, 430) uses the linear layer (413, 423, 433 ) to add a weight matrix to the input matrix
Figure PCTKR2022008848-appb-img-000036
The value matrix V k can be generated by multiplying .
이후, 각 어텐션 헤드(410, 420, 430)는 생성된 쿼리 행렬 Qk, 키 행렬 Kk 및 값 행렬 Vk을 이용한 어텐션(414, 424, 434)를 수행하여 각각 상술한 수학식 9를 만족하는 출력 행렬 Z1, Z2 및 Z3을 생성할 수 있다.Afterwards, each attention head (410, 420, 430) performs attention (414, 424, 434) using the generated query matrix Q k , key matrix K k, and value matrix V k , respectively satisfying Equation 9 described above. output matrices Z 1 , Z 2 and Z 3 can be generated.
이후, 제1 셀프 어텐션 레이어(311)는 각 어텐션 헤드(410, 420, 430)의 출력 행렬 Z1, Z2 및 Z3을 연결한 후(440), 선형 레이어(450)를 이용하여 가중치
Figure PCTKR2022008848-appb-img-000037
을 곱함으로써, 상술한 수학식 14를 만족하는 셀프 어텐션 행렬 Z를 생성할 수 있다.
Afterwards, the first self-attention layer 311 connects the output matrices Z 1 , Z 2 , and Z 3 of each attention head 410, 420, and 430 (440), and then calculates the weights using the linear layer 450.
Figure PCTKR2022008848-appb-img-000037
By multiplying, a self-attention matrix Z that satisfies Equation 14 described above can be generated.
도 5는 일 실시예에 따른 디코더 레이어의 구성을 나타낸 도면이다.Figure 5 is a diagram showing the configuration of a decoder layer according to one embodiment.
구체적으로, 도 2에 도시된 각 디코더 레이어(130-1, 130-2, 130-M)는 예를 들어, 도 5에 도시된 디코더 레이어(510)와 동일한 구성을 가질 수 있다.Specifically, each decoder layer 130-1, 130-2, and 130-M shown in FIG. 2 may have the same configuration as the decoder layer 510 shown in FIG. 5, for example.
도 5를 참조하면, 디코더 레이어(510)는 제2 셀프 어텐션 레이어(511), 레이어 정규화(512, 514, 516), 크로스 어텐션 레이어(513) 및 피드-포워드 네트워크(515)를 포함할 수 있다.Referring to FIG. 5, the decoder layer 510 may include a second self-attention layer 511, layer normalization 512, 514, and 516, a cross attention layer 513, and a feed-forward network 515. .
제2 셀프 어텐션 레이어(511)는 디코더 레이어(510)로 입력되는 입력 행렬
Figure PCTKR2022008848-appb-img-000038
(이때, m은 1≤m≤M)과 행동 쿼리 행렬
Figure PCTKR2022008848-appb-img-000039
를 결합하여 생성된 행렬
Figure PCTKR2022008848-appb-img-000040
에 대해 셀프 어텐션을 수행할 수 있다. 이때, 제2 셀프 어텐션 레이어(511)로 입력되는 행렬 Y'm-1는 아래의 수학식 15과 같이 입력 행렬 Ym-1과 행동 쿼리 행렬 Y를 더함으로써 생성될 수 있다.
The second self-attention layer 511 is an input matrix input to the decoder layer 510.
Figure PCTKR2022008848-appb-img-000038
(In this case, m is 1≤m≤M) and the action query matrix
Figure PCTKR2022008848-appb-img-000039
A matrix created by combining
Figure PCTKR2022008848-appb-img-000040
Self-attention can be performed for . At this time, the matrix Y'm -1 input to the second self-attention layer 511 can be generated by adding the input matrix Y m-1 and the action query matrix Y as shown in Equation 15 below.
[수학식 15][Equation 15]
Figure PCTKR2022008848-appb-img-000041
Figure PCTKR2022008848-appb-img-000041
일 실시예에 따르면, 행동 쿼리 행렬 Y는 각각 D 차원의 벡터인 L개의 행동 쿼리를 포함하는 행렬이며 행동 예측 모델(100)에 대한 학습을 통해 결정되는 학습 가능한(learnable) 파라미터이다. 또한, 행동 쿼리 행렬에 포함된 행동 쿼리의 개수 L은 사전에 설정된 하이퍼파라미터이며, 실시예에 따라 상이한 값으로 설정될 수 있다.According to one embodiment, the behavior query matrix Y is a matrix including L behavior queries, each of which is a D-dimensional vector, and is a learnable parameter determined through learning the behavior prediction model 100. Additionally, the number L of action queries included in the action query matrix is a preset hyperparameter and may be set to different values depending on the embodiment.
한편, 디코더 레이어(510)가 첫 번째 디코더 레이어인 경우(즉, m=1), 디코더 레이어(510)로 입력되는 입력 행렬 Ym-1은 사전 설정된 초기 디코더 입력 행렬
Figure PCTKR2022008848-appb-img-000042
일 수 있다. 이때, 초기 디코더 입력 행렬 Y0는 예를 들어 모든 원소의 값이 0인 행렬일 수 있다.
Meanwhile, if the decoder layer 510 is the first decoder layer (i.e., m=1), the input matrix Y m-1 input to the decoder layer 510 is the preset initial decoder input matrix
Figure PCTKR2022008848-appb-img-000042
It can be. At this time, the initial decoder input matrix Y 0 may be, for example, a matrix in which all elements have values of 0.
또한, 디코더 레이어(510)가 두 번째 이후의 디코더 레이어인 경우(즉, 2≤m≤M), 디코더 레이어(510)로 입력되는 입력 행렬 Ym-1은 m-1 번째 디코더 레이어의 출력 행렬일 수 있다.Additionally, if the decoder layer 510 is the second or subsequent decoder layer (i.e., 2≤m≤M), the input matrix Y m-1 input to the decoder layer 510 is the output matrix of the m-1th decoder layer. It can be.
한편, 첫 번째 레이어 정규화(512)는 행렬 Y'm-1을 이용하여 제2 셀프 어텐션 레이어(511)에 의해 생성된 셀프 어텐션 행렬 Z'과 디코더 레이어(510)의 입력 행렬 Ym-1을 더하는 잔차 연결을 수행한 후 레이어 정규화를 수행할 수 있다. 구체적으로, 첫 번째 레이어 정규화(512)를 통해 생성되는 행렬
Figure PCTKR2022008848-appb-img-000043
은 아래의 수학식 16과 같이 표현될 수 있다.
Meanwhile, the first layer normalization 512 uses the self-attention matrix Z' generated by the second self-attention layer 511 and the input matrix Y m-1 of the decoder layer 510 using the matrix Y' m-1. After performing additive residual concatenation, layer normalization can be performed. Specifically, the matrix generated through first layer normalization (512)
Figure PCTKR2022008848-appb-img-000043
Can be expressed as Equation 16 below.
[수학식 16][Equation 16]
Figure PCTKR2022008848-appb-img-000044
Figure PCTKR2022008848-appb-img-000044
크로스 어텐션 레이어(513)는 첫 번째 레이어 정규화(512)를 통해 생성된 행렬 Y''m-1과 행동 쿼리 행렬 Y를 결합한 행렬
Figure PCTKR2022008848-appb-img-000045
과 인코더 출력 행렬 XN과 위치 임베딩 행렬 P를 결합한 행렬
Figure PCTKR2022008848-appb-img-000046
에 대한 크로스 어텐션을 수행할 수 있다. 이때, 행렬 Y'''m-1는 아래의 수학식 17와 같이 입력 행렬 Y''m-1과 행동 쿼리 행렬 Y를 더함으로써 생성될 수 있고, 행렬 X'N는 아래의 수학식 18와 같이 인코더 출력 행렬 XN과 위치 임베딩 행렬 P를 더함으로써 생성될 수 있다.
The cross attention layer 513 is a matrix that combines the matrix Y'' m-1 generated through the first layer normalization 512 and the behavior query matrix Y.
Figure PCTKR2022008848-appb-img-000045
and a matrix combining the encoder output matrix
Figure PCTKR2022008848-appb-img-000046
Cross attention can be performed on . At this time, the matrix Y''' m-1 can be created by adding the input matrix Y'' m-1 and the action query matrix Y as shown in Equation 17 below, and the matrix Likewise, it can be generated by adding the encoder output matrix X N and the position embedding matrix P.
[수학식 17][Equation 17]
Figure PCTKR2022008848-appb-img-000047
Figure PCTKR2022008848-appb-img-000047
[수학식 18][Equation 18]
Figure PCTKR2022008848-appb-img-000048
Figure PCTKR2022008848-appb-img-000048
한편, 두 번째 레이어 정규화(514)는 크로스 어텐션 레이어(513)에 의해 생성된 크로스 어텐션 행렬
Figure PCTKR2022008848-appb-img-000049
과 첫 번째 레이어 정규화(512)에 의해 생성된 행렬 Y''m-1을 더하는 잔차 연결을 수행한 후 레이어 정규화를 수행할 수 있다. 구체적으로, 두 번째 레이어 정규화(514)를 통해 생성되는 행렬
Figure PCTKR2022008848-appb-img-000050
은 아래의 수학식 19와 같이 표현될 수 있다.
Meanwhile, the second layer normalization 514 is a cross attention matrix generated by the cross attention layer 513.
Figure PCTKR2022008848-appb-img-000049
After performing residual concatenation by adding the matrix Y'' m-1 generated by the first layer normalization 512, layer normalization can be performed. Specifically, the matrix generated through second layer normalization (514)
Figure PCTKR2022008848-appb-img-000050
Can be expressed as Equation 19 below.
[수학식 19][Equation 19]
Figure PCTKR2022008848-appb-img-000051
Figure PCTKR2022008848-appb-img-000051
한편, 크로스 어텐션 레이어(513)를 통해 생성되는 행렬 Y''''m-1은 피드-포워드 네트워크(515)를 거치게 되며, 세 번째 레이어 정규화(516)는 피드-포워드 네트워크(515)의 출력 행렬과 피드-포워드 네트워크(515)의 입력 행렬 Y''''m-1을 더하는 잔차 연결을 수행한 후 레이어 정규화를 수행하여 디코더 레이어(510)의 출력 행렬
Figure PCTKR2022008848-appb-img-000052
을 생성할 수 있다. 구체적으로, 디코더 레이어(310)의 출력 행렬 Ym은 아래의 수학식 20과 같이 표현될 수 있다.
Meanwhile, the matrix Y'''' m-1 generated through the cross attention layer 513 passes through the feed-forward network 515, and the third layer normalization 516 is the output of the feed-forward network 515. Perform residual concatenation by adding the input matrix Y'''' m-1 of the feed-forward network 515 and then perform layer normalization to the output matrix of the decoder layer 510.
Figure PCTKR2022008848-appb-img-000052
can be created. Specifically, the output matrix Y m of the decoder layer 310 can be expressed as Equation 20 below.
[수학식 20][Equation 20]
Figure PCTKR2022008848-appb-img-000053
Figure PCTKR2022008848-appb-img-000053
한편, 일 실시예에 따르면, 제2 셀프 어텐션 레이어(511)는 제2 셀프 어텐션 레이어(511)로 입력되는 행렬 Y'm-1에 대한 셀프 어텐션을 병렬적으로 수행하는 복수의 어텐션 헤드를 포함할 수 있다. 이 경우, 제2 셀프 어텐션 레이어(511)에 의해 생성되는 셀프 어텐션 행렬은 제2 셀프 어텐션 레이어(511)의 입력 행렬 Y'm-1을 이용한 복수의 어텐션 헤드 각각의 출력 행렬에 기초하여 생성될 수 있다.Meanwhile, according to one embodiment, the second self-attention layer 511 includes a plurality of attention heads that perform self-attention in parallel for the matrix Y'm -1 input to the second self-attention layer 511. can do. In this case, the self-attention matrix generated by the second self-attention layer 511 will be generated based on the output matrix of each of the plurality of attention heads using the input matrix Y' m-1 of the second self-attention layer 511. You can.
구체적으로, 제2 셀프 어텐션 레이어(511)에 포함된 각 어텐션 헤드는 제2 셀프 어텐션 레이어(511)로 입력되는 행렬 Y'm-1로부터 쿼리 행렬, 키 행렬 및 값 행렬을 생성하고, 생성된 쿼리 행렬, 키 행렬 및 값 행렬을 이용한 셀프 어텐션을 수행하여 출력 행렬을 생성할 수 있다. Specifically, each attention head included in the second self-attention layer 511 generates a query matrix, key matrix, and value matrix from the matrix Y'm -1 input to the second self-attention layer 511, and the generated You can generate an output matrix by performing self-attention using the query matrix, key matrix, and value matrix.
예를 들어, 제1 셀프 어텐션 레이어(511)에 포함된 어텐션 헤드의 개수가 h2인 경우, l(이때, 1≤l≤h2)번째 어텐션 헤드의 출력 행렬 Z'l는 아래의 수학식 21에 따라 생성될 수 있다.For example, if the number of attention heads included in the first self-attention layer 511 is h 2 , the output matrix Z' l of the l (in this case, 1 ≤ l ≤ h 2 )th attention head is expressed in the equation below: It can be created according to 21.
[수학식 21][Equation 21]
Figure PCTKR2022008848-appb-img-000054
Figure PCTKR2022008848-appb-img-000054
수학식 21에서 쿼리 행렬 Q'l, 키 행렬 K'l 및 값 행렬 V'l는 각각 아래의 수학식 22 내지 24에 따라 생성될 수 있다.In Equation 21, the query matrix Q'l , key matrix K'l , and value matrix V'l can be generated according to Equations 22 to 24 below, respectively.
[수학식 22][Equation 22]
Figure PCTKR2022008848-appb-img-000055
Figure PCTKR2022008848-appb-img-000055
[수학식 23][Equation 23]
Figure PCTKR2022008848-appb-img-000056
Figure PCTKR2022008848-appb-img-000056
[수학식 24][Equation 24]
Figure PCTKR2022008848-appb-img-000057
Figure PCTKR2022008848-appb-img-000057
수학식 22 내지 24에서,
Figure PCTKR2022008848-appb-img-000058
,
Figure PCTKR2022008848-appb-img-000059
Figure PCTKR2022008848-appb-img-000060
는 각각 행동 예측 모델(100)에 대한 학습을 통해 결정되는 가중치 행렬을 나타내며, 각 어텐션 헤드마다 상이할 수 있다.
In equations 22 to 24,
Figure PCTKR2022008848-appb-img-000058
,
Figure PCTKR2022008848-appb-img-000059
and
Figure PCTKR2022008848-appb-img-000060
represents a weight matrix determined through learning the behavior prediction model 100, and may be different for each attention head.
한편, 수학식 21에서 score(Q'l,K'l)는 예를 들어, 아래 수학식 25과 같은 스케일드 닷-프로덕트 함수일 수 있으나, 실시예에 따라 스케일드 닷-프로덕트 함수 외에도 다양한 종류의 스코어 함수가 이용될 수 있다.Meanwhile, in Equation 21, score(Q' l , K' l ) may be a scaled dot-product function, for example, as in Equation 25 below, but depending on the embodiment, various types of functions may be used in addition to the scaled dot-product function. A score function may be used.
[수학식 25][Equation 25]
Figure PCTKR2022008848-appb-img-000061
Figure PCTKR2022008848-appb-img-000061
한편, 제2 셀프 어텐션 레이어(511)는 각 어텐션 헤드의 출력 행렬을 이용하여 셀프 어텐션 행렬
Figure PCTKR2022008848-appb-img-000062
을 생성할 수 있다. 구체적으로, 제2 셀프 어텐션 레이어(511)는 아래의 수학식 26과 같이 각 어텐션 헤드의 출력 행렬을 연결하여 셀프 어텐션 행렬 Z'을 생성할 수 있다.
Meanwhile, the second self-attention layer 511 uses the output matrix of each attention head to create a self-attention matrix.
Figure PCTKR2022008848-appb-img-000062
can be created. Specifically, the second self-attention layer 511 can generate a self-attention matrix Z' by connecting the output matrices of each attention head as shown in Equation 26 below.
[수학식 26][Equation 26]
Figure PCTKR2022008848-appb-img-000063
Figure PCTKR2022008848-appb-img-000063
이때,
Figure PCTKR2022008848-appb-img-000064
는 행동 예측 모델(100)에 대한 학습을 통해 결정되는 가중치 행렬을 나타낸다.
At this time,
Figure PCTKR2022008848-appb-img-000064
represents a weight matrix determined through learning the behavior prediction model 100.
한편, 도 6은 일 실시예에 따른 제2 셀프 어텐션 레이어의 일 예를 나타낸 도면이다.Meanwhile, Figure 6 is a diagram showing an example of a second self-attention layer according to an embodiment.
도 6에 도시된 예에서는 설명의 편의를 위해 제2 셀프 어텐션 레이어(511)가 3개의 어텐션 헤드(610, 620, 630)를 포함(즉, h2=3)하는 것으로 가정하나, 제2 셀프 어텐션 레이어(511)에 포함된 어텐션 헤드의 개수는 도시된 예에 한정되는 것은 아니며 실시예에 따라 달리 설정될 수 있다. In the example shown in FIG. 6, for convenience of explanation, it is assumed that the second self attention layer 511 includes three attention heads 610, 620, and 630 (i.e., h 2 = 3), but the second self attention layer 511 is assumed to include three attention heads 610, 620, and 630. The number of attention heads included in the attention layer 511 is not limited to the illustrated example and may be set differently depending on the embodiment.
도 6을 참조하면, 각 어텐션 헤드(610, 620, 630)는 선형 레이어(611, 621, 631)를 이용하여 입력 행렬 Y'm-1에 가중치 행렬
Figure PCTKR2022008848-appb-img-000065
를 곱함으로써 쿼리 행렬 Q'l을 생성할 수 있다. 또한, 각 어텐션 헤드(610, 620, 630)는 선형 레이어(612, 622, 632)를 이용하여 입력 행렬 Y'm-1에 가중치 행렬
Figure PCTKR2022008848-appb-img-000066
를 곱함으로써 키 행렬 K'l을 생성할 수 있다. 또한, 각 어텐션 헤드(610, 620, 630)는 선형 레이어(613, 623, 633)를 이용하여 입력 행렬 Y'm-1에 가중치 행렬
Figure PCTKR2022008848-appb-img-000067
를 곱함으로써 값 행렬 V'l을 생성할 수 있다.
Referring to Figure 6, each attention head (610, 620, 630) uses a linear layer (611, 621, 631) to add a weight matrix to the input matrix Y'm -1.
Figure PCTKR2022008848-appb-img-000065
You can create the query matrix Q' l by multiplying . In addition, each attention head (610, 620, 630) uses the linear layer (612, 622, 632) to add a weight matrix to the input matrix Y' m-1.
Figure PCTKR2022008848-appb-img-000066
You can generate the key matrix K' l by multiplying . In addition, each attention head (610, 620, 630) uses the linear layer (613, 623, 633) to add a weight matrix to the input matrix Y' m-1.
Figure PCTKR2022008848-appb-img-000067
You can create the value matrix V' l by multiplying .
이후, 각 어텐션 헤드(610, 620, 630)는 생성된 쿼리 행렬 Q'l, 키 행렬 K'l 및 값 행렬 V'l을 이용한 어텐션(614, 624, 634)를 수행하여 각각 상술한 수학식 21 만족하는 출력 행렬 Z'1, Z'2 및 Z'3을 생성할 수 있다.Afterwards, each attention head (610, 620, 630) performs attention (614, 624, 634) using the generated query matrix Q'l , key matrix K'l , and value matrix V'l , respectively, using the above-mentioned equation 21 It is possible to generate output matrices Z' 1 , Z' 2 and Z' 3 that satisfy.
이후, 제2 셀프 어텐션 레이어(511)는 각 어텐션 헤드(610, 620, 630)의 출력 행렬 Z'1, Z'2 및 Z'3을 연결한 후(640), 선형 레이어(650)를 이용하여 가중치
Figure PCTKR2022008848-appb-img-000068
을 곱함으로써, 상술한 수학식 26을 만족하는 셀프 어텐션 행렬 Z'를 생성할 수 있다.
Afterwards, the second self-attention layer 511 connects the output matrices Z' 1 , Z' 2 and Z' 3 of each attention head (610, 620, 630) (640) and then uses the linear layer (650). by weighting
Figure PCTKR2022008848-appb-img-000068
By multiplying, a self-attention matrix Z' that satisfies Equation 26 described above can be generated.
다시 도 5를 참조하면, 일 실시예에 따른 크로스 어텐션 레이어(513)는 크로스 어텐션 레이어(513)로 입력되는 두 행렬 X'N과 Y'''m-1에 대한 크로스 어텐션을 병렬적으로 수행하는 복수의 어텐션 헤드를 포함할 수 있다. 이 경우, 크로스 어텐션 레이어(513)에 의해 생성되는 크로스 어텐션 행렬은 행렬 X'N과 Y'''m-1을 입력으로 이용한 복수의 어텐션 헤드 각각의 출력 행렬에 기초하여 생성될 수 있다.Referring again to FIG. 5, the cross attention layer 513 according to one embodiment performs cross attention on the two matrices X' N and Y''' m-1 input to the cross attention layer 513 in parallel. It may include a plurality of attention heads. In this case, the cross attention matrix generated by the cross attention layer 513 may be generated based on the output matrix of each of the plurality of attention heads using the matrices X' N and Y''' m-1 as input.
구체적으로, 크로스 어텐션 레이어(513)에 포함된 각 어텐션 헤드는 크로스 어텐션 레이어(513)로 입력되는 두 개의 행렬 중 행렬 Y'''m-1로부터 쿼리 행렬을 생성하고, 행렬 X'N로부터 키 행렬 및 값 행렬을 생성할 수 있다. 또한, 각 어텐션 헤드는 생성된 쿼리 행렬, 키 행렬 및 값 행렬을 이용한 크로스 어텐션을 수행하여 출력 행렬을 생성할 수 있다. Specifically, each attention head included in the cross attention layer 513 generates a query matrix from matrix Y''' m-1 among the two matrices input to the cross attention layer 513, and a key from matrix You can create matrices and value matrices. Additionally, each attention head can generate an output matrix by performing cross attention using the generated query matrix, key matrix, and value matrix.
예를 들어, 크로스 어텐션 레이어(513)에 포함된 어텐션 헤드의 개수가 h3인 경우, u(이때, 1≤u≤h3)번째 어텐션 헤드의 출력 행렬 Z''u는 아래의 수학식 27에 따라 생성될 수 있다.For example, if the number of attention heads included in the cross attention layer 513 is h 3 , the output matrix Z'' u of the u (in this case, 1≤u≤h 3 )th attention head is Equation 27 below: It can be created according to .
[수학식 27][Equation 27]
Figure PCTKR2022008848-appb-img-000069
Figure PCTKR2022008848-appb-img-000069
수학식 27에서 쿼리 행렬 Q''u, 키 행렬 K''u 및 값 행렬 V''u는 각각 아래의 수학식 28 내지 30에 따라 생성될 수 있다.In Equation 27, the query matrix Q'' u , the key matrix K'' u , and the value matrix V'' u can each be generated according to Equations 28 to 30 below.
[수학식 28][Equation 28]
Figure PCTKR2022008848-appb-img-000070
Figure PCTKR2022008848-appb-img-000070
[수학식 29][Equation 29]
Figure PCTKR2022008848-appb-img-000071
Figure PCTKR2022008848-appb-img-000071
[수학식 30][Equation 30]
Figure PCTKR2022008848-appb-img-000072
Figure PCTKR2022008848-appb-img-000072
수학식 28 내지 30에서,
Figure PCTKR2022008848-appb-img-000073
,
Figure PCTKR2022008848-appb-img-000074
Figure PCTKR2022008848-appb-img-000075
는 각각 행동 예측 모델(100)에 대한 학습을 통해 결정되는 가중치 행렬을 나타내며, 각 어텐션 헤드마다 상이할 수 있다.
In equations 28 to 30,
Figure PCTKR2022008848-appb-img-000073
,
Figure PCTKR2022008848-appb-img-000074
and
Figure PCTKR2022008848-appb-img-000075
represents a weight matrix determined through learning the behavior prediction model 100, and may be different for each attention head.
한편, 수학식 27에서 score(Q''u,K''u)는 예를 들어, 아래 수학식 31과 같은 스케일드 닷-프로덕트 함수일 수 있으나, 실시예에 따라 스케일드 닷-프로덕트 함수 외에도 다양한 종류의 스코어 함수가 이용될 수 있다.Meanwhile, in Equation 27, score(Q'' u , K'' u ) may be, for example, a scaled dot-product function such as Equation 31 below, but depending on the embodiment, various functions may be used in addition to the scaled dot-product function. A variety of score functions can be used.
[수학식 31][Equation 31]
Figure PCTKR2022008848-appb-img-000076
Figure PCTKR2022008848-appb-img-000076
한편, 크로스 어텐션 레이어(513)는 각 어텐션 헤드의 출력 행렬을 이용하여 크로스 어텐션 행렬
Figure PCTKR2022008848-appb-img-000077
을 생성할 수 있다. 구체적으로, 크로스 어텐션 레이어(513)는 아래의 수학식 32와 같이 각 어텐션 헤드의 출력 행렬을 연결하여 크로스 어텐션 행렬 Z''을 생성할 수 있다.
Meanwhile, the cross attention layer 513 uses the output matrix of each attention head to create a cross attention matrix.
Figure PCTKR2022008848-appb-img-000077
can be created. Specifically, the cross attention layer 513 can generate a cross attention matrix Z'' by connecting the output matrices of each attention head as shown in Equation 32 below.
[수학식 32][Equation 32]
Figure PCTKR2022008848-appb-img-000078
Figure PCTKR2022008848-appb-img-000078
이때,
Figure PCTKR2022008848-appb-img-000079
는 행동 예측 모델(100)에 대한 학습을 통해 결정되는 가중치 행렬을 나타낸다.
At this time,
Figure PCTKR2022008848-appb-img-000079
represents a weight matrix determined through learning the behavior prediction model 100.
한편, 도 7은 일 실시예에 따른 크로스 어텐션 레이어의 일 예를 나타낸 도면이다.Meanwhile, Figure 7 is a diagram showing an example of a cross attention layer according to an embodiment.
도 7에 도시된 예에서는 설명의 편의를 위해 크로스 어텐션 레이어(513)가 3개의 어텐션 헤드(710, 720, 730)를 포함(즉, h3=3)하는 것으로 가정하나, 크로스 어텐션 레이어(513)에 포함된 어텐션 헤드의 개수는 도시된 예에 한정되는 것은 아니며 실시예에 따라 달리 설정될 수 있다. In the example shown in FIG. 7, for convenience of explanation, it is assumed that the cross attention layer 513 includes three attention heads 710, 720, and 730 (i.e., h 3 = 3), but the cross attention layer 513 ) The number of attention heads included is not limited to the example shown and may be set differently depending on the embodiment.
도 7을 참조하면, 각 어텐션 헤드(710, 720, 730)는 선형 레이어(711, 721, 731)를 이용하여 입력 행렬 Y'''m-1에 가중치 행렬
Figure PCTKR2022008848-appb-img-000080
를 곱함으로써 쿼리 행렬 Q''u을 생성할 수 있다. 또한, 각 어텐션 헤드(710, 720, 730)는 선형 레이어(712, 722, 732)를 이용하여 입력 행렬 X'N에 가중치 행렬
Figure PCTKR2022008848-appb-img-000081
를 곱함으로써 키 행렬 K''u을 생성할 수 있다. 또한, 각 어텐션 헤드(710, 720, 730)는 선형 레이어(713, 723, 733)를 이용하여 입력 행렬 X'N에 가중치 행렬
Figure PCTKR2022008848-appb-img-000082
를 곱함으로써 값 행렬 V''u을 생성할 수 있다.
Referring to Figure 7, each attention head (710, 720, 730) uses a linear layer (711, 721, 731) to add a weight matrix to the input matrix Y''' m-1.
Figure PCTKR2022008848-appb-img-000080
You can create the query matrix Q'' u by multiplying . In addition, each attention head (710, 720, 730) uses the linear layer (712, 722, 732) to add a weight matrix to the input matrix
Figure PCTKR2022008848-appb-img-000081
You can generate the key matrix K'' u by multiplying . In addition, each attention head (710, 720, 730) uses the linear layer (713, 723, 733) to add a weight matrix to the input matrix
Figure PCTKR2022008848-appb-img-000082
You can create the value matrix V'' u by multiplying .
이후, 각 어텐션 헤드(710, 720, 730)는 생성된 쿼리 행렬 Q''u, 키 행렬 K''u 및 값 행렬 V''u을 이용한 어텐션(714, 724, 734)를 수행하여 각각 상술한 수학식 27을 만족하는 출력 행렬 Z''1, Z''2 및 Z''3을 생성할 수 있다.Afterwards, each attention head (710, 720, 730) performs attention (714, 724, 734) using the generated query matrix Q''u , key matrix K''u, and value matrix V''u , respectively, as described above. Output matrices Z'' 1 , Z'' 2 , and Z'' 3 that satisfy Equation 27 can be generated.
이후, 크로스 어텐션 레이어(513)는 각 어텐션 헤드(710, 720, 730)의 출력 행렬 Z''1, Z''2 및 Z''3을 연결한 후(740), 선형 레이어(750)를 이용하여 가중치
Figure PCTKR2022008848-appb-img-000083
을 곱함으로써, 상술한 수학식 32를 만족하는 크로스 어텐션 행렬 Z''를 생성할 수 있다.
Afterwards, the cross attention layer 513 connects the output matrices Z'' 1 , Z'' 2 , and Z'' 3 of each attention head (710, 720, 730) (740), and then connects the linear layer (750). using weights
Figure PCTKR2022008848-appb-img-000083
By multiplying, a cross attention matrix Z'' that satisfies Equation 32 described above can be generated.
다시 도 1을 참조하면, 행동 분류부(140)는 인코더(120)에서 출력되는 인코더 출력 행렬에 기초하여 입력 프레임 시퀀스에서 관측되는 하나 이상의 행동을 식별한다.Referring again to FIG. 1, the behavior classification unit 140 identifies one or more behaviors observed in the input frame sequence based on the encoder output matrix output from the encoder 120.
구체적으로, 인코더 출력 행렬 XN은 입력 프레임 시퀀스에 포함된 T0개의 프레임에 대응하는 T0개의 D차원 벡터로 구성되며, 행동 분류부(140)는 인코더 출력 행렬 XN을 이용하여 T0개의 프레임 각각에 대응하는 행동을 식별할 수 있다. Specifically , the encoder output matrix The action corresponding to each frame can be identified.
일 실시예에 따르면, 행동 분류부(140)는 인코더 출력 행렬 XN에 기초하여 I개의 행동 클래스에 대한 입력 프레임 시퀀스에 포함된 T0개의 프레임 각각의 확률 분포를 생성하고, 생성된 확률 분포에 기초하여 각 프레임에 대응하는 행동을 I개의 행동 클래스 중 하나로 분류할 수 있다. 이때, 행동 클래스의 종류 및 개수는 행동 예측 모델(100)의 학습을 위해 이용된 학습 데이터에 따라 변경될 수 있다.According to one embodiment, the action classification unit 140 generates a probability distribution for each of T 0 frames included in the input frame sequence for I action classes based on the encoder output matrix Based on this, the behavior corresponding to each frame can be classified into one of I behavior classes. At this time, the type and number of behavior classes may change depending on the learning data used to learn the behavior prediction model 100.
구체적으로, 일 실시예에 따르면, 행동 분류부(140)는 아래의 수학식 33과 같이 인코더 출력 행렬 XN에 완전 연결 레이어(fully connected layer)를 적용한 후 소프트맥스 함수를 적용하여 I개의 행동 클래스에 대한 T0개의 프레임 각각의 확률 분포를 나타내는 행렬
Figure PCTKR2022008848-appb-img-000084
을 생성할 수 있다.
Specifically, according to one embodiment, the behavior classification unit 140 applies a fully connected layer to the encoder output matrix A matrix representing the probability distribution of each of the 0 frames for T
Figure PCTKR2022008848-appb-img-000084
can be created.
[수학식 33][Equation 33]
Figure PCTKR2022008848-appb-img-000085
Figure PCTKR2022008848-appb-img-000085
이때,
Figure PCTKR2022008848-appb-img-000086
는 완전 연결 레이어에 의해 인코더 출력 행렬 XN에 곱해지는 가중치 행렬을 나타내며, 행동 예측 모델(100)에 대한 학습을 통해 결정될 수 있다.
At this time,
Figure PCTKR2022008848-appb-img-000086
represents the weight matrix multiplied by the encoder output matrix
한편, 행동 예측부(150)는 디코더(130)에서 출력되는 디코더 출력 행렬에 기초하여 행동 분류부(140)에 의해 식별된 하나 이상의 행동 이후에 순차적으로 발생할 하나 이상의 미래 행동을 병렬적으로 예측한다.Meanwhile, the action prediction unit 150 predicts in parallel one or more future actions that will occur sequentially after one or more actions identified by the action classifier 140 based on the decoder output matrix output from the decoder 130. .
구체적으로, 디코더 출력 행렬 YM은 행동 쿼리 행렬 Y에 포함된 L개의 행동 쿼리에 대응하는 L개의 D차원 벡터로 구성되며, 행동 예측부(150)는 디코더 출력 행렬 YM을 이용하여 순차적으로 발생할 L개의 미래 행동을 병렬적으로 예측할 수 있다. 이때, 순차적으로 발생할 L개의 미래 행동을 병렬적으로 예측한다는 것은 L개의 미래 행동 중 t(이때, 2≤t≤L) 번째 미래 행동 예측을 위해 t-1 번째 미래 행동에 대한 예측 결과를 이용할 필요가 없음을 의미한다.Specifically, the decoder output matrix Y M consists of L D-dimensional vectors corresponding to the L behavior queries included in the behavior query matrix Y, and the behavior prediction unit 150 sequentially generates data using the decoder output matrix Y M. L future actions can be predicted in parallel. At this time, predicting L future actions that will occur sequentially in parallel requires using the prediction result for the t-1th future action to predict the t (here, 2≤t≤L)th future action among the L future actions. It means there is no.
한편, 일 실시예에 따르면, 행동 예측부(150)는 I+1개의 행동 클래스에 대한 L개의 미래 행동 각각의 확률 분포를 생성하고, 생성된 확률 분포에 기초하여 L개의 미래 행동 각각을 I+1개의 행동 클래스 중 하나로 분류할 수 있다. 이때, I+1개의 행동 클래스는 상술한 I개의 행동 클래스 및 I개의 행동 클래스 중 어디에도 속하지 않음을 나타내는 더미(dummy) 클래스를 포함할 수 있다. Meanwhile, according to one embodiment, the behavior prediction unit 150 generates a probability distribution of each of the L future actions for the I+1 action classes, and predicts each of the L future actions based on the generated probability distribution to I+ It can be classified into one behavior class. At this time, I+1 behavior classes may include the above-described I behavior classes and a dummy class indicating that it does not belong to any of the I behavior classes.
구체적으로, 일 실시예에 따르면, 행동 예측부(150)는 아래의 수학식 34와 같이 디코더 출력 행렬 YM에 완전 연결 레이어를 적용한 후 소프트맥스 함수를 적용하여 I+1개의 행동 클래스에 대한 L개의 미래 행동 각각의 확률 분포를 나타내는 행렬
Figure PCTKR2022008848-appb-img-000087
을 생성할 수 있다.
Specifically, according to one embodiment, the behavior prediction unit 150 applies a fully connected layer to the decoder output matrix Y M as shown in Equation 34 below and then applies the softmax function to obtain L for I+1 behavior classes. A matrix representing the probability distribution of each of the dog's future actions
Figure PCTKR2022008848-appb-img-000087
can be created.
[수학식 34][Equation 34]
Figure PCTKR2022008848-appb-img-000088
Figure PCTKR2022008848-appb-img-000088
이때,
Figure PCTKR2022008848-appb-img-000089
는 완전 연결 레이어에 의해 디코더 출력 행렬 YM에 곱해지는 가중치 행렬을 나타내며, 행동 예측 모델(100)에 대한 학습을 통해 결정될 수 있다.
At this time,
Figure PCTKR2022008848-appb-img-000089
represents the weight matrix multiplied by the decoder output matrix Y M by the fully connected layer, and can be determined through learning the behavior prediction model 100.
한편, 일 실시예에 따르면, 행동 예측부(150)는 예측된 하나 이상의 미래 행동 각각에 대한 지속 시간을 병렬적으로 예측할 수 있다.Meanwhile, according to one embodiment, the behavior prediction unit 150 may predict the duration of each of one or more predicted future behaviors in parallel.
구체적으로, 행동 예측부(150)는 아래의 수학식 35와 같이 디코더 출력 행렬 YM에 완전 연결 레이어를 적용하여 L개의 미래 행동 각각에 대한 지속 시간을 원소로 포함하는 L차원의 벡터
Figure PCTKR2022008848-appb-img-000090
를 생성할 수 있다.
Specifically, the action prediction unit 150 applies a fully connected layer to the decoder output matrix Y M as shown in Equation 35 below to create an L-dimensional vector containing the duration of each of the L future actions as an element.
Figure PCTKR2022008848-appb-img-000090
can be created.
[수학식 35][Equation 35]
Figure PCTKR2022008848-appb-img-000091
Figure PCTKR2022008848-appb-img-000091
이때,
Figure PCTKR2022008848-appb-img-000092
는 완전 연결 레이어에 의해 디코더 출력 행렬 YM에 곱해지는 가중치 행렬을 나타내며, 행동 예측 모델(100)에 대한 학습을 통해 결정될 수 있다. 한편,
Figure PCTKR2022008848-appb-img-000093
에 포함된 L개의 원소 중 j번째 원소 dj는 예측된 L개의 미래 행동 중 j번째 미래 행동의 상대적 지속시간을 나타내는 0과 1 사이의 값일 수 있으며,
Figure PCTKR2022008848-appb-img-000094
에 포함된 L개의 원소의 합은 1일 수 있다(즉,
Figure PCTKR2022008848-appb-img-000095
).
At this time,
Figure PCTKR2022008848-appb-img-000092
represents the weight matrix multiplied by the decoder output matrix Y M by the fully connected layer, and can be determined through learning the behavior prediction model 100. Meanwhile,
Figure PCTKR2022008848-appb-img-000093
The jth element d j of the L elements included in may be a value between 0 and 1 that represents the relative duration of the jth future action among the L predicted future actions,
Figure PCTKR2022008848-appb-img-000094
The sum of the L elements included in may be 1 (i.e.
Figure PCTKR2022008848-appb-img-000095
).
한편, 일 실시예에 따르면, 입력 프레임 시퀀스가 추출된 동영상의 전체 프레임 개수가 T인 경우, 행동 예측부(150)에 의해 예측되는 L개의 미래 행동은 전체 프레임 중 입력 프레임 시퀀스가 추출된 αT개의 프레임 이후 βT개의 프레임에서 발생할 것으로 예측되는 행동일 수 있으며, L개의 미래 행동 각각에 대해 예측되는 실제 지속시간은 βTdj일 수 있다. 이때, β는 β∈[0, 1-α]인 사전 설정된 예측률(prediction ratio)을 의미한다.Meanwhile, according to one embodiment, when the total number of frames of the video from which the input frame sequence is extracted is T, the L future actions predicted by the action prediction unit 150 are αT number of future actions from which the input frame sequence was extracted among all frames. It may be an action predicted to occur in βT frames after the frame, and the actual duration predicted for each of the L future actions may be βTd j . At this time, β means the preset prediction ratio of β∈[0, 1-α].
한편, 일 실시예에 따르면, 행동 예측 모델(100)은 αT개의 프레임에서 추출된 입력 프레임 시퀀스에 포함된 T0개의 프레임 각각에서 관측된 실제 행동에 대한 행동 클래스를 행동 분류부(140)가 식별할 행동에 대한 정답(ground truth)으로 이용하고, βT개의 프레임에서 관측된 실제 행동에 대한 행동 클래스를 행동 예측부(150)가 예측할 미래 행동에 정답으로 이용하여 학습될 수 있다. 또한, 실시예에 따라 행동 예측부(150)가 미래 행동 예측과 함께 예측된 미래 행동에 대한 지속 시간을 예측하도록 구성되는 경우, 행동 예측 모델(100)은 βT개의 프레임에서 관측된 실제 행동에 대한 행동 클래스 및 지속 시간을 행동 예측부(150)가 예측할 미래 행동 및 지속 시간에 대한 정답으로 이용하여 학습될 수 있다. Meanwhile, according to one embodiment, the behavior prediction model 100 has the behavior classifier 140 identify a behavior class for the actual behavior observed in each of the T 0 frames included in the input frame sequence extracted from the αT frames. It can be learned by using it as the ground truth for the action to be performed, and by using the action class for the actual action observed in βT frames as the correct answer for the future action to be predicted by the action prediction unit 150. In addition, depending on the embodiment, when the behavior prediction unit 150 is configured to predict the duration of the predicted future behavior along with the future behavior prediction, the behavior prediction model 100 predicts the actual behavior observed in the βT frames. The behavior class and duration can be learned using the correct answer for the future behavior and duration to be predicted by the behavior prediction unit 150.
도 8은 일 실시예에 따른 행동 예측 방법의 순서도이다.Figure 8 is a flowchart of a behavior prediction method according to one embodiment.
도 8에 도시된 방법은 예를 들어, 도 9에 도시된 컴퓨팅 장치(12)에 의해 수행될 수 있다.The method shown in FIG. 8 may be performed, for example, by computing device 12 shown in FIG. 9 .
도 8을 참조하면, 컴퓨팅 장치(12)는 입력 프레임 시퀀스로부터 추출된 특징에 기초하여 입력 프레임 시퀀스에 대응하는 인코더 입력 행렬을 생성한다(810).Referring to FIG. 8, computing device 12 generates an encoder input matrix corresponding to the input frame sequence based on features extracted from the input frame sequence (810).
이후, 컴퓨팅 장치는 제1 셀프 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 인코더 레이어로 구성된 인코더(120)를 이용하여 인코더 입력 행렬에 기초한 인코더 출력 행렬을 생성한다(820).Thereafter, the computing device generates an encoder output matrix based on the encoder input matrix using the encoder 120 composed of one or more encoder layers including the first self-attention layer as a sub-layer (820).
이후, 컴퓨팅 장치(12)는 제2 셀프 어텐션 레이어 및 크로스 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 디코더 레이어로 구성된 디코더(130)를 이용하여, 인코더 출력 행렬 및 행동 쿼리 행렬에 기초한 디코더 출력 행렬을 생성한다(830).Thereafter, the computing device 12 uses the decoder 130, which is composed of one or more decoder layers including a second self-attention layer and a cross-attention layer as sub-layers, to generate a decoder output matrix based on the encoder output matrix and the action query matrix. Create (830).
이때, 일 실시예에 따르면, 행동 쿼리 행렬은 예측 모델(100)에 대한 학습을 통해 결정되는 학습 가능한 파라미터일 수 있다.At this time, according to one embodiment, the behavior query matrix may be a learnable parameter determined through learning the prediction model 100.
이후, 컴퓨팅 장치(12)는 인코더 출력 행렬에 기초하여, 입력 프레임 시퀀스에서 관측되는 하나 이상의 행동을 식별한다(840). Computing device 12 then identifies one or more behaviors observed in the input frame sequence based on the encoder output matrix (840).
이후, 컴퓨팅 장치(12)는 디코더 출력 행렬에 기초하여 하나 이상의 행동 이후에 순차적으로 발생할 하나 이상의 미래 행동을 병렬적으로 예측한다(850). Computing device 12 then predicts in parallel one or more future actions that will occur sequentially after the one or more actions based on the decoder output matrix (850).
한편, 실시예에 따라, 컴퓨팅 장치(12)는 디코더 출력 행렬에 기초하여 하나 이상의 미래 행동 각각에 대한 지속 시간을 병렬적으로 예측할 수 있다.Meanwhile, depending on the embodiment, computing device 12 may predict the duration for each of one or more future actions in parallel based on the decoder output matrix.
한편, 도 8에 도시된 순서도에서 적어도 일부의 단계들은 순서를 바꾸어 수행되거나, 다른 단계와 결합되어 함께 수행되거나, 생략되거나, 세부 단계들로 나뉘어 수행되거나, 도시되지 않은 하나 이상의 단계가 부가되어 수행될 수 있다.Meanwhile, in the flowchart shown in FIG. 8, at least some of the steps are performed out of order, combined with other steps, omitted, divided into detailed steps, or performed with one or more steps not shown. It can be.
도 9는 일 실시예에 따른 컴퓨팅 장치를 포함하는 컴퓨팅 환경을 예시하여 설명하기 위한 블록도이다. FIG. 9 is a block diagram illustrating and illustrating a computing environment including a computing device according to an embodiment.
도 9에 도시된 실시예에서, 각 컴포넌트들은 이하에 기술된 것 이외에 상이한 기능 및 능력을 가질 수 있고, 이하에 기술된 것 이외에도 추가적인 컴포넌트를 포함할 수 있다.In the embodiment shown in Figure 9, each component may have different functions and capabilities in addition to those described below, and may include additional components in addition to those described below.
도시된 컴퓨팅 환경(10)은 컴퓨팅 장치(12)를 포함한다. The illustrated computing environment 10 includes a computing device 12 .
컴퓨팅 장치(12)는 적어도 하나의 프로세서(14), 컴퓨터 판독 가능 저장 매체(16) 및 통신 버스(18)를 포함한다. 프로세서(14)는 컴퓨팅 장치(12)로 하여금 앞서 언급된 예시적인 실시예에 따라 동작하도록 할 수 있다. 예컨대, 프로세서(14)는 컴퓨터 판독 가능 저장 매체(16)에 저장된 하나 이상의 프로그램들을 실행할 수 있다. 상기 하나 이상의 프로그램들은 하나 이상의 컴퓨터 실행 가능 명령어를 포함할 수 있으며, 상기 컴퓨터 실행 가능 명령어는 프로세서(14)에 의해 실행되는 경우 컴퓨팅 장치(12)로 하여금 예시적인 실시예에 따른 동작들을 수행하도록 구성될 수 있다. Computing device 12 includes at least one processor 14, a computer-readable storage medium 16, and a communication bus 18. Processor 14 may cause computing device 12 to operate in accordance with the example embodiments noted above. For example, processor 14 may execute one or more programs stored on computer-readable storage medium 16. The one or more programs may include one or more computer-executable instructions, which, when executed by the processor 14, cause computing device 12 to perform operations according to example embodiments. It can be.
컴퓨터 판독 가능 저장 매체(16)는 컴퓨터 실행 가능 명령어 내지 프로그램 코드, 프로그램 데이터 및/또는 다른 적합한 형태의 정보를 저장하도록 구성된다. 컴퓨터 판독 가능 저장 매체(16)에 저장된 프로그램(20)은 프로세서(14)에 의해 실행 가능한 명령어의 집합을 포함한다. 일 실시예에서, 컴퓨터 판독 가능 저장 매체(16)는 메모리(랜덤 액세스 메모리와 같은 휘발성 메모리, 비휘발성 메모리, 또는 이들의 적절한 조합), 하나 이상의 자기 디스크 저장 디바이스들, 광학 디스크 저장 디바이스들, 플래시 메모리 디바이스들, 그 밖에 컴퓨팅 장치(12)에 의해 액세스되고 원하는 정보를 저장할 수 있는 다른 형태의 저장 매체, 또는 이들의 적합한 조합일 수 있다.Computer-readable storage medium 16 is configured to store computer-executable instructions or program code, program data, and/or other suitable form of information. The program 20 stored in the computer-readable storage medium 16 includes a set of instructions executable by the processor 14. In one embodiment, computer-readable storage medium 16 includes memory (volatile memory, such as random access memory, non-volatile memory, or an appropriate combination thereof), one or more magnetic disk storage devices, optical disk storage devices, flash It may be memory devices, another form of storage medium that can be accessed by computing device 12 and store desired information, or a suitable combination thereof.
통신 버스(18)는 프로세서(14), 컴퓨터 판독 가능 저장 매체(16)를 포함하여 컴퓨팅 장치(12)의 다른 다양한 컴포넌트들을 상호 연결한다. Communication bus 18 interconnects various other components of computing device 12, including processor 14 and computer-readable storage medium 16.
컴퓨팅 장치(12)는 또한 하나 이상의 입출력 장치(24)를 위한 인터페이스를 제공하는 하나 이상의 입출력 인터페이스(22) 및 하나 이상의 네트워크 통신 인터페이스(26)를 포함할 수 있다. 입출력 인터페이스(22) 및 네트워크 통신 인터페이스(26)는 통신 버스(18)에 연결된다. 입출력 장치(24)는 입출력 인터페이스(22)를 통해 컴퓨팅 장치(12)의 다른 컴포넌트들에 연결될 수 있다. 예시적인 입출력 장치(24)는 포인팅 장치(마우스 또는 트랙패드 등), 키보드, 터치 입력 장치(터치패드 또는 터치스크린 등), 음성 또는 소리 입력 장치, 다양한 종류의 센서 장치 및/또는 촬영 장치와 같은 입력 장치, 및/또는 디스플레이 장치, 프린터, 스피커 및/또는 네트워크 카드와 같은 출력 장치를 포함할 수 있다. 예시적인 입출력 장치(24)는 컴퓨팅 장치(12)를 구성하는 일 컴포넌트로서 컴퓨팅 장치(12)의 내부에 포함될 수도 있고, 컴퓨팅 장치(12)와는 구별되는 별개의 장치로 컴퓨팅 장치(12)와 연결될 수도 있다. Computing device 12 may also include one or more input/output interfaces 22 and one or more network communication interfaces 26 that provide an interface for one or more input/output devices 24. The input/output interface 22 and the network communication interface 26 are connected to the communication bus 18. Input/output device 24 may be coupled to other components of computing device 12 through input/output interface 22. Exemplary input/output devices 24 include, but are not limited to, a pointing device (such as a mouse or trackpad), a keyboard, a touch input device (such as a touchpad or touch screen), a voice or sound input device, various types of sensor devices, and/or imaging devices. It may include input devices and/or output devices such as display devices, printers, speakers, and/or network cards. The exemplary input/output device 24 may be included within the computing device 12 as a component constituting the computing device 12, or may be connected to the computing device 12 as a separate device distinct from the computing device 12. It may be possible.
이상에서 대표적인 실시예를 통하여 본 발명에 대하여 상세하게 설명하였으나, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 전술한 실시예에 대하여 본 발명의 범주에서 벗어나지 않는 한도 내에서 다양한 변형이 가능함을 이해할 것이다. 그러므로 본 발명의 권리범위는 설명된 실시예에 국한되어 정해져서는 안 되며, 후술하는 특허청구범위 뿐만 아니라 이 특허청구범위와 균등한 것들에 의해 정해져야 한다.Although the present invention has been described in detail above through representative embodiments, those skilled in the art will recognize that various modifications to the above-described embodiments are possible without departing from the scope of the present invention. You will understand. Therefore, the scope of the present invention should not be limited to the described embodiments, but should be determined by the claims and equivalents of the claims as well as the claims described later.

Claims (22)

  1. 입력 프레임 시퀀스로부터 추출된 특징에 기초하여 상기 입력 프레임 시퀀스에 대응하는 인코더 입력 행렬을 생성하는 동작;generating an encoder input matrix corresponding to the input frame sequence based on features extracted from the input frame sequence;
    제1 셀프 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 인코더 레이어로 구성된 인코더를 이용하여, 상기 인코더 입력 행렬에 기초한 인코더 출력 행렬을 생성하는 동작;An operation of generating an encoder output matrix based on the encoder input matrix using an encoder composed of one or more encoder layers including a first self-attention layer as a sub-layer;
    제2 셀프 어텐션 레이어 및 크로스 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 디코더 레이어로 구성된 디코더를 이용하여, 상기 인코더 출력 행렬 및 행동 쿼리 행렬에 기초한 디코더 출력 행렬을 생성하는 동작;An operation of generating a decoder output matrix based on the encoder output matrix and the action query matrix using a decoder composed of one or more decoder layers including a second self-attention layer and a cross-attention layer as sub-layers;
    상기 인코더 출력 행렬에 기초하여, 상기 입력 프레임 시퀀스에서 관측되는 하나 이상의 행동을 식별하는 동작; 및identifying one or more behaviors observed in the input frame sequence based on the encoder output matrix; and
    상기 디코더 출력 행렬에 기초하여 상기 하나 이상의 행동 이후에 순차적으로 발생할 하나 이상의 미래 행동을 병렬적으로 예측하는 동작을 포함하는, 행동 예측 방법.An action prediction method comprising predicting in parallel one or more future actions that will occur sequentially after the one or more actions based on the decoder output matrix.
  2. 청구항 1에 있어서,In claim 1,
    상기 행동 쿼리 행렬은, 상기 인코더 및 상기 디코더를 포함하는 예측 모델에 대한 학습을 통해 결정되는 학습 가능한 파라미터인, 행동 예측 방법.The behavior query matrix is a learnable parameter determined through learning a prediction model including the encoder and the decoder.
  3. 청구항 1에 있어서,In claim 1,
    상기 인코더는, 각각 상기 제1 셀프 어텐션 레이어를 서브 레이어로 포함하고 순차적으로 수행되는 복수의 인코더 레이어를 포함하고, The encoder includes a plurality of encoder layers each including the first self-attention layer as a sub-layer and performed sequentially,
    상기 인코더 출력 행렬은, 상기 복수의 인코더 레이어 중 마지막 인코더 레이어의 출력 행렬인, 행동 예측 방법.The encoder output matrix is an output matrix of the last encoder layer among the plurality of encoder layers.
  4. 청구항 3에 있어서,In claim 3,
    상기 복수의 인코더 레이어 중 첫 번째 인코더 레이어에 포함된 제1 셀프 어텐션 레이어는, 상기 인코더 입력 행렬과 위치 임베딩 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하고,The first self-attention layer included in the first encoder layer among the plurality of encoder layers performs self-attention based on a matrix generated by combining the encoder input matrix and the position embedding matrix,
    상기 복수의 인코더 레이어 중 n(이때, n은 2≤n≤N 인 자연수, N은 상기 복수의 인코더 레이어의 개수)번째 인코더 레이어에 포함된 제1 셀프 어텐션 레이어는, 상기 복수의 인코더 레이어 중 n-1번째 인코더 레이어의 출력 행렬과 상기 위치 임베딩 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하는, 행동 예측 방법.The first self-attention layer included in the nth encoder layer (where n is a natural number of 2≤n≤N, N is the number of the plurality of encoder layers) among the plurality of encoder layers is n among the plurality of encoder layers. -A behavior prediction method that performs self-attention based on a matrix generated by combining the output matrix of the first encoder layer and the position embedding matrix.
  5. 청구항 1에 있어서,In claim 1,
    상기 제1 셀프 어텐션 레이어는, 각각 상기 제1 셀프 어텐션 레이어로 입력되는 행렬에 기초한 셀프 어텐션을 수행하는 복수의 어텐션 헤드를 포함하는, 행동 예측 방법. The first self-attention layer includes a plurality of attention heads that each perform self-attention based on a matrix input to the first self-attention layer.
  6. 청구항 1에 있어서,In claim 1,
    상기 디코더는, 각각 상기 제2 셀프 어텐션 레이어 및 상기 크로스 어텐션 레이어를 서브 레이어로 포함하고 순차적으로 수행되는 복수의 디코더 레이어를 포함하고,The decoder includes a plurality of decoder layers each including the second self-attention layer and the cross-attention layer as sub-layers and performed sequentially,
    상기 디코더 출력 행렬은, 상기 복수의 디코더 레이어 중 마지막 디코더 레이어의 출력 행렬인, 행동 예측 방법.The decoder output matrix is an output matrix of the last decoder layer among the plurality of decoder layers.
  7. 청구항 6에 있어서,In claim 6,
    상기 복수의 디코더 레이어 중 첫 번째 디코더 레이어에 포함된 제2 셀프 어텐션 레이어는, 기 설정된 초기 디코더 입력 행렬과 상기 행동 쿼리 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하고,The second self-attention layer included in the first decoder layer among the plurality of decoder layers performs self-attention based on a matrix generated by combining a preset initial decoder input matrix and the action query matrix,
    상기 복수의 디코더 레이어 중 m(이때, m은 2≤m≤M 인 자연수, M은 상기 복수의 디코더 레이어의 개수)번째 디코더 레이어에 포함된 제2 셀프 어텐션 레이어는, 상기 복수의 디코더 레이어 중 m-1번째 디코더 레이어의 출력 행렬과 상기 행동 쿼리 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하는, 행동 예측 방법.The second self-attention layer included in the m decoder layer (where m is a natural number of 2≤m≤M, M is the number of the plurality of decoder layers) among the plurality of decoder layers is m among the plurality of decoder layers. -A behavior prediction method that performs self-attention based on a matrix generated by combining the output matrix of the first decoder layer and the behavior query matrix.
  8. 청구항 1에 있어서,In claim 1,
    상기 제2 셀프 어텐션 레이어는, 각각 상기 제2 셀프 어텐션 레이어로 입력되는 행렬에 기초한 셀프 어텐션을 수행하는 복수의 어텐션 헤드를 포함하는, 행동 예측 방법.The second self-attention layer includes a plurality of attention heads that each perform self-attention based on a matrix input to the second self-attention layer.
  9. 청구항 1에 있어서,In claim 1,
    상기 크로스 어텐션 레이어는, 상기 인코더 출력 행렬과 위치 임베딩 행렬을 결합한 제1 입력 행렬, 및 상기 제2 셀프 어텐션 레이어에 의해 생성된 셀프 어텐션 행렬에 대해 레이어 정규화를 수행하여 생성된 행렬과 상기 행동 쿼리 행렬을 결합한 제2 입력 행렬에 기초한 크로스 어텐션을 수행하는, 행동 예측 방법.The cross attention layer includes a first input matrix combining the encoder output matrix and a position embedding matrix, a matrix generated by performing layer normalization on the self-attention matrix generated by the second self-attention layer, and the action query matrix. A behavior prediction method that performs cross attention based on a second input matrix combining .
  10. 청구항 9에 있어서,In claim 9,
    상기 크로스 어텐션 레이어는, 각각 제1 입력 행렬 및 상기 제2 입력 행렬에 기초한 크로스 어텐션을 수행하는 복수의 어텐션 헤드를 포함하는, 행동 예측 방법.The cross attention layer includes a plurality of attention heads that each perform cross attention based on a first input matrix and a second input matrix.
  11. 청구항 1에 있어서,In claim 1,
    상기 디코더 출력 행렬에 기초하여 상기 하나 이상의 미래 행동 각각에 대한 지속 시간을 병렬적으로 예측하는 동작을 더 포함하는, 행동 예측 방법.Predicting a duration for each of the one or more future actions in parallel based on the decoder output matrix.
  12. 하나 이상의 프로세서; 및One or more processors; and
    상기 하나 이상의 프로세서에 의해 실행되는 하나 이상의 프로그램을 저장하는 메모리를 포함하고,a memory storing one or more programs to be executed by the one or more processors;
    상기 하나 이상의 프로세서는,The one or more processors:
    입력 프레임 시퀀스로부터 추출된 특징에 기초하여 상기 입력 프레임 시퀀스에 대응하는 인코더 입력 행렬을 생성하고,Generate an encoder input matrix corresponding to the input frame sequence based on features extracted from the input frame sequence,
    제1 셀프 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 인코더 레이어로 구성된 인코더를 이용하여, 상기 인코더 입력 행렬에 기초한 인코더 출력 행렬을 생성하고,Using an encoder composed of one or more encoder layers including a first self-attention layer as a sub-layer, generate an encoder output matrix based on the encoder input matrix,
    제2 셀프 어텐션 레이어 및 크로스 어텐션 레이어를 서브 레이어로 포함하는 하나 이상의 디코더 레이어로 구성된 디코더를 이용하여, 상기 인코더 출력 행렬 및 행동 쿼리 행렬에 기초한 디코더 출력 행렬을 생성하고,Using a decoder composed of one or more decoder layers including a second self-attention layer and a cross-attention layer as sub-layers, generate a decoder output matrix based on the encoder output matrix and the action query matrix,
    상기 인코더 출력 행렬에 기초하여, 상기 입력 프레임 시퀀스에서 관측되는 하나 이상의 행동을 식별하고,Based on the encoder output matrix, identify one or more behaviors observed in the input frame sequence,
    상기 디코더 출력 행렬에 기초하여, 상기 하나 이상의 행동 이후에 순차적으로 발생할 하나 이상의 미래 행동을 병렬적으로 예측하는, 행동 예측 장치.An action prediction device that predicts in parallel one or more future actions that will occur sequentially after the one or more actions, based on the decoder output matrix.
  13. 청구항 12에 있어서,In claim 12,
    상기 행동 쿼리 행렬은, 상기 인코더 및 상기 디코더를 포함하는 예측 모델에 대한 학습을 통해 결정되는 학습 가능한 파라미터인, 행동 예측 장치.The behavior query matrix is a learnable parameter that is determined through learning a prediction model including the encoder and the decoder.
  14. 청구항 12에 있어서,In claim 12,
    상기 인코더는, 각각 상기 제1 셀프 어텐션 레이어를 서브 레이어로 포함하고 순차적으로 수행되는 복수의 인코더 레이어를 포함하고, The encoder includes a plurality of encoder layers each including the first self-attention layer as a sub-layer and performed sequentially,
    상기 인코더 출력 행렬은, 상기 복수의 인코더 레이어 중 마지막 인코더 레이어의 출력 행렬인, 행동 예측 장치.The encoder output matrix is an output matrix of the last encoder layer among the plurality of encoder layers.
  15. 청구항 14에 있어서,In claim 14,
    상기 복수의 인코더 레이어 중 첫 번째 인코더 레이어에 포함된 제1 셀프 어텐션 레이어는, 상기 인코더 입력 행렬과 위치 임베딩 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하고,The first self-attention layer included in the first encoder layer among the plurality of encoder layers performs self-attention based on a matrix generated by combining the encoder input matrix and the position embedding matrix,
    상기 복수의 인코더 레이어 중 n(이때, n은 2≤n≤N 인 자연수, N은 상기 복수의 인코더 레이어의 개수)번째 인코더 레이어에 포함된 제1 셀프 어텐션 레이어는, 상기 복수의 인코더 레이어 중 n-1번째 인코더 레이어의 출력 행렬과 상기 위치 임베딩 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하는, 행동 예측 장치.The first self-attention layer included in the nth encoder layer (where n is a natural number of 2≤n≤N, N is the number of the plurality of encoder layers) among the plurality of encoder layers is n among the plurality of encoder layers. -A behavior prediction device that performs self-attention based on a matrix generated by combining the output matrix of the first encoder layer and the position embedding matrix.
  16. 청구항 12에 있어서,In claim 12,
    상기 제1 셀프 어텐션 레이어는, 각각 상기 제1 셀프 어텐션 레이어로 입력되는 행렬에 기초한 셀프 어텐션을 수행하는 복수의 어텐션 헤드를 포함하는, 행동 예측 장치. The first self-attention layer includes a plurality of attention heads that each perform self-attention based on a matrix input to the first self-attention layer.
  17. 청구항 12에 있어서,In claim 12,
    상기 디코더는, 각각 상기 제2 셀프 어텐션 레이어 및 상기 크로스 어텐션 레이어를 서브 레이어로 포함하고 순차적으로 수행되는 복수의 디코더 레이어를 포함하고,The decoder includes a plurality of decoder layers each including the second self-attention layer and the cross-attention layer as sub-layers and performed sequentially,
    상기 디코더 출력 행렬은, 상기 복수의 디코더 레이어 중 마지막 디코더 레이어의 출력 행렬인, 행동 예측 장치.The decoder output matrix is an output matrix of the last decoder layer among the plurality of decoder layers.
  18. 청구항 17에 있어서,In claim 17,
    상기 복수의 디코더 레이어 중 첫 번째 디코더 레이어에 포함된 제2 셀프 어텐션 레이어는, 기 설정된 초기 디코더 입력 행렬과 상기 행동 쿼리 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하고,The second self-attention layer included in the first decoder layer among the plurality of decoder layers performs self-attention based on a matrix generated by combining a preset initial decoder input matrix and the action query matrix,
    상기 복수의 디코더 레이어 중 m(이때, m은 2≤m≤M 인 자연수, M은 상기 복수의 디코더 레이어의 개수)번째 디코더 레이어에 포함된 제2 셀프 어텐션 레이어는, 상기 복수의 디코더 레이어 중 m-1번째 디코더 레이어의 출력 행렬과 상기 행동 쿼리 행렬을 결합하여 생성된 행렬에 기초한 셀프 어텐션을 수행하는, 행동 예측 장치.The second self-attention layer included in the m decoder layer (where m is a natural number of 2≤m≤M, M is the number of the plurality of decoder layers) among the plurality of decoder layers is m among the plurality of decoder layers. -A behavior prediction device that performs self-attention based on a matrix generated by combining the output matrix of the first decoder layer and the behavior query matrix.
  19. 청구항 12에 있어서,In claim 12,
    상기 제2 셀프 어텐션 레이어는, 각각 상기 제2 셀프 어텐션 레이어로 입력되는 행렬에 기초한 셀프 어텐션을 수행하는 복수의 어텐션 헤드를 포함하는, 행동 예측 장치.The second self-attention layer includes a plurality of attention heads that each perform self-attention based on a matrix input to the second self-attention layer.
  20. 청구항 12에 있어서,In claim 12,
    상기 크로스 어텐션 레이어는, 상기 인코더 출력 행렬과 위치 임베딩 행렬을 결합한 제1 입력 행렬, 및 상기 제2 셀프 어텐션 레이어에 의해 생성된 셀프 어텐션 행렬에 대해 레이어 정규화를 수행하여 생성된 행렬과 상기 행동 쿼리 행렬을 결합한 제2 입력 행렬에 기초한 크로스 어텐션을 수행하는, 행동 예측 장치.The cross attention layer includes a first input matrix combining the encoder output matrix and a position embedding matrix, a matrix generated by performing layer normalization on the self-attention matrix generated by the second self-attention layer, and the action query matrix. A behavior prediction device that performs cross attention based on a second input matrix that combines.
  21. 청구항 20에 있어서,In claim 20,
    상기 크로스 어텐션 레이어는, 각각 제1 입력 행렬 및 상기 제2 입력 행렬에 기초한 크로스 어텐션을 수행하는 복수의 어텐션 헤드를 포함하는, 행동 예측 장치.The cross attention layer includes a plurality of attention heads that each perform cross attention based on a first input matrix and a second input matrix.
  22. 청구항 12에 있어서,In claim 12,
    상기 하나 이상의 프로세서는, 상기 디코더 출력 행렬에 기초하여 상기 하나 이상의 미래 행동 각각에 대한 지속 시간을 병렬적으로 예측하는, 행동 예측 장치.wherein the one or more processors predict a duration for each of the one or more future actions in parallel based on the decoder output matrix.
PCT/KR2022/008848 2022-05-27 2022-06-22 Method and apparatus for predicting actions WO2023229094A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20220065606 2022-05-27
KR10-2022-0065606 2022-05-27

Publications (1)

Publication Number Publication Date
WO2023229094A1 true WO2023229094A1 (en) 2023-11-30

Family

ID=88919314

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/008848 WO2023229094A1 (en) 2022-05-27 2022-06-22 Method and apparatus for predicting actions

Country Status (1)

Country Link
WO (1) WO2023229094A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117612071A (en) * 2024-01-23 2024-02-27 中国科学技术大学 Video action recognition method based on transfer learning

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102213385B1 (en) * 2019-11-13 2021-02-05 창원대학교 산학협력단 Video caption generation apparatus and mehtod thereof
KR20210141115A (en) * 2020-05-15 2021-11-23 삼성전자주식회사 Method and apparatus for estimating utterance time
KR20210145861A (en) * 2020-05-18 2021-12-02 주식회사 스트라드비젼 Method and apparatus for predicting behavior using expressible self-focused attention
US20220108478A1 (en) * 2020-10-02 2022-04-07 Google Llc Processing images using self-attention based neural networks
KR20220045215A (en) * 2019-09-25 2022-04-12 딥마인드 테크놀로지스 리미티드 Gated Attention Neural Network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220045215A (en) * 2019-09-25 2022-04-12 딥마인드 테크놀로지스 리미티드 Gated Attention Neural Network
KR102213385B1 (en) * 2019-11-13 2021-02-05 창원대학교 산학협력단 Video caption generation apparatus and mehtod thereof
KR20210141115A (en) * 2020-05-15 2021-11-23 삼성전자주식회사 Method and apparatus for estimating utterance time
KR20210145861A (en) * 2020-05-18 2021-12-02 주식회사 스트라드비젼 Method and apparatus for predicting behavior using expressible self-focused attention
US20220108478A1 (en) * 2020-10-02 2022-04-07 Google Llc Processing images using self-attention based neural networks

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117612071A (en) * 2024-01-23 2024-02-27 中国科学技术大学 Video action recognition method based on transfer learning
CN117612071B (en) * 2024-01-23 2024-04-19 中国科学技术大学 Video action recognition method based on transfer learning

Similar Documents

Publication Publication Date Title
WO2019164251A1 (en) Method of performing learning of deep neural network and apparatus thereof
WO2015088179A1 (en) Method and device for positioning with respect to key points of face
WO2022005188A1 (en) Entity recognition method, apparatus, electronic device and computer readable storage medium
WO2021150017A1 (en) Method for interactive segmenting an object on an image and electronic computing device implementing the same
WO2021006522A1 (en) Image diagnosis apparatus using deep learning model and method therefor
WO2020242090A1 (en) Apparatus for deep representation learning and method thereof
WO2021158085A1 (en) Neural network update method, classification method and electronic device
WO2023229094A1 (en) Method and apparatus for predicting actions
WO2020168606A1 (en) Advertisement video optimising method, apparatus and device and computer readable storage medium
WO2023167532A1 (en) Method and apparatus for video action classification
WO2022164299A1 (en) Framework for causal learning of neural networks
WO2021132798A1 (en) Method and apparatus for data anonymization
WO2011068315A4 (en) Apparatus for selecting optimum database using maximal concept-strength recognition technique and method thereof
WO2020091253A1 (en) Electronic device and method for controlling electronic device
EP3659073A1 (en) Electronic apparatus and control method thereof
WO2022131450A1 (en) Document summarization method using noise injection-based coverage and word association, and recording medium and device for performing same
WO2020138575A1 (en) Method and device for selecting machine learning data
WO2023163405A1 (en) Method and apparatus for updating or replacing credit evaluation model
WO2023224430A1 (en) Method and apparatus for on-device personalised analysis using a machine learning model
WO2023068821A1 (en) Multi-object tracking device and method based on self-supervised learning
WO2023048537A1 (en) Server and method for providing recommendation content
WO2023287239A1 (en) Function optimization method and apparatus
WO2021125521A1 (en) Action recognition method using sequential feature data and apparatus therefor
WO2021112647A1 (en) Method, apparatus and electronic device for determining word representation vector
WO2021230449A1 (en) Method and device for controlling electronic device for federated learning

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22943901

Country of ref document: EP

Kind code of ref document: A1