A computer-implemented method capable of automatically detecting and differentiating esophageal, stomach, small bowel and colon lesions in device-assisted enteroscopy images by classifying the pixels as esophageal, stomach, small bowel and colon lesions, comprising selecting the architecture combination and fully training such architecture for esophageal, stomach, small bowel and colon lesions with means of output validation and storage capabilities wherein the method: - selects a number of subsets of all endoscopic ultrasonography images/videos, each of said subsets considering only images from the same patient; - selects another subset as validation set, wherein the subset does not overlap chosen images on the previously selected subsets; - pre-trains of each of the chosen subsets with one of a plurality of combinations of image feature extraction component, followed by a subsequent classification neural network component for pixel classification as esophageal, stomach, small bowel and colon lesions wherein said pre-training; - early stops when the scores do not improved over a given number of epochs, namely three; - evaluates the performance of each of the combinations; - is repeated on new, different subsets, with another networks combination and training hyperparameters, wherein such new combination considers a higher number of dense layers if the f1-metric is low and fewer dense layers if the f1-metric suggests overfitting; - selects the architecture combination that performs best during pre-training; - fully trains and validates the selected architecture combination using the entire set of device-assisted enteroscopy images to obtain an optimized architecture combination for each classification; - predicts esophageal, stomach, small bowel and colon lesions using said optimized architecture combination for classification; - receives the classification output of the prediction module by an output collect module with means of communication to a third-party capable of performing validation of said network classification; - stores the corrected prediction into the storage component. - selects a number of subsets of all endoscopic ultrasonography images/videos, each of said subsets considering only images from the same patient; - selects another subset as validation set, wherein the subset does not overlap chosen images on the previously selected subsets; - pre-trains of each of the chosen subsets with one of a plurality of combinations of image feature extraction component, followed by a subsequent classification neural network component for pixel classification as esophageal, stomach, small bowel and colon lesions wherein said pre-training; - early stops when the scores do not improved over a given number of epochs, namely three; - evaluates the performance of each of the combinations; - is repeated on new, different subsets, with another networks combination and training hyperparameters, wherein such new combination considers a higher number of dense layers if the f1-metric is low and fewer dense layers if the f1-metric suggests overfitting; - early stops when the scores do not improved over a given number of epochs, namely three; - evaluates the performance of each of the combinations; - is repeated on new, different subsets, with another networks combination and training hyperparameters, wherein such new combination considers a higher number of dense layers if the f1-metric is low and fewer dense layers if the f1-metric suggests overfitting; - selects the architecture combination that performs best during pre-training; - fully trains and validates the selected architecture combination using the entire set of device-assisted enteroscopy images to obtain an optimized architecture combination for each classification; - predicts esophageal, stomach, small bowel and colon lesions using said optimized architecture combination for classification; - receives the classification output of the prediction module by an output collect module with means of communication to a third-party capable of performing validation of said network classification; - stores the corrected prediction into the storage component.