## 1 Introduction  
Chronic atrophic gastritis is a significant precursor lesion for gastric cancer, and its presence markedly elevates the risk of developing this malignancy [1; 2; 3]. As a highly prevalent and lethal tumor, stomach cancer poses a serious threat to human health and safety. The early identification and intervention of chronic atrophic gastritis not only aids in preventing its progression to gastric cancer but also substantially enhances the quality of life for patients [4]. Currently, the majority of gastritis detection methods in China rely on clinical techniques such as modified gastroscopy and pathological tissue biopsy. While these methods exhibit high diagnostic accuracy, they often induce discomfort and anxiety in patients due to their invasive nature, thereby impacting patient compliance [5; 6; 7]. Furthermore, the gastroscopy procedure may result in pain, nausea, and other uncomfortable symptoms, with potential complications such as bleeding and infection occurring in some cases [8]. These factors may lead some patients to be unable to tolerate or refuse gastroscopy, resulting in missed or misdiagnosis of early gastritis. Additionally, these methods necessitate specialized medical equipment and trained personnel, which increases diagnostic costs and strains medical resources. Consequently, the pursuit of a safe, convenient, and efficient non-invasive testing method has emerged as a focal point and challenge in current gastritis diagnosis research.  
In recent years, noninvasive tests have emerged as a significant entry point for the diagnosis and treatment of gastritis [9; 10; 11; 12; 13; 14; 15]. Existing studies demonstrate that machine learning algorithms are extensively utilized for predictive modeling of various physical examination results, including cardiovascular disease [16], diabetes [17], breast cancer [18; 19], lung cancer [20], and chronic obstructive pulmonary disease [21]. Through noninvasive examination, patients can be evaluated for histologic changes in the gastric mucosa, identify potential lesions, and receive early warnings. This is crucial for predicting and assessing chronic atrophic gastritis, which can facilitate early intervention and treatment, thereby improving clinical outcomes and enabling long-term monitoring. However, current noninvasive testing methods exhibit certain limitations in the diagnosis of gastritis. First, a single noninvasive detection index may lack sufficient sensitivity and specificity, making it challenging to comprehensively and accurately reflect the pathological changes in the gastric mucosa. Second, the results from different noninvasive testing methods may exhibit variability and inconsistency, which can adversely affect their diagnostic accuracy and reliability. These limitations indicate that noninvasive tests are not yet capable of fully replacing invasive procedures, such as gastroscopy and biopsy, in the diagnosis of gastritis.  
To address this issue, we propose a new predictive model for the non-invasive prediction of chronic atrophic gastritis based on electronic medical record data and machine learning algorithms. By analyzing the electronic medical record data of 20,615 patients, we identified the significant influencing factors using a logistic regression algorithm and applied Random Forest, XGBoost, SVC, and KNN algorithms to build the prediction model. In this study, MATLAB 9.12 was used to construct and train the neural network. Our results show that the Random Forest algorithm performs well in predicting gastritis and provides strong support for future noninvasive diagnostic methods.