This study aimed to test a convolutional neural network (CNN) in two different settings of training and testing data. Panoramic radiographs were selected from 1170 female dental patients (mean age 49.19 ± 21.91 yr). The cortical bone of the mandible inferior border was evaluated for osteoporosis or normal condition on the panoramic radiographs. Among them, 586 patients (mean age 27.46 ± 6.73 yr) had normal condition, and osteoporosis was interpreted on 584 patients (mean age 71.00 ± 7.64 yr). Among them, one data set of 569 normal patients (mean age 26.61 ± 4.60 yr) and 502 osteoporosis patients (mean age 72.37 ± 7.10 yr) was used for training CNN, and the other data set of 17 normal patients (mean age 55.94 ± 4.0 yr) and 82 osteoporosis patients (mean age 62.60 ± 5.00 yr) for testing CNN in the first experiment, while the latter was used for training CNN and the former for testing CNN in the second experiment. The error rate was 15.15% in the first experiment and 5.14% in the second experiment. This study suggests that age-matched training data make more accurate testing results.