Psychological data analysis system based on machine learning

By using an improved iTransformer network for psychological feature modeling and risk assessment, the problems of discontinuous psychological state modeling and insufficient suggestion generation in existing systems are solved. This enables high-precision psychological state identification and personalized intervention suggestions, thereby improving the intelligence level of the mental health management system.

CN121964071APending Publication Date: 2026-05-01BUILDING RESILIENCE (NINGBO) INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BUILDING RESILIENCE (NINGBO) INTELLIGENT TECHNOLOGY CO LTD
Filing Date
2026-01-19
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing psychological assessment systems struggle to effectively and continuously model changes in an individual's psychological state, lack the ability to model the dynamic interactions between multiple psychological characteristics, resulting in crude or distorted psychological state assessments. Furthermore, they lack a mechanism for generating suggestions for high-risk states, impacting the practicality and intelligence of mental health management systems.

Method used

An improved iTransformer network is used for psychological feature modeling. Through modules for psychological feature extraction, modeling, risk assessment, similarity analysis, and suggestion generation, dynamic modeling of psychological states and personalized intervention suggestions are achieved. This includes the synergistic effect of modules for data collection and preprocessing, psychological feature extraction, psychological feature modeling, risk assessment, similarity analysis, and state analysis.

Benefits of technology

It improved the accuracy of psychological state identification and the continuity of risk assessment, enhanced the integration of analysis and guidance, improved the interpretability and applicability of the mental health management system, and significantly improved the automation and targeting of psychological intervention decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121964071A_ABST
    Figure CN121964071A_ABST
Patent Text Reader

Abstract

The invention discloses a psychological data analysis system based on machine learning, and the system comprises a collection and preprocessing module which is used for obtaining the multi-source psychological data of a target object and carrying out the preprocessing of the multi-source psychological data; the psychological feature extraction module is used for extracting a target psychological feature and mapping to generate a psychological semantic feature tensor; the psychological feature modeling module is used for generating a psychological state feature vector sequence from the psychological semantic feature tensor through an improved iTransform network; the risk assessment module is used for performing risk assessment on the psychological state feature vector sequence; the similarity analysis module is used for constructing an individual psychological distribution matrix according to the psychological state feature vector sequence and a historical sample library; the state analysis module is used for analyzing and generating a psychological state analysis result; and the suggestion generation module is used for generating psychological counseling suggestions according to the psychological state analysis result. According to the psychological data analysis method and the psychological data analysis system, the reliability of psychological data analysis is improved through the improved iTransform network.
Need to check novelty before this filing date? Find Prior Art

Description

A machine learning-based psychological data analysis system Technical Field

[0001] This invention relates to the field of psychological data analysis technology, and in particular to a psychological data analysis system based on machine learning. Background Technology

[0002] With the increasing demand for human-computer interaction, digital health management, and mental health monitoring, psychological risk modeling technology targeting individual psychological and behavioral changes has received widespread attention. Existing psychological assessment systems primarily rely on static psychological questionnaires or single-dimensional behavioral data to determine mental state, but these systems generally suffer from the following problems in practical applications:

[0003] The collected psychological data is heterogeneous in dimensions. Structured questionnaire data, behavioral logs, and text records are difficult to align in time sequence, making it difficult to continuously model the trajectory of psychological state changes. Existing systems generally lack the ability to model the dynamic interaction relationships between multiple psychological characteristics, making it difficult to accurately reflect the coupling patterns between emotional evolution, behavioral frequency, and language emotion, resulting in overly crude or distorted individual psychological risk assessment results. Most traditional psychological state recognition systems are based on rule-based or shallow classification models, making it difficult to capture the fluctuation characteristics of psychological states across multiple time scales, and making it difficult to effectively predict the risk trends of individuals within different time windows. Existing systems lack a suggestion generation mechanism for high-risk states, failing to form a complete analysis, early warning, and intervention system, thus affecting the practicality and intelligence level of the mental health management system.

[0004] Therefore, how to provide a psychological data analysis system based on machine learning is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] One objective of this invention is to propose a machine learning-based psychological data analysis system. This invention fully utilizes an improved iTransformer network and describes in detail the dynamic modeling of individual psychological states, risk level determination, and generation of personalized intervention suggestions. It has the advantages of high accuracy in psychological state recognition, strong continuity in risk assessment, strong feature expression ability, and a high degree of integration between analysis and guidance.

[0006] A machine learning-based psychological data analysis system according to an embodiment of the present invention includes the following modules:

[0007] The data acquisition and preprocessing module is used to acquire multi-source psychological data of the target object and preprocess it to obtain a standard psychological dataset.

[0008] The psychological feature extraction module is used to extract target psychological features based on standard psychological datasets and map them to generate a psycho-semantic feature tensor.

[0009] The psychological feature modeling module is used to model psychological features by using the improved iTransformer network to transform the psycho-semantic feature tensor into a psychological feature vector sequence.

[0010] The risk assessment module is used to assess the risk of psychological state feature vector sequences and calculate the psychological risk score sequence and psychological risk level label sequence of the target object.

[0011] The similarity analysis module is used to filter similar psychological sample sets based on the sequence of psychological state feature vectors and a preset historical sample library, and to construct an individual psychological distribution matrix.

[0012] The state analysis module is used to generate psychological state analysis results and output them to the user terminal based on the psychological risk score sequence, psychological risk level label sequence and individual psychological distribution matrix.

[0013] The suggestion generation module is used to match the psychological state analysis results with the preset suggestion rule base, generate psychological counseling suggestions, and output them to the user terminal.

[0014] Optionally, the modules can be connected through the following steps:

[0015] Step 1: Obtain multi-source psychological data of the target object and preprocess it to obtain a standard psychological dataset;

[0016] Step 2: Based on the standard psychological dataset, extract the target psychological features and generate a psycho-semantic feature tensor from the target psychological features through feature mapping;

