# Human Pose Estimation Using MediaPipe Pose and Optimization Method Based on a Humanoid Model
## 2 Pose Estimation Approach
### Fast Global Optimization Method  
For an estimation of the joint angles in the humanoid model that fits well with the MPP skeleton model for the current frame, inverse kinematics is basically necessary. However, it takes a long time to solve the formula-based inverse kinematics of the humanoid robot due to the complicated structure of the humanoid model, as shown in Figure 2.  
uDEAS has been developed for solving non-smooth and multimodal engineering problems. uDEAS validates the fastest and most reliable global optimization performance on seven well-known low-dimensional (two to six) benchmark functions, three high-dimensional (up to 30) benchmark functions [29], the optimal designs of Gabor filter [30], and the joint trajectory generation for a humanoid's ascending and descending stairs [31]. In addition, a modified version of uDEAS that can also search integer variables, cDEAS (combinatorial DEAS), has been recently developed and applied to the optimization of hybrid energy system [32]. uDEAS is a global optimization method that hybridizes local and global search schemes. For local search in uDEAS, all the optimization variables are represented by binary strings, such as genetic algorithm (GA) [33]. A basic unit of the local search is a session composed of single bisectional search (BSS) and multiple unidirectional search (UDS) with a binary string for each variable. The BSS attaches 0 and 1 at the end of the selected string as a new least significant bit (LSB), e.g., \(010_{2}\gets 01_{2}\to 011_{2}\), where the insertion of 0 (1) as a new LSB of the binary string corresponds to a decrease (increase) in its decoded real value compared to that of the parent string [23]. For example, assume that the binary string \(010_{2}\) is converted by the decoding function into a real value 0.3 and the cost value is 0.7, i.e., \(J(d(010_{2}))=J(0.3)=0.7\), whereas the binary string \(011_{2}\) is decoded into 0.1 and its cost value is 0.3, i.e., \(J(d(011_{2}))=J(0.1)=0.3\). Because \(J(0.1)<J(0.3)\), increasing the current variable turns out to be a good search scheme as a result of the BSS. On the other hand, the UDS adds or subtracts by 1 the optimal binary string according to the promising direction found at the previous BSS. For the BSS example mentioned above, the subsequent UDS will produce a binary string along the better BSS direction such that \(100_{2}(\text{first\,UDS})\to 101_{2}(\text{second\,UDS})\to\cdots\) until no more cost reduction occurs. This set of BSS and UDS plays a significant role in balancing exploitation and exploration in the local search, respectively. For the \(n\)-dimensional problem, uDEAS stacks up the \(n\) strings to make up a binary matrix with \(n\) rows. * Step 1. Initialization of new restart: Make an \(n\times m\) binary matrix \(\mathbf{M}\) which elements are randomly chosen binary digits. The row length index \(m\) is set \(m_{0}\). The optimization variable vector is \(\mathbf{v}=[v_{1}\,v_{2}\cdots v_{n}]^{T}\). * Step 2. Start the first session with \(i=1\). * Step 3. BSS: From the current best matrix \(\mathbf{M}\), the binary vector of the \(j(=\mathbf{J}(i))\)-th row is selected as \[\mathbf{r}_{j}(\mathbf{M})=\Big{[}a_{jm}\,a_{j(m-1)}\,\cdots\,a_{j1}\Big{]}, \ a_{jk}=\{0,1\},\,1\leq k\leq m\] (1) Attach 0 or 1 as a new LSB of the row vector, which yields \[\mathbf{r}_{j}^{-}=\Big{[}a_{jm}\,a_{j(m-1)}\,\cdots\,a_{j1}\,0\Big{]},\ \mathbf{r}_{j}^{+}=\Big{[}a_{jm}\,a_{j(m-1)}\,\cdots\,a_{j1}\,1\Big{]}\] (2) Then, these strings are decoded into real values and replaced with the \(j\)th variable of the current best optimization variable vector \(\mathbf{v}^{*}\) as follows: \[\mathbf{v}^{-}=\mathbf{v}^{+}=\mathbf{v}^{*},\ \mathbf{v}^{-}(j)=d\Big{(} \mathbf{r}_{j}^{-}\Big{)},\ \mathbf{v}^{+}(j)=d\Big{(}\mathbf{r}_{j}^{+}\Big{)}\] (3) Next, compute cost values \(J(\mathbf{v}^{-})\) and \(J(\mathbf{v}^{+})\). If \(J(\mathbf{v}^{-})<J(\mathbf{v}^{+})\), the direction for the UDS is set as \(u(j)=-1\); otherwise, \(u(j)=1\). The better row is saved as \(\mathbf{r}_{j}^{*}\). * Step 4.