To develop a machine learning diagnostic model based on MMP7 and other serological testing indicators for early and efficient diagnosis of biliary atresia (BA). A retrospective analysis was conducted on patient information from those hospitalized for pathological jaundice at Beijing Children's Hospital between January 1, 2019, and December 31, 2023. Patients with serum MMP7, liver stiffness measurements, and other routine serological tests were included in the study. Six machine learning models were constructed, including logistic regression (LR), random forest (RF), decision tree (DET), support vector machine classifier (SVC), neural network (MLP), and extreme gradient boosting (XGBoost), to diagnose BA. The area under the receiver operating characteristic curve was used to evaluate the diagnostic efficacy of the various models. A total of 98 patients were included in the study, comprising 64 BA patients and 34 patients with other cholestatic liver diseases. Among the six machine learning models, the XGBoost algorithm model and RF algorithm model achieved the best predictive performance, with an AUROC of nearly 100% in both the training and validation sets. In the training set, these two algorithm models achieved an accuracy, precision, recall, F1 score, and AUROC of 1. Through model interpretation analysis, serum MMP7 levels, serum GGT levels, and acholic stools were identified as the most important indicators for diagnosing BA. The nomogram constructed based on the XGBoost algorithm model also demonstrated convenient and efficient diagnostic efficacy. Machine learning models, especially the XGBoost algorithm and RF algorithm models, constructed based on preoperative serum MMP7 and serological tests can diagnose BA more efficiently and accurately. The most important influencing factors for diagnosis are serum MMP7, serum GGT, and acholic stools.