Lung cancer continues to be the leading cause of cancer-related mortality worldwide. Early detection and a comprehensive understanding of tumor-immune interactions are crucial for improving patient outcomes. This study aimed to develop a novel biomarker panel utilizing peripheral blood transcriptomics and machine learning algorithms for early lung cancer diagnosis, while simultaneously providing insights into tumor-immune crosstalk mechanisms. Leveraging a training cohort (GSE135304), we employed multiple machine learning algorithms to formulate a Lung Cancer Diagnostic Score (LCDS) based on peripheral blood transcriptomic features. The LCDS model's performance was evaluated using the area under the receiver operating characteristic (ROC) curve (AUC) in multiple validation cohorts (GSE42834, GSE157086, and an in-house dataset). Peripheral blood samples were obtained from 20 lung cancer patients and 10 healthy control subjects, representing an in-house cohort recruited at the Sixth People's Hospital of Chengdu. We employed advanced bioinformatics techniques to explore tumor-immune interactions through comprehensive immune infiltration and pathway enrichment analyses. Initial screening identified 844 differentially expressed genes, which were subsequently refined to 87 genes using the Boruta feature selection algorithm. The random forest (RF) algorithm demonstrated the highest accuracy in constructing the LCDS model, yielding a mean AUC of 0.938. Lower LCDS values were significantly associated with elevated immune scores and increased CD4+ and CD8+ T-cell infiltration, indicative of enhanced antitumor-immune responses. Higher LCDS scores correlated with activation of hypoxia, peroxisome proliferator-activated receptor (PPAR), and Toll-like receptor (TLR) signaling pathways, as well as reduced DNA damage repair pathway scores. Our study presents a novel, machine learning-derived peripheral blood transcriptomic biomarker panel with potential applications in early lung cancer diagnosis. The LCDS model not only demonstrates high accuracy in distinguishing lung cancer patients from healthy individuals but also offers valuable insights into tumor-immune interactions and underlying cancer biology. This approach may facilitate early lung cancer detection and contribute to a deeper understanding of the molecular and cellular mechanisms underlying tumor-immune crosstalk. Furthermore, our findings on the relationship between LCDS and immune infiltration patterns may have implications for future research on therapeutic strategies targeting the immune system in lung cancer.