Prediction of college student psychological state based on deep learning framework combining the improved Whale Optimization Algorithm and LSTM Authors: Xiaohan Sun, Hanhui Liu Published: 2026 ABSTRACT In intelligent education, accurate prediction of college students’ psychological states is crucial for teaching quality improvement and mental health interventions. Psychological state data with temporal dependency and nonlinearity limits traditional machine learning, while Long Short-Term Memory (LSTM) is sensitive to hyperparameters and prone to premature convergence. To solve these problems, this paper proposes a CNWOA-LSTM framework combining an improved Whale Optimization Algorithm (WOA) with LSTM: chaotic initialization is introduced to enhance population diversity and global search ability, and a niche operator is added to alleviate premature convergence; the improved WOA optimizes key LSTM hyperparameters (hidden units, learning rate, dropout rate, batch size). Experiments are conducted on a public kaggle dataset of college students’ behavioral features, learning interaction data and psychological assessment indicators. CNWOA-LSTM is compared with traditional machine learning models (SVM, Random Forest, GBDT), classical deep learning models (CNN, Transformer, GRU, BiLSTM), and meta-heuristic optimized LSTM models (DE-LSTM, HHO-LSTM, MPA-LSTM, AOA-LSTM, RSA-LSTM). Results show CNWOA-LSTM achieves 93.64% accuracy, 9.33% and 6.63% higher than original LSTM and standard WOA-LSTM respectively, and 5.21%–7.34% higher than other meta-heuristic optimized LSTM models, verifying its effectiveness for psychological state prediction. Introduction In recent years, deep learning has emerged as a powerful tool in the field of psychological state prediction for college students, bringing revolutionary changes to the accurate perception and dynamic monitoring of students’ mental conditions. Unlike traditional shallow machine learning methods, deep learning algorithms—such as Long Short-Term Memory (LSTM), Convolutional Neural Networks (CNNs)1, and attention-based models—possess strong capabilities in feature automatic extraction and complex temporal dependency modeling2–5. These advantages enable them to effectively process multi-modal data related to college students’ psychological states, including behavioral logs, physiological signals, and textual expressions, thereby overcoming the limitations of traditional assessment methods such as subjectivity and low temporal resolution. By capturing subtle changes in students’ emotional, cognitive, and motivational states in real time, deep learning not only improves the accuracy and timeliness of psychological state prediction but also provides scientific support for the formulation of personalized and precision-oriented educational guidance strategies, laying a solid technical foundation for the digital transformation of Ideological and Political Education (IPE) in colleges and universities6,7. With the rapid advancement of information technology, higher education is undergoing a profound transformation toward digitalization and intelligence. In this process, Ideological and Political Education (IPE) has been increasingly emphasized as a fundamental approach to cultivating students’ values, moral awareness, and social responsibility8–11. As an essential component of classroom ecology, students’ psychological states play a decisive role in shaping learning outcomes. Psychological engagement, emotional responses, and cognitive acceptance not only reflect students’ learning effectiveness but also influence the internalization of ideological and political concepts12–14. Therefore, accurately perceiving and predicting students’ psychological states has become a crucial prerequisite for implementing student-centered and precision-oriented IPE teaching15–18. However, the psychological states of college students in classroom environments are characterized by strong dynamics, nonlinearity, and concealment. Traditional assessment approaches, such as post-class questionnaires or occasional teacher observations, are often limited by subjectivity and temporal delay, making it difficult to capture real-time emotional fluctuations during instruction19–22. To overcome these shortcomings, data-driven methods based on artificial intelligence have been increasingly introduced into educational research. By leveraging students’ behavioral logs, learning interactions, and physiological signals, intelligent models can uncover latent psychological patterns that are difficult to observe directly23–26. Among various deep learning models, the Long Short-Term Memory (LSTM) network has demonstrated remarkable performance in modeling sequential and time-dependent data. Its gating mechanism effectively alleviates the vanishing gradient problem and enables the capture of long-term dependencies in time-series educational data, such as learning trajectories and emotional evolution27–30. Consequently, LSTM has been widely applied to emotion recognition, engagement analysis, and psychological state prediction in educational contexts. Nevertheless, the predictive performance of LSTM is highly dependent on the configuration of its hyperparameters, including the number of hidden units, learning rate, dropout rate, and batch size31–34. Improper parameter settings may lead to slow convergence, overfitting, or suboptimal prediction accuracy. To address the challenge of hyperparameter optimization, meta-heuristic algorithms have attracted considerable attention due to their gradient-free nature and strong global search capability. As a classic sequential deep learning model, Long Short-Term Memory (LSTM) has outstanding advantages in mining time-series psychological data features and is widely adopted for temporal state prediction tasks. Algorithms such as Particle Swarm Optimization (PSO), Grey Wolf Optimizer (GWO), and Whale Optimization Algorithm (WOA) have been successfully applied to optimize neural network structures and training parameters35–38. Among them, WOA, inspired by the bubble-net hunting strategy of humpback whales, exhibits a simple structure and efficient convergence behavior39–42. In recent years, numerous improved variants of WOA have been proposed to optimize its search mechanism and solve practical optimization bottlenecks43,44. However, when dealing with high-dimensional and complex optimization problems such as LSTM hyperparameter tuning, the standard WOA still suffers from inherent limitations, including insufficient population diversity and premature convergence in later iterations45–48. These issues restrict its ability to explore the global optimum effectively. Motivated by these observations, this paper proposes a novel hybrid framework named CNWOA-LSTM, which integrates an improved Whale Optimization Algorithm with an LSTM network for college students’ psychological state prediction in IPE classrooms. Specifically, two enhancement strategies are introduced into the standard WOA. First, a chaotic initialization operator is employed to replace random population initialization. By exploiting the ergodicity and randomness of chaotic mapping, the initial whale population is more uniformly distributed in the search space, thereby strengthening global exploration capability in the early optimization stage49–52. Second, a niche operator is incorporated to preserve population diversity during evolution. By dividing individuals into multiple subpopulations based on fitness similarity, the niche mechanism effectively suppresses domination by elite individuals and mitigates premature convergence, enabling the algorithm to explore multiple promising regions simultaneously53–56. The improved CNWOA is then used to automatically optimize key LSTM hyperparameters, leading to enhanced predictive performance and robustness57–66. In order to comprehensively evaluate the effectiveness of the proposed method, a publicly available IPE classroom psychological state dataset67 was used, including behavioral observations, learning interaction records, and physiological response characteristics. As shown in 1, the proposed CNWOA-LSTM model is systematically compared with traditional machine learning models (SVM, RF, and GBDT), representative deep learning models (CNN, Transformer, GRU, and BiLSTM), and LSTM models optimized by other advanced meta-heuristic algorithms, such as DE, HHO, MPA, AOA, and RSA. Experimental results demonstrate that the proposed method consistently outperforms baseline models in terms of Accuracy, F1-score, and AUC, highlighting its effectiveness and practical value for intelligent psychological state perception in IPE teaching scenarios. The main contributions of this paper can be summarized as follows: A novel hybrid prediction framework, CNWOA-LSTM, is proposed for modeling and predicting college students’ psychological states in IPE classrooms, effectively integrating multi-modal educational data with deep learning.An improved Whale Optimization Algorithm is developed by incorporating chaotic initialization and niche operators, which significantly enhances population diversity, global search ability, and optimization robustness.Extensive experiments on a public IPE psychological state dataset demonstrate the superiority of the proposed method over traditional machine learning models, deep learning models, and other meta-heuristic optimized LSTM variants, verifying its applicability in real educational practice.The remainder of this paper is organized as follows. The section “Related work” reviews related work on psychological state prediction and meta-heuristic optimization. The section “Methodology” introduces the proposed CNWOA algorithm and the CNWOA-LSTM framework in detail. The section “Experiment and analysis” presents experimental settings and result analysis. Finally, the section “Conclusion” concludes the paper and discusses future research directions.Fig. 1Overall architecture of the CNWOA-LSTM framework. A novel hybrid prediction framework, CNWOA-LSTM, is proposed for modeling and predicting college students’ psychological states in IPE classrooms, effectively integrating multi-modal educational data with deep learning. A novel hybrid prediction framework, CNWOA-LSTM, is proposed for modeling and predicting college students’ psychological states in IPE classrooms, effectively integrating multi-modal educational data with deep learning. An improved Whale Optimization Algorithm is developed by incorporating chaotic initialization and niche operators, which significantly enhances population diversity, global search ability, and optimization robustness. An improved Whale Optimization Algorithm is developed by incorporating chaotic initialization and niche operators, which significantly enhances population diversity, global search ability, and optimization robustness. Extensive experiments on a public IPE psychological state dataset demonstrate the superiority of the proposed method over traditional machine learning models, deep learning models, and other meta-heuristic optimized LSTM variants, verifying its applicability in real educational practice. Extensive experiments on a public IPE psychological state dataset demonstrate the superiority of the proposed method over traditional machine learning models, deep learning models, and other meta-heuristic optimized LSTM variants, verifying its applicability in real educational practice. Overall architecture of the CNWOA-LSTM framework. Related work This section systematically reviews three interrelated research areas: psychological state analysis in Ideological and Political Education (IPE), deep learning approaches for sequential psychological modeling, and meta-heuristic optimization techniques for Long Short-Term Memory (LSTM) models. To provide a comprehensive and comparative overview of existing studies, we summarize representative works in Table 1, highlighting their core methodologies, key findings, advantages, and limitations.Table 1Summary of representative studies in related research areas.Research AreaModel/MethodCore MethodologyKey FindingsAdvantages and LimitationsPsychological State Analysis in IPETraditional ScalesSCL-90, self-report questionnairesProvides comprehensive assessment of overall psychological status68Advantages: Intuitive, easy to implementLimitations: High subjectivity, delayed feedback, low temporal resolutionClassroom ObservationQualitative instructor assessmentCaptures contextual information about classroom interactions69Advantages: Rich contextual insightsLimitations: Labor-intensive, prone to observer biasSVMHandcrafted behavioral featuresEffective for binary emotional state classification70Advantages: Good generalization on small datasetsLimitations: Relies on manual feature engineering, poor temporal modelingRandom ForestMultimodal behavioral featuresRobust performance in student engagement detection8Advantages: Robust to noise, interpretable feature importanceLimitations: Static model, cannot capture sequential dependenciesDeep Learning for Sequential Psychological ModelingStandard LSTMSingle-modal sequential dataOutperforms traditional methods in temporal data analysis27Advantages: Models long-term temporal dependenciesLimitations: Sensitive to hyperparameters, single-modal limitationCNN-LSTMSpatial-temporal feature fusionImproved performance in multimodal emotion recognition71Advantages: Extracts both spatial and temporal featuresLimitations: Fixed receptive field, limited global context modelingAttention-LSTMSelf-attention mechanismEnhanced ability to focus on critical time steps72Advantages: Improved interpretability, better performance on long sequencesLimitations: High computational cost, overfitting risk on small datasetsBiLSTMBidirectional temporal modelingCaptures both past and future contextual information28Advantages: Comprehensive temporal context modelingLimitations: Increased model complexity, slower inferenceMeta-heuristic Optimization for LSTM ModelsPSO-LSTMParticle swarm optimizationReduces manual hyperparameter tuning effort73Advantages: Fast convergence, easy implementationLimitations: Prone to premature convergence, weak local searchGWO-LSTMGrey wolf optimizationBalances exploration and exploitation capabilities74Advantages: Good global search abilityLimitations: Slow convergence in high-dimensional spacesWOA-LSTMWhale optimization algorithmSuperior performance compared to PSO and GWO in many tasks75Advantages: Simple structure, few control parametersLimitations: Premature convergence, uneven population initializationChaotic WOA-LSTMChaotic mapping enhanced WOAImproves population diversity and global exploration76Advantages: Mitigates premature convergenceLimitations: Limited application in educational psychology domain Table 1Summary of representative studies in related research areas.Research AreaModel/MethodCore MethodologyKey FindingsAdvantages and LimitationsPsychological State Analysis in IPETraditional ScalesSCL-90, self-report questionnairesProvides comprehensive assessment of overall psychological status68Advantages: Intuitive, easy to implementLimitations: High subjectivity, delayed feedback, low temporal resolutionClassroom ObservationQualitative instructor assessmentCaptures contextual information about classroom interactions69Advantages: Rich contextual insightsLimitations: Labor-intensive, prone to observer biasSVMHandcrafted behavioral featuresEffective for binary emotional state classification70Advantages: Good generalization on small datasetsLimitations: Relies on manual feature engineering, poor temporal modelingRandom ForestMultimodal behavioral featuresRobust performance in student engagement detection8Advantages: Robust to noise, interpretable feature importanceLimitations: Static model, cannot capture sequential dependenciesDeep Learning for Sequential Psychological ModelingStandard LSTMSingle-modal sequential dataOutperforms traditional methods in temporal data analysis27Advantages: Models long-term temporal dependenciesLimitations: Sensitive to hyperparameters, single-modal limitationCNN-LSTMSpatial-temporal feature fusionImproved performance in multimodal emotion recognition71Advantages: Extracts both spatial and temporal featuresLimitations: Fixed receptive field, limited global context modelingAttention-LSTMSelf-attention mechanismEnhanced ability to focus on critical time steps72Advantages: Improved interpretability, better performance on long sequencesLimitations: High computational cost, overfitting risk on small datasetsBiLSTMBidirectional temporal modelingCaptures both past and future contextual information28Advantages: Comprehensive temporal context modelingLimitations: Increased model complexity, slower inferenceMeta-heuristic Optimization for LSTM ModelsPSO-LSTMParticle swarm optimizationReduces manual hyperparameter tuning effort73Advantages: Fast convergence, easy implementationLimitations: Prone to premature convergence, weak local searchGWO-LSTMGrey wolf optimizationBalances exploration and exploitation capabilities74Advantages: Good global search abilityLimitations: Slow convergence in high-dimensional spacesWOA-LSTMWhale optimization algorithmSuperior performance compared to PSO and GWO in many tasks75Advantages: Simple structure, few control parametersLimitations: Premature convergence, uneven population initializationChaotic WOA-LSTMChaotic mapping enhanced WOAImproves population diversity and global exploration76Advantages: Mitigates premature convergenceLimitations: Limited application in educational psychology domain Summary of representative studies in related research areas. Advantages: Intuitive, easy to implement Limitations: High subjectivity, delayed feedback, low temporal resolution Advantages: Rich contextual insights Limitations: Labor-intensive, prone to observer bias Advantages: Good generalization on small datasets Limitations: Relies on manual feature engineering, poor temporal modeling Advantages: Robust to noise, interpretable feature importance Limitations: Static model, cannot capture sequential dependencies Advantages: Models long-term temporal dependencies Limitations: Sensitive to hyperparameters, single-modal limitation Advantages: Extracts both spatial and temporal features Limitations: Fixed receptive field, limited global context modeling Advantages: Improved interpretability, better performance on long sequences Limitations: High computational cost, overfitting risk on small datasets Advantages: Comprehensive temporal context modeling Limitations: Increased model complexity, slower inference Advantages: Fast convergence, easy implementation Limitations: Prone to premature convergence, weak local search Advantages: Good global search ability Limitations: Slow convergence in high-dimensional spaces Advantages: Simple structure, few control parameters Limitations: Premature convergence, uneven population initialization Advantages: Mitigates premature convergence Limitations: Limited application in educational psychology domain Psychological state analysis in IPE In Ideological and Political Education (IPE), students’ psychological states are widely regarded as an essential indicator of learning effectiveness and value acceptance. Early studies primarily relied on traditional assessment methods, including psychological self-report scales (e.g., SCL-90) and qualitative classroom observations conducted by instructors68,69. Although these approaches provide intuitive insights into students’ mental conditions, they are inherently constrained by subjectivity, delayed feedback, and limited temporal resolution, which makes them unsuitable for capturing rapid psychological fluctuations during classroom instruction19. With the development of educational data mining and learning analytics, researchers have gradually shifted toward quantitative and intelligent approaches. Machine learning techniques such as Support Vector Machines (SVM) and Random Forests (RF) have been applied to classify students’ emotional or psychological states based on behavioral and physiological features8,70. While these methods improve objectivity compared with traditional assessments, they generally rely on handcrafted features and static assumptions, limiting their ability to model complex temporal dependencies in IPE classroom environments. Deep learning for sequential psychological modeling To overcome the limitations of shallow learning models, deep learning methods have been increasingly adopted for analyzing sequential educational data. Among them, the Long Short-Term Memory (LSTM) network has demonstrated significant advantages due to its gated recurrent structure, which enables effective modeling of long-term temporal dependencies while alleviating the vanishing gradient problem27,28. LSTM has been widely used in emotion recognition, engagement analysis, and psychological state prediction tasks, particularly in scenarios involving continuous behavioral logs and physiological signals. Recent studies have further enhanced LSTM-based frameworks by integrating Convolutional Neural Networks (CNNs) or attention mechanisms to extract spatial–temporal features from multimodal educational data, leading to notable improvements in prediction performance71,72,77. Despite these advances, LSTM-based models remain highly sensitive to hyperparameter configurations, such as the number of hidden units, learning rate, batch size, and dropout rate31. Exhaustive tuning strategies, including grid search and random search, are computationally expensive and often ineffective in high-dimensional parameter spaces78. Meta-heuristic optimization for LSTM models Meta-heuristic optimization algorithms have emerged as effective tools for automating hyperparameter tuning in deep learning models. Inspired by natural phenomena, swarm intelligence algorithms such as Particle Swarm Optimization (PSO)79,80, Grey Wolf Optimizer (GWO), and Whale Optimization Algorithm (WOA) have been successfully applied to optimize neural network parameters73–75. Among these methods, WOA has attracted particular attention due to its simple structure, few control parameters, and efficient convergence behavior. However, existing studies indicate that the standard WOA still suffers from several inherent limitations when applied to complex, high-dimensional optimization problems. Random population initialization may lead to uneven coverage of the search space, while population diversity tends to decrease rapidly in later iterations, increasing the risk of premature convergence49,81. These issues restrict the algorithm’s ability to consistently identify high-quality solutions when optimizing LSTM hyperparameters. To address these challenges, various enhancement strategies have been proposed. Chaotic mapping techniques have been widely adopted to improve population initialization by exploiting their ergodic and stochastic properties, thereby enhancing global exploration capability76. In addition, niche-based mechanisms have been introduced to preserve population diversity by encouraging parallel exploration of multiple promising regions in the solution space, effectively mitigating premature convergence82. Although these strategies have shown effectiveness in other optimization contexts, their application to WOA-based LSTM optimization for psychological state prediction in IPE remains limited. Work motivation The motivation of this study stems from the need to develop a robust and intelligent framework that bridges advanced deep learning techniques with the practical requirements of Ideological and Political Education. Although LSTM networks are well suited for modeling the temporal dynamics of students’ psychological states, their performance in real-world IPE classrooms is hindered by the difficulty of hyperparameter optimization and limited robustness across different teaching contexts. Moreover, while the Whale Optimization Algorithm provides a promising meta-heuristic optimization tool, its standard form is constrained by random initialization and insufficient population diversity during evolution. These limitations motivate the development of an enhanced optimization strategy that can better balance global exploration and local exploitation. To this end, this paper proposes a novel CNWOA-LSTM framework, which integrates an improved Whale Optimization Algorithm with an LSTM network for psychological state prediction. Two targeted enhancement mechanisms are introduced: (1) Chaotic Initialization Operator, which replaces random initialization to generate a uniformly distributed initial population and improve early-stage global search efficiency; (2) Niche Operator, which dynamically maintains population diversity by partitioning individuals into subpopulations based on fitness similarity, thereby alleviating premature convergence. By combining these algorithmic improvements with the temporal modeling capability of LSTM, the proposed CNWOA-LSTM framework aims to provide an accurate, robust, and automated solution for predicting college students’ psychological states, supporting intelligent and data-driven decision-making in IPE classrooms. Methodology Problem formulation Within the specific domain of Ideological and Political Education (IPE), a student’s psychological state—particularly their mood—is not a fixed characteristic but a dynamic temporal process. It is shaped by external triggers (e.g., IPE teaching content, ambient environment) and internal factors (e.g., cognitive load, physical condition), requiring a time-series-based modeling approach. To accurately assess students’ mood states during IPE activities, we frame this problem as a supervised sequence classification task. Let \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathcal {D} = \{(\textbf{x}_i, y_i)\}_{i=1}^{1000}$$\end{document} represent the observational dataset, which contains 1000 student samples collected during IPE sessions. For each sample i, the input vector \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{x}_i \in \mathbb {R}^{17}$$\end{document} corresponds to a multimodal feature set with D=17 dimensions. These features integrate physiological signals (collected via biosensors), environmental data, behavioral records, demographic attributes, task metadata, and cognitive load information—excluding non-predictive columns (ID, Time) that only serve as sample identifiers or timestamps. The specific composition and attributes of these features are detailed in Table 2. The target variable \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$y_i \in \mathcal {Y}$$\end{document} denotes the discrete mood state label of the i-th student, where the label space is strictly defined based on the dataset’s actual annotations: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathcal {Y} = \{0: \text {Happy}, 1: \text {Neutral}, 2: \text {Sad}, 3: \text {Anxious}\}$$\end{document}. This label set directly reflects the four core mood categories annotated in the dataset, ensuring alignment between the modeling task and real-world data characteristics.Table 2Feature composition of IPE student mood state dataset.CategoryFeature NameUnit/TypeKey DescriptionPhysiologicalHRV (ms)NumericalHeart Rate Variability, reflects stress/relaxationGSRNumericalGalvanic Skin Response, indicates emotional arousalEEG Power BandsCategoricalBrain activity patterns (1000 unique annotations)Blood Pressure (mmHg)CategoricalCardiovascular response (373 unique values)Oxygen Saturation (%)NumericalBlood oxygen level (95–100%)Heart Rate (BPM)NumericalCardiac frequency (60–99 BPM)Respiration Rate (BPM)NumericalBreathing frequency (12–24 BPM)Skin Temp (°C)NumericalSkin temperature (34–36 °C)EnvironmentalAmbient Noise (dB)NumericalBackground noise (30.02–69.90 dB)BehavioralFocus Duration (s)NumericalSustained attention time (10–299 s)DemographicAgeNumericalStudent age (18–29 years)GenderCategorical(Male/Female/Other)Educational LevelCategorical(High School/Undergraduate/Postgraduate)Study MajorCategorical3 categories (Science/Arts/Engineering)Task MetadataTask TypeCategorical(Lecture/Discussion/Assignment/Exam)Psychological ContextCognitive LoadCategorical3 levels (Low/Moderate/High) Table 2Feature composition of IPE student mood state dataset.CategoryFeature NameUnit/TypeKey DescriptionPhysiologicalHRV (ms)NumericalHeart Rate Variability, reflects stress/relaxationGSRNumericalGalvanic Skin Response, indicates emotional arousalEEG Power BandsCategoricalBrain activity patterns (1000 unique annotations)Blood Pressure (mmHg)CategoricalCardiovascular response (373 unique values)Oxygen Saturation (%)NumericalBlood oxygen level (95–100%)Heart Rate (BPM)NumericalCardiac frequency (60–99 BPM)Respiration Rate (BPM)NumericalBreathing frequency (12–24 BPM)Skin Temp (°C)NumericalSkin temperature (34–36 °C)EnvironmentalAmbient Noise (dB)NumericalBackground noise (30.02–69.90 dB)BehavioralFocus Duration (s)NumericalSustained attention time (10–299 s)DemographicAgeNumericalStudent age (18–29 years)GenderCategorical(Male/Female/Other)Educational LevelCategorical(High School/Undergraduate/Postgraduate)Study MajorCategorical3 categories (Science/Arts/Engineering)Task MetadataTask TypeCategorical(Lecture/Discussion/Assignment/Exam)Psychological ContextCognitive LoadCategorical3 levels (Low/Moderate/High) Feature composition of IPE student mood state dataset. The objective is to learn a nonlinear mapping function1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \mathcal {F}: \mathbb {R}^{T \times D} \rightarrow \mathcal {Y}, \end{aligned}$$\end{document}parameterized by \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\boldsymbol{\theta }$$\end{document}, which includes both network weights and hyperparameters of the LSTM model. The optimal parameter set is obtained by minimizing the categorical cross-entropy loss between the predicted psychological state \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\hat{y}_i = \mathcal {F}(\textbf{X}_i;\boldsymbol{\theta })$$\end{document} and the ground-truth label \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$y_i$$\end{document}. LSTM-based psychological state prediction network Fig. 2Architecture of the LSTM-based psychological state prediction network. Architecture of the LSTM-based psychological state prediction network. Standard Recurrent Neural Networks (RNNs) often suffer from vanishing or exploding gradients when modeling long-term dependencies, which limits their effectiveness in capturing sustained emotional and cognitive changes during an entire IPE class session. To address this limitation, the Long Short-Term Memory (LSTM) network is adopted as the core predictive model, as illustrated in Fig. 2. An LSTM cell regulates information flow through three gating mechanisms: the forget gate \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{f}_t$$\end{document}, input gate \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{i}_t$$\end{document}, and output gate \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{o}_t$$\end{document}. Given the input vector \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{x}_t$$\end{document} at time step t and the previous hidden state \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{h}_{t-1}$$\end{document}, the state update equations are defined as follows:2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \begin{aligned} \textbf{f}_t&= \sigma (\textbf{W}_f[\textbf{h}_{t-1}, \textbf{x}_t] + \textbf{b}_f), \\ \textbf{i}_t&= \sigma (\textbf{W}_i[\textbf{h}_{t-1}, \textbf{x}_t] + \textbf{b}_i), \\ \tilde{\textbf{C}}_t&= \tanh (\textbf{W}_c[\textbf{h}_{t-1}, \textbf{x}_t] + \textbf{b}_c), \\ \textbf{C}_t&= \textbf{f}_t \odot \textbf{C}_{t-1} + \textbf{i}_t \odot \tilde{\textbf{C}}_t, \\ \textbf{o}_t&= \sigma (\textbf{W}_o[\textbf{h}_{t-1}, \textbf{x}_t] + \textbf{b}_o), \\ \textbf{h}_t&= \textbf{o}_t \odot \tanh (\textbf{C}_t), \end{aligned} \end{aligned}$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma (\cdot )$$\end{document} denotes the sigmoid activation function, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\tanh (\cdot )$$\end{document} represents the hyperbolic tangent function, and ⊙ indicates element-wise multiplication. The cell state \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{C}_t$$\end{document} serves as a long-term memory that preserves temporal psychological patterns across the sequence. The hidden state at the final time step \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{h}_T$$\end{document} is passed to a Softmax classifier to estimate the probability distribution over psychological state categories:3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} P(y=k|\textbf{X}) = \text {Softmax}(\textbf{W}_{cls}\textbf{h}_T + \textbf{b}_{cls}). \end{aligned}$$\end{document} Chaotic Niche Whale Optimization Algorithm (CNWOA) Although LSTM networks possess strong temporal modeling capabilities, their predictive performance is highly sensitive to hyperparameter settings, such as the number of hidden units, learning rate, dropout ratio, and batch size. To automatically identify optimal hyperparameter configurations, this study proposes an improved Whale Optimization Algorithm, termed Chaotic Niche Whale Optimization Algorithm (CNWOA). Standard Whale Optimization Algorithm The Whale Optimization Algorithm (WOA) is a population-based meta-heuristic inspired by the bubble-net hunting behavior of humpback whales. Each whale represents a candidate solution (position vector) \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{X}_i = [X_{i,1}, \ldots , X_{i,d}]$$\end{document} in a d-dimensional search space. Let \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{X}^*(t)$$\end{document} denote the best solution found up to iteration t. WOA alternates between exploitation (encircling prey and spiral bubble-net attack) and exploration (random search), controlled by adaptive coefficients. 1) Encircling prey (exploitation). WOA assumes that whales can recognize the position of prey and encircle it. The distance vector and position update are defined as:4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \textbf{D} = \left| \textbf{C}\odot \textbf{X}^*(t) - \textbf{X}(t)\right| , \end{aligned}$$\end{document}5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \textbf{X}(t+1) = \textbf{X}^*(t) - \textbf{A}\odot \textbf{D}, \end{aligned}$$\end{document}where ⊙ denotes the Hadamard product, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{A}$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{C}$$\end{document} are coefficient vectors computed by:6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \textbf{A} = 2a\textbf{r} - a, \quad \textbf{C} = 2\textbf{r}, \end{aligned}$$\end{document}in which \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{r}\sim U(0,1)^d$$\end{document} is a random vector and a decreases linearly from 2 to 0 over iterations:7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} a(t) = 2 - 2\cdot \frac{t}{T_{max}}. \end{aligned}$$\end{document} 2) Bubble-net attacking method (spiral updating, exploitation). To simulate the helix-shaped movement of whales around prey, WOA uses the spiral model:8\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \textbf{X}(t+1) = \textbf{D}' \cdot e^{b l}\cdot \cos (2\pi l) + \textbf{X}^*(t), \end{aligned}$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{D}'=\left| \textbf{X}^*(t)-\textbf{X}(t)\right|$$\end{document}, b is a constant defining the logarithmic spiral shape (typically b=1), and l∼ U(-1,1). 3) Switching mechanism between encircling and spiral behaviors. WOA probabilistically selects between encircling prey and spiral updating:9\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \textbf{X}(t+1)= {\left\{ \begin{array}{ll} \textbf{X}^*(t) - \textbf{A}\odot \textbf{D}, & p < 0.5,\\ \textbf{D}' \cdot e^{b l}\cdot \cos (2\pi l) + \textbf{X}^*(t), & p \ge 0.5, \end{array}\right. } \end{aligned}$$\end{document}where p∼ U(0,1). 4) Search for prey (exploration). When \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$|\textbf{A}| \ge 1$$\end{document}, whales perform global exploration by moving relative to a randomly selected whale \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{X}_{rand}$$\end{document}:10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \textbf{D} = \left| \textbf{C}\odot \textbf{X}_{rand}(t) - \textbf{X}(t)\right| , \end{aligned}$$\end{document}11\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \textbf{X}(t+1) = \textbf{X}_{rand}(t) - \textbf{A}\odot \textbf{D}. \end{aligned}$$\end{document}This mechanism increases population exploration and helps avoid stagnation in local optima. CNWOA: Chaotic initialization and Niche-based diversity preservation Although standard WOA is effective, it may suffer from insufficient initial diversity (due to random initialization) and premature convergence in later iterations. To mitigate these issues, we propose CNWOA by incorporating: (i) chaotic initialization to enhance early global exploration, and (ii) a niche operator to maintain diversity throughout the search process. (i) Chaotic initialization. We adopt the Logistic chaotic map to generate an ergodic sequence:12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} z_{k+1}=\mu z_k(1-z_k), \quad \mu =4, \end{aligned}$$\end{document}and map it to the search bounds:13\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} X_{i,j}(0)=lb_j + z_{i,j}(ub_j-lb_j). \end{aligned}$$\end{document} (ii) Niche operator (fitness sharing). Let the Euclidean distance between whales i and j be \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$d_{ij}=\Vert \textbf{X}_i-\textbf{X}_j\Vert.$$\end{document} A sharing function is defined as:14\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} sh(d_{ij})= {\left\{ \begin{array}{ll} 1-\left( \frac{d_{ij}}{\sigma _{share}}\right) ^\alpha , & d_{ij}<\sigma _{share},\\ 0, & \text {otherwise}, \end{array}\right. } \end{aligned}$$\end{document}and the shared fitness is computed as:15\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} F'_i=\frac{F_i}{\sum _{j=1}^{N} sh(d_{ij})}, \end{aligned}$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$F_i$$\end{document} is the original fitness (e.g., validation accuracy or validation loss), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma _{share}$$\end{document} is the niche radius, and α controls the sharing shape. This mechanism discourages overcrowding near a single peak and enables parallel exploration of multiple promising regions. Algorithm 1Chaotic Niche Whale Optimization Algorithm (CNWOA) Chaotic Niche Whale Optimization Algorithm (CNWOA) CNWOA-LSTM framework integration Figure 1 illustrates the overall workflow of the proposed CNWOA-LSTM framework. The framework begins with multi-modal data acquisition from IPE classrooms, including behavioral observations, physiological measurements, and learning interaction records. After preprocessing steps such as noise removal, normalization, and feature extraction, the data are partitioned into training, validation, and test sets. The CNWOA module then optimizes the LSTM hyperparameter vector θ = [\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$N_{hidden}, \eta$$\end{document}, BatchSize, Dropout] using validation accuracy as the fitness function. Through chaotic initialization and niche-based diversity preservation, CNWOA effectively searches for high-quality hyperparameter configurations. Finally, the optimized LSTM model is trained to learn temporal psychological patterns and output psychological state predictions. These predictions provide real-time feedback for instructors, enabling adaptive teaching strategies and supporting intelligent decision-making in IPE classrooms. Experiment and analysis Experimental environment and parameter settings To ensure reproducibility and fair comparison among different models, all experiments were conducted on a unified computing platform. The software environment was based on Python 3.9, with PyTorch 1.13 employed for deep learning model implementation and Scikit-learn for data preprocessing and performance evaluation. The hardware configuration consisted of an Intel Core i9-13900K CPU, 64 GB DDR5 RAM, and an NVIDIA GeForce RTX 4090 GPU with 24 GB memory, which effectively accelerated the training and optimization of deep learning models. The experimental parameters include two main components: the hyperparameters of the LSTM network and the control parameters of the proposed Chaotic Niche Whale Optimization Algorithm (CNWOA). For LSTM, key hyperparameters to be optimized include the number of hidden units, learning rate, batch size, and dropout rate. CNWOA is responsible for automatically searching for the optimal hyperparameter combination within predefined ranges. The fitness function guiding the optimization process is defined as the classification accuracy on the validation set:16\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \text {Fitness} (\boldsymbol{\theta }) = \frac{1}{|D_{val}|} \sum _{(\textbf{X}, y)\in D_{val}} \mathbb {I}\big (f(\textbf{X}; \boldsymbol{\theta }) = y\big ), \end{aligned}$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\boldsymbol{\theta }$$\end{document} denotes the LSTM hyperparameter vector optimized by CNWOA, f(· ) represents the LSTM predictor, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {I}(\cdot )$$\end{document} is the indicator function. The detailed search space of LSTM hyperparameters and the fixed control parameters of CNWOA are summarized in Table 3.Table 3Hyperparameter search space and CNWOA control settings.CategoryParameterSymbolValue / RangeLSTM HyperparametersHidden Units\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$N_{hidden}$$\end{document}[32, 256] (Integer)Learning Rateη\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$[1\times 10^{-4}, 1\times 10^{-2}]$$\end{document} (Continuous)Batch SizeB\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\{16, 32, 64, 128\}$$\end{document} (Discrete)Dropout Rate\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p_{drop}$$\end{document}[0.1, 0.5] (Continuous)CNWOA ParametersPopulation SizeN50Maximum Iterations\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$T_{max}$$\end{document}100Spiral Constantb1Niche Radius\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma _{share}$$\end{document}0.5 Table 3Hyperparameter search space and CNWOA control settings.CategoryParameterSymbolValue / RangeLSTM HyperparametersHidden Units\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$N_{hidden}$$\end{document}[32, 256] (Integer)Learning Rateη\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$[1\times 10^{-4}, 1\times 10^{-2}]$$\end{document} (Continuous)Batch SizeB\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\{16, 32, 64, 128\}$$\end{document} (Discrete)Dropout Rate\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p_{drop}$$\end{document}[0.1, 0.5] (Continuous)CNWOA ParametersPopulation SizeN50Maximum Iterations\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$T_{max}$$\end{document}100Spiral Constantb1Niche Radius\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma _{share}$$\end{document}0.5 Hyperparameter search space and CNWOA control settings. Parameter sensitivity analysis of CNWOA To address concerns about reproducibility and verify the robustness of the proposed CNWOA, we conducted a systematic sensitivity analysis on its core control parameters. We tested the performance of CNWOA-LSTM under different parameter configurations within reasonable ranges, with the results showing that the model maintains stable performance across a wide range of parameter settings. Specifically: (1) For population size N, values between 30 and 70 yield similar prediction accuracy (fluctuation < 0.8%), with N=50 achieving the optimal balance between search capability and computational efficiency; (2) Maximum iterations \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$T_{max}=100$$\end{document} is sufficient for CNWOA to converge stably, and further increasing iterations does not bring significant performance improvement; (3) Niche radius \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma _{share}$$\end{document} has a moderate impact on performance, with values between 0.3 and 0.7 maintaining high accuracy, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma _{share}=0.5$$\end{document} achieving the best balance between population diversity preservation and convergence speed; (4) The spiral constant b has minimal impact on the optimization results, and the standard value b=1 is sufficient for this task. Overall, the performance fluctuation of CNWOA-LSTM is less than 1.2% across all tested parameter configurations, demonstrating that the parameter settings adopted in this study are robust and the experimental results are highly reproducible. Dataset description To evaluate the effectiveness of the proposed CNWOA-LSTM framework, experiments were conducted on a public psychological state dataset67 for validation. This dataset is specifically constructed for ideological and political education (IPE) scenarios, containing 1000 student samples. It integrates multi-source information closely related to students’ in-class states, including physiological responses (e.g., HRV, GSR, EEG power bands), a single environmental variable (ambient noise), behavioral records (focus duration), demographic attributes (age, gender, educational level, study major), task metadata (IPE activity types), and psychological context (cognitive load). This multi-dimensional composition supports comprehensive and fine-grained modeling of students’ mood states during IPE sessions. There are a total of 17 columns in this dataset that are valid input features. The target variable is the Mood State label, which is categorized into four classes based on actual annotations in the dataset: Happy, Neutral, Sad, and Anxious. These categories accurately reflect typical emotional responses in IPE classrooms—for example, Happy corresponds to positive engagement during group discussions, Neutral to stable attention during theoretical lectures, Anxious to tension during in-class exams, and Sad to low mood when facing difficult learning tasks. Data preprocessing and sequence construction Raw multimodal classroom data inevitably contain noise, scale inconsistencies, and heterogeneous formats. To ensure model robustness and stable convergence, a standardized preprocessing pipeline was employed, including data cleaning, feature transformation, temporal sequence construction, and rigorous model regularization and validation strategies tailored to the characteristics of psychological datasets. Data cleaning and feature parsing All records were first examined for missing or abnormal values. Due to the controlled acquisition process of the public dataset, no large-scale data imputation was required. Complex composite features were decomposed into independent variables when necessary. For example, physiological spectrum features were parsed into distinct frequency-band components to preserve detailed cognitive information. Feature transformation Different preprocessing strategies were applied according to feature types:Z-score normalization was applied to all continuous features to eliminate scale disparities, computed as \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$x'=(x-\mu )/\sigma$$\end{document}.One-hot encoding was used for categorical variables such as academic major and educational level.Label encoding was applied to psychological state categories for supervised learning. Z-score normalization was applied to all continuous features to eliminate scale disparities, computed as \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$x'=(x-\mu )/\sigma$$\end{document}. Z-score normalization was applied to all continuous features to eliminate scale disparities, computed as \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$x'=(x-\mu )/\sigma$$\end{document}. One-hot encoding was used for categorical variables such as academic major and educational level. One-hot encoding was used for categorical variables such as academic major and educational level. Label encoding was applied to psychological state categories for supervised learning. Label encoding was applied to psychological state categories for supervised learning. Temporal sequence generation To capture the temporal evolution of students’ psychological states, a sliding window strategy was adopted to generate LSTM-compatible sequences. Given a chronological feature sequence \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\{\textbf{x}_1, \textbf{x}_2, \dots , \textbf{x}_T\}$$\end{document}, a window size of W=10 and a step size of S=1 were used. Each sample \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{S}_t$$\end{document} was constructed as:17\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \textbf{S}_t = [\textbf{x}_{t-W+1}, \textbf{x}_{t-W+2}, \dots , \textbf{x}_t] \in \mathbb {R}^{W \times D}, \end{aligned}$$\end{document}where D=17 denotes the feature dimension after preprocessing. This transformation enables the LSTM network to learn temporal dependencies across consecutive classroom observations. Dataset partitioning The generated sequence samples were stratified and split into training, validation, and testing sets with a ratio of 70:10:20. Stratified sampling ensures consistent class distribution across subsets, thereby preventing performance bias caused by class imbalance. Model regularization and validation strategy To address the overfitting risk inherent in small and noisy psychological datasets, we implemented a comprehensive regularization and validation framework:Dropout regularization: We inserted dropout layers between LSTM hidden layers and the final fully connected layer with a dropout rate of 0.3, which randomly deactivates a portion of neurons during training to prevent co-adaptation of features.L2 weight decay: We applied L2 regularization with a weight decay coefficient of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$10^{-4}$$\end{document} to all trainable parameters of the LSTM network, which penalizes large weight values and reduces model complexity.Early stopping: We monitored the validation loss during training and stopped the training process early if the validation loss did not decrease for 10 consecutive epochs, which effectively prevents the model from overfitting to the training data.5-fold cross-validation: In addition to the hold-out validation set, we performed 5-fold stratified cross-validation on the training set to further evaluate the model’s generalization ability. The final reported results are the average values across all folds, which provides a more reliable and unbiased estimate of model performance.These combined strategies effectively mitigate the overfitting problem caused by the limited size and inherent noise of psychological datasets, ensuring that the proposed CNWOA-LSTM framework maintains stable and reliable performance on unseen test data. Dropout regularization: We inserted dropout layers between LSTM hidden layers and the final fully connected layer with a dropout rate of 0.3, which randomly deactivates a portion of neurons during training to prevent co-adaptation of features. Dropout regularization: We inserted dropout layers between LSTM hidden layers and the final fully connected layer with a dropout rate of 0.3, which randomly deactivates a portion of neurons during training to prevent co-adaptation of features. L2 weight decay: We applied L2 regularization with a weight decay coefficient of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$10^{-4}$$\end{document} to all trainable parameters of the LSTM network, which penalizes large weight values and reduces model complexity. L2 weight decay: We applied L2 regularization with a weight decay coefficient of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$10^{-4}$$\end{document} to all trainable parameters of the LSTM network, which penalizes large weight values and reduces model complexity. Early stopping: We monitored the validation loss during training and stopped the training process early if the validation loss did not decrease for 10 consecutive epochs, which effectively prevents the model from overfitting to the training data. Early stopping: We monitored the validation loss during training and stopped the training process early if the validation loss did not decrease for 10 consecutive epochs, which effectively prevents the model from overfitting to the training data. 5-fold cross-validation: In addition to the hold-out validation set, we performed 5-fold stratified cross-validation on the training set to further evaluate the model’s generalization ability. The final reported results are the average values across all folds, which provides a more reliable and unbiased estimate of model performance. 5-fold cross-validation: In addition to the hold-out validation set, we performed 5-fold stratified cross-validation on the training set to further evaluate the model’s generalization ability. The final reported results are the average values across all folds, which provides a more reliable and unbiased estimate of model performance. Performance evaluation metrics To comprehensively evaluate the multi-class prediction performance of the proposed CNWOA-LSTM framework, we employ four widely used classification metrics: Accuracy (Acc), Precision (Pre), Recall (Rec), and F1-score (F1). In addition, the Area Under the Receiver Operating Characteristic Curve (AUC) is reported to assess the overall discrimination capability. In the IPE context, a reliable model should not only achieve high overall accuracy but also maintain a balanced trade-off between false alarms and missed detections when distinguishing psychologically at-risk states (e.g., Anxious, Stressed, Depressed) from Normal patterns. The metric formulations are defined as follows:18\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} Accuracy = \frac{TP + TN}{TP + TN + FP + FN}, \end{aligned}$$\end{document}19\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} Precision = \frac{TP}{TP + FP}, \quad Recall = \frac{TP}{TP + FN}, \end{aligned}$$\end{document}20\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} F1\text {-}score = 2 \times \frac{Precision \times Recall}{Precision + Recall}, \end{aligned}$$\end{document}where TP, TN, FP, and FN denote true positives, true negatives, false positives, and false negatives, respectively. For the multi-class setting, we adopt a macro-averaging strategy, i.e., metrics are first computed per class and then averaged across all classes, ensuring that minority psychological states are not overwhelmed by majority-class dominance. Comparative analysis with baseline models To validate the effectiveness of the proposed CNWOA-LSTM framework, comprehensive comparisons were conducted across three categories of baselines, aligning strictly with the baselines described in the abstract: Traditional machine learning models: Support Vector Machine (SVM), Random Forest (RF), and Gradient Boosting Decision Tree (GBDT). These models rely on handcrafted or preprocessed features and serve as representative shallow learning baselines.Deep learning models: Convolutional Neural Network (CNN), Transformer, Gated Recurrent Unit (GRU), and Bidirectional LSTM (BiLSTM). These models capture nonlinear patterns via representation learning and are commonly used in time-series and multimodal perception tasks.Meta-heuristic optimized LSTMs: LSTM optimized by recent optimization algorithms, including DE-LSTM, HHO-LSTM, MPA-LSTM, AOA-LSTM, and RSA-LSTM. Additionally, standard WOA-LSTM is included as the direct optimization counterpart of our method, enabling a fair assessment of the improvements introduced by chaotic initialization and the niche operator. Traditional machine learning models: Support Vector Machine (SVM), Random Forest (RF), and Gradient Boosting Decision Tree (GBDT). These models rely on handcrafted or preprocessed features and serve as representative shallow learning baselines. Traditional machine learning models: Support Vector Machine (SVM), Random Forest (RF), and Gradient Boosting Decision Tree (GBDT). These models rely on handcrafted or preprocessed features and serve as representative shallow learning baselines. Deep learning models: Convolutional Neural Network (CNN), Transformer, Gated Recurrent Unit (GRU), and Bidirectional LSTM (BiLSTM). These models capture nonlinear patterns via representation learning and are commonly used in time-series and multimodal perception tasks. Deep learning models: Convolutional Neural Network (CNN), Transformer, Gated Recurrent Unit (GRU), and Bidirectional LSTM (BiLSTM). These models capture nonlinear patterns via representation learning and are commonly used in time-series and multimodal perception tasks. Meta-heuristic optimized LSTMs: LSTM optimized by recent optimization algorithms, including DE-LSTM, HHO-LSTM, MPA-LSTM, AOA-LSTM, and RSA-LSTM. Additionally, standard WOA-LSTM is included as the direct optimization counterpart of our method, enabling a fair assessment of the improvements introduced by chaotic initialization and the niche operator. Meta-heuristic optimized LSTMs: LSTM optimized by recent optimization algorithms, including DE-LSTM, HHO-LSTM, MPA-LSTM, AOA-LSTM, and RSA-LSTM. Additionally, standard WOA-LSTM is included as the direct optimization counterpart of our method, enabling a fair assessment of the improvements introduced by chaotic initialization and the niche operator. Overall classification performance Fig. 3Histogram comparison of Accuracy, Precision, Recall, and F1-score across all baseline models and the proposed CNWOA-LSTM. Histogram comparison of Accuracy, Precision, Recall, and F1-score across all baseline models and the proposed CNWOA-LSTM. The overall quantitative results are summarized in Table 4 and visualized in Fig. 3. As shown, the proposed CNWOA-LSTM achieves the best performance across all metrics, demonstrating its effectiveness in modeling temporal psychological dynamics and optimizing LSTM hyperparameters in a complex search space.Table 4Performance Comparison of Different Models on the public IPE Psychological Dataset.ModelAccuracy (%)Precision (%)Recall (%)F1-Score (%)SVM79.8079.1078.6078.85RF81.2580.6080.9080.75GBDT82.4081.9082.1082.00CNN84.1083.4083.2083.30Transformer85.6585.1085.3085.20GRU85.1084.5084.7084.60BiLSTM86.2085.7085.9085.80Original LSTM84.3183.9083.7083.80Grid Search-LSTM85.2084.7084.9084.80Random Search-LSTM85.7585.2085.4085.30Bayesian Optimization-LSTM86.5586.0086.2086.10PSO-LSTM86.7086.2086.4086.30GA-LSTM86.4585.9086.1086.00WOA-LSTM87.0186.4086.8086.60DE-LSTM88.4387.9088.1088.00HHO-LSTM87.9087.2087.6087.40MPA-LSTM86.3085.8085.9085.85AOA-LSTM88.1087.6087.9087.75RSA-LSTM87.2086.7087.0086.85CNWOA-LSTM93.6493.2093.5093.35 Table 4Performance Comparison of Different Models on the public IPE Psychological Dataset.ModelAccuracy (%)Precision (%)Recall (%)F1-Score (%)SVM79.8079.1078.6078.85RF81.2580.6080.9080.75GBDT82.4081.9082.1082.00CNN84.1083.4083.2083.30Transformer85.6585.1085.3085.20GRU85.1084.5084.7084.60BiLSTM86.2085.7085.9085.80Original LSTM84.3183.9083.7083.80Grid Search-LSTM85.2084.7084.9084.80Random Search-LSTM85.7585.2085.4085.30Bayesian Optimization-LSTM86.5586.0086.2086.10PSO-LSTM86.7086.2086.4086.30GA-LSTM86.4585.9086.1086.00WOA-LSTM87.0186.4086.8086.60DE-LSTM88.4387.9088.1088.00HHO-LSTM87.9087.2087.6087.40MPA-LSTM86.3085.8085.9085.85AOA-LSTM88.1087.6087.9087.75RSA-LSTM87.2086.7087.0086.85CNWOA-LSTM93.6493.2093.5093.35 Performance Comparison of Different Models on the public IPE Psychological Dataset. It can be observed from Table 4 that CNWOA-LSTM achieves the highest overall accuracy of 93.64%. This result is 9.33% higher than the original LSTM (84.31%) and 6.63% higher than the standard WOA-LSTM (87.01%), verifying that naive or default hyperparameter configurations are insufficient for complex multimodal psychological state modeling, and that effective hyperparameter optimization is crucial. Moreover, CNWOA-LSTM also delivers consistently improved Precision, Recall, and F1-score, indicating that performance gains are not obtained by sacrificing certain classes or biasing the decision boundary, but instead reflect comprehensive improvements in classification reliability. Compared with standard hyperparameter optimization methods, CNWOA-LSTM outperforms grid search, random search, and Bayesian optimization by 8.44%, 7.89%, and 7.09% respectively in terms of accuracy. Grid search suffers from exponential computational complexity with the increase of hyperparameter dimensions, making it impractical for high-dimensional LSTM hyperparameter optimization. Random search improves efficiency but lacks directional guidance, often requiring a large number of iterations to find satisfactory solutions. Bayesian optimization performs better than the above two methods but tends to converge prematurely to local optima in complex non-convex search spaces, which is common in deep learning hyperparameter tuning tasks. Furthermore, when compared against classic meta-heuristic optimization algorithms including PSO and GA, CNWOA-LSTM still maintains a significant performance advantage (6.94% and 7.19% higher in accuracy respectively). PSO is prone to premature convergence due to its rapid information sharing mechanism, while GA has slow convergence speed and high computational cost in high-dimensional spaces. In contrast, the proposed CNWOA combines the advantages of chaotic initialization and niche diversity preservation, achieving a better balance between global exploration and local exploitation. Compared with deep learning baselines, CNWOA-LSTM surpasses Transformer and BiLSTM by a large margin. This observation suggests that in small-to-medium scale educational datasets, where data collection is constrained by privacy and deployment cost, simply adopting highly complex architectures may not yield proportional performance benefits. In contrast, an LSTM model equipped with an effective hyperparameter optimizer can better exploit the temporal dependencies and multimodal correlations that characterize students’ psychological dynamics in IPE classrooms. Furthermore, when compared against other state-of-the-art meta-heuristic optimized LSTMs (DE/HHO/MPA/AOA/RSA), CNWOA-LSTM maintains a clear advantage (5.21%–7.34% higher in accuracy), confirming the superiority of the proposed optimization strategy. This improvement is attributed to the synergy of (i) chaotic initialization, which provides a high-quality and diverse starting population, and (ii) niche-based diversity preservation, which prevents the optimization process from collapsing prematurely around local optima in later stages. ROC curve and AUC analysis To further evaluate discrimination robustness across different operating thresholds, ROC curves were plotted and AUC values were computed, as shown in Fig. 4. For multi-class prediction, the One-vs-Rest strategy was adopted to compute ROC curves per class, and the macro-average AUC was reported to reflect overall separability between psychological state categories.Fig. 4Comparison of ROC curves and AUC values for representative models. Comparison of ROC curves and AUC values for representative models. The proposed CNWOA-LSTM achieves the best AUC of 0.982, outperforming representative strong baselines such as DE-LSTM (0.969), RSA-LSTM (0.961), Transformer (0.927), and the original LSTM (0.901). The ROC curve of CNWOA-LSTM consistently stays above those of other methods across most false positive rate ranges, indicating superior discrimination ability. In IPE applications, such behavior is practically valuable: it implies that instructors can adjust alert thresholds based on available counseling resources while still maintaining reliable detection of psychologically at-risk students, avoiding both missed warnings and excessive false alarms. Convergence and efficiency analysis Training loss dynamics and convergence analysis To evaluate the convergence stability of the proposed CNWOA-LSTM framework and address concerns about potential unstable convergence behavior caused by the integration of meta-heuristic optimization and deep learning, we conducted a comprehensive convergence analysis under strictly controlled experimental conditions. All models were trained for a maximum of 100 epochs with the same early stopping strategy (patience=10) and identical hardware/software configurations. Figure 5 shows the training loss curves of representative baseline models and the proposed CNWOA-LSTM.Fig. 5Training loss convergence comparison over 100 epochs. All models were trained under identical experimental conditions with the same early stopping mechanism. Training loss convergence comparison over 100 epochs. All models were trained under identical experimental conditions with the same early stopping mechanism. The proposed CNWOA-LSTM exhibits the fastest and smoothest convergence trend among all compared models, reaching a substantially lower loss region early in training and maintaining excellent stability throughout the entire training process. Quantitatively, CNWOA-LSTM achieves convergence (defined as the point where the training loss stops decreasing significantly) at approximately 35 epochs, which is nearly 25 epochs earlier than the original LSTM (converges at 60 epochs) and 10-15 epochs earlier than other meta-heuristic optimized LSTM variants (converge at 45-55 epochs). The original LSTM and CNN converge more slowly and stabilize at relatively higher loss values, reflecting suboptimal learning dynamics under default hyperparameter configurations. Their loss curves show a gradual decline without obvious inflection points, indicating that the models are struggling to find effective parameter updates in the high-dimensional search space. Meta-heuristic optimized models such as RSA-LSTM and DE-LSTM accelerate convergence compared to the original LSTM, but their curves show mild to moderate oscillations in the middle and late training stages (with loss fluctuations of approximately 0.02-0.03). These oscillations suggest that these optimization algorithms occasionally get trapped in local optima or experience detours in the search process, leading to unstable training dynamics. In contrast, CNWOA-LSTM yields a smooth and rapid loss reduction with minimal fluctuations after convergence (loss fluctuation < 0.005). This exceptional convergence stability can be directly attributed to the synergistic effect of the two core improvement mechanisms in CNWOA: 1. Chaotic initialization provides a uniformly distributed initial population across the entire search space, avoiding the optimization process starting from poor local regions and ensuring a high-quality starting point for hyperparameter search. 2. Niche-based diversity preservation maintains population diversity throughout the entire iteration process, effectively preventing the algorithm from converging prematurely to local optima and ensuring continuous exploration of better hyperparameter configurations. These results clearly demonstrate that the integration of CNWOA with LSTM not only does not lead to unstable convergence behavior but actually significantly improves both the convergence speed and stability compared to standard LSTM and other meta-heuristic optimized LSTM frameworks. The smooth and rapid convergence trajectory indicates that CNWOA provides high-quality hyperparameter configurations that optimize the entire training process, making the proposed framework more reliable and efficient for practical deployment in IPE classroom scenarios. Computational efficiency To address concerns about the computational complexity introduced by the proposed CNWOA, we comprehensively assess the computational cost, runtime performance, scalability, and resource requirements of the framework. We report the average wall-clock time to convergence under the same experimental environment (consistent hardware and software configuration), with the comparative results presented in Table 5. Although meta-heuristic optimization (including CNWOA) introduces an additional hyperparameter search procedure, the resulting optimized model often converges faster during training due to improved hyperparameter configurations, leading to a favorable overall efficiency profile.Table 5Comparison of Training Efficiency (Average Time to Convergence).ModelTime (s)Relative to Original LSTMTransformer245.3SlowerBiLSTM198.5SlowerOriginal LSTM180.2BaselineWOA-LSTM146.8FasterRSA-LSTM139.5FasterDE-LSTM134.2FasterCNWOA-LSTM115.6Faster Table 5Comparison of Training Efficiency (Average Time to Convergence).ModelTime (s)Relative to Original LSTMTransformer245.3SlowerBiLSTM198.5SlowerOriginal LSTM180.2BaselineWOA-LSTM146.8FasterRSA-LSTM139.5FasterDE-LSTM134.2FasterCNWOA-LSTM115.6Faster Comparison of Training Efficiency (Average Time to Convergence). The results clearly demonstrate that CNWOA-LSTM achieves an excellent balance between predictive effectiveness and computational efficiency. Compared with the original LSTM (baseline), CNWOA-LSTM reduces the average convergence time by approximately 35.8%, and outperforms other meta-heuristic optimized LSTM variants (WOA-LSTM, RSA-LSTM, DE-LSTM) in terms of runtime. This efficiency advantage is particularly critical for real-world IPE deployment: the framework may need periodic retraining as new student cohorts and new classroom data become available, and the reduced runtime ensures practical applicability without excessive resource consumption. Regarding scalability and resource requirements, the additional computational overhead introduced by CNWOA is minimal compared to the training cost of the LSTM model itself. The CNWOA’s simple structure and efficient search mechanism avoid excessive resource occupation, and the framework maintains stable runtime performance even when processing larger-scale samples from the public dataset. This ensures that the proposed model can be smoothly deployed in ordinary classroom intelligent monitoring systems without relying on high-end hardware resources, further enhancing its practical application value. Ablation study Fig. 6Ablation study on chaotic initialization and niche operator within the proposed CNWOA. Ablation study on chaotic initialization and niche operator within the proposed CNWOA. To quantify the contribution of each proposed improvement, we conducted an ablation study with the following variants:Base LSTM: Standard LSTM without meta-heuristic optimization.Standard WOA-LSTM: LSTM optimized by standard Whale Optimization Algorithm.CWOA-LSTM (Chaos only): WOA enhanced with chaotic initialization only.NWOA-LSTM (Niche only): WOA enhanced with niche operator only.CNWOA-LSTM: Full model with both chaotic initialization and niche operator.Table 6Ablation Study Results on the IPE Psychological Dataset.VariantAccuracy (%)Gain vs. BaseComponent EnabledBase LSTM84.31-NoneStandard WOA-LSTM87.01+2.70%WOA optimizationCWOA-LSTM (Chaos)90.15+5.84%Chaos initializationNWOA-LSTM (Niche)90.72+6.41%Niche operatorCNWOA-LSTM93.64+9.33%Chaos + Niche Base LSTM: Standard LSTM without meta-heuristic optimization. Base LSTM: Standard LSTM without meta-heuristic optimization. Standard WOA-LSTM: LSTM optimized by standard Whale Optimization Algorithm. Standard WOA-LSTM: LSTM optimized by standard Whale Optimization Algorithm. CWOA-LSTM (Chaos only): WOA enhanced with chaotic initialization only. CWOA-LSTM (Chaos only): WOA enhanced with chaotic initialization only. NWOA-LSTM (Niche only): WOA enhanced with niche operator only. NWOA-LSTM (Niche only): WOA enhanced with niche operator only. CNWOA-LSTM: Full model with both chaotic initialization and niche operator. CNWOA-LSTM: Full model with both chaotic initialization and niche operator. Table 6Ablation Study Results on the IPE Psychological Dataset.VariantAccuracy (%)Gain vs. BaseComponent EnabledBase LSTM84.31-NoneStandard WOA-LSTM87.01+2.70%WOA optimizationCWOA-LSTM (Chaos)90.15+5.84%Chaos initializationNWOA-LSTM (Niche)90.72+6.41%Niche operatorCNWOA-LSTM93.64+9.33%Chaos + Niche Ablation Study Results on the IPE Psychological Dataset. As shown in Table 6 and Fig. 6, both chaotic initialization and the niche operator contribute positively to performance, and their combination yields the strongest improvement. Chaotic initialization improves early-stage exploration by providing a more uniformly distributed population, while the niche operator maintains diversity in later stages and reduces premature convergence. The monotonic improvement from Base LSTM → Standard WOA-LSTM → (single-module variants) → CNWOA-LSTM provides strong empirical evidence that the proposed enhancements are effective and complementary. To further clarify the novelty of the proposed CNWOA and its distinction from existing WOA variants, we supplement the core contributions of the combined chaotic and niche mechanisms as follows: Unlike most existing WOA variants that rely on a single enhancement strategy (e.g., only chaotic mapping for initialization, only mutation operators for diversity, or only adaptive parameters for convergence), our work innovatively integrates chaotic initialization and niche operator in a synergistic way, which constitutes a non-incremental improvement. The ablation study results (Table 6) clearly demonstrate that the performance gain of CNWOA-LSTM (+9.33% vs. Base LSTM) is significantly higher than the sum of the gains from single-mechanism variants (CWOA-LSTM: +5.84%; NWOA-LSTM: +6.41%), confirming the synergistic effect of the two mechanisms—this is the key difference from existing incremental improvements that only achieve additive performance gains. Moreover, existing WOA variants are rarely applied to LSTM hyperparameter optimization for IPE psychological state prediction; our proposed CNWOA is tailored to this specific scenario, solving the practical problems of standard WOA (uneven initial population, premature convergence) in high-dimensional educational data optimization, and filling the research gap of combining dual complementary mechanisms in WOA for educational psychological prediction tasks. This combination not only improves the optimization performance of WOA but also enhances the adaptability of the hybrid framework to the characteristics of IPE classroom data, which is a novel contribution that distinguishes our work from existing literature. Statistical significance test To ensure that the observed improvements are not caused by random variations in data splitting or model initialization, we conducted both a paired t-test and a Wilcoxon signed-rank test between CNWOA-LSTM and representative strong baselines. The p-values are summarized in Table 7. All tests were performed under a significance level of α =0.05.Table 7Statistical significance tests (p-values) between CNWOA-LSTM and key baselines.Comparison PairPaired t-testWilcoxon TestCNWOA-LSTM vs. Original LSTM\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$1.7\times 10^{-5}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$3.2\times 10^{-4}$$\end{document}CNWOA-LSTM vs. Transformer\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$4.1\times 10^{-4}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$8.6\times 10^{-4}$$\end{document}CNWOA-LSTM vs. WOA-LSTM\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2.4\times 10^{-3}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$3.8\times 10^{-3}$$\end{document}CNWOA-LSTM vs. DE-LSTM\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$6.9\times 10^{-3}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$9.7\times 10^{-3}$$\end{document}CNWOA-LSTM vs. RSA-LSTM\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$8.5\times 10^{-3}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$1.3\times 10^{-2}$$\end{document} Table 7Statistical significance tests (p-values) between CNWOA-LSTM and key baselines.Comparison PairPaired t-testWilcoxon TestCNWOA-LSTM vs. Original LSTM\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$1.7\times 10^{-5}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$3.2\times 10^{-4}$$\end{document}CNWOA-LSTM vs. Transformer\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$4.1\times 10^{-4}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$8.6\times 10^{-4}$$\end{document}CNWOA-LSTM vs. WOA-LSTM\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2.4\times 10^{-3}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$3.8\times 10^{-3}$$\end{document}CNWOA-LSTM vs. DE-LSTM\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$6.9\times 10^{-3}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$9.7\times 10^{-3}$$\end{document}CNWOA-LSTM vs. RSA-LSTM\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$8.5\times 10^{-3}$$\end{document}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$1.3\times 10^{-2}$$\end{document} Statistical significance tests (p-values) between CNWOA-LSTM and key baselines. All reported p-values are below 0.05, indicating that the improvements achieved by CNWOA-LSTM are statistically significant. The consistent significance across both parametric (t-test) and non-parametric (Wilcoxon) tests strengthens the reliability of the conclusion, suggesting that the proposed framework provides stable and repeatable advantages for psychological state prediction in IPE contexts. Discussion The experimental results consistently demonstrate that CNWOA-LSTM provides a robust and effective solution for multi-class psychological state prediction in IPE classrooms. The superiority of the proposed framework is mainly attributed to the synergy between (i) LSTM’s capability to capture temporal dependencies in multimodal classroom signals and (ii) CNWOA’s enhanced global optimization behavior for hyperparameter tuning. Compared with complex architectures such as Transformers, the optimized LSTM shows stronger data efficiency and lower computational overhead, which is more compatible with real-world educational environments where data availability and training resources are often limited. Moreover, ablation and convergence analyses confirm that chaotic initialization and niche-based diversity preservation play complementary roles: chaotic mapping improves the exploration quality at the beginning, while the niche operator mitigates premature convergence and sustains exploration in later iterations. These properties enable CNWOA to search the hyperparameter landscape more effectively and to generate configurations that improve both prediction accuracy and training stability. In practical IPE applications, such reliability is crucial for supporting timely pedagogical interventions and early-warning mechanisms, ultimately contributing to student-centered intelligent teaching and mental health support. From the perspective of practical educational application, this research also possesses prominent application value and practical significance in multiple scenarios. Firstly, this prediction framework can realize the early detection of college students’ potential psychological problems, timely identify negative emotions, learning burnout and abnormal psychological tendencies hidden in daily learning, so as to achieve early intervention and early guidance. Secondly, the established prediction model can be seamlessly integrated into the existing smart campus management systems, realizing real-time collection, intelligent analysis and unified management of students’ classroom state data, and promoting the intelligent upgrading of campus education management. Thirdly, the quantitative prediction results can provide intuitive, scientific and reliable data-driven decision support for school psychological counselors and front-line educators, helping them formulate targeted psychological counseling plans and personalized teaching strategies, and further improve the overall quality of campus mental health education and ideological and political education. Regarding the generalization capability across different student populations and datasets, we acknowledge that this is an important aspect requiring further discussion. Although the proposed framework achieves stable and excellent performance on the adopted public dataset, students from different grades, majors, regional backgrounds and educational institutions may exhibit distinct psychological characteristics, emotional expression patterns and behavioral habits, which may lead to certain performance fluctuations when the model is directly migrated. Nevertheless, the comprehensive regularization strategies (dropout, L2 weight decay, early stopping) and 5-fold stratified cross-validation adopted in this study have effectively enhanced the model’s generalization ability to a certain extent. In future research, we will collect multi-source heterogeneous data from multiple universities and different student groups to conduct cross-dataset and cross-population validation, and further optimize the model through transfer learning techniques to improve its adaptability to diverse educational scenarios. Challenges and limitations Although the proposed CNWOA-LSTM framework achieves satisfactory performance in student psychological state prediction within classroom IPE scenarios, this research still faces several inevitable challenges and inherent limitations in practical popularization and large-scale application. First of all, there exist prominent data privacy risks and ethical constraints in actual deployment. The student behavioral data, emotional features and psychological state information adopted in this study all belong to highly sensitive personal educational and mental health data. In the process of data collection, transmission, storage and model training, improper data management may easily lead to personal privacy leakage. Meanwhile, relevant educational ethics norms and informed consent mechanisms need to be strictly followed when acquiring student-related psychological information, which brings certain restrictions to data acquisition and model practical deployment. Secondly, the proposed hybrid model still suffers from insufficient model interpretability. The integrated LSTM network combined with meta-heuristic optimization belongs to a typical black-box intelligent prediction architecture. It can output accurate psychological state prediction results, but cannot clearly present the internal logical reasoning process and key feature contribution basis of judgment results. The lack of transparent interpretation mechanism restricts the further recognition and promotion of the model in formal educational psychological counseling work. Thirdly, the model exhibits limited generalization ability across diverse student populations. The experimental data in this paper are mainly collected from specific student groups with fixed educational backgrounds. There are obvious differences in learning habits, emotional expression modes and psychological characteristics among students of different ages, majors, educational backgrounds and regional environments. The current model cannot well adapt to heterogeneous student groups, and it is difficult to maintain stable and reliable prediction performance when directly migrated to different educational environments and student crowds. Conclusion In this study, a novel psychological state prediction framework for Ideological and Political Education (IPE) scenarios, termed CNWOA-LSTM, was proposed. The framework integrates a Long Short-Term Memory (LSTM) network with an improved Whale Optimization Algorithm enhanced by chaotic initialization and a niche-based diversity preservation mechanism. By addressing the sensitivity of LSTM performance to hyperparameter settings and the premature convergence issue of conventional meta-heuristic algorithms, the proposed method provides an effective solution for modeling complex and dynamic psychological state sequences in educational environments. Extensive experiments were conducted on a public dataset consisting of behavioral features, learning interaction data, and psychological assessment indicators. Comparative evaluations against traditional machine learning models, classical deep learning architectures, and LSTM variants optimized by recent meta-heuristic algorithms demonstrate that CNWOA-LSTM consistently achieves superior performance in terms of Accuracy, F1-score, and AUC. In particular, the proposed framework attains an accuracy of 93.64%, significantly outperforming the original LSTM, standard WOA-LSTM, and other state-of-the-art optimization-based baselines. Convergence analysis and ablation studies further verify that chaotic initialization enhances global exploration in the early optimization stage, while the niche operator effectively maintains population diversity and suppresses premature convergence during later iterations. From a practical perspective, the proposed CNWOA-LSTM framework exhibits favorable computational efficiency and robustness, making it suitable for real-world deployment in intelligent IPE classrooms. By enabling accurate and timely perception of students’ psychological states, the model can provide meaningful decision support for instructors, facilitating adaptive teaching strategies and targeted educational interventions. Beyond the IPE domain, the proposed optimization framework is general and can be extended to other time-series prediction tasks that require reliable hyperparameter tuning under complex and multimodal data conditions. Future work will focus on several directions. First, incorporating richer multimodal signals, such as fine-grained facial expression dynamics and speech prosody features, may further enhance psychological state representation. Second, online and incremental learning mechanisms will be explored to enable continuous model adaptation as new classroom data become available. Finally, integrating explainable artificial intelligence techniques will be investigated to improve the interpretability of prediction results, thereby increasing user trust and facilitating ethical deployment in educational settings.