Objective. This study is aimed at exploring the application effect of duodenoscopy assisted by visual sensing technology based on convolutional neural network (CNN) segmentation algorithm in the diagnosis and treatment of gallbladder stones, so as to provide safer and more effective treatment methods for patients with gallstones. Methods. 188 patients with gallstones and choledocholithiasis who were admitted to our hospital from January 2016 to April 2021 were selected as the research objects. Based on whether the patients were willing to use AI-assisted visual sensing technology during the treatment process, all patients were divided into two groups, namely, the AI group and the conventional group. Various surgical indicators of patients in two groups were compared. Results. The precision, recall, and mean intersection ratio of the M-Unet-based segmentation algorithm were 94.56%, 96.56%, and 98.92%, respectively. In the AI group, the operation time (
2.74
±
0.45
h
), postoperative drainage tube placement time (
4.31
±
1.15
d
), time required for recovery of gastrointestinal function (
1.74
±
0.54
d
), time required to get out of bed (
1.14
±
0.55
h
), and time spent in hospital (
9.94
±
1.45
d
) were all shorter compared with those in the conventional group, which were
3.21
±
0.32
h
,
12.14
±
2.98
d
,
2.89
±
0.67
d
,
2.09
±
0.87
h
, and
14.14
±
1.15
h
, showing statistical differences (
P
<
0.05
); the intraoperative blood loss (
79.74
±
6.45
mL
) and residual status of stones (0%) in the AI group were much lower than those in the conventional group (
P
<
0.05
). In addition, the incidence of complications (10.26%) and the indicators of postoperative gallbladder function of patients in the AI group were lower greatly than those in the conventional group (
P
<
0.05
). Conclusion. The visual sensing technology assisted by the CNN algorithm showed a good effect on image processing, and endoscopic technology can effectively improve the treatment effect of gallbladder stones combined with choledocholithiasis with the aid of this technology. Therefore, the conclusion in this study proved that visual sensing technology based on intelligent algorithms showed a good future in the medical field.