ObjectiveThis study aims to precisely model the nonlinear relationship between university students’ literature reading preferences (LRP) and their levels of anxiety and depression using a multilayer perceptron (MLP) to identify reading-related risk factors affecting anxiety and depression among university students.MethodsIn this cross-sectional study, an internet-based questionnaire was conducted among 2,092 undergraduate students (aged 18–22, 62.7% female, from seven provinces in China). Participants completed a customized questionnaire on their LRP, followed by standardized assessments of anxiety and depression using the Generalized Anxiety Disorder 7-item Scale and the Beck Depression Inventory, respectively. An MLP with residual connections was employed to establish the nonlinear relationship between LRP and anxiety and depression.ResultsThe MLP model achieved an average accuracy of 86.8% for predicting non-anxious individuals and 81.4% for anxious individuals. In the case of depression, the model’s accuracy was 90.1% for non-depressed individuals and 84.1% for those with depression. SHAP value analysis identified “Tense/Suspenseful-Emotional Tone,” “War and Peace-Thematic Content,” and “Infrequent Reading-Reading Habits” as the top contributors to anxiety prediction accuracy. Similarly, “Sad-Emotional Tone Preference,” “Emotional Depictions-Thematic Content,” and “Thought-Provoking-Emotional Tone” were the primary contributors to depression prediction accuracy.ConclusionThe MLP accurately models the nonlinear relationship between LRP and mental health in university students, indicating the significance of specific reading preferences as risk factors. The study underscores the importance of literature emotional tone and themes in mental health. LRP should be integrated into psychological assessments to help prevent anxiety and depression among university students.