# Curvature Sensing and Control of Soft Continuum Robots Using e-Textile Sensors
## 5 Results and Discussion
### K-Fold Cross-Validation  
In this subsection, we applied the K-Fold Cross-Validation technique, as detailed in [31], to a comprehensive evaluation of the suggested CNN model. This technique is essential for thoroughly evaluating the model's shape-sensing abilities in a range of architectural layouts, guaranteeing dependability and efficacy. The dataset was split up into \(k=5\) different subsets so that training and evaluating the model could be performed repeatedly. This thorough evaluation process offers insightful information on how well the model performs in various scenarios. Notably, this framework highlights the model's applicability to real-world scenarios in addition to identifying the best architectural design.  
In this work, we used feed-forward and convolutional neural network (CNN) architectures to create a set of five Deep Neural Network (DNN) models. These two- to three-layered models, which span a range of trainable parameters from 259 to 2515, are described in Table 1. Fully connected layers have an 'F' prefix and a subscript that indicates the number of neurones, whereas convolutional layers are indicated by a 'C' prefix followed by a subscript that indicates the size and number of kernels. Each and every convolutional layer uses a stride of 1 without any padding. All the layers employ the hyperbolic tangent (tanh) activation function, with the exception of the output layer, which uses a linear activation function. In models without a first convolutional layer, a flatten layer is included to transform the input posture image into a column vector so that it can be used with the network.  
The Adam optimizer was used to train these models over 100 epochs, with the mean squared error (MSE) serving as the main loss metric. A 5-fold cross-validation approach was used to guarantee thorough examination and validation. The learning algorithm's convergence trends across all network configurations and validation folds are shown in Figure 10(a). Furthermore, a thorough examination of the average MSE losses and their standard deviations for every model architecture--with a particular emphasis on the CNN models--is shown in Figure 10(b).  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Layers** & **Size** & **Average MSE** \\ \hline
1 & \(F_{16},F_{3}\) & 306 & 0.21 \\
2 & \(C_{8,2},F_{3}\) & 186 & 0.28 \\
3 & \(C_{8,2},C_{4,2},F_{3}\) & 206 & 0.26 \\
4 & \(C_{16,2},C_{8,2},F_{3}\) & 666 & 0.16 \\
5 & \(C_{32,2},C_{16,2},F_{8},F_{3}\) & 2762 & 0.04 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Selected architectures for the 5-fold cross-validation experiment.  
Figure 11: (**a**) Training losses depicted as mean squared error (MSE) for five deep neural network (DNN) models during 5-fold cross-validation, and (**b**) the corresponding mean and standard deviations of these losses. Architectures with more number of neocons are having intense red colors.  
Notably, bigger networks tend to converge more successfully towards lower MSE values; networks with a greater parameter count are indicated in dark red. We selected a neural network that performed well in both the training and testing phases in order to keep things simple. The overall robustness of the system might be improved by investigating compact and quickly learning designs.