# Multifrequency Impedance Method Based on Neural Network for Root Canal Length Measurement
## 3 Results
### Neural Network Training  
The sample set was taken from numerous measurements of 21 teeth with multifrequency signals combinations. Due to the lack of tooth samples, leave-one-out (LOO) cross-validation was used to evaluate the performance of the neural network and to prevent overfitting [24]. For the 21 tooth samples, the LOO-based validation was performed with 21 iterations. In each iteration, the neural network was trained with the data set of 20 samples and tested on the remaining sample. According to the loss curve in Figure 11, a suitable optimizer was selected. The mean values of accuracy of the training and test sets after all iterations were calculated as indicators to assess the generalizability of the model. The performance of the neural network model with different structures using the LOO method is depicted in Figure 12. It should be noted that a large number of structures with different layers and nodes were verified, while a few of these results were selected to display. A highly effective model should possess both low bias and low variance. High performance on the training set reflects low bias but can cause overfitting, which suggests high variance. Therefore, point E represented the best structure.  
Figure 10: The impedance ratios of nine groups of frequency combinations varying with the distance between the file and the apical foramen (molar, #15).  
As evident from Figures 11 and 12, the neural network model eventually developed had two hidden layers, where the numbers of nodes in the hidden layers were nine and five, respectively. A neural network with no more than three layers was sufficient for the uncomplicated data set of impedance, tooth type, and file type, while it was identified that the performance with three layers was not good enough (especially point K). More layers can make the training process more complicated and can prevent the model from converging, leading to overfitting. The optimization method used for training was Adam; furthermore, regularization was added.  
The 21 teeth were divided into three groups, according to the types of tooth and file: Group 1--molar, #15(6); Group 2--molar, #25(6); and Group 3--canine, #15(9). Table 2 presents a comparison of the  
Figure 11: Loss curves with different optimizers.  
Figure 12: Performances of neural network models with different structures.  
performance of the dual-impedance ratio method and the neural network-based multifrequency method. Four pairs of frequencies were selected for the impedance ratios: 5 kHz/0.5 kHz, 10 kHz/0.5 kHz, 10 kHz/1 kHz, and 20 kHz/1 kHz.  
For the dual-frequency impedance ratio method, using the average impedance ratio of 21 teeth to determine the apical foramen was not appropriate for Group 1. This was because there were three teeth in Group 1 for which the dual-frequency impedance ratio at the 0 mm position was quite different from the average impedance ratio. By contrast, the neural network-based multifrequency method could solve this problem, had a high accuracy rate, was less affected by changes in tooth and file type, and exhibited decent robustness.  
The experimental results indicated that the proposed measurement method is relatively robust and improved the effects of measuring factors on the results. The experiments in this study may not have been perfect, however. Further improvements in accuracy can be considered, based on the following aspects: improving the neural network structure, using different judgment strategies, using different optimization methods and, most importantly, expanding the data set.