Adolescent idiopathic scoliosis (AIS) can cause abnormal body posture, which has a negative impact on the overall posture. Therefore, timely prevention and early treatment are extremely important. The purpose of this study is to build an early warning model of AIS risk, so as to provide guidance for accurately identifying early high-risk AIS children and adolescents. We conducted a retrospective study of 1732 children and adolescents with or without AIS who underwent physical examination in Longgang District Central Hospital of Shenzhen (LDCHS queue) from January 2019 to October 2022 and 1581 children and adolescents with or without AIS in Shenzhen People Hospital (January 2018 to December 2022) as external validation queues (SPH queue). The random forest model (RFM), support vector machine model, artificial neural network model (ANNM), decision tree model (DTM), and generalized linear model (GLM) were used to build AIS model for children and adolescents. The predictive efficacy of 5 machine learning models was evaluated by receiver operating characteristic curve and decision curve analysis. For screening candidate predictors of AIS, the ratio of sitting height to standing height (ROSHTSH), angle of lumbar rotation, scapular tilt (ST), shoulder-height difference (SHD), lumbar concave (LC), pelvic tilt (PT) and angle of thoracolumbar rotation (AOTR) can be used as a potential predictor of AIS. The effectiveness of the prediction model constructed by the 5 machine learning algorithms was between (area under the curve [AUC]: 0.767, 95% confidence interval [CI]: 0.710–0.824) and (AUC: 0.899, 95% CI: 0.842–0.956) in the training set and internal verification set, respectively. Among them, the ANNM was equipped with the best prediction effectiveness (training set: AUC: 0.899, 95% CI: 0.842–0.956) and (internal verification set: AUC: 0.897, 95% CI: 0.842–0.952). The prediction model of AIS based on machine learning algorithm can achieve satisfactory prediction efficiency, among which ANNM is the best, which can be used to guide clinicians in diagnosis and treatment and improve the prognosis of AIS children and adolescents.