[0017] Step 3: Input the psycho-semantic feature tensor into the improved iTransformer network to perform psycho-feature modeling and output a sequence of psycho-state feature vectors; the improved iTransformer network includes an input encoding module, a psycho-variable modeling module, a psycho-temporal modeling module, and a feature fusion output module;

[0018] Step 4: Based on the psychological state feature vector sequence, calculate the psychological risk score sequence and psychological risk level label sequence of the target object;

[0019] Step 5: Calculate the similarity between the sequence of psychological state feature vectors and the preset historical sample library, filter similar psychological sample sets, and construct an individual psychological distribution matrix based on the similar psychological sample sets;

[0020] Step Six: Based on the psychological risk score sequence, psychological risk level label sequence, and individual psychological distribution matrix, generate psychological state analysis results and output them to the user terminal;

[0021] Step 7: Match the psychological state analysis results with the preset suggestion rule base, generate psychological counseling suggestions, and output them to the user terminal.

[0022] Optionally, step one specifically includes:

[0023] The multi-source psychological data includes structured psychological assessment data, behavioral log data, and text record data;

[0024] The preprocessing specifically involves: setting a time step sequence, aligning the multi-source psychological data according to the time step sequence; filling missing items in the multi-source psychological data using linear interpolation; and standardizing the numerical data in the multi-source psychological data using the Z-Score method.

[0025] Optionally, step two specifically includes:

[0026] The target psychological characteristics include emotional change characteristics, behavioral frequency characteristics, and textual emotional characteristics;

[0027] The emotional change characteristics include: extracting the probability distribution of emotional tags, the magnitude of emotional change, and the duration of emotional change based on the emotional fields in structured psychological assessment data and text record data;

[0028] The behavioral frequency features include: calculating and generating the unit time operation frequency, application switching frequency, and average page category dwell time based on the application usage frequency, operation records, and page access records in the behavioral log data.

[0029] The text sentiment features include: extracting sentiment word density and sentiment polarity score from text record data, and converting the text record data into sentiment embedding vectors with set feature dimensions through a pre-trained Word2Vec model;

[0030] Each feature dimension of the target psychological feature is used to generate a feature embedding vector through linear feature mapping, and all feature embedding vectors are organized into a psycho-semantic feature tensor according to the result of time step × feature dimension × feature embedding dimension.

[0031] Optionally, step three specifically includes:

[0032] In the input encoding module, the psycho-semantic feature tensor is linearly transformed in the feature embedding dimension through a trainable embedding mapping matrix and a bias vector to obtain the psycho-semantic embedding tensor.

[0033] At each time step, a time encoding matrix is ​​initialized based on a normal distribution, and the time encoding matrix is ​​updated through backpropagation during training;

[0034] The time encoding matrix is ​​assembled into a time encoding tensor according to time steps, and the psycho-semantic embedding tensor is added element-wise to the time encoding tensor along the feature embedding dimension to obtain the psycho-semantic embedding tensor.

[0035] In the psychological variable modeling module, attention operations are performed on the psychological semantic embedding tensor by constructing a structural interaction weight matrix and psychological factor vectors to obtain the psychological variable modeling tensor.

[0036] In the psychological temporal modeling module, a set of time scales is defined, where each time scale corresponds to a convolutional kernel size;

[0037] At each time scale, the tensor modeling the psychological variables is subjected to deep convolution along the time step dimension to obtain the deep convolution feature tensor for each time scale.

[0038] At each time scale, the depthwise convolutional feature tensor is channel-mapped in the feature embedding dimension through one-dimensional point convolution to obtain the point convolutional feature tensor.

[0039] We weight and fuse the point convolutional feature tensors across all time scales to obtain the psychological temporal modeling tensor.

[0040] In the feature fusion output module, the psychological time series modeling tensor is flattened according to the variable dimension at each time step to obtain the psychological flattened vector at each time step;

[0041] The psychological flattening vector at each time step is concatenated with the corresponding emotion embedding vector to obtain the psychological fusion vector;

[0042] The psychological fusion vector is output-mapped to the output bias vector through a trainable output mapping matrix to obtain the psychological state feature vector.

[0043] The psychological state feature vectors are arranged into a psychological state feature vector sequence according to time steps.

[0044] Optionally, in the psychological variable modeling module, by constructing a structural interaction weight matrix and psychological factor vectors, attention operations are performed on the psychological semantic embedding tensor to obtain the psychological variable modeling tensor, specifically including:

[0045] Based on the psychosemantic embedding tensor, a sequence of psychosemantic embedding vectors in the feature dimension is obtained. The sequence of psychosemantic embedding vectors is averaged in the time step dimension and linearly mapped through a trainable structure mapping weight matrix and structure mapping bias vector to obtain the structure feature vector.

[0046] Based on structural feature vectors, construct a structural interaction weight matrix: calculate the inner product similarity between the i-th structural feature vector and the j-th structural feature vector through inner product operation, and normalize the inner product similarity by Sigmoid to obtain the structural interaction weight, and use the structural interaction weight as the element value of the i-th row and j-th column of the structural interaction weight matrix.

[0047] The structural interaction weight matrix remains unchanged at each time step and is updated through backpropagation during the training and generation process;

[0048] Based on the psychosemantic embedding tensor, the psychosemantic embedding matrix at each time step is obtained, and then transformed into a query matrix, a key matrix, and a value matrix through three trainable mapping matrices respectively.

[0049] The psycho-semantic embedding matrix at each time step is max-pooled along the feature dimension, and a psycho-factor vector is generated through linear mapping.

[0050] The psychological factor vectors are mapped to query factor vectors and key factor vectors respectively through a trainable query state mapping matrix and a key state mapping matrix;

[0051] The query factor vector and key factor vector are broadcast in the variable dimension, and the query matrix and key matrix are modulated element by element to obtain the psychomodulated query matrix and psychomodulated key matrix.

[0052] At each time step, the psychological modulation query matrix and psychological modulation key matrix are processed by scaling inner product and Softmax normalization to obtain the variable attention weight matrix. The variable attention weight matrix is ​​then multiplied element-wise with the structural interaction weight matrix to obtain the structural constraint attention matrix. Finally, the structural constraint attention matrix is ​​multiplied with the value matrix to obtain the psychological variable modeling matrix.

