# Construction of Human Behavior Cognitive Map for Robots
## 2 Human Behavior Recognition
### Body Behavior Recognition Model  
The 2D pose estimator using PAF is useful for recognizing human behavior. Because human behavior is relative to time, the GRU (gated-recurrent-units) is necessary for learning temporal characteristics. Therefore, a new type of neural networks called GRU-based DHN is proposed. [PERSON] et al. [20] proposed highway networks based on the idea of bypassing a few upper layers and transmitting information to the deeper layers. In highway networks, a transform \(T(\text{W}_{T}\textbf{X}+b_{T})\) is additionally defined to control the weights of the combination of input x and the output of the transform \(H(\text{W}_{H}\textbf{X}+b_{H})\). However, the **X** is the axis of each joint from the human skeleton. The detailed function (Equation (9)) is illustrated in Figure 2:  
\[y=H(W_{H}\textbf{X}+b_{H})\cdot T(W_{T}\textbf{X}+b_{T})+x\cdot(1-T(W_{T} \textbf{X}+b_{T})) \tag{9}\]  
where \(\textbf{X}\in R^{m},\;\;y\in R^{n}\) denote the input and output of a layer, respectively; \(W_{T}\), \(W_{H}\in R^{n\times m},\;b_{T},b_{H}\in R^{n}\) the weights and bias in the transform \(T(\text{W}_{T}\textbf{X}+b_{T})\); \(H\) an activation function, which is a rectified linear unit here; and \(T\) an activation function, which is a sigmoid function here. The dot operator \((\cdot)\) denotes element-wise multiplication, and 1 denotes column vector with elements of 1. In addition, Equation (9) shows that y is a linear combination of input x and the output of the transform \(H(\text{W}_{H}\textbf{X}+b_{H})\) in which the output of function \(T\) ranges between 0 and 1. Recalling the idea of the output of \(T(\text{W}_{T}\textbf{X}+b_{T})\) the output denotes the weights of the combination of input x and the output of the transform \(H(\text{W}_{H}\textbf{X}+b_{H})\) and backpropagation tunes the weights to minimize loss function. We can consider the weights to be tuned according to the utility of input **X** and the output of the transform \(H(\text{W}_{H}\textbf{X}+b_{H})\) through backpropagation. Based on the idea of the output of \(T(\text{W}_{T}\textbf{X}+b_{T})\) the utility of input x and the output of the transform \(H(\text{W}_{H}\textbf{X}+b_{H})\) can be compared. The proposed dynamic high network (DHN) is expressed as Equations (10) and (11), and it is shown in Figure 3:  
\[d=T_{1}(b_{T_{1}})\cdot H_{1}(W_{H_{1}}\textbf{X}+b_{H_{1}}) \tag{10}\]  
\[y=T_{2}(b_{T_{2}})\cdot H_{2}(W_{H_{2}}d+b_{H_{2}})+(1-T_{2}(b_{T_{2}}))\cdot \textbf{X} \tag{11}\]  
where \(\textbf{X},y\in R^{m},\;\;d\in R^{n}\) denote the input, output, and middle input of the entire layer, respectively. \(W_{H_{1}}\in R^{n\times m},\;b_{H_{1}},b_{T_{1}}\in R^{n},\;W_{H_{2}}\in R^{m \times n},\;b_{H_{2}},b_{T_{1}}\in R^In DHNs, the function of the first layer is expressed as Equation (10). In this layer, \(T_{1}\big{(}b_{T_{1}}\big{)}\) compares the utility of \(H_{1}(W_{H_{1}}x+b_{H_{1}})\) with 0. Based on the values of \(T_{1}\big{(}b_{T_{1}}\big{)}\), one can determine whether the number of neurons in the growing units is adequate. Consequently, the dimensionality of the growing units, n, can be raised until the values of \(T_{1}\big{(}b_{T_{1}}\big{)}\) are adequately small or the maximum permissible number of growing units is achieved. As a result, n can change dynamically according to the utility of \(H_{1}(W_{H_{1}}\mathbf{X}+b_{H_{1}})\). A GRU was proposed in [21]. The GRU is a structure of nodes. It is used in recurrent neural networks to learn the temporal features. The GRU introduces reset gates and update gates. Update gates avoid gradient diverging or gradient vanishing owing to the recurrent use of the same weights. The GRU is used instead of long short-term memory (LSTM) because the GRU model contains fewer parameters, which means the model can be trained faster and with lower memory usage. Information on human behavior is dependent on time. Therefore, extending the DHNs with the GRU model improves the behavior-recognition performance.