Background: The sleep quality of medical staff was severely affected during COVID-19, but the factors influencing the sleep quality of frontline staff involved in medical assistance remained unclear, and screening tools for their sleep quality were lacking. Methods: From June 25 to July 14, 2022, we conducted an Internet-based cross-sectional survey. The Pittsburgh Sleep Quality Index (PSQI), a self-designed general information questionnaire, and a questionnaire regarding the factors influencing sleep quality were combined to understand the sleep quality of frontline medical staff in Fujian Province supporting Shanghai in the past month. A chi-square test was used to compare participant characteristics, and multivariate unconditional logistic regression analysis was used to determine the predictors of sleep quality. Stratified sampling was used to divide the data into a training test set (n = 1061, 80%) and an independent validation set (n = 265, 20%). Six models were developed and validated using logistic regression, artificial neural network, gradient augmented tree, random forest, naive Bayes, and model decision tree. Results: A total of 1326 frontline medical staff were included in this survey, with a mean PSQI score of 11.354 ± 4.051. The prevalence of poor sleep quality was 80.8% (n = 1072, PSQI >7). Six variables related to sleep quality were used as parameters in the prediction model, including type of work, professional job title, work shift, weight change, tea consumption during assistance, and basic diseases. The artificial neural network (ANN) model produced the best overall performance with area under the curve, accuracy, sensitivity, specificity, precision, F1 score, and kappa of 71.6%, 68.7%, 66.7%, 69.2%, 34.0%, 45.0%, and 26.2% respectively. Conclusions: In this study, the ANN model, which demonstrated excellent predictive efficiency, showed potential for application in monitoring the sleep quality of medical staff and provide some scientific guidance suggestions for early intervention.