Objective. This study aimed to optimize the CT images of anal fistula patients using a convolutional neural network (CNN) algorithm to investigate the anal function recovery. Methods. 57 patients with complex anal fistulas admitted to our hospital from January 2020 to February 2021 were selected as research subjects. Of them, CT images of 34 cases were processed using the deep learning neural network, defined as the experimental group, and the remaining unprocessed 23 cases were in the control group. Whether to process CT images depended on the patient’s own wish. The imaging results were compared with the results observed during the surgery. Results. It was found that, in the experimental group, the images were clearer, with DSC = 0.89, precision = 0.98, and recall = 0.87, indicating that the processing effects were good; that the CT imaging results in the experimental group were more consistent with those observed during the surgery, and the difference was notable (
P
<
0.05
). Furthermore, the experimental group had lower RP (mmHg), AMCP (mmHg) scores, and postoperative recurrence rate, with notable differences noted (
P
<
0.05
). Conclusion. CT images processed by deep learning are clearer, leading to higher accuracy of preoperative diagnosis, which is suggested in clinics.