**4.3 Proposed algorithm**

The classification algorithm is based on an unsupervised clustering algorithm K-MEANS The choice of this method is justified by the low running time and a priori knowledge of the number of classes K. The algorithm is based on a parameter vector V based on the criteria mentioned in previous sections. Table 3 shows the ranking of the parameters belonging to the vector V from the most to least significant paarameter.


Table 3. List of parameters belonging to the vector V

The classification of movements is made in a hierarchical manner. Indeed a first algorithm classifies the movement into two classes. The first concerns the movements made by the whole body while the second represents the movements made only by hands. In this algorithm we used only five parameters {P2, P3, P4, P5 and P6}. The second algorithm achieves an overall classification and uses the entire set of parameters.

The clustering algorithm K-means (MacQueen, 1967) allows to partition the set of movements into k classes {C1, C2, …, Ck}. U1 partition of the first algorithm contains two rows and n columns. While for the second algorithm U2 contains 6 rows and n columns where n is the number of video sequences. For each sequence a vector V is generated.

$$\mathbf{U}1 = \begin{bmatrix} \mathbf{u}\_{1,1} & \mathbf{u}\_{1,2} & \cdots & \mathbf{u}\_{1,n} \\ \mathbf{u}\_{2,1} & \mathbf{u}\_{2,2} & \cdots & \mathbf{u}\_{2,n} \end{bmatrix}; \quad \mathbf{U}2 = \begin{bmatrix} \mathbf{u}\_{1,1} & \mathbf{u}\_{1,2} & \cdots & \mathbf{u}\_{1,n} \\ \mathbf{u}\_{2,1} & \mathbf{u}\_{2,2} & \cdots & \mathbf{u}\_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ \mathbf{u}\_{6,1} & \mathbf{u}\_{6,2} & \cdots & \mathbf{u}\_{6,n} \end{bmatrix} \tag{10}$$

Where u 0,1 i,j : means the belonging of the movement Pj to the class Ci.

$$\begin{cases} \text{if } \mathbf{P}\_{\mathbf{j}} \in \mathbf{C}\_{\mathbf{i}} \text{ then } \mathbf{u}\_{\mathbf{i},\mathbf{j}} = 1\\ \text{else} \quad \mathbf{u}\_{\mathbf{i},\mathbf{j}} = 0 \end{cases} \tag{11}$$

In addition, we impose the following two constraints on each partition

$$\sum\_{i=1}^{K} \mathbf{u}\_{i,j} = \mathbf{1}, \; j = \mathbf{1}, \dots, \mathbf{N} \tag{12}$$

$$\sum\_{i=1}^{N} \mathbf{u}\_{i,j} \succeq 0, \text{ i = 1, \dots, K} \tag{13}$$

With K is equal to 2 for the first algorithm and 6 for the second. The first specifies that any sample movement must belong to one and only one class of the partition, while the second specifies that a class must have at least one sample of movement.