[0053] By concatenating the psychological variable modeling matrices at all time steps, the psychological variable modeling tensor is obtained.

[0054] Optionally, step four specifically includes:

[0055] The psychological risk score for each time step is calculated by linearly mapping the psychological state feature vector at each time step to the risk bias term through a trainable risk mapping weight vector; the psychological risk scores are then arranged into a psychological risk score sequence in chronological order.

[0056] Set normal, mild, and moderate thresholds, and determine the level of psychological risk score at each time step:

[0057] If the psychological risk score at the current time step is less than the normal threshold, then the psychological risk level label is set to 1, indicating that it is normal.

[0058] If the psychological risk score at the current time step is less than the mild threshold but greater than or equal to the normal threshold, then the psychological risk level label is set to 2, indicating a mild warning.

[0059] If the psychological risk score at the current time step is less than the moderate threshold but greater than or equal to the mild threshold, then set the psychological risk level label to 3, indicating a moderate warning.

[0060] If the psychological risk score at the current time step is greater than or equal to the moderate threshold, then set the psychological risk level label to 4, indicating a high level of alert.

[0061] The psychological risk level labels are arranged into a psychological risk level label sequence in chronological order.

[0062] Optionally, step five specifically includes:

[0063] A historical sample library is set up, which includes several historical samples, each of which is a sequence of psychological state feature vectors labeled with a psychological risk level sequence;

[0064] The similarity score between the current psychological state feature vector sequence and each historical sample is calculated using the cosine similarity formula. Based on the similarity score, the top K historical samples are selected to form a set of similar psychological samples.

[0065] At each time step, the number of samples belonging to each psychological risk level label in the similar psychological sample set is counted, and the number of samples is normalized to obtain the probability distribution value of each psychological risk level label, and an individual psychological distribution vector is formed.

[0066] The individual psychological distribution matrix is ​​formed by assembling the individual psychological distribution vectors of all time steps.

[0067] Optionally, step six specifically includes:

[0068] Traverse the psychological risk level label sequence, take the time step with psychological risk level label 4 as the high risk time step, and merge consecutive high risk time steps to form a high risk interval.

[0069] Each high-risk interval consists of a start time step and an end time step. If a high-risk time step exists alone, then the start time step and the end time step of the high-risk interval are the same.

[0070] Merge all high-risk intervals and output a set of high-risk intervals;

[0071] Set the sliding window length and perform sliding difference on the psychological risk score sequence to obtain the risk score change sequence;

[0072] Set a confidence threshold, and based on the individual psychological distribution matrix, obtain the maximum probability value of the individual psychological distribution vector at each time step. If the maximum probability value is less than the confidence threshold, the current time step is determined to be in an uncertain state, and a set of uncertain time steps is obtained.

[0073] The psychological state analysis results are composed of the psychological risk level label sequence, the high-risk interval set, the psychological risk score sequence, the risk score change sequence, the individual psychological distribution matrix, and the set of uncertain time steps, and then output to the user terminal.

[0074] Optionally, step seven specifically includes:

[0075] If the current time step belongs to the set of time steps with uncertain state, then the uncertain state suggestion template is called from the suggestion rule base;

[0076] If the current time step is in a high-risk zone, then a high-risk suggestion template is retrieved from the suggestion rule base;

[0077] If the change in risk score at the current time step is greater than the set sentiment fluctuation threshold, then the sentiment fluctuation suggestion template will be invoked.

[0078] The suggestion templates for uncertain status, high risk, or emotional fluctuation at each time step are combined to generate psychological counseling suggestions, which are then output to the user terminal in the order of time steps.

[0079] The beneficial effects of this invention are:

[0080] (1) This invention introduces an improved iTransformer network into the psychological feature modeling module to perform deep temporal modeling of the psychological semantic feature tensor. By combining the psychological variable modeling module and the psychological temporal modeling module, it achieves a joint characterization of the dynamic coupling relationship between emotional change features, behavioral frequency features and text sentiment features. This enables the psychological state feature vector sequence to simultaneously express the structural correlation and temporal evolution law between multidimensional psychological features, thereby significantly improving the integrity and stability of psychological state representation and avoiding the problem of state expression distortion caused by isolated feature modeling in the prior art.

[0081] (2) Under the synergistic effect of the risk assessment module and the similarity analysis module, this invention constructs a psychological risk score sequence, a psychological risk level label sequence and an individual psychological distribution matrix based on the psychological state feature vector sequence. Through similarity calculation of the historical sample database, it depicts the distribution of individual psychological states in the group context, so that the psychological state analysis results have both individual temporal characteristics and group statistical characteristics as constraints, effectively reducing the risk of misjudgment caused by the instability of single model prediction, and enhancing the continuity, consistency and credibility of psychological risk assessment results.

[0082] (3) This invention integrates the psychological risk score sequence, psychological risk level label sequence and individual psychological distribution matrix into a unified psychological state analysis result through the state analysis module and the suggestion generation module, and further matches it with the preset suggestion rule base to generate psychological counseling suggestions. This realizes the process from psychological state modeling and risk judgment to counseling suggestion output, which improves the interpretability and applicability of psychological state analysis results, and significantly enhances the automation and pertinence of psychological intervention decision-making. It overcomes the problem that existing systems can only output risk conclusions and cannot provide subsequent intervention support. Attached Figure Description

[0083] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0084] Figure 1 is a schematic diagram of the modules of a machine learning-based psychological data analysis system proposed in this invention;

[0085] Figure 2 is a flowchart of the improved iTransformer network structure in a machine learning-based psychological data analysis system proposed in this invention.

[0086] Figure 3 is a flowchart of risk assessment and similarity analysis in a machine learning-based psychological data analysis system proposed in this invention. Detailed Implementation

[0087] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0088] Referring to Figures 1-3, a machine learning-based psychological data analysis system includes the following modules:

