## 1 Introduction  
Gastrointestinal (GI) diseases are common in the human digestive system. Stomach cancer, esophageal cancer, and colorectal cancer are most common in terms of incidence and fatality [1, 2]. Endoscopic examinations are thus vital to detect diseases and form the critical initial step for diagnosing GI tract diseases generally [3]. Such examinations also enhance the assessment of the clinical features of lesions to determine their severity and type and to arrive at proper diagnoses. Variations in the expertise of different clinicians could introduce errors in some cases, especially with respect to controversial aspects of diagnostic images and videos from endoscopic examinations. Such inconsistency may lead to misdiagnoses and negative impact on patient care. Automatic disease classification potentially addresses this problem by providing clinicians with objective and reliable identification of several GI endoscopic images, thereby minimizing the misdiagnosis rate, improving prognosis, and economizing clinicians' valuable time. Automatic GI disease classification thus remains an open area of research for attaining better lesion detection and classification accuracy [4]. Recently, artificial intelligence based on deep learning (DL) has demonstrated remarkable progress in classification, detection, fault diagnosis, and segmentation tasks [5; 6; 7; 8; 9]. However, a drawback to the potential of DL is that large amounts of data are required for optimum performance. In addition, difficulty in obtaining GI images is increased by patient privacy concerns and annotation costs [2; 10; 11]. In short, optimal use of the DL approach to automatic GI disease classification is constrained by data scarcity. Unlike classic machine learning-based classifiers such as support vector machines (SVMs) that are used for feature extraction [12], convolutional neural networks (CNNs) have shown better performance in feature extraction, making them state-of-the-art for DL applications [8]. Effective use of CNNs has improved image recognition- and classification-related tasks [8]. The foundation of CNN is the convolution operation that fuses spatial and channel-wise information within local receptive fields to extract information features, a process known as spatial encoding [13]. However, the vanilla CNN mechanism would allow the CNN operation to pay more attention to the pixel regions that play a decisive role in classifying input images while ignoring irrelevant information [14]. To improve the suggestive power of a CNN network, several recent studies have shown the benefit of enhancing the spatial encoding ability of CNN via spatial attention modules. Other studies have indicated promising CNN-based approaches for disease classifications [9; 12; 15; 16; 17; 18; 19; 20]. In addition, spatial attention mechanisms have been studied and applied to related tasks [16; 17; 21; 22; 23]. To the best of our knowledge, GI-tract disease classification of multi-sited, multi-class diseases and artifacts, from GI endoscopic images using attention-guided CNNs, has not previously been applied. Multi-class disease and artifact classification and generalization are essential not only for diagnosis but also to avoid training biases. Our goal in this study, therefore, is to design, test, and validate an efficient spatial attention-guided CNN-based disease classification model that can be used in a computer-aided diagnosis (CAD) system for automatic GI disease classification. We examine a total of 10 classes: esophagitis, polyps, ulcerative colitis, early esophagus cancer, normal ececum, normal Z-line, normal pylorus, dyed-lifted polyps, dyed-resection-margins, and artifacts. Moreover, we adapt a t-distributed stochastic neighborhood embedding (t-SNE) visualization technique to better understand the data. [14]. Automatic classification of GI diseases using CAD can assist in the diagnosis of GI disease and in the efficient, effective, and safe removal of lesions [24; 25; 26].