# A Resource Constrained Neural Network for the Design of Embedded Human Posture Recognition Systems
## 2 The Proposed System and the Underlying Model
### FCN Training and Accuracy Results  
Keras and Larq tools have been used to describe the FCN model. In order to prove the performance of the system in two of the most interesting contexts for HPR in biomedical and industrial application fields, two datasets have been employed for lying and sitting posture recognition, respectively. The public PmatData dataset in Table 2 has been specifically designed for in-bed posture classification [35]. The pressure data have been collected by using a Vista Medical FSA SoftFlex 2048, equipped with 2048 1 inch\({}^{2}\) pressure sensors \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Layer** & **N\({}^{\circ}\) Parameters** & **Operations per Windows** & **N\({}^{\circ}\) of Bits** \\ \hline CONV 1 & \(11\times 24\) & SAC: (* \(N-10)\times 11\times 24\) & \(11\times 24\times 3\) \\ NORM 1 & \(2\times 24\) & ADD: (* \(N-10)\times 24\) & \(24\times 5+24\) \\ CONV 2 & \(11\times 24\times 24\) & SAC: (* \(N-20)\times 11\times 24\times 24\) & \(11\times 24\times 24\times 3\) \\ NORM 2 & \(2\times 24\) & ADD: (* \(N-20)\times 24\) & \(24\times 10+24\) \\ CONV 3 & \(11\times 24\times 32\) & SAC: (* \(N-30)\times 11\times 24\times 32\) & \(11\times 24\times 32\times 3\) \\ NORM 3 & \(2\times 32\) & ADD: (* \(N-30)\times 32\) & \(32\times 10+32\) \\ GAP & 0 & ADD: (* \(N-30)\times 32\) & 0 \\ SOFTMAX & 32\(\times\) Classes ** & SAC:32\(\times\) Classes ** & 32\(\times\) Classes \(\times\) 3 \\ \hline \hline \end{tabular}  
* \(n=108\) is the dimension of the input window of the laying dataset. \(n=56\) is the dimension of the input window of the sitting dataset. ** Classes = 17 for the laying dataset. Classes = 8 for the sitting dataset.  
\end{table} 
Table 1: Complexity of the proposed FCN. Figure 3: Operations of the BN and Activation functions. placed on a \(32\times 64\) grid. The sensors provide output values coded with 12 bits and normalized in the range \([0,1]\). The dataset is composed of 17 postures listed in Table 2, sampled at 1 Hz and taken from 13 participants whose physical characteristics range in the intervals: [19; 34] years for ages, [170; 186] cm for heights and [63; 100] kg for weights. The Sparse_categorical_cross-entropy loss function has been used for training, set with 100 epochs, a batch size of 20 and a learning rate of \(5\times 10^{-4}\). Initial tests on the dataset showed that 2048 input samples provided for each acquisition are an unnecessary oversampling of the body footprint, which only increases complexity of the input layer without any evident advantages in terms of accuracy. The number of the inputs has been reduced to 108 by a downsampling of about 1:19, empirically determined as the best trade-off between the HW complexity of the input layer and the overall classification accuracy. The effects on the mean classification accuracy of the FCN of the binary (BNN) and ternary (TNN) quantization schemes for weights are shown in Figure 4 and compared with the Base-2 defined from Equation (1). Table 3 reports the main test results when a 10-fold cross validation has been used. The positions \"Supine 1-4\" are supine postures with different body attitudes: legs and arms more or less spread, cozy position, straddling left and right leg. In order to prove the effectiveness of the FCN to classify sitting postures, we built a custom dataset by using the Medilogic(r) Seat Pressure Measurement System in Figure 5 to train and test the FCN, considering that, based on our knowledge, there is no public dataset available for the purpose. The measurement system is composed by a carpet of 480 piezoresistive sensors distributed on a matrix of 24 \(\times\) 20 elements. The commercial