[0089] The data acquisition and preprocessing module is used to acquire multi-source psychological data of the target object and preprocess it to obtain a standard psychological dataset.

[0090] The psychological feature extraction module is used to extract target psychological features based on standard psychological datasets and map them to generate a psycho-semantic feature tensor.

[0091] The psychological feature modeling module is used to model psychological features by using the improved iTransformer network to transform the psycho-semantic feature tensor into a psychological feature vector sequence.

[0092] The risk assessment module is used to assess the risk of psychological state feature vector sequences and calculate the psychological risk score sequence and psychological risk level label sequence of the target object.

[0093] The similarity analysis module is used to filter similar psychological sample sets based on the sequence of psychological state feature vectors and a preset historical sample library, and to construct an individual psychological distribution matrix.

[0094] The state analysis module is used to generate psychological state analysis results and output them to the user terminal based on the psychological risk score sequence, psychological risk level label sequence and individual psychological distribution matrix.

[0095] The suggestion generation module is used to match the psychological state analysis results with the preset suggestion rule base, generate psychological counseling suggestions, and output them to the user terminal.

[0096] In this embodiment, the modules are connected through the following steps:

[0097] Step 1: Obtain multi-source psychological data of the target object and preprocess it to obtain a standard psychological dataset;

[0098] Step 2: Based on the standard psychological dataset, extract the target psychological features and generate a psycho-semantic feature tensor from the target psychological features through feature mapping;

[0099] Step 3: Input the psycho-semantic feature tensor into the improved iTransformer network to perform psycho-feature modeling and output a sequence of psycho-state feature vectors; the improved iTransformer network includes an input encoding module, a psycho-variable modeling module, a psycho-temporal modeling module, and a feature fusion output module;

[0100] Step 4: Based on the psychological state feature vector sequence, calculate the psychological risk score sequence and psychological risk level label sequence of the target object;

[0101] Step 5: Calculate the similarity between the sequence of psychological state feature vectors and the preset historical sample library, filter similar psychological sample sets, and construct an individual psychological distribution matrix based on the similar psychological sample sets;

[0102] Step Six: Based on the psychological risk score sequence, psychological risk level label sequence, and individual psychological distribution matrix, generate psychological state analysis results and output them to the user terminal;

[0103] Step 7: Match the psychological state analysis results with the preset suggestion rule base, generate psychological counseling suggestions, and output them to the user terminal.

[0104] In this embodiment, step one specifically includes:

[0105] The multi-source psychological data includes structured psychological assessment data, behavioral log data, and text record data;

[0106] The structured psychological assessment data includes item numbers, answer option codes, and time information; the behavioral log data includes application usage frequency, page dwell time, operation type, operation duration, and operation interval time; the text interaction record data includes sentence length of natural language content, emotional word density, word frequency statistics, reading pause interval, and response latency.

[0107] The preprocessing specifically involves: setting a time step sequence, aligning the multi-source psychological data according to the time step sequence; filling missing items in the multi-source psychological data using linear interpolation; and standardizing the numerical data in the multi-source psychological data using the Z-Score method.

[0108] The numerical data includes answer option codes, application usage frequency, page dwell time, operation time, operation interval time, sentence length, sentiment word density, word frequency statistics, reading pause interval, and response latency.

[0109] In this embodiment, step two specifically includes:

[0110] The target psychological characteristics include emotional change characteristics, behavioral frequency characteristics, and textual emotional characteristics;

[0111] The emotional change characteristics include: extracting the probability distribution of emotional tags, the magnitude of emotional change, and the duration of emotional change based on the emotional fields in structured psychological assessment data and text record data;

[0112] The behavioral frequency features include: calculating and generating the unit time operation frequency, application switching frequency, and average page category dwell time based on the application usage frequency, operation records, and page access records in the behavioral log data.

[0113] The text sentiment features include: extracting sentiment word density and sentiment polarity score based on text record data, and converting the text record data into sentiment embedding vectors with set feature dimensions through a pre-trained Word2Vec model; the sentiment polarity score is calculated by counting the number of positive and negative sentiment words in the text record data, and combining the sentiment weight of each sentiment word, and calculating the difference between the sum of positive weights and the sum of negative weights as the sentiment polarity score. For example, for the text "Today's work was very easy but a little annoying", where "easy" is a positive sentiment word with a weight of 0.8 and "annoying" is a negative sentiment word with a weight of −0.6, the sentiment polarity score is 0.8 − (−0.6) = 1.4;

[0114] Each feature dimension of the target psychological feature is used to generate a feature embedding vector through linear feature mapping, and all feature embedding vectors are organized into a psycho-semantic feature tensor according to the result of time step × feature dimension × feature embedding dimension.

[0115] In this embodiment, step three specifically includes:

[0116] In the input encoding module, the psycho-semantic feature tensor is linearly transformed in the feature embedding dimension through a trainable embedding mapping matrix and a bias vector to obtain the psycho-semantic embedding tensor.

[0117] At each time step, a time encoding matrix is ​​initialized based on a normal distribution, and the time encoding matrix is ​​updated through backpropagation during training;

[0118] The time encoding matrix is ​​assembled into a time encoding tensor according to time steps, and the psycho-semantic embedding tensor is added element-wise to the time encoding tensor along the feature embedding dimension to obtain the psycho-semantic embedding tensor.

[0119] In the psychological variable modeling module, attention operations are performed on the psychological semantic embedding tensor by constructing a structural interaction weight matrix and psychological factor vectors to obtain the psychological variable modeling tensor.

[0120] In the psychological temporal modeling module, a set of time scales is defined, where each time scale corresponds to a convolutional kernel size;

[0121] At each time scale, the tensor modeling the psychological variables is subjected to deep convolution along the time step dimension to obtain the deep convolution feature tensor for each time scale.

[0122] At each time scale, the depthwise convolutional feature tensor is channel-mapped in the feature embedding dimension through one-dimensional point convolution to obtain the point convolutional feature tensor.

[0123] We weight and fuse the point convolutional feature tensors across all time scales to obtain the psychological temporal modeling tensor.

