Background and Aims: Depression is one of the most important global challenges in the field of psychological disorders. However, timely diagnosis of depression requires relatively comprehensive data information from the target population and often delays timely intervention. Advances in artificial intelligence (AI) provide developers with tools to identify impairments through patterns and objective data. In this article, the effectiveness of artificial intelligence models in predicting depression in the student population, with the aim of improving early diagnosis, has been investigated. Methods: This study proposes developing a depression detection model using advanced machine learning methods. The research utilized 'Student Depression Dataset' from Kaggle. Data preprocessing was led to handle missing values, encode categorical variables, and normalize the data. Feature selection was carefully performed to enhance model performance. This study provided powerful ensemble-based classification algorithms, containing Random Forest and eXtreme Gradient Boosting (XGBoost), alongside RBF SVM and K-Nearest Neighbors (KNN), to create and estimate prediction models for depression detection. Results: In this research, among the applied models, the random forest algorithm attained good performance in predicting depression. It achieved an accuracy of ۸۴.۹۶%, a precision of ۸۵.۷۹%, a recall of ۸۹.۰۷%, and an F۱-score of ۸۷.۴۰%, demonstrating its robustness and reliability. Additionally, the Random Forest model attained a high ROC AUC score of ۰.۹۲۰۳, indicating excellent discriminatory ability in depression detection compared to other models. Conclusion:
Machine learning shows significant potential in predicting depression among student populations and provides a basis for early intervention. Further research in this area by combining a variety of models and using these models in a variety of human populations will give us more accurate results in the early detection of mental disorders.