## 6 Sensor Data Acquisition and Collection
### Sensor Data Collection by HMM
For the mapping of execution progress data series to the \(K\) clusters, a temporal cohesion criterion is used and given by RBF (Radial Basis Function) [67] defined as follows:

\[\textbf{Temporal Cluster Cohesion:}\ \xi^{T^{*}}(k)=\sum_{i=1}^{T}\xi_{i}^{T^{*}} \cdot\varphi(i,\omega_{k}) \tag{8}\] \[\varphi(i,\omega_{k})=e^{-\varepsilon\|i-\omega_{k}\|^{2}}\]

where \(i=\{1,2,\ldots,M\}\) refers to \(M\) logic time instances associated to the inferred execution progress data in the time interval of length \(T\); \(\omega_{k}=(T/K)\cdot(k-1)\) is a reference time point for each \(K\)-th cluster of the total \(K\) classification clusters for the same time interval of length \(T\); \(\varepsilon\) is a scaling constant. In effect, with this RBF-based criterion, each progress data will be weighted differently in different classification clusters. For establishing a reference trajectory for operation classification and anomaly detection, the training of HMM models is preferred to be based on the data that represent comfortable socket usage. Such a data set, denoted with \(\mathcal{D}_{Comfort}\), could be collected from test cases that may have delimited gait dynamics (e.g., with slower paces), or specific socket configurations (e.g., with specific liner choices), yet are perceived to be comfortable by the user. ## 7 Operation Condition Analysis and Anomaly Detection

This service of operation condition analysis and anomaly detection (i.e., the service \(\blacklozenge\) shown in Figure 1) is responsible for quantifying similarity or discrepancy of measured operational conditions. The design is focused on the classification of collected dynamic operational conditions with the procedure shown with Algorithm 3. For each set of newly-collected operation data \(\mathcal{D}_{Operation}\), we use the pre-trained HMM model based on comfort data \(\mathcal{D}_{Comfort}\) for inferring its most likely path of execution progress \(\xi^{T^{*}[Operation]}\) (see Equation (6)) as follows:

\[ \begin{split}\beta_{t}^{T^{*}[Operation]}=\{\ln p(\xi_{t}^{T^{*}[ Operation]}\mid(\mu_{k}^{[Comfort]}\pm\,\alpha_{k}\cdot\sigma_{k}^{[Comfort]}))\}\\ t\in(1,\dots,T);k\in(1,\dots,K);((k-1)\cdot\frac{T}{K})\leq t \leq(k\cdot\frac{T}{K})\end{split}  \tag{9}\]

where \(\mu_{k}^{[Comfort]}\) and \(\sigma_{k}^{[Comfort]}\) are the parameters in the model of \(\mathcal{N}(\mu_{k}^{[Comfort]},\sigma_{k}^{[Comfort]})\) that characterizes the \(k\)-th temporal clusters of the reference execution path \(\xi^{T^{*}[Comfort]}\); \(\alpha_{k}\) is a term for the sensitivity of \(k\) regarding the likelihood. As a notation, \(\beta^{T^{*}[Operation]}\) refers to the sequence of all \(\beta_{t}^{T^{*}[Operation]}\) over the time interval \(T\). For each execution progress \(\xi_{t}^{T^{*}[Operation]}\), we detect thereafter the anomalous condition with the following _dynamic threshold_ criteria \(\tau\), given as a function of the likelihood of one or multiple observations:

\[ \begin{split}\tau_{t}^{T^{*}[Operation]}=f(\beta_{t}^{T^{*}[Operation]}(k))\}\\ t\in(1,\dots,T);k\in(1,\dots,K).\end{split}  \tag{10}\]

```
Input:\(\mathcal{D}_{Operation},K,\mathcal{N}(\mu_{k}^{[Comfort]},\sigma_{k}^{[Comfort]}), \Theta_{Trained(\mathcal{D}_{Comfort},N)}\), Threshold Result:\(\textit{Anomaly}_{t}\) \(\
eg\textit{Anomaly}_{t}\) \(\beta^{T^{*}[Operation]}\leftarrow\Theta_{Trained(\mathcal{D}_{Comfort},N)}( \mathcal{D}_{Operation})\) for\(t=1,2,\dots,T\)do if\(\beta_{t}^{T^{*}[Operation]}<\tau_{t}^{T^{*}[Operation]}\)then  Anomaly\({}_{t}\) else \(\
eg\textit{Anomaly}_{t}\)  end for  end for
```

**Algorithm 3**Detecting anomalous operational conditions using HMM-based cluster model. ## 8 Case Study and Results

For the evaluation of our approach, we used _OpenSim_[60] models for the simulation of biomechanical behaviors and _ANSYS_[61] models for the identification of reference intra-socket pressure distribution. The physical stump replica is produced through a shell mold casting process using a silicone mixture with _Shore Hardness A26_.