Methods: A total of 24 CCE exams (PillCam COLON 2®) performed at a single centre between 2010-2020 were analysed. From these exams, 3 635 frames of the colonic mucosa were extracted, 770 containing colonic ulcers or erosions and 2 865 showing normal colonic mucosa. These images were used for construction of training (80% of the frames) and validation (20% of the frames) datasets. The output provided by the CNN was compared to the classification provided by a consensus of specialists. Performance marks included sensitivity, specificity, positive and negative predictive values, accuracy and area under the receiving operator characteristics curve (AUROC).Results: After the optimization of the neural architecture of the CNN, our model automatically detected colonic ulcers and erosions with a sensitivity of 90.3%, specificity of 98.8% and an accuracy of 97.0%. The AUROC was 0.99, with a processing speed of 66 frames/s.Discussion: We developed a CNN model which demonstrated high levels of efficiency for the automatic detection of ulcers and erosions in CCE images. Our study lays the foundations for the development of effective AI tools for application to CCE exams, which may improve the diagnostic accuracy of CCE, and the time spent reading these exams.