[0124] In the feature fusion output module, the psychological time series modeling tensor is flattened according to the variable dimension at each time step to obtain the psychological flattened vector at each time step;

[0125] The psychological flattening vector at each time step is concatenated with the corresponding emotion embedding vector to obtain the psychological fusion vector;

[0126] The psychological fusion vector is output-mapped to the output bias vector through a trainable output mapping matrix to obtain the psychological state feature vector.

[0127] The psychological state feature vectors are arranged into a psychological state feature vector sequence according to time steps.

[0128] In this embodiment, the psychological variable modeling module obtains the psychological variable modeling tensor by constructing a structural interaction weight matrix and a psychological factor vector, and then performing attention operations on the psychological semantic embedding tensor. Specifically, this includes:

[0129] Based on the psychosemantic embedding tensor, a sequence of psychosemantic embedding vectors in the feature dimension is obtained. The sequence of psychosemantic embedding vectors is averaged in the time step dimension and linearly mapped through a trainable structure mapping weight matrix and structure mapping bias vector to obtain the structure feature vector.

[0130] Based on structural feature vectors, construct a structural interaction weight matrix: calculate the inner product similarity between the i-th structural feature vector and the j-th structural feature vector through inner product operation, and normalize the inner product similarity by Sigmoid to obtain the structural interaction weight, and use the structural interaction weight as the element value of the i-th row and j-th column of the structural interaction weight matrix.

[0131] The structural interaction weight matrix remains unchanged at each time step and is updated through backpropagation during the training and generation process;

[0132] Based on the psychosemantic embedding tensor, the psychosemantic embedding matrix at each time step is obtained, and then transformed into a query matrix, a key matrix, and a value matrix through three trainable mapping matrices respectively.

[0133] The psycho-semantic embedding matrix at each time step is max-pooled along the feature dimension, and a psycho-factor vector is generated through linear mapping.

[0134] The psychological factor vectors are mapped to query factor vectors and key factor vectors respectively through a trainable query state mapping matrix and a key state mapping matrix;

[0135] The query factor vector and key factor vector are broadcast in the variable dimension, and the query matrix and key matrix are modulated element by element to obtain the psychomodulated query matrix and psychomodulated key matrix.

[0136] At each time step, the psychological modulation query matrix and psychological modulation key matrix are processed by scaling inner product and Softmax normalization to obtain the variable attention weight matrix. The variable attention weight matrix is ​​then multiplied element-wise with the structural interaction weight matrix to obtain the structural constraint attention matrix. Finally, the structural constraint attention matrix is ​​multiplied with the value matrix to obtain the psychological variable modeling matrix.

[0137] By concatenating the psychological variable modeling matrices at all time steps, the psychological variable modeling tensor is obtained.

[0138] This invention, by introducing a structural interaction weight matrix and psychological factor vectors, integrates the structural relationships between variables and temporal contextual emotion modulation information in the psychosemantic embedding tensor, effectively enhancing the interaction modeling capability between multi-source psychological features. Compared to traditional attention mechanisms that rely solely on query-key relevance calculations, this structure introduces dual regulation of structural constraints and psychological state modulation during attention calculation, effectively improving the semantic rationality and structural stability of attention weight allocation. This enhances the sensitivity of the psychological variable modeling tensor to risk signals and the accuracy of characterizing psychological state changes, significantly strengthening the model's expressive and discriminative abilities when processing complex psychological behavioral data.

[0139] In this embodiment, step four specifically includes:

[0140] The psychological risk score for each time step is calculated by linearly mapping the psychological state feature vector at each time step to the risk bias term through a trainable risk mapping weight vector; the psychological risk scores are then arranged into a psychological risk score sequence in chronological order.

[0141] Set normal, mild, and moderate thresholds, and determine the level of psychological risk score at each time step:

[0142] If the psychological risk score at the current time step is less than the normal threshold, then the psychological risk level label is set to 1, indicating that it is normal.

[0143] If the psychological risk score at the current time step is less than the mild threshold but greater than or equal to the normal threshold, then the psychological risk level label is set to 2, indicating a mild warning.

[0144] If the psychological risk score at the current time step is less than the moderate threshold but greater than or equal to the mild threshold, then set the psychological risk level label to 3, indicating a moderate warning.

[0145] If the psychological risk score at the current time step is greater than or equal to the moderate threshold, then set the psychological risk level label to 4, indicating a high level of alert.

[0146] The psychological risk level labels are arranged into a psychological risk level label sequence in chronological order.

[0147] In this embodiment, step five specifically includes:

[0148] A historical sample library is set up, which includes several historical samples, each of which is a sequence of psychological state feature vectors labeled with a psychological risk level sequence;

[0149] The similarity score between the current psychological state feature vector sequence and each historical sample is calculated using the cosine similarity formula. Based on the similarity score, the top K historical samples are selected to form a set of similar psychological samples.

[0150] At each time step, the number of samples belonging to each psychological risk level label in the similar psychological sample set is counted, and the number of samples is normalized to obtain the probability distribution value of each psychological risk level label, and an individual psychological distribution vector is formed.

[0151] The individual psychological distribution matrix is ​​formed by assembling the individual psychological distribution vectors of all time steps.

[0152] In this embodiment, step six specifically includes:

[0153] Traverse the psychological risk level label sequence, take the time step with psychological risk level label 4 as the high risk time step, and merge consecutive high risk time steps to form a high risk interval.

[0154] Each high-risk interval consists of a start time step and an end time step. If a high-risk time step exists alone, then the start time step and the end time step of the high-risk interval are the same.

[0155] Merge all high-risk intervals and output a set of high-risk intervals;

[0156] For example, a user generates a psychological risk level label sequence in a psychological state analysis as: [1, 2, 4, 4, 3, 1, 4, 2, 4, 4, 4, 1]. When traversing this psychological risk level label sequence, the time step with label 4 is identified as a high-risk time step, appearing at time steps 3, 4, 7, 9, 10, and 11. Based on continuity judgment, time steps 3 and 4 are merged into a high-risk interval, with the starting time step being 3 and the ending time step being 4; time step 7 is a separate high-risk point, forming a high-risk interval with both the starting and ending time step being 7; time steps 9 to 11 appear consecutively, forming a third high-risk interval with the starting time step being 9 and the ending time step being 11. The set of high-risk intervals is: {[3, 4], [7, 7], [9, 11]}.

