This study focused on the segmentation effects of an artificial intelligence-based algorithm of CT images, to detect the bile duct injury (BDI) after laparoscopic cholecystectomy (LC) under dezocine anesthesia. This study was based on the maximum between-class variance (Otsu) algorithm; it introduced the image grayscale mapping method to increase the accuracy of the target area segmentation within the CT image and compare the segmentation effect with the threshold segmentation and the regional growth segmentation algorithm. 46 patients treated with laparoscopic cholecystectomy (LC) were used as research objects, and all patients were inspected in the abdominal CT examination. According to the anesthetic drug selection, patients were divided into control group (conventional anesthesia) and dezocine group (conventional anesthesia + dezocine), with 23 cases in each group. And it compared the difference between the respiratory recovery time, the wake time, the tube time, and the postoperative 3, 6, 12, and 24 h after surgery, and complication after LC evaluation of bile duct injury (BDI). It was found that the algorithm in this study can segment the target area in CT image accurately. Compared with the threshold segmentation and region growing segmentation algorithms, its Dice similarity coefficient (DSC) and Jaccard similarity coefficient (JSC) were higher (
P
<
0.05
). There was no statistically significant difference in postoperative spontaneous breathing recovery time, wake-up time, and extubation time between the dezocine group and the control group (
P
>
0.05
), but in the dezocine group, the visual analogue scale (VAS) scores at 3, 6, 12, and 24 hours after the surgery were lower (
P
<
0.05
). 27 patients developed BDI after the surgery, and they were classified as per the Strasberg classification standard. It was found that 6 cases were evaluated as type A, 4 cases were type B, 2 cases were type C, 6 cases were type D, and 9 cases were type E. It was concluded that the algorithm in this study can segment the target area of the CT image accurately, assisting the doctor in diagnosis. The use of dezocine before LC can effectively relieve patients’ postoperative pain. This study provides a basis for the diagnosis and treatment of gallbladder disease and the detection of complications.