## 2 Materials and Methods
### Classification by a Sample-Encoding Generalization of the Kohonen Neural Network
#### 2.2.2 Sample-Encoding Kohonen Network Algorithm  
The output of the network algorithm are samples of size \(N,\mathbf{W}_{j}=\{\mathbf{w}_{1j},\dots\mathbf{w}_{Nj}\}\), of \(D\)-dimensional weight vectors \(\mathbf{w}_{ij}=(w^{1}_{ij^{\prime}},\dots,w^{D}_{ij})\), \(i=1,\dots N\), stored at nodes \(j=1,\dots,J\). In our application, each vector \(\mathbf{w}_{i,j}\), \(i=1,\dots N\), at node \(j\), encodes a kinematic data curve and we use the network as a knee pathology classifier. The network runs an algorithm which updates its weights iteratively asinputs, in the form of samples of multi-dimensional vectors, are sequentially presented. This algorithm can be summarized as follows:  
**Input**\(\mathbf{X}=\{\mathbf{x}_{1},...,\mathbf{x}_{N}\}\), \(i=1,\ldots,N\)  
**Output**\(\mathbf{W}_{j}=\{\mathbf{w}_{1j},\ldots,\mathbf{w}_{Nj}\}\), \(j=1,\ldots,J\)  
* Initialize samples \(\mathbf{W}_{j}\) stored at nodes \(j\), \(j=1,\ldots,J\).
* Get input sample \(\mathbf{X}\) and compute the similarities (the Hotelling \(T^{2}\) statistics) \(s_{j}(\mathbf{X},\mathbf{W}_{j})\) between \(X\) and samples \(\mathbf{W}_{j}\) stored at nodes \(j\), \(j=1,\ldots,J\).
* Determine the node with weight vector closest to input: \[j^{*}=\arg\min_{j}s_{j},\] (6)
* Update samples \(\mathbf{W}_{j}=\{\mathbf{w}_{1j},\ldots\mathbf{w}_{Nj}\}\) stored at nodes \(j\), \(j=1,\ldots,J\). \[\begin{array}{l}\mathbf{w}_{1j}(t+1)=\mathbf{w}_{1j}(t)+\epsilon(t)h(t)^{ jj^{*}}(\mathbf{\tilde{X}}-\mathbf{w}_{1j}(t))\\ \cdots\\ \mathbf{w}_{Nj}(t+1)=\mathbf{w}_{nj}(t)+\epsilon(t)h(t)^{jj^{*}}(\mathbf{ \tilde{X}}-\mathbf{w}_{Nj}(t)),\\ \epsilon(t)=\epsilon_{i}\left(\frac{\epsilon_{f}}{\epsilon_{i}}\right)^{\frac{ t}{\max}},\ \ \sigma(t)=\sigma_{i}\left(\frac{\sigma_{f}}{\sigma_{i}}\right)^{\frac{t}{\max}},\\ h(t)^{jj^{*}}=exp-\frac{||j-j^{*}||^{2}}{2\sigma(n)^{2}}.\end{array}\] (7)  
**Algorithm 1** Network algorithm  
The samples of weight vectors at the network nodes are initialized randomly. They are then modified iteratively, each modification triggered by an input sample, \(\mathbf{X}\). The update consists of finding the node \(j^{*}\) with weight closest, most similar, to the current input and modifying the weight vectors at each node \(j\) according to its grid distance from \(j^{*}\). Closeness is in terms of the two-sample Hotelling \(T^{2}\) statistic, as explained earlier. For multivariate data, the two-sample Hotelling \(T^{2}\) statistic is proportional to the squared Mahalanobis distance between the means of the two samples. The update equations, for multivariate data, are given by Equation (7), where \(t\) designates the iteration index. Function \(h^{j,j^{*}}\), given by Equation (9), defines the influence of \"winning\" node \(j^{*}\) on node \(j\): Every vector of the sample stored at each network node \(j\) is corrected by \"pulling\" it toward the current input sample by an amount decreasing with increasing grid distance from node \(j^{*}\). This correction also lessens in time as a function of parameter \(\sigma\) which decreases between initial and final values \(\sigma_{i}\) and \(\sigma_{f}\). This is shown in Equation (1). Finally, the correction is modulated by multiplicative parameter \(\epsilon\) which also decreases in time, between initial and final values \(\epsilon_{i}\) and \(\epsilon_{f}\) as shown in Equation (8). Parameters \(\epsilon,\sigma\) must be set so as to obtain ordering of the weights, in the sense described earlier, and convergence to their final values. These parameters are set experimentally.