[0157] Set the sliding window length and perform sliding difference on the psychological risk score sequence to obtain the risk score change sequence;

[0158] Set a confidence threshold, and based on the individual psychological distribution matrix, obtain the maximum probability value of the individual psychological distribution vector at each time step. If the maximum probability value is less than the confidence threshold, the current time step is determined to be in an uncertain state, and a set of uncertain time steps is obtained.

[0159] The psychological state analysis results are composed of the psychological risk level label sequence, the high-risk interval set, the psychological risk score sequence, the risk score change sequence, the individual psychological distribution matrix, and the set of uncertain time steps, and then output to the user terminal.

[0160] In this invention, the high-risk interval set is used to identify consecutive time periods during which the target object's psychological state is at a high warning level within the analysis period, and can serve as the core trigger condition for key interventions and recommendations; the risk score change sequence reflects the fluctuation range of the psychological risk score between adjacent time steps, and is used to identify the risk trend of sudden emotional fluctuations or rapid deterioration of psychological state, which is an important basis for judging emotional instability; the uncertain state time step set is used to identify results with low confidence in the model's predictions at certain time steps, which helps to indicate that the system's analysis results at these time points have uncertainty risks, and facilitates guiding users to conduct secondary evaluations or supplement data, thereby improving the reliability and interpretability of the overall psychological state analysis.

[0161] In this embodiment, step seven specifically includes:

[0162] If the current time step belongs to the set of time steps with uncertain state, then the uncertain state suggestion template is called from the suggestion rule base;

[0163] If the current time step is in a high-risk zone, then a high-risk suggestion template is retrieved from the suggestion rule base;

[0164] If the change in risk score at the current time step is greater than the set sentiment fluctuation threshold, then the sentiment fluctuation suggestion template will be invoked.

[0165] The suggestion templates for uncertain status, high risk, or emotional fluctuation at each time step are combined to generate psychological counseling suggestions, which are then output to the user terminal in the order of time steps.

[0166] Example 1

[0167] To verify the feasibility of this invention in practice, it was applied to a student mental health education center's intelligent assessment and intervention system for psychological states. The center focused on first- to third-year students, and with informed consent, extracted multi-source psychological data from voluntarily submitted psychological assessment questionnaires, daily behavior logs, and unstructured text interaction records from online learning and communication platforms. The data was then standardized using timestamps to create a standardized psychological dataset. Traditional assessment methods rely primarily on one-time questionnaires and manual intervention, failing to dynamically track changes in individual psychological states. This is especially problematic before and after stressful events, where psychological fluctuations are prone to occur, yet timely warnings or appropriate guidance are often lacking.

[0168] In the implementation process, the collected structured questionnaire data, behavioral log data, and text record data are first time-aligned and normalized to generate a multi-source standardized psychological dataset. Then, the psychological feature extraction module extracts emotion change features, behavioral frequency features, and text sentiment features, and constructs a psychological semantic feature tensor. This psychological semantic feature tensor is input into an improved iTransformer network to generate a sequence of psychological state feature vectors. The risk assessment module generates a psychological risk score sequence and a psychological risk level label sequence based on the psychological state feature vector sequence, and constructs an individual psychological distribution matrix by combining it with a historical sample database. In the state analysis module, the system can automatically identify high-risk time intervals and uncertain time points, further matching them with a suggestion rule base to generate personalized psychological counseling suggestions. After the generated results are fed back to the user terminal, students can view them independently, and counselors can also view the student's risk dynamics and suggestion implementation status in the backend console.

[0169] To verify the effectiveness of this invention in practical applications, a comparative experiment was conducted with the following two systems: System A is a combination of traditional scale assessment and static feature MLP classifier, and System B is a psychoanalysis system based on the standard iTransformer network. The experimental results are shown in Table 1.

[0170] Table 1. Comparison of the performance of the system of the present invention and the comparative system in the task of mental state recognition.

[0171] Comparison Indicators: Comparison System A vs. Comparison System B Invention System Status Recognition Accuracy: 76.2% vs. 84.7% vs. 89.6% High-Risk Recognition Recall: 70.8% vs. 86.1% vs. 92.3% Status Recognition F1 Score: 74.5% vs. 83.9% vs. 88.7% Risk Level Change Detection Delay (hours): 11.6% vs. 6.8% vs. 3.2% Status Uncertainty Recognition Accuracy: 62.1% vs. 74.3% vs. 86.4% Suggestion Adoption Rate (Student End): 52.8% vs. 66.4% vs. 79.5% Teacher Satisfaction Rating (out of 10): 6.3% vs. 7.8% vs. 9.1% surface

[0172] As shown in Table 1, the system of this invention outperforms existing comparative systems in all comparative metrics. Firstly, in terms of state recognition accuracy, the system of this invention achieves 89.6%, an improvement of 13.4 percentage points compared to comparative system A and 4.9 percentage points compared to comparative system B. This indicates that the improved iTransformer network used in this invention can more comprehensively characterize the temporal and structural dependencies in the psycho-semantic feature tensor, improving the overall accuracy of psychological state recognition. In terms of high-risk recognition recall and state recognition F1 score, the system of this invention achieves 92.3% and 88.7% respectively, significantly higher than the 70.8% and 74.5% of comparative system A and the 86.1% and 83.9% of comparative system B. This demonstrates that the structural interaction weight matrix and psychological factor modulation mechanism introduced in the psychological variable modeling module of this invention can more accurately extract psychological state feature vectors strongly correlated with risk states, improving the improved iTransformer network's ability to identify key risk samples and making it suitable for detecting dynamic psychological events such as sudden anxiety and continuous high pressure. Regarding the delay in detecting changes in risk level, the average delay of the system of this invention is only 3.2 hours, which is significantly better than the 6.8 hours of the comparative system B and the 11.6 hours of the comparative system A. This indicates that the present invention can quickly respond to subtle fluctuations in risk trends in the psychological state feature vector sequence, and achieve sensitive capture and timely warning of changes in risk level.

