Association of multi-site microbial features with malignancy risk in pulmonary ground-glass nodules and identification of predictive biomarkers: a prospective multicenter cohort study Authors: Chunxia Huang, Jiawei He, Xi Fu, Yang Zhong, Yuling Jiang, Aoling Yang, Hengzhou Lai, Qian Wang, Shiyan Tan, Xueke Li, Yifang Jiang, Yuli Qu, Xiang Zhuang, Ping Xiao, Yifeng Ren, Chuan Zheng, Fengming You, Qiong Ma Published: 2025 ABSTRACT BackgroundEmerging evidence links multi-anatomical site microbiota of the respiratory tract to lung cancer development; however, its potential for predicting the malignancy risk of ground-glass nodules (GGN) has not been systematically explored.MethodsA total of 748 patients with GGN from three medical centers were prospectively enrolled. Nasopharyngeal swabs and bronchoalveolar lavage fluid (BALF) samples were collected from these patients. During the 2-year follow-up, the patients were divided into a benign group (B_GGN, n = 251) and a malignant (M_GGN, n = 136) group. We used 16S rRNA gene sequencing to analyze the structure of the respiratory microbiota. Additionally, seven machine learning algorithms were integrated to construct and screen the best model for predicting the malignancy risk of GGN. The Shapley Additive Explanations method was utilized to identify key microbial markers, and their specificity was verified using an external independent dataset. Furthermore, co-occurrence network analysis and PICRUSt2 functional prediction were conducted to explore the functional changes in microbial communities during the malignant progression of GGN.ResultsThe respiratory microbiota of patients with GGN displayed distinct site-specific distribution characteristics, with the nasopharyngeal microbiota demonstrating significant advantages in predicting the malignancy risk of GGN. The LightGBM prediction model based on the nasopharyngeal microbiota exhibited the best diagnostic performance (AUC = 0.808, 95% CI: 0.769–0.850). Fusobacterium, Gemella, TM7x, Lachnoanaerobaculum, Rothia, and Veillonella were identified as key biomarkers. The specificity of these markers has been validated in multiple external cohorts and can enhance the overall predictive performance of traditional clinical models, such as the Mayo Clinic Model (AUC = 0.835, 95% CI: 0.801–0.873). Functional prediction analysis suggested that the malignant progression of GGN may be associated with dysregulation of amino acid metabolism and immune-related pathways.ConclusionsThe nasopharyngeal microbiota might serve as a non-invasive and reliable biomarker for early prediction of the malignant risk of GGN, exhibiting potential application value in the clinical management of pulmonary nodules.Trial registrationChiCTR2200062140; Date of registration: 25/07/2022.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12967-025-07483-2. Introduction Epidemiological studies have demonstrated that over 84.9% of patients with lung cancer exhibit ground-glass nodule (GGN) characteristics on low-dose computed tomography (LDCT) images [1, 2], underscoring the clinical significance of these images in early lung cancer detection [3]. From a pathological perspective, GGN typically correspond to early-stage malignant lesions, with certain patient cohorts achieving 5-year recurrence-free survival rates approaching 100% [4, 5]. These findings emphasize the critical importance of timely and accurate identification of malignant-prone GGN to optimize therapeutic outcomes. Although surgical resection and needle biopsy remain the gold standards for determining the benignity or malignancy of GGN, their invasiveness and high costs severely limit the feasibility of large-scale screening. Current guidelines recommend an imaging-based follow-up management strategy [6, 7], but issues such as iatrogenic anxiety caused by long-term monitoring are becoming increasingly prominent. Therefore, there is an urgent clinical need to establish a noninvasive, high-precision system for predicting the malignant risk of GGN to achieve individualized and precise diagnosis and treatment. In recent years, numerous studies have highlighted the significant role of the host microbiota in tumor initiation and progression [8–10]. With the rapid advancements in microbiota profiling techniques, host-associated microbial communities are emerging as promising novel biomarkers for non-invasive cancer diagnosis, demonstrating substantial potential for clinical translation. Notably, the respiratory tract—a critical interface between the human body and the external environment—facilitates the colonization of specific respiratory pathogens (e.g., Prevotella and Streptococcus) [11–13]. Through dynamic interactions with the mucosal immune system, these pathogens activate signaling pathways such as NF-κB and MAPK, inducing a chronic inflammatory microenvironment that promotes lung cancer cell proliferation, invasion, and metastasis [14]. This mechanistic evidence suggests their potential involvement in early lung carcinogenesis [15, 16]. Although machine learning algorithms have been employed to explore the diagnostic potential of the respiratory microbiota in discriminating patients with lung cancer from healthy controls (HC), systematic investigations regarding their utility in predicting the malignancy risk of GGN during early-stage lung cancer remain scarce. Furthermore, heterogeneity in respiratory sample sources (e.g., sputum vs. bronchoalveolar lavage fluid (BALF)) and variations in machine learning algorithms have led to substantial discrepancies in model construction and diagnostic performance across studies, potentially compromising the reproducibility and clinical applicability of the findings [17–19]. Therefore, a prospective multicenter study is urgently needed to systematically evaluate the potential of site-specific respiratory tract microbiota for early lung cancer detection, particularly in the classification of GGN. Therefore, we prospectively collected nasopharyngeal swabs and BALF microbial samples from 748 patients with GGN from three centers for 16S rRNA sequencing analysis. This multicenter design enabled the characterization of site-specific microbial distribution patterns in benign GGN (B_GGN) and malignant GGN (M_GGN). We systematically evaluated seven machine learning algorithms—including logistic regression (LR), support vector machine (SVM), multilayer perceptron (MLP), Naïve Bayes (NB), random forest (RF), gradient boosting decision tree (GBDT), and light gradient boosting machine (LightGBM)—to comparatively assess the diagnostic performance of the upper (nasopharyngeal) and lower (BALF) respiratory tract microbiomes. This comparison aimed to select the optimal model for predicting the malignancy risk of GGN and to identify core nasopharyngeal microbial biomarkers. To further validate the generalizability and specificity of the identified microbial biomarkers, we integrated microbiome data from three cross-disease population cohorts from public databases and conducted a comprehensive multi-cohort evaluation. Additionally, we explored the correlation between site-specific microorganisms and clinical features, as well as the potential biological mechanisms underlying their role in GGN progression (Fig. 1). This study provides a theoretical basis for optimizing individualized diagnosis and treatment strategies for GGN and offers potential directions for future translational research targeting microbial interventions. Fig. 1Graphical abstract Graphical abstract Methods Study population This study adopted a prospective specimen collection with a retrospective, blinded evaluation (PRoBE) cohort design. Participants were recruited from visitors at the Chengdu University of Traditional Chinese Medicine Affiliated Hospital, Sichuan Cancer Hospital, and Chengdu Integrated Traditional Chinese and Western Medicine Hospital between July 2022 and December 2024. The inclusion criteria were as follows: (I) presence of GGN in the lung parenchyma identified on CT images, with all radiological images independently reviewed by two pulmonologists; (II) maximum nodule diameter ≤ 30 mm; (III) availability of complete clinical data; (IV) confirmed pathological diagnosis results following surgical intervention; and (V) participants aged 18 to 80 years. The exclusion criteria were as follows: (I) non-GGN lesions identified on initial chest CT images; (II) presence of autoimmune or granulomatous diseases; and (III) administration of antibiotics or probiotics within the past month. Sample information collection Basic clinical information was collected from all participants. Nasopharyngeal swab collection was performed by trained medical researchers in a sterile sampling environment. Participants were instructed to sit upright, slightly tilt their heads backward, and take deep breaths to maintain a relaxed state. A pre-sterilized nasopharyngeal swab was then gently inserted into one nostril until it reached the nasopharynx. The swab was rotated to ensure adequate contact with the nasopharyngeal mucosa. Immediately after collection, the swab was carefully removed and stored at − 80 °C for subsequent analysis. BALF was collected under strict aseptic conditions according to standardized protocols. Prior to the procedure, all patients underwent comprehensive clinical evaluation to confirm indications and exclude contraindications. Under the supervision of a board-certified pulmonologist, the bronchoscope was advanced and wedged into the target bronchial segment. Sterile normal saline (37 °C, total volume 100–250 mL) was instilled in aliquots of 20–50 mL, with immediate gentle aspiration following each instillation. The procedure was considered technically adequate if a fluid recovery > 30% was achieved. BALF specimens (minimum 15 mL) were collected in sterile polypropylene tubes, maintained at 4 °C during transport, and processed within 2 h. All samples were cryopreserved in liquid nitrogen for subsequent analysis. 16S rRNA gene sequencing Total genomic DNA was extracted using the EZNA® Soil DNA Kit (Omega Bio-Tek, Norcross, GA, USA). DNA concentration and purity were measured using a NanoDrop 2000 UV spectrophotometer (Thermo Scientific, Wilmington, DE, USA), and DNA quality was further evaluated using 1% agarose gel electrophoresis. The amplification of the V3-V4 hypervariable region of the 16 S rRNA gene was performed using 338 F forward and 806R reverse primers [20]. PCR products were sequenced on the Illumina MiSeq PE300 platform (Illumina, San Diego, CA, USA) and normalized for downstream analysis. For PacBio sequencing data, high-quality reads were generated using the ccs module of SMRT Link (v11.0) analysis software, followed by sequence orientation correction. After barcode-based demultiplexing, primer sequences were removed, and size selection was applied to obtain optimized single-end circular consensus sequences. Quality control of raw data was performed using Fastp (v0.19.6), and paired-end reads were merged with FLASH (v1.2.7). Sequence denoising was conducted using DADA2 to remove PCR amplification and sequencing errors, generating amplicon sequence variants (ASVs). Taxonomic annotation was performed against the Silva138/16s_bacteria database, and species classification was implemented using the classify-sklearn (NB) algorithm in QIIME2 (v2022.2) [21], with a confidence threshold of 70%. Microbial information analysis Subsequently, taxonomic profiling, community diversity analysis, and species composition analysis were performed. Using Python 2.7.10, we quantified the number of common and unique genera between the two sample groups and visualized the results using a Venn diagram. α-diversity indices (Ace and Chao) were calculated under various random sampling conditions using Mothur software (v.1.30.2). The Wilcoxon rank-sum test was used to evaluate the significance of the differences between the two groups. In R language (v.3.3.1), we constructed a β-diversity curve based on Bray-Curtis distance and performed Principal Coordinates Analysis (PCoA) and Non-Metric Multidimensional Scaling (NMDS). To visualize the community structure characteristics, a Circos diagram was constructed using Circos-0.67-7. Statistically significant species were identified using the Wilcoxon test, and Linear Discriminant Analysis (LDA) at the genus level was performed using the LEfSe tool, with the LDA threshold set at 2. To improve the robustness of the correlation analysis between microbial communities and clinical features, we calculated the variance inflation factor using the vegan package in R to select representative clinical features. Using the Bray-Curtis distance, the influence of clinical characteristics on nasopharyngeal microbial communities was evaluated through distance-based redundancy analysis (db-RDA). Additionally, the association between nasopharyngeal microbial communities and clinical features was evaluated using Spearman’s correlation coefficient, and the results are depicted in a heatmap. The Microbial Health Index (MHI) represents a robust metric for assessing host health status, independent of clinical diagnosis. The MHI evaluates the likelihood of illness by examining the relative abundances of two different sets of microbial species: those associated with positive health and those linked to negative health results. The calculation formula is as follows [22]: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${h_{i,{M_H},{M_{N=}}}}{\log _{10}}\left( {\frac{{\frac{{{R_{{M_H}}}}}{{\left| {\left. {{M_H}} \right|} \right.}}\mathop \sum \nolimits_{{j \in {I_{{M_H}}}}} \left| {{n_j}} \right.\left. {ln\left( {{n_j}} \right)} \right|}}{{\frac{{{R_{{M_N}}}}}{{\left| {\left. {{M_N}} \right|} \right.}}\mathop \sum \nolimits_{{j \in {I_{{M_N}}}}} \left| {{n_j}} \right.\left. {ln\left( {{n_j}} \right)} \right|}}} \right)$$\end{document} The Microbial Dysbiosis Index (MDI) measures the extent of ecological dysregulation within a microbial community, with higher values indicating more pronounced microbiota disturbances. The MDI is calculated using the following formula: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$MDI={\log _{10}}\frac{\begin{gathered} {\mathrm{total~abundance~in~genera~}} \hfill \\ {\mathrm{increased~in~disease~group}} \hfill \\ \end{gathered} }{\begin{gathered} {\mathrm{total~abundance~in~genera~}} \hfill \\ {\mathrm{decreased~in~disease~group}} \hfill \\ \end{gathered} }$$\end{document} Model construction and validation Considering the variations in computational efficiency, data assumptions, and interpretability among different machine learning models, seven classifiers was constructed: LR, SVM, MLP, NB, RF, GBDT, and LightGBM. LR is a simple and efficient binary classification model well-suited for linear problems; however, it is sensitive to nonlinear relationships and outliers [23]. SVM constructs an optimal hyperplane through the maximum margin principle, making it effective for accurate classification and regression tasks [24]. MLP, as a neural network-based model, can capture complex nonlinear relationships [25]. NB leverages Bayes’ theorem and assumes feature independence to simplify computations, thereby enhancing efficiency [26]. RF is effective for handling large datasets and high-dimensional features, offering robust predictive accuracy [27]. LightGBM, known for its efficient gradient-boosting implementation, significantly enhances computational efficiency with large data volumes [28]. Although RF, GBDT, and LightGBM are all ensemble learning algorithms, they differ in their implementation: RF builds weak learners through random sampling and feature selection, whereas GBDT is constructed by iteratively fitting residuals, which makes it particularly effective for complex nonlinear data and demonstrates strong noise resistance [29]. In this study, an 8∶2 ratio was used to randomly assign the subjects to the training and internal validation sets. Model parameters were tuned through five-fold cross-validation. After determining the optimal hyperparameters, the models were retrained to produce a weighted ensemble. To guarantee consistency of the outcomes, 30 training iterations of training were performed using various random seeds, and the mean performance from these iterations was used as the final evaluation measure. Model assessment and explanation Although ML algorithms have significant potential for enhancing the accuracy of clinical decision-making, their “black box” nature often renders the results challenging to interpret. S. SHapley Additive exPlanations (SHAP) uses game theory principles to provide an interpretability framework that assesses the contribution of individual features to model predictions. It possesses ideal properties, including local accuracy, missingness, and consistency [30]. The calculation of SHAP values for the samples involved in installing and using the SHAP library is available at https://github.com/shap/shap. Prediction of microbial biological functions Functional pathway analysis was performed using PICRUSt2, leveraging the Kyoto Encyclopedia of Genes and Genomes (KEGG) and Clusters of Orthologous Groups (COG) databases. MinPath was used to identify gene pathways. Initially, ASV sequences were aligned with internal reference sequences, enabling their placement into corresponding reference trees. This step facilitated the inference of copy numbers for each ASV gene family, allowing the prediction of gene content within each ASV and the quantification of gene family abundance across samples. Subsequently, gene family data were mapped to relevant functional databases (KEGG, COG) to derive functional annotations and abundance profiles for each sample. External data download We downloaded three independent external validation datasets from the National Center for Biotechnology Information (https://www.ncbi.nlm.nih.gov/), including nasopharyngeal microbial data from patients with nasopharyngeal carcinoma, bronchiectasis, asthma, and HC. The Bioproject accession numbers are PRJNA722880, PRJEB70777, and PRJNA911564, respectively. Statistical analysis Differences in microbiome richness, diversity, and clinical features were compared using the Wilcoxon rank sum test and Pearson’s Chi-squared test, respectively, with SPSS® Statistics v26. Results Study cohort’s clinical features This study prospectively analyzed respiratory microbial samples, including nasopharyngeal swabs and BALF, from 748 patients with GGN. After a 2-year follow-up and excluding cases lost to follow-up 387 nasopharyngeal swab samples and 74 BALF samples were included for 16S rRNA sequencing analysis. During the sequencing process, 12 nasopharyngeal samples were excluded due to factors such as discrete points, excessively low microbial diversity, or OD260/280 values below 1.8. Ultimately, 375 high-quality nasopharyngeal samples (M_GGN = 130, B_GGN = 245) and 74 BALF samples (M_GGN = 35, B_GGN = 39) were included in the subsequent analysis (Fig. 2). There were no statistically significant differences in baseline characteristics between the two groups (P > 0.05, Table 1), indicating good comparability. Fig. 2Study recruitment flow chart Study recruitment flow chart Table 1Clinical baseline characteristics of GGN patientsGGN (Nasopharyngeal)P-valueGGN (BALF)P-valueM_GGNB_GGNM_GGNB_GGNVariableN = 130, (35%)N = 245, (65%)1N = 35, (47%)1N = 39, (53%)1Sex 1a0.1510.528 Female74(56.9%)158(64.5%)19(54.3%)24(61.5%) male56(43.1%)87(35.5%)16(45.7%)15(38.5%)Age 2b49[43,55]51[41,58]0.57044[39.5,46.5]46[41.5,48]0.241Family tumor history 1a0.3490.485 No78(60.0%)159(64.9%)19(54.3%)18(46.2%) Yes52(40.0%)86(35.1%)16(45.7%)21(53.8%)Allergic history 1a0.5530.600 No109(83.8%)211(86.1%)27(77.1%)32(82.1%) Yes21(16.2%)34(13.9%)8(22.9%)7(17.9%)Smoking history 1a0.8080.210 never95(73.1%)184(75.1%)26(74.3%)31(79.5%) ever23(17.7%)43(17.6%)7(20.0%)3(7.7%) current12(9.2%)18(7.3%)2(5.7%)5(12.8%)1. n (%); 2. Median [IQR]a. Pearson’s Chi-squared test; b Wilcoxon rank sum test Table 1Clinical baseline characteristics of GGN patientsGGN (Nasopharyngeal)P-valueGGN (BALF)P-valueM_GGNB_GGNM_GGNB_GGNVariableN = 130, (35%)N = 245, (65%)1N = 35, (47%)1N = 39, (53%)1Sex 1a0.1510.528 Female74(56.9%)158(64.5%)19(54.3%)24(61.5%) male56(43.1%)87(35.5%)16(45.7%)15(38.5%)Age 2b49[43,55]51[41,58]0.57044[39.5,46.5]46[41.5,48]0.241Family tumor history 1a0.3490.485 No78(60.0%)159(64.9%)19(54.3%)18(46.2%) Yes52(40.0%)86(35.1%)16(45.7%)21(53.8%)Allergic history 1a0.5530.600 No109(83.8%)211(86.1%)27(77.1%)32(82.1%) Yes21(16.2%)34(13.9%)8(22.9%)7(17.9%)Smoking history 1a0.8080.210 never95(73.1%)184(75.1%)26(74.3%)31(79.5%) ever23(17.7%)43(17.6%)7(20.0%)3(7.7%) current12(9.2%)18(7.3%)2(5.7%)5(12.8%)1. n (%); 2. Median [IQR]a. Pearson’s Chi-squared test; b Wilcoxon rank sum test Clinical baseline characteristics of GGN patients 1. n (%); 2. Median [IQR] a. Pearson’s Chi-squared test; b Wilcoxon rank sum test Site-specific microbial signatures in the nasopharyngeal and BALF microbiota samples The rarefaction curves approached saturation (Fig. 3A, B), confirming that our sequencing depth adequately captured the microbial diversity present in the samples. UMAP dimensionality reduction revealed clear separation between nasopharyngeal and BALF microbiota communities (Fig. 3C), demonstrating significant niche specialization within the respiratory tract. Additionally, we assessed the ecological characteristics of the microbiota at both sites (Fig. 3D). Distinct community distribution patterns were observed in the two microbiota samples: the nasopharyngeal microbiota was richer and more evenly distributed, whereas the BALF microbiota was more skewed and discrete. Upset plot analysis of genus-level taxonomic distribution in the B_GGN and M_GGN groups consistently showed that the nasopharyngeal samples harbored a greater number of unique and shared microbial taxa, indicating a more diverse microbial community structure (Fig. 3E, F). These findings suggested that, in studies related to GGN, it is essential to evaluate the microbial characteristics of different respiratory sampling sites and select the most disease-representative biological samples for subsequent analysis. Fig. 3Significant site-specific differences in respiratory microbiota. (A) Rarefaction curves of nasopharyngeal microbiota samples. (B) Rarefaction curves of BALF microbiota samples. (C) Visualization of microbiome samples from distinct respiratory tract sites based on UMAP analysis. (D) Microbiota richness and evenness density distribution across separate areas of the respiratory tract. (E) Upset Venn diagrams of genera in the two types of respiratory samples from the M_GGN group. (F) Upset Venn diagrams of genera in the two types of respiratory samples from the B_GGN group. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules) Significant site-specific differences in respiratory microbiota. (A) Rarefaction curves of nasopharyngeal microbiota samples. (B) Rarefaction curves of BALF microbiota samples. (C) Visualization of microbiome samples from distinct respiratory tract sites based on UMAP analysis. (D) Microbiota richness and evenness density distribution across separate areas of the respiratory tract. (E) Upset Venn diagrams of genera in the two types of respiratory samples from the M_GGN group. (F) Upset Venn diagrams of genera in the two types of respiratory samples from the B_GGN group. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules) Analysis of respiratory microbial diversity untangles community structure differences in patients with GGN Our comparative analysis revealed distinct ecological patterns between the two anatomical sites. There were notable differences in the diversity of nasopharyngeal microbiota between the B_GGN and M_GGN groups. Specifically, α-diversity indices (Ace, Chao) were markedly lower in the M_GGN group compared to the B_GGN group (Fig. 4A, B, P < 0.05), indicating reduced community richness and phylogenetic diversity in malignant cases. β-diversity analysis revealed significant structural differences in the microbial communities (R²=0.0075, P < 0.05), as evidenced by distinct clustering patterns in both PCoA and NMDS ordinations based on Bray-Curtis dissimilarity metrics (Fig. 4C, D). In contrast, the BALF microbiota exhibited no significant variations in α-diversity (Ace, Chao) or β-diversity (PCoA, NMDS) between groups (P > 0.05, Fig. 4E-H). Fig. 4Differences in respiratory microbiota between B_GGN and M_GGN patients. (A) Ace index-based α-diversity analysis of nasopharyngeal microbial samples. (B) Chao index-based α-diversity analysis of nasopharyngeal microbial samples. (C) PCoA analysis of nasopharyngeal microbial samples. (D) NMDS analysis of nasopharyngeal microbial samples. (E) Ace index-based α-diversity analysis of BALF microbial samples. (F) Chao index-based α-diversity analysis of BALF microbial samples. (G) PCoA analysis of BALF microbial samples. (H) NMDS analysis of BALF microbial samples. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules, * 0.01 < P ≤ 0.05, ** 0.001 < P ≤ 0.01, *** P ≤ 0.001) Differences in respiratory microbiota between B_GGN and M_GGN patients. (A) Ace index-based α-diversity analysis of nasopharyngeal microbial samples. (B) Chao index-based α-diversity analysis of nasopharyngeal microbial samples. (C) PCoA analysis of nasopharyngeal microbial samples. (D) NMDS analysis of nasopharyngeal microbial samples. (E) Ace index-based α-diversity analysis of BALF microbial samples. (F) Chao index-based α-diversity analysis of BALF microbial samples. (G) PCoA analysis of BALF microbial samples. (H) NMDS analysis of BALF microbial samples. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules, * 0.01 < P ≤ 0.05, ** 0.001 < P ≤ 0.01, *** P ≤ 0.001) Microbial community comparisons between nasopharyngeal and BALF microbiota Venn diagram analysis demonstrated distinct microbiota profiles between nasopharyngeal and BALF samples (Fig. 5A, D), with consistently greater bacterial diversity observed in the B_GGN group compared to the M_GGN group. Community structure visualization through Circos diagrams (Fig. 5B, E) revealed differential dominance patterns: nasopharyngeal samples were predominantly colonized by Streptococcus (15.18%), Neisseria (14.10%), Rothia (12.19%), Prevotella (11.34%), and Veillonella (9.92%), while BALF samples showed a predominance of Achromobacter (19.29%), Streptococcus (11.19%), Prevotella (10.55%), Pedobacter (7.46%), and Veillonella (6.85%). LEfSe analysis identified group-specific taxonomic signatures at the genus level (Fig. 5C, F). Wilcoxon rank-sum tests indicated significantly higher abundances of Haemophilus, Fusobacterium, Granulicatella, Capnocytophaga, Peptostreptococcus, Eubacteriun_nadatum_group and Catonella in B_GGN nasopharyngeal samples, whereas Atopobium, Selenomonas and Megasphaera, and were enriched in M_GGN specimens (Fig. 5G). BALF analysis showed Prevotella, Rubellimicrobium, Deinococcus and Anaerostipes enrichment in B_GGN, contrasting with Chloroplast and Carnobacterium predominance in M_GGN (Fig. 5H). In summary, our metagenomic analysis revealed significant differences in the microbial signatures between B_GGN and M_GGN, suggesting that they may have distinct predictive efficacies in assessing the malignancy risk of GGN. Fig. 5Characteristics of respiratory tract microbiota composition in B_GGN and M_GGN groups. (A) Venn diagram of nasopharyngeal microbial samples. (B) Circos plot of host-microbiome interactions in nasopharyngeal microbiota. (C) LEfSe analysis of nasopharyngeal microbiota. (D) Venn diagram of BALF samples. (E) Circos plot of host-microbiome interactions in BALF microbiota. (F) LEfSe analysis of BALF microbiota. (G). Differential nasopharyngeal microflora analysis of two groups based on wilcoxon rank-sum test. (H) Differential BALF microflora analysis of two groups based on wilcoxon rank-sum test. (I) Analyzing the ability of nasopharyngeal and BALF microbiota to forecast the benign-malignant status of GGN with a RF model. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules, * 0.01 < P ≤ 0.05, ** 0.001 < P ≤ 0.01, *** P ≤ 0.001) Characteristics of respiratory tract microbiota composition in B_GGN and M_GGN groups. (A) Venn diagram of nasopharyngeal microbial samples. (B) Circos plot of host-microbiome interactions in nasopharyngeal microbiota. (C) LEfSe analysis of nasopharyngeal microbiota. (D) Venn diagram of BALF samples. (E) Circos plot of host-microbiome interactions in BALF microbiota. (F) LEfSe analysis of BALF microbiota. (G). Differential nasopharyngeal microflora analysis of two groups based on wilcoxon rank-sum test. (H) Differential BALF microflora analysis of two groups based on wilcoxon rank-sum test. (I) Analyzing the ability of nasopharyngeal and BALF microbiota to forecast the benign-malignant status of GGN with a RF model. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules, * 0.01 < P ≤ 0.05, ** 0.001 < P ≤ 0.01, *** P ≤ 0.001) Comparative predictive performance of nasopharyngeal versus BALF microbiota in GGN malignancy risk assessment Then, we constructed RF models to systematically evaluate and compare the diagnostic potential of nasopharyngeal and BALF microbiota for GGN detection (Fig. 5I). Notably, the nasopharyngeal microbiota demonstrated superior predictive performance with a significantly higher AUC value compared to its BALF counterpart. These findings collectively indicated that, relative to BALF microbiota profiling, nasopharyngeal microbiota analysis exhibited superior discriminatory power (AUC = 0.737 vs. 0.654) and enhanced clinical utility for GGN malignancy risk stratification. Construction and assessment of a nasopharyngeal microbiota-based model for predicting GGN malignancy risk In this study, 375 nasopharyngeal microbiota samples were randomly divided into training set and test sets in an 8∶2 ratio. No significant differences in clinical characteristics were observed between the two sets (P > 0.05). Then, we developed seven ML models to predict the malignancy risk of GGN (Fig. 6A-G). We also conducted a comprehensive evaluation of the model’s performance using metrics such as AUC, f1-score, precision, recall, and specificity (Table 2; Fig. 6H). The results indicated that the predictive performance of LightGBM was notably better than that of the other models within the test set (AUC = 0.818, f1-score = 0.700, precision = 0.600, recall = 0.840, and specificity = 0.714). Table 2Comparative performance of seven machine learning models on the test set (mean ± SD)ModelF1-scorePrecisionRecallSpecificityAUCSVM0.618 ± 0.0070.586 ± 0.0080.654 ± 0.0090.750 ± 0.0060.685(95% CI: 0.634–0.738)NB0.625 ± 0.0060.455 ± 0.0071.000 ± 0.0050.388 ± 0.0090.727 (95% CI: 0.682–0.778)LR0.635 ± 0.0050.526 ± 0.0060.800 ± 0.0070.633 ± 0.0080.737(95% CI: 0.694–0.792)MLP0.643 ± 0.0080.581 ± 0.0090.720 ± 0.0100.735 ± 0.0070.743(95% CI: 0.695–0.788)RF0.643 ± 0.0070.600 ± 0.0080.692 ± 0.0090.755 ± 0.0050.767(95% CI: 0.720–0.808)GBDT0.655 ± 0.0090.576 ± 0.0100.760 ± 0.0080.714 ± 0.0060.776(95% CI: 0.740–0.813)LightGBM0.700 ± 0.0060.600 ± 0.0070.840 ± 0.0080.714 ± 0.0090.818(95% CI: 0.776–0.859) Table 2Comparative performance of seven machine learning models on the test set (mean ± SD)ModelF1-scorePrecisionRecallSpecificityAUCSVM0.618 ± 0.0070.586 ± 0.0080.654 ± 0.0090.750 ± 0.0060.685(95% CI: 0.634–0.738)NB0.625 ± 0.0060.455 ± 0.0071.000 ± 0.0050.388 ± 0.0090.727 (95% CI: 0.682–0.778)LR0.635 ± 0.0050.526 ± 0.0060.800 ± 0.0070.633 ± 0.0080.737(95% CI: 0.694–0.792)MLP0.643 ± 0.0080.581 ± 0.0090.720 ± 0.0100.735 ± 0.0070.743(95% CI: 0.695–0.788)RF0.643 ± 0.0070.600 ± 0.0080.692 ± 0.0090.755 ± 0.0050.767(95% CI: 0.720–0.808)GBDT0.655 ± 0.0090.576 ± 0.0100.760 ± 0.0080.714 ± 0.0060.776(95% CI: 0.740–0.813)LightGBM0.700 ± 0.0060.600 ± 0.0070.840 ± 0.0080.714 ± 0.0090.818(95% CI: 0.776–0.859) Comparative performance of seven machine learning models on the test set (mean ± SD) Fig. 6Construction and assessment of seven machine learning models for classifying GGN using nasopharyngeal microbiome profiling. (A-G) Normalized confusion matrices and corresponding ROC curves for model performance evaluation: (A) SVM, (B) RF, (C) NB, (D) GBDT, (E) LR, (F) LightGBM, and (G) MLP. (H) Comparative analysis of AUC values across all models. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules) Construction and assessment of seven machine learning models for classifying GGN using nasopharyngeal microbiome profiling. (A-G) Normalized confusion matrices and corresponding ROC curves for model performance evaluation: (A) SVM, (B) RF, (C) NB, (D) GBDT, (E) LR, (F) LightGBM, and (G) MLP. (H) Comparative analysis of AUC values across all models. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules) Identifying core nasopharyngeal microbial biomarkers for predicting malignancy GGN using ML To identify specific bacterial taxa crucial for distinguishing between B_GGN and M_GGN, we employed a robust feature selection approach. By using the top-performing LightGBM for feature ranking, we successfully identified six key microbial signatures critical for diagnosing B_GGN and M_GGN: Fusobacterium, Gemella, TM7x, Lachnoanaerobaculum, Rothia, and Veillonella. Compared to the full set of microbial features, these key signatures demonstrated comparable discriminatory power in differentiating B_GGN from M_GGN (Fig. 7A, B). The Kernel Density Estimate (KDE) curve revealed differences in the distribution of six biomarkers between the B_GGN and M_GGN groups. Specifically, Fusobacterium and Gemella exhibited sharper peaks in the M_GGN group, whereas TM7x and Veillonella showed sharper peaks in the B_GGN group. The abundance peak positions of Rothia and Lachnoanaerobaculum were notably different between the two groups (Fig. 7C). Further analysis revealed significant differences in the abundance of these six microbial markers between the two groups (Supplementary Fig. 1). Additionally, we assessed the contributions of these key microbial signatures to model predictions using the SHAP method. The feature importance ranking derived from SHAP values demonstrated strong consistency with the ranking generated by the LightGBM model, further validating their central role in distinguishing between benign and malignant GGN (Fig. 7D). SHAP dependency plots (Fig. 7E, F) were used to illustrate the nonlinear impact of individual features on model output and their interaction effects. When the bacterial abundances are set as Fusobacterium = 87, Rothia = 437, TM7x = 54, and Lachnoanaerobaculum = 12, the output value f(x) exceeds the base value, resulting in a classification leaning toward the “M_GGN” microbiota. Conversely, when the values are Fusobacterium = 359, TM7x = 46, Rothia = 58, Lachnoanaerobaculum = 9.0, and Veillonella = 225, f(x) falls below the base value, shifting the prediction to the “B_GGN” microbiota category. These findings not only clarify the contribution patterns of microbial taxon abundance to model predictions but also provide valuable insights into the biological significance of microbial signatures in distinguishing B_GGN from M_GGN. Fig. 7Identification and evaluation of nasopharyngeal microbial biomarkers for distinguishing B_GGN and M_ GGN. (A) Feature importance bar chart of microbial taxa based on LightGBM model analysis. (B) ROC curve comparison using all microbial features versus top 6 selected features in the test set. (C) KDE curves of the B_GGN and M_GGN groups. The x-axis represents the relative abundance of bacteria, and the y-axis indicates the probability density. The area under each curve equals 1. A greater divergence between the two curves, (e.g. separation of peak positions or distinct curve shapes) suggests more significant differences in the abundance of corresponding bacteria between the two groups. (D) SHAP value-based heatmap visualization of microbial feature importance across sample types. (E) SHAP value interpretation of model predictions for M_GGN classification. (F) SHAP value interpretation of model predictions for B_GGN classification. (SHAP visualization parameters: features are ranked by their mean absolute SHAP values; positive SHAP values indicate increased prediction probability for malignancy, while negative values suggest decreased probability. B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules) Identification and evaluation of nasopharyngeal microbial biomarkers for distinguishing B_GGN and M_ GGN. (A) Feature importance bar chart of microbial taxa based on LightGBM model analysis. (B) ROC curve comparison using all microbial features versus top 6 selected features in the test set. (C) KDE curves of the B_GGN and M_GGN groups. The x-axis represents the relative abundance of bacteria, and the y-axis indicates the probability density. The area under each curve equals 1. A greater divergence between the two curves, (e.g. separation of peak positions or distinct curve shapes) suggests more significant differences in the abundance of corresponding bacteria between the two groups. (D) SHAP value-based heatmap visualization of microbial feature importance across sample types. (E) SHAP value interpretation of model predictions for M_GGN classification. (F) SHAP value interpretation of model predictions for B_GGN classification. (SHAP visualization parameters: features are ranked by their mean absolute SHAP values; positive SHAP values indicate increased prediction probability for malignancy, while negative values suggest decreased probability. B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules) Validating the M_GGN specificity of core nasopharyngeal microbial signatures using external data Based on the disease-sharing mechanisms uncovered by the microbiome Cross-Pathological Network Interaction Theory, this study used three non-GGN-associated disease cohorts from public databases—nasopharyngeal carcinoma (17 patients vs. 9 HC), asthma (63 patients vs. 82 HC), and bronchiectasis (47 patients vs. 43 HC)—as external validation sets to systematically evaluate the disease specificity of candidate microbial biomarkers through cross-disease cohort comparisons. The results showed a significant decline in the model’s performance for non-GGN-associated diseases, with AUC values in each cohort being substantially lower than those of the GGN prediction model. Notably, the AUC values were 0.808 (95% CI: 0.769–0.850), 0.681 (95% CI: 0.631–0.729), and 0.676 (95% CI: 0.630–0.719) for the nasopharyngeal carcinoma, asthma, and bronchiectasis cohorts, respectively (Fig. 8A, B). These findings indicated that GGN exhibited distinct microbial community characteristics and that the identified nasopharyngeal microbial markers demonstrated high specificity in distinguishing between benign and malignant GGN, further highlighting their potential diagnostic value. Comparative analysis with clinical models to validate the reliability of core nasopharyngeal microbial signatures The Mayo Clinic Model is extensively used to predict the risk of malignancy in pulmonary nodule, demonstrating robust predictive performance across various clinical scenarios. To assess the performance of the LightGBM model, which is based on nasopharyngeal microbiota features, in predicting the malignant risk of GGN, we compared it with the classic Mayo Clinic Model. The results showed that LightGBM demonstrated superior performance compared to the Mayo Clinic Model in independently predicting GGN malignancies, achieving an AUC of 0.808 (95% CI: 0.769–0.850) (Fig. 8C). Furthermore, when nasopharyngeal microbiota features were integrated as complementary information into the Mayo Clinic Model, its predictive performance was further enhanced, increasing the AUC value to 0.835 (95% CI: 0.801–0.873) (Fig. 8D). These findings indicated that microbiota features exhibited high reliability, excelling not only in independent prediction models but also effectively enhancing traditional clinical models when combined. This highlights the potential of microbiota-based models for assessing GGN malignancy risk and suggests that our LightGBM model could serve as a valuable complementary tool for clinical diagnosis. Development of an online platform for predicting GGN malignancy To transform a static machine learning model into a dynamic clinical decision support system, we integrated the LightGBM machine learning framework with the SHAP method. This integration resulted in the development of a GGN malignancy risk prediction platform based on nasopharyngeal microbial data. A key innovation is the implementation of SHAP values, which provide a quantitative assessment of the contributions of features to model predictions. The system calculates SHAP values for each microbial marker and visually represents their marginal effects on risk prediction ( http://124.223.3.36:8084/). As shown in Fig. 8E, the platform features an intuitive dual-panel interface optimized for clinical usability. The left panel serves as a data input hub for patient microbiome profiles, whereas the right panel is strategically divided into two functional domains. The upper domain provides real-time malignancy risk probability estimates generated by the LightGBM algorithm, whereas the lower domain presents an interactive feature importance visualization, detailing both the magnitude and direction (positive/negative influence) of the contribution of each microbial feature to the prediction. This architecture not only ensures predictive accuracy but also enhances clinical interpretability through transparent feature attribution, thereby enabling data-driven clinical decision-making. Fig. 8Analysis of specificity and sensitivity for the LightGBM model based on the nasopharyngeal microbiome using external validation groups. (A) ROC curves for the LightGBM model’s performance in external validation groups (nasopharyngeal carcinoma, bronchiectasis, and asthma) were compared with GGN. (B) Comparative analysis of AUC values across different disease cohorts. (C) Evaluating the performance of the Mayo Clinic model against the LightGBM model. (D) Evaluation of predictive performance: nasopharyngeal-enhanced Mayo Clinic model compared to the original Mayo Clinic model. (E) Interface demonstration of the online platform for GGN malignancy probability prediction Analysis of specificity and sensitivity for the LightGBM model based on the nasopharyngeal microbiome using external validation groups. (A) ROC curves for the LightGBM model’s performance in external validation groups (nasopharyngeal carcinoma, bronchiectasis, and asthma) were compared with GGN. (B) Comparative analysis of AUC values across different disease cohorts. (C) Evaluating the performance of the Mayo Clinic model against the LightGBM model. (D) Evaluation of predictive performance: nasopharyngeal-enhanced Mayo Clinic model compared to the original Mayo Clinic model. (E) Interface demonstration of the online platform for GGN malignancy probability prediction Correlation between nasopharyngeal microbiota and clinical characteristics of GGN Based on the aforementioned findings, we investigated the relationship between differences in microbial species and GGN disease states. First, MHI (Fig. 9A) and MDI (Fig. 9B) analyses revealed that the degree of microbiota dysbiosis was significantly more pronounced in the M_GGN group compared to the B_GGN group. Subsequently, we selected effective clinical factors through Variance Inflation Factor analysis (Supplementary Table 1) and analyzed the correlation between the top 20 dominant microorganisms and clinical factors. We found a significant correlation between nasopharyngeal microbiota and clinical characteristics, with six selected microbial biomarkers being particularly prominent (Fig. 9C). For example, Fusobacterium exhibit a negative correlation with sex, age, and allergic history. Gemella exhibited a positive correlation with sex, allergic history, and smoking history, but a negative correlation with family tumor history. TM7x showed a negative correlation with the characteristics except for family cancer history. We employed db-RDA to explore the influence of clinical factors on the classification of GGN into benign and malignant categories (Supplementary Fig. 2). This analysis provides a visual representation of the impact of clinical factors on the microbial community structure. These findings suggest that the nasopharyngeal microbiota may play a pivotal role in modulating the benign and malignant phenotypes of GGN and their interactions with clinical factors. Fig. 9Evaluation of the association between clinical characteristics and nasopharyngeal microbiota. (A) Nasopharyngeal microbiome health index. (B) Nasopharyngeal microbiome dysregulation index. (C) A heatmap illustrating the relationship between clinical features and nasopharyngeal genera using Spearman correlation analysis. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules, * 0.01 < P ≤ 0.05, ** 0.001 < P ≤ 0.01, *** P ≤ 0.001) Evaluation of the association between clinical characteristics and nasopharyngeal microbiota. (A) Nasopharyngeal microbiome health index. (B) Nasopharyngeal microbiome dysregulation index. (C) A heatmap illustrating the relationship between clinical features and nasopharyngeal genera using Spearman correlation analysis. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules, * 0.01 < P ≤ 0.05, ** 0.001 < P ≤ 0.01, *** P ≤ 0.001) Co-occurrence network of nasopharyngeal microbiota in benign and malignant GGN Next, we conducted a comprehensive visual analysis of the relationships within the nasopharyngeal microbial communities. Initially, we constructed a correlation network to depict interactions among various taxa within the nasopharyngeal microbiota (Fig. 10A, B). Our research indicated that M_GGN patients harbored a more intricate microbial ecological network, with 208 genera and 858 edges, compared to B_GGN patients, who harbored 213 genera and 791 edges, which may contribute to M_GGN pathogenesis. Subsequently, we performed a network analysis to map the associations between the six GGN malignancy-predictive microbial biomarkers and the 50 most abundant microbiota taxa (Fig. 10C, D). To quantitatively assess the linear relationships among these microbial markers, we conducted Pearson correlation coefficient analysis, which provided a detailed description and evaluation of their interactions (Supplementary Fig. 3). Biological pathways of nasopharyngeal microbiota in benign and malignant GGN To further explore the potential biological relationships between nasopharyngeal microbiota data and the benign or malignant phenotypes of GGN, we used PICRUSt2 for functional prediction analysis. Using the COG (Supplementary Fig. 4) and KEGG databases, we predicted the differences in metabolic pathways and orthologous groups during the pathogenesis of B_GGN and M_GGN (Fig. 10E, F). KEGG Orthology (KO) functional enrichment analysis identified distinct functional profiles between the study groups (Fig. 10E). The M_GGN group showed significant upregulation of several functional elements, including segregation and condensation protein A, homoserine dehydrogenase, undecaprenyl-diphosphatase, and protein-tyrosine phosphatase. In contrast, the B_GGN group exhibited preferential enrichment of type I restriction enzyme R subunit. Differential pathway analysis at the KEGG level 3 (Fig. 10F) revealed significant upregulation of specific metabolic pathways in the B_GGN group, particularly the flavonoid biosynthesis, limonene and pinene degradation, and geraniol degradation pathways. These findings suggest that the nasopharyngeal microbiota may contribute to GGN phenotype differentiation by regulating distinct amino acid metabolism and immune-related biological pathways, potentially influencing the development of benign versus malignant characteristics. Fig. 10Microbial community characterization and functional prediction analysis using PICRUSt2. (A) Co-occurrence network analysis of all bacterial taxa in B_GGN patients. (B) Co-occurrence network analysis of all bacterial taxa in M_GGN patients (C) Interaction network of the top 50 abundant bacterial taxa in B_GGN patients. (D) Interaction network of the top 50 abundant bacterial taxa in M_GGN patients. (E) KO analysis revealing significant functional differences between groups. (F) Pathway enrichment analysis under KEGG level 3 classification. (Network visualization parameters: nodes represent bacterial taxa; connecting lines indicate significant associations, with line thickness proportional to interaction strength. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules, * 0.01 < P ≤ 0.05, ** 0.001 < P ≤ 0.01, *** P ≤ 0.001) Microbial community characterization and functional prediction analysis using PICRUSt2. (A) Co-occurrence network analysis of all bacterial taxa in B_GGN patients. (B) Co-occurrence network analysis of all bacterial taxa in M_GGN patients (C) Interaction network of the top 50 abundant bacterial taxa in B_GGN patients. (D) Interaction network of the top 50 abundant bacterial taxa in M_GGN patients. (E) KO analysis revealing significant functional differences between groups. (F) Pathway enrichment analysis under KEGG level 3 classification. (Network visualization parameters: nodes represent bacterial taxa; connecting lines indicate significant associations, with line thickness proportional to interaction strength. (B_GGN: Benign_ground-glass nodules; M_GGN: Malignant_ground-glass nodules, * 0.01 < P ≤ 0.05, ** 0.001 < P ≤ 0.01, *** P ≤ 0.001) Discussion In this multicenter prospective study, we conducted a comprehensive characterization of the respiratory microbiome in GGN patients and predicted its functional potential through 16S rRNA gene sequencing. By integrating multiple explainable ML frameworks, we developed a robust predictive model for GGN malignancy risk and identified a panel of core microbial biomarkers that effectively differentiate between benign and malignant GGN phenotypes. The multi-dimensional role of the microbiome in tumor initiation and progression has made it a promising biomarker [31]. Increasing evidence suggests that the respiratory microbiome may contribute to the development and progression of lung tumors by modulating local immune homeostasis, metabolic microenvironments, and host-microbe interactions [32]. We found significant site specificity in the microbiota of nasopharynx and BALF, which may be closely related to the anatomical structure and microenvironmental gradients (such as oxygen content and mucus secretion) of different segments of the respiratory tract [33]. Notably, statistically significant differences in α and β diversity between M-GGN and B-GGN were observed only in the nasopharyngeal microbiome, while no significant intergroup heterogeneity was observed in the BALF microbiome. This result suggests that in the early stages of lung cancer, the upper respiratory microbial community may reflect pathophysiological changes in the host earlier and more sensitively than the lower respiratory flora, thus possessing superior biomarker potential. Recent studies have gradually revealed the clinical value of the nasopharyngeal microbiome in respiratory diseases. For instance, nasal microbiota transplantation has been shown to reshape the microbial ecology of patients with chronic rhinosinusitis [34], while prediction models based on nasopharyngeal microbiota have significantly improved the early diagnostic efficacy of nasopharyngeal carcinoma [35]. This study further expands in this direction, finding that the nasopharyngeal microbial alpha diversity in M_GGN patients was significantly lower than that in the B_GGN group, consistent with previous reports on reduced microbiome diversity associated with lung cancer [36, 37]. This suggests that lower microbial diversity may be associated with a higher risk of lung cancer. These findings collectively confirm the significant potential of the nasopharyngeal microbiome in predicting the malignant risk of GGN. To identify the optimal predictive model for assessing the malignancy risk of GGN, we performed a comprehensive evaluation of multiple machine learning algorithms, with the LightGBM framework demonstrating superior predictive performance. This finding is consistent with previous reports highlighting LightGBM’s exceptional capability in microbiome-based analyses. For instance, Zeng et al. identified LightGBM as the optimal model for detecting gut microbiota signatures associated with nonalcoholic fatty liver disease [38]. We attribute LightGBM’s superior performance to its distinctive algorithmic advantages, including efficient training processes, a leaf-wise growth strategy, and reduced computational overhead in gain calculation [39]. In a comparative analysis with the established Mayo model, our nasopharyngeal microbiome-based LightGBM model demonstrated enhanced predictive performance in assessing GGN malignancy risk. Biomarkers are playing an increasingly important role in translating basic cancer research into clinical applications [40, 41], with microbial biomarkers emerging as a key area of focus. In this study, we adopted an approach that integrates feature importance from tree models with SHAP values. This method effectively captures nonlinear relationships and interactions while providing model-agnostic interpretability. Through this approach, we identified six core microbial biomarkers: Fusobacterium, Gemella, TM7x, Lachnoanaerobaculum, Rothia, and Veillonella. These microbial signatures have been extensively implicated in lung cancer pathogenesis and progression, with their clinical relevance well-documented in previous research. Among these, Fusobacterium, Gemella, and Lachnoanaerobaculum were confirmed to significantly influence the response to immunotherapy [42–44], whereas Rothia, TM7x, and Veillonella demonstrated substantial value in prognosis assessment and malignant progression [45–47]. Furthermore, to evaluate the disease specificity of the selected microbial biomarkers for pulmonary nodules, this study incorporated non-pulmonary nodule diseases, including nasopharyngeal carcinoma, asthma, and bronchiectasis—which are closely associated with the respiratory microbiome, as a control disease group. A systematic analysis was conducted to assess the specificity of these biomarkers in discriminating the malignancy risk of GGN. Notably, the constructed microbial signature exhibited the highest diagnostic performance for GGN, with significantly lower discriminatory power observed in other respiratory diseases. These findings collectively confirm that the microbial biomarkers identified in this study possess strong clinical specificity and potential for application in the differential diagnosis of pulmonary nodules, offering a novel microbiological basis for enhancing the precision of malignancy risk assessment in GGN. Recognizing that the complexity and cost of comprehensive microbiome analysis could hinder its implementation in resource-limited settings, we have deployed the LightGBM model on an online platform. This platform enables clinicians to simply upload quantitative values of key microbial biomarkers, thereby bypassing the need for complex sequencing data while generating immediate patient risk predictions. Furthermore, to maximize the model’s predictive power and clinical utility, our future research will focus on integrating multi-source data, including microbiome profiles from multiple anatomical sites, radiomic features from LDCT scans, and established clinical risk factors (such as age, nodule location, and cancer history as outlined in the Mayo Clinic model). This integrated model is designed to provide auxiliary malignant risk assessment for indeterminate pulmonary nodules following initial LDCT screening, thereby offering clinicians valuable evidence-based support for subsequent triage and management decisions. Accumulating evidence has confirmed that oral pathogenic microorganisms and their metabolites can translocate and colonize the lower respiratory tract, leading to dysregulation of the pulmonary microenvironment and influencing pathological processes [48]. Using PICRUSt2-based functional prediction analysis, this study has preliminarily revealed the potential biological mechanisms involving microbial communities associated with GGN. The results demonstrated that microbial functions in GGN patients were predominantly enriched in pathways related to amino acid metabolism and immune regulation. Immunosuppression within the tumor microenvironment is one of the core mechanisms driving malignant progression, and targeting immune regulation has become an important strategy in cancer therapy [49]. Existing studies have shown that metabolic pathways such as tryptophan and arginine metabolism can occur in both microorganisms and host cells, and have been confirmed to be associated with poor prognosis in various tumors, including breast cancer, colorectal cancer, and lung cancer. These findings suggest that oral microorganisms may participate in the malignant transformation of GGN by modulating amino acid metabolism and the local tumor immune microenvironment, thereby providing new directions for subsequent mechanistic research. We hereby acknowledge the limitations of this study and propose corresponding strategies for addressing them. Firstly, our cohort was recruited from multiple medical centers across Southwest China. As it is well-established that microbiome composition can be significantly influenced by factors such as ethnicity, geography, and long-term dietary habits, future large-scale, multi-center studies involving more heterogeneous populations are warranted to enhance the generalizability of our findings. Secondly, the sample size in this study remains relatively limited, particularly for BALF samples due to the invasive nature of the collection procedure. Future investigations should aim to expand the cohort through international multi-center, multi-regional, and multi-ethnic collaborations to improve the external validity of our conclusions. Additionally, although standardized protocols were implemented throughout sample collection, DNA extraction, and bioinformatics analysis, potential batch effects or technical biases in the workflow may still have influenced the microbial composition profiles. Furthermore, the absence of detailed histopathological data on specific subtypes of GGN has limited deeper interpretation of the biological mechanisms underlying the associated microbial biomarkers. Future studies incorporating multi-omics integration (e.g., metagenomics and metabolomics) and longer-term longitudinal analyses will help dynamically track temporal changes in the microbiome and elucidate its relationship with long-term GGN progression, thereby providing more comprehensive mechanistic insights. Conclusions This study presents the first systematic investigation of respiratory microbiome characteristics in patients with B_GGN and M_GGN. By integrating microbiome profiling with advanced machine learning algorithms, we developed a high-accuracy predictive model for GGN classification. We identified novel microbial biomarkers and established theoretical frameworks for differentiating GGN phenotypes, offering significant implications for personalized therapeutic strategies. Supplementary Information Below is the link to the electronic supplementary material. Supplementary Material 1 Supplementary Material 1