Artificial intelligence (AI) enhances advanced endoscopic imaging in gastroenterology with techniques such as NBI, Linked Color Imaging, iSCAN and confocal laser endomicroscopy. Deep learning algorithms, especially convolutional neural networks and transformer-based models, enable accurate real-time detection, classification and risk stratification of premalignant and malignant lesions, reducing unnecessary biopsies. In the upper gastrointestinal tract, AI detects dysplasia in Barrett's esophagus, differentiates early gastric cancer from benign changes, and predicts the depth of submucosal invasion, aiding in endoscopic submucosal dissection. In the lower tract, AI identifies adenomas, serrated lesions, and neoplastic changes in ulcerative colitis, while colonoscopy with AI increases the detection rate of adenomas and reduces the incidence of interval colorectal cancer. AI objectively assesses mucosal healing and histology in inflammatory bowel disease, helps predict outcomes, and supports precision medicine. The article analyzes the integration of AI with clinical and molecular biomarkers for higher diagnostic accuracy in both upper and lower gastrointestinal pathologies. It cites challenges such as multicenter validation, standardization of algorithms, and ethical issues in implementation. The future requires prospective studies to verify the long-term benefits in practice.