[0173] Furthermore, when dealing with ambiguous states and abnormal psychological fluctuations, the state uncertainty recognition accuracy of this invention reaches 86.4%, significantly higher than the 62.1% of comparison system A and 74.3% of comparison system B. This indicates that the state analysis module of this invention can effectively improve the robustness and reliability of state determination. Regarding the adoption rate of results, the psychological counseling suggestions generated by the system of this invention achieved a 79.5% adoption rate among students, and a teacher subjective satisfaction rating of 9.1, significantly better than the 52.8% and 6.3 of comparison system A, and also better than the 66.4% and 7.8 of comparison system B. This fully demonstrates that this invention can generate more individualized and timely psychological suggestions, effectively improving the practical value of intervention implementation and user acceptance.

[0174] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A machine learning-based psychological data analysis system, characterized in that, include: The data acquisition and preprocessing module is used to acquire multi-source psychological data of the target object and preprocess it to obtain a standard psychological dataset. The psychological feature extraction module is used to extract target psychological features based on standard psychological datasets and map them to generate a psycho-semantic feature tensor. The psychological feature modeling module is used to model psychological features using a modified iTransformer network, outputting a sequence of psychological state feature vectors. The risk assessment module is used to assess the risk of the psychological state feature vector sequence, calculating the psychological risk score sequence and psychological risk level label sequence of the target object. The similarity analysis module is used to filter similar psychological sample sets based on the psychological state feature vector sequence and a preset historical sample library, and construct an individual psychological distribution matrix. The state analysis module is used to generate psychological state analysis results based on the psychological risk score sequence, psychological risk level label sequence, and individual psychological distribution matrix, and output them to the user terminal. The suggestion generation module is used to match the psychological state analysis results with the preset suggestion rule base, generate psychological counseling suggestions, and output them to the user terminal.

2. The machine learning-based psychological data analysis system according to claim 1, characterized in that, The modules are connected through the following steps: Step 1: Obtain multi-source psychological data of the target object and preprocess it to obtain a standard psychological dataset; Step 2: Based on the standard psychological dataset, extract the target psychological features and generate a psycho-semantic feature tensor from the target psychological features through feature mapping; step Step 3: Input the psycho-semantic feature tensor into the improved iTransformer network to perform psycho-feature modeling and output a sequence of psycho-state feature vectors; the improved iTransformer network includes an input encoding module, a psycho-variable modeling module, a psycho-temporal modeling module, and a feature fusion output module; Step 4: Calculate the psycho-risk score sequence and psycho-risk level label sequence of the target object based on the psycho-state feature vector sequence; Step 5: Calculate the similarity between the psycho-state feature vector sequence and a preset historical sample library, filter similar psycho-sample sets, and construct an individual psycho-distribution matrix based on the similar psycho-sample sets; Step 6: Generate psycho-state analysis results based on the psycho-risk score sequence, psycho-risk level label sequence, and individual psycho-distribution matrix and output them to the user terminal; Step 7: Match the psycho-state analysis results with a preset suggestion rule library to generate psycho-guidance suggestions and output them to the user terminal.

3. The psychological data analysis system based on machine learning according to claim 2, characterized in that, Step one specifically includes: the multi-source psychological data includes structured psychological assessment data, behavioral log data, and text record data; the preprocessing specifically includes: setting a time step sequence, aligning the multi-source psychological data according to the time step sequence; filling missing items in the multi-source psychological data using linear interpolation, and standardizing the numerical data in the multi-source psychological data using the Z-Score method.

4. A machine learning-based psychological data analysis system according to claim 2, characterized in that, Step two specifically includes: the target psychological features include emotion change features, behavior frequency features, and text sentiment features; the emotion change features include: extracting the probability distribution of emotion tags, the amplitude of emotion change, and the duration of emotion based on the emotion fields in the structured psychological assessment data and text record data; the behavior frequency features include: calculating and generating the unit time operation frequency, application switching frequency, and average dwell time of page categories based on the application usage frequency, operation records, and page access records in the behavior log data; the text sentiment features include: extracting the emotion word density and emotion polarity score based on the text record data, and converting the text record data into emotion embedding vectors with set feature dimensions through a pre-trained Word2Vec model; generating feature embedding vectors for each feature dimension of the target psychological features through linear feature mapping, and organizing all feature embedding vectors into a psycho-semantic feature tensor according to the result of time step × feature dimension × feature embedding dimension.

5. A machine learning-based psychological data analysis system according to claim 2, characterized in that, Step three specifically includes: In the input encoding module, the psychosemantic feature tensor is linearly transformed along the feature embedding dimension using a trainable embedding mapping matrix and a bias vector to obtain a psychosemantic embedding tensor; at each time step, a time encoding matrix is ​​initialized based on a normal distribution, and the time encoding matrix is ​​updated through backpropagation during training; the time encoding matrix is ​​assembled into a time encoding tensor according to the time steps, and the psychosemantic embedding tensor is added element-wise to the time encoding tensor along the feature embedding dimension to obtain a psychosemantic embedding tensor; in the psychovariable modeling module, attention operations are performed on the psychosemantic embedding tensor by constructing a structured interaction weight matrix and a psychofactor vector to obtain a psychovariable modeling tensor; in the psychotemporal modeling module, a set of time scales is set, where each time scale corresponds to a convolutional kernel size; at each time scale, The psychological variable modeling tensor is subjected to deep convolution along the time step dimension to obtain a deep convolutional feature tensor for each time scale. At each time scale, the deep convolutional feature tensor is channel-mapped along the feature embedding dimension using one-dimensional point convolution to obtain a point convolutional feature tensor. The point convolutional feature tensors from all time scales are weighted and fused to obtain a psychological temporal modeling tensor. In the feature fusion output module, the psychological temporal modeling tensor is flattened along the variable dimension at each time step to obtain a psychological flattened vector at each time step. The psychological flattened vector at each time step is concatenated with the corresponding emotion embedding vector to obtain a psychological fusion vector. The psychological fusion vector is output-mapped using a trainable output mapping matrix and an output bias vector to obtain a psychological state feature vector. The psychological state feature vectors are then assembled into a psychological state feature vector sequence according to the time steps.

