Background Dental radiology has significantly benefited from cone-beam computed tomography (CBCT) because of its compact size and low radiation exposure. Canal tracking is an important application of CBCT for determining the relationship between the inferior alveolar nerve and third molar. Usually, canal tacking is performed manually, which takes a lot of time. This study aimed to develop an artificial intelligence (AI) model to automate classification of the mandibular canal in relation to the third molar. Methods This retrospective study was conducted using 434 CBCT images. 3D slicer software was used to annotate and classify the data into lingual, buccal, and inferior categories. Two convolution neural network models, AlexNet and ResNet50, were developed to classify this relationship. The study included 262 images for training and 172 images for testing, with the model performance evaluated by sensitivity, precision, and F1 score. Results The performance of the two models was evaluated using a 3 × 3 confusion matrix, with the data categorized into 3 clases: lingual, buccal, and inferior. The mandibular canal and third molar have a close anatomical relationship, highlighting the need for precise imaging in dental and surgical settings. To accurately classify the mandibular canal in relation to the third molar, both AlexNet and ResNet50 demonstrated high accuracy, with F1 scores ranging from 0.64 to 0.92 for different classes, with accuracy of 81% and 83%, respectively, for accurately classifying the mandibular canal in relation to the third molar. Conclusion The present study developed and evaluated AI models to accurately classify and establish the relationship between the mandibular canal and third molars using CBCT images with a higher accuracy rate.