# Deep-Learning Algorithms for Prescribing Insoles to Patients with Foot Pain
## 2 Methods
### Deep-Learning Algorithms
\begin{table}
\begin{tabular}{c l l l l l} \hline \multicolumn{4}{c}{**Sample size and ratio**} & - 70\% for training: 586; 30\% for validation: 252; total: 838 \\  & - Class 0: 392 (66.9\%), class 1: 64 (10.9\%), class 2: 130 (22.2\%) for training \\  & - Class 0: 169 (67.1\%), class 1: 28 (11.1\%), class 2: 55 (21.8\%) for validation \\ \hline \multirow{4}{*}{DNN model} & - Five hidden layers with 512-512-1024-1024-512 neurons \\  & - Adam optimizer, ReLU activation \\  & - Learning rate \(1\times 10^{-2}\) batch size 32 \\  & - Dropout layer for regularization \\  & - Training accuracy: 89.1\%, validation accuracy: 89.7\% \\ \hline \multirow{4}{*}{Model performance (validation data)} & Class & Precision & Recall & F1-score & Support & ROC AUC \\ \cline{2-6}  & 0 & 0.961 & 0.882 & 0.920 & 169 & 0.942 \\ \cline{2-6}  & 1 & 0.839 & 0.939 & 0.881 & 28 & 0.993 \\ \cline{2-6}  & 2 & 0.773 & 0.927 & 0.843 & 55 & 0.950 \\ \cline{2-6}  & 2 & 0.858 & 0.913 & 0.881 & 252 & 0.961 \\ \cline{2-6}  & 2 & Micro average & 0.907 & 0.897 & 0.899 & 252 & 0.949 \\ \hline \multicolumn{6}{c}{DNN, deep neural network; Adam, adaptive moment estimation; ReLU, rectified linear unit; ROC, receiver operating characteristic; AUC, area under the curve; class 0, no application; class 1, application of new lift to the right side; class 2, application of new lift to the left side.} \\ \end{tabular}
\end{table} 
Table 2: Details of the model for determining the application of heel lift. \begin{table}
\begin{tabular}{c l l l l l} \hline \multicolumn{4}{c}{**Sample size and ratio**} & - 70\% for training: 586; 30\% for validation: 252; total: 838 \\  & - Class 0: 508 (86.7\%), class 1: 23 (3.9\%), class 2: 55 (9.4\%) for training \\  & - Class 0: 218 (86.5\%), class 1: 10 (4\%), class 2: 24 (9.5\%) for validation \\ \hline \multirow{4}{*}{DNN model} & - Three hidden layers with 256-256-512 neurons \\  & - RMSProp optimizer, ReLU activation \\  & - Learning rate \(5\times 10^{-3}\), batch size 2 \\  & - Dropout layer for regularization \\  & - Training accuracy: 94.7\%, validation accuracy: 94.8\% \\ \hline \multirow{4}{*}{Model performance (validation data)} & Class & Precision & Recall & F1-score & Support & ROC AUC \\ \cline{2-6}  & 0 & 0.977 & 0.968 & 0.972 & 218 & 0.939 \\ \cline{1-1} \cline{2-6}  & 1 & 0.750 & 0.600 & 0.667 & 10 & 0.868 \\ \cline{1-1} \cline{2-6}  & 2 & 0.786 & 0.917 & 0.846 & 24 & 0.991 \\ \cline{1-1} \cline{2-6}  & \multicolumn{1}{l}{Macro average} & 0.838 & 0.828 & 0.828 & 252 & 0.933 \\ \cline{1-1} \cline{2-6}  & \multicolumn{1}{l}{Micro average} & 0.950 & 0.948 & 0.948 & 252 & 0.941 \\ \hline \end{tabular}
\end{table} 
Table 3: Details of the model for determining the application of entire lift. Tables 2-6 present the results of the multi-class classification models designed to handle more than two classes or categories. The entire lift, lateral wedge support, and calcaneocuboid arch support models used the RMSProp optimizer. The heel lift and medial wedge support models utilized the Adam and Nadam optimizers, respectively. In terms of performance, the heel lift, entire lift, and lateral wedge support models exhibited exceptional results, with accuracy rates surpassing 90% for the validation data. In contrast, the accuracies of the medial wedge support and calcaneocuboid arch support models were moderate, yielding accuracy levels ranging between 72% and 80% for the validation data.