BackgroundGastric cancer (GC) represents a malignancy with a multi-factorial combination of genetic, environmental, and microbial factors. Targeting lysosomes presents significant potential in the treatment of numerous diseases, while lysosome-related genetic markers for early GC detection have not yet been established, despite implementing this process by assembling artificial intelligence algorithms would greatly break through its value in translational medicine, particularly for immunotherapy.MethodsTo this end, this study, by utilizing the transcriptomic as well as single cell data and integrating 20 mainstream machine-learning (ML) algorithms. We optimized an AI-based predictor for GC diagnosis. Then, the reliability of the model was initially confirmed by the results of enrichment analyses currently in use. And the immunological implications of the genes comprising the predictor was explored and response of GC patients were evaluated to immunotherapy and chemotherapy. Further, we performed systematic laboratory work to evaluate the build-up of the central genes, both at the expression stage and at the functional aspect, by which we could also demonstrate the reliability of the model to guide cancer immunotherapy.ResultsEight lysosomal-related genes were selected for predictive model construction based on the inclusion of RMSE as a reference standard and RF algorithm for ranking, namely ADRB2, KCNE2, MYO7A, IFI30, LAMP3, TPP1, HPS4, and NEU4. Taking into account accuracy, precision, recall, and F1 measurements, a preliminary determination of our study was carried out by means of applying the extra tree and random forest algorithms, incorporating the ROC-AUC value as a consideration, the Extra Tree model seems to be the optimal option with the AUC value of 0.92. The superiority of diagnostic signature is also reflected in the analysis of immune features.ConclusionIn summary, this study is the first to integrate around 20 mainstream ML algorithms to construct an AI-based diagnostic predictor for gastric cancer based on lysosomal-related genes. This model will facilitate the accurate prediction of early gastric cancer incidence and the subsequent risk assessment or precise individualized immunotherapy, thus improving the survival prognosis of GC patients.