6. A machine learning-based psychological data analysis system according to claim 5, characterized in that, In the psychological variable modeling module, attention operations are performed on the psychological semantic embedding tensor by constructing a structural interaction weight matrix and psychological factor vectors to obtain the psychological variable modeling tensor. Specifically, this includes: obtaining a sequence of psychological semantic embedding vectors along the feature dimension based on the psychological semantic embedding tensor; performing average pooling on the sequence of psychological semantic embedding vectors along the time step dimension; and performing linear mapping through a trainable structural mapping weight matrix and a structural mapping bias vector to obtain structural feature vectors; constructing a structural interaction weight matrix based on the structural feature vectors: calculating the inner product similarity between the i-th and j-th structural feature vectors through an inner product operation, and normalizing the inner product similarity using Sigmoid to obtain structural interaction weights; and using the structural interaction weights as the element value of the i-th row and j-th column of the structural interaction weight matrix; the structural interaction weight matrix remains unchanged at each time step and is updated through backpropagation during the training process; and obtaining the psychological semantic modeling tensor at each time step based on the psychological semantic embedding tensor. The embedding matrix is ​​transformed into a query matrix, a key matrix, and a value matrix using three trainable mapping matrices. The psychosemantic embedding matrix at each time step is max-pooled along the feature dimension and a psychofactor vector is generated through linear mapping. The psychofactor vectors are then mapped to query factor vectors and key factor vectors using trainable query-state mapping matrices and key-state mapping matrices, respectively. The query factor vectors and key factor vectors are broadcast along the variable dimension, and the query matrix and key matrix are modulated element-wise by addition to obtain the psychomodulated query matrix and psychomodulated key matrix. At each time step, the psychomodulated query matrix and psychomodulated key matrix are normalized using a scaled inner product and Softmax to obtain a variable attention weight matrix. This variable attention weight matrix is ​​then multiplied element-wise with the structural interaction weight matrix to obtain a structural constraint attention matrix. Finally, the structural constraint attention matrix is ​​multiplied with the value matrix to obtain the psychovariable modeling matrix. The psychovariable modeling matrices from all time steps are concatenated to obtain the psychovariable modeling tensor.

7. A machine learning-based psychological data analysis system according to claim 2, characterized in that, Step four specifically includes: linearly mapping the psychological state feature vector of each time step to a risk bias term using a trainable risk mapping weight vector, and calculating the psychological risk score for each time step; arranging the psychological risk scores into a psychological risk score sequence in chronological order; setting normal, mild, and moderate thresholds, and determining the level of the psychological risk score for each time step: if the psychological risk score of the current time step is less than the normal threshold, then the psychological risk level label is set to 1, indicating normal; if the psychological risk score of the current time step is less than the mild threshold but greater than or equal to the normal threshold, then the psychological risk level label is set to 2, indicating mild warning; if the psychological risk score of the current time step is less than the moderate threshold but greater than or equal to the mild threshold, then the psychological risk level label is set to 3, indicating moderate warning; if the psychological risk score of the current time step is greater than or equal to the moderate threshold, then the psychological risk level label is set to 4, indicating high warning; and arranging the psychological risk level labels into a psychological risk level label sequence in chronological order.

8. A machine learning-based psychological data analysis system according to claim 2, characterized in that, Step five specifically includes: setting up a historical sample library, which includes several historical samples, each of which is a sequence of psychological state feature vectors labeled with psychological risk level tags; calculating the similarity score between the current psychological state feature vector sequence and each historical sample using the cosine similarity formula, and selecting the top K historical samples based on the similarity scores to form a similar psychological sample set; at each time step, counting the number of samples in the similar psychological sample set belonging to each psychological risk level tag, and normalizing the number of samples to obtain the probability distribution value of each psychological risk level tag, and forming an individual psychological distribution vector; and forming an individual psychological distribution matrix from the individual psychological distribution vectors of all time steps.

9. A machine learning-based psychological data analysis system according to claim 2, characterized in that, Step six specifically includes: traversing the psychological risk level label sequence, taking the time step with a psychological risk level label of 4 as a high-risk time step, and merging consecutive high-risk time steps to form a high-risk interval; wherein, each high-risk interval consists of a start time step and an end time step, and if a high-risk time step exists alone, the start time step and end time step of the high-risk interval are the same; merging all high-risk intervals and outputting a high-risk interval set; setting a sliding window length and performing sliding difference on the psychological risk score sequence to obtain a risk score change sequence; setting a confidence threshold, and based on the individual psychological distribution matrix, obtaining the maximum probability value of the individual psychological distribution vector at each time step; if the maximum probability value is less than the confidence threshold, the current time step is determined to be in an uncertain state, obtaining a set of uncertain state time steps; combining the psychological risk level label sequence, the high-risk interval set, the psychological risk score sequence, the risk score change sequence, the individual psychological distribution matrix, and the set of uncertain state time steps to form a psychological state analysis result, and outputting it to the user terminal.

10. A machine learning-based psychological data analysis system according to claim 2, characterized in that, Step seven specifically includes: if the current time step belongs to the set of time steps with uncertain states, then call the uncertain state suggestion template from the suggestion rule base; if the current time step is in a high-risk range, then call the high-risk suggestion template from the suggestion rule base; if the risk score change value of the current time step is greater than the set emotional fluctuation threshold, then call the emotional fluctuation suggestion template; combine the uncertain state suggestion template, high-risk suggestion template or emotional fluctuation suggestion template of each time step to generate psychological counseling suggestions, and output them to the user terminal in the order of time steps.