Mental health assessment method based on dynamic time sequence hypergraph representation learning
By using a dynamic temporal hypergraph representation learning method, we analyze students' campus network behavior data, construct a dynamic temporal hypergraph, extract rhythm and preference features, solve the problems of objectivity and real-time performance in the assessment of college students' mental health, and achieve early risk warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LANZHOU UNIV
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies for assessing the mental health of college students suffer from insufficient objectivity, high costs, and difficulty in large-scale real-time monitoring. In particular, they rely on questionnaire self-assessment and professional interviews, making it difficult to conduct continuous, real-time monitoring and early warning in a large student population.
Based on the dynamic temporal hypergraph representation learning method, this paper constructs a dynamic temporal hypergraph by analyzing students' campus network behavior data, extracts rhythmic representation features and preference representation features, and combines event semantics and time difference hyperedge weights to assess mental health status.
It enables objective assessment of students' mental health risks without parsing sensitive text content, provides early warnings, balances compliance and interpretability, and is suitable for continuous and real-time monitoring of large-scale student groups.
Smart Images

Figure CN122050828A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence and mental health assessment technology, specifically to a mental health assessment method based on dynamic temporal hypergraph representation learning. Background Technology
[0002] Because emotional and psychological issues can have a lasting impact on learning efficiency, daily routines, and interpersonal relationships, the mental health of university students is receiving increasing attention. In reality, assessments of students' mental health on campus primarily rely on self-assessment questionnaires or assessments by professionals through interviews, scales, and related monitoring methods. However, the former is easily influenced by privacy concerns, insufficient willingness to express themselves, and cognitive and recall biases, potentially leading to less objective results. The latter relies heavily on professional resources, resulting in high implementation costs and long response times, making it difficult to support continuous, real-time monitoring and early warning for large student populations. With the development of artificial intelligence technology, utilizing campus network behavior data generated by students' use of the campus network to objectively assess their mental health has become an important research direction for evaluating student mental health on campus. Summary of the Invention
[0003] This application provides a mental health assessment method based on dynamic temporal hypergraph representation learning, which can objectively assess students' mental health status using students' campus network behavior data. The technical solution is as follows:
[0004] On the one hand, a mental health assessment method based on dynamic temporal hypergraph representation learning is provided, the method including:
[0005] Obtain campus network behavior data of the target student. The campus network behavior data includes N access behavior data sorted by timestamp, where N is an integer greater than 1.
[0006] N access behavior data are converted into N triple events consisting of time slice index, website category number and access intensity. The N triple events are sorted by timestamp to obtain the triple event sequence. The access intensity is determined based on the number of visits and / or dwell time of the corresponding website category.
[0007] Based on the triple event sequence, a dynamic temporal hypergraph of the target student is constructed. The dynamic temporal hypergraph includes k1 time slice nodes, k2 website category nodes, k3 access intensity nodes, and N hyperedges connecting a single time slice node, a single website category node, and a single access intensity node. k1, k2, and k3 are all integers greater than 1. Each triple event corresponds to a hyperedge connecting the corresponding time slice node, the corresponding website category node, and the corresponding intensity node.
[0008] Based on the event semantic features corresponding to N triple events and the time difference between the occurrence time and the evaluation time of the N triple events, the weight values corresponding to the N hyperedges in the dynamic temporal hypergraph are determined. The event semantic features are composed of the time encoding features of the time slice nodes connected by the hyperedges describing the corresponding triple events in the dynamic temporal hypergraph, the category semantic features of the website category nodes, and the access intensity features of the access intensity nodes.
[0009] Based on the weight values corresponding to the N hyperedges, the initial features of each node in the dynamic temporal hypergraph are updated to obtain the target features of each node in the dynamic temporal hypergraph.
[0010] Attention pooling is performed on the target features of k1 time slice nodes to obtain rhythmic representation features, which indicate the temporal characteristics of the target student's use of the campus network.
[0011] Attention pooling is performed on the target features of k2 website category nodes to obtain preference representation features, which indicate the preferences of target students in accessing websites using the campus network;
[0012] Based on rhythmic and preference representations, the mental health status of target students is assessed, and mental health assessment results are obtained.
[0013] On the other hand, a mental health assessment device based on dynamic temporal hypergraph representation learning is provided, the device comprising:
[0014] The data acquisition module is used to acquire campus network behavior data of the target students. The campus network behavior data includes N access behavior data sorted by timestamp, where N is an integer greater than 1.
[0015] The data processing module is used to convert N access behavior data into N triple events consisting of time slice index, website category number and access intensity, and sort the N triple events by timestamp to obtain a triple event sequence. The access intensity is determined based on the number of visits and / or dwell time of the corresponding website category.
[0016] The hypergraph construction module is used to construct a dynamic temporal hypergraph of the target student based on the triple event sequence. The dynamic temporal hypergraph includes k1 time slice nodes, k2 website category nodes, k3 access intensity nodes, and N hyperedges connecting a single time slice node, a single website category node, and a single access intensity node. k1, k2, and k3 are all integers greater than 1. Each triple event corresponds to a hyperedge connecting the corresponding time slice node, the corresponding website category node, and the corresponding intensity node.
[0017] The weight determination module is used to determine the weight values of the N hyperedges in the dynamic temporal hypergraph based on the event semantic features corresponding to the N triple events and the time difference between the occurrence time and the evaluation time of the N triple events. The event semantic features are composed of the time encoding features of the time slice nodes connected by the hyperedges describing the corresponding triple events in the dynamic temporal hypergraph, the category semantic features of the website category nodes, and the access intensity features of the access intensity nodes.
[0018] The feature update module is used to update the initial features of each node in the dynamic temporal hypergraph based on the weight values corresponding to the N hyperedges, so as to obtain the target features of each node in the dynamic temporal hypergraph.
[0019] The representation learning module is used to perform attention pooling on the target features of k1 time slice nodes to obtain rhythmic representation features, which indicate the time characteristics of target students using the campus network; and to perform attention pooling on the target features of k2 website category nodes to obtain preference representation features, which indicate the preferences of target students in accessing websites using the campus network.
[0020] The assessment module is used to evaluate the mental health status of target students based on rhythmic and preference representation features, and obtain mental health assessment results.
[0021] On the other hand, a computer device is provided, comprising a memory and a processor, wherein the memory is used to store a computer program and the processor is used to execute the computer program to implement the steps of the above-described mental health assessment method based on dynamic temporal hypergraph representation learning.
[0022] On the other hand, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described mental health assessment method based on dynamic temporal hypergraph representation learning.
[0023] On the other hand, this application provides a computer program product containing instructions that are executed by a processor to implement the steps of the above-described mental health assessment method based on dynamic temporal hypergraph representation learning.
[0024] The technical solution provided in this application has at least the following beneficial effects:
[0025] This application uses campus network behavior data of target students as a foundation. It converts N access behavior data into triple event sequences and introduces time-slice periodic coding to characterize the behavioral rhythms of target students. Furthermore, it integrates the hierarchical relationships of classification systems and the statistical relationships of group behavior to construct a network semantic graph and generate category semantic features. This transforms website categories from discrete numbers into vector representations that express semantic similarity and statistical correlation. Based on this, the joint relationship between event-level time slices, categories, and intensity is explicitly modeled in the form of hyperedges in a dynamic temporal hypergraph. By combining the hyperedge weights of event semantics and time differences, the contribution of recent and semantically significant events is highlighted, thereby enhancing the sensitivity to changes in risk-related patterns. Furthermore, based on the target students' dynamic temporal hypergraph, rhythmic and preference representation features are extracted. Cross-view semantic alignment and alignment residual modeling are used to analyze the deviation between rhythm and preference, thereby assessing the mental health status of target students. Therefore, this application can objectively assess the mental health risks of target students and provide early warnings by analyzing the regularity and preference changes in their online activities, especially when abnormal deviations occur. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. It should be noted that the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a schematic diagram of the architecture of a student campus data processing system provided in an embodiment of this application;
[0028] Figure 2 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application;
[0029] Figure 3 This is a flowchart illustrating a mental health assessment method provided in an embodiment of this application;
[0030] Figure 4 This is a schematic diagram of the structure of a mental health assessment device provided in an embodiment of this application. Detailed Implementation
[0031] To make the purpose, technical solution, and beneficial effects of this application clearer, the technical solution of this application will be further described below with reference to embodiments. It should be understood that the following embodiments are only used to explain this application and do not constitute a limitation on the scope of protection.
[0032] In a campus network environment, students' internet usage behavior typically exhibits both rhythmicity and preference: rhythmicity is reflected in the distribution and stability of access intensity across day and night and weekly cycles; preference is reflected in the access structure and its changes across different website categories. When a target student is at risk of mental health issues, their behavioral patterns may manifest as abnormal rhythms, abrupt changes in preferences, or a discrepancy between the two. Using only statistical features or fixed window sequence modeling often fails to retain the joint context of time, category, and intensity at the event level, and it is also difficult to integrate the category system structure and group statistical relationships to form a stable semantic prior. Furthermore, it does not adequately express the differences between recent and long-term behaviors. On the other hand, parsing webpage text, search terms, or chat content carries the risk of handling sensitive information, which is detrimental to large-scale deployment in campus scenarios. Based on this background and need, this application proposes a mental health assessment method based on dynamic temporal hypergraph representation learning. This method can assess mental health without parsing sensitive text content, using behavioral data for evaluation. It obtains rhythmic and preference representation features through semantic enhancement and dynamic temporal hypergraph modeling, and drives the output of risk probabilities and scores using cross-view aligned residuals, thereby achieving early screening and trend warning.
[0033] Based on the above considerations, this application provides a mental health assessment method based on dynamic temporal hypergraph representation learning. It can objectively assess the mental health risks of target students and provide early warnings by analyzing the regularity and preference changes of target students' online behavior data, especially when there are abnormal deviations between the two.
[0034] As an example, the mental health assessment method based on dynamic temporal hypergraph representation learning provided in this application can be applied to campus network data processing and risk assessment scenarios, such as deployment on... Figure 1 The student campus data processing system shown. See also Figure 1 The student campus data processing system includes a campus gateway 100, a database 200, and data processing equipment 300.
[0035] The input source for the student campus data processing system can be a device that generates or carries online behavioral events of students within the campus network environment. For example, the input source can be a student terminal (such as a mobile phone, tablet, or personal computer), a campus public internet access device, or other networked device capable of accessing the campus network. The campus gateway 100, as the aggregation / egress node of the campus network, is used to record and aggregate access behaviors passing through the campus network, generating campus network behavior data corresponding to the access behaviors. This campus network behavior data includes N access behavior data (i.e., access behavior records) sorted by timestamp. Each access behavior data record includes access time, access target identifier (domain name, IP address, or its mapping identifier), access intensity-related statistical information, etc. In some embodiments, the N access behavior data obtained and used in this application embodiment do not involve webpage text, search terms, comment content, or chat content to reduce the risk of sensitive information processing.
[0036] Database 200 is used to store, index, and manage access control for campus behavior data output by campus gateway 100, in order to support subsequent querying, extraction, and analysis.
[0037] The data processing device 300 is used to acquire campus behavior data and execute the technical solution provided in this application embodiment to output the target student's mental health assessment result by analyzing the target student's campus network behavior data. Exemplarily, the data processing device 300 can acquire real-time or near-real-time behavior data streams from the campus gateway 100; or read historical behavior data from the database 200; or simultaneously acquire data from the campus gateway 100 and the database 200 to achieve collaborative processing of real-time assessment and historical comparison. In some embodiments, the mental health assessment result finally output by the data processing device 300 may include multiple items such as risk probability, mental health score, and graded prompts generated by preset threshold rules. This application embodiment does not limit the specific content that the mental health assessment result may include.
[0038] In some embodiments, the data processing device 300 can be a server, workstation, edge computing node, or a combination thereof; it can also be implemented as a cluster, distributed system, or cloud service, for example, providing computing power on a cloud computing platform using virtual machines, containers, or service-oriented interfaces, and cooperating with database services, message queue services, security audit services, etc., to meet the needs of concurrent access, batch evaluation, and access control in a campus setting. Where the evaluation process of the embodiments of this application can be implemented, the embodiments of this application do not limit the specific hardware form and deployment location of the data processing device 300.
[0039] As an example, data processing device 300 can provide Figure 2 The computer equipment shown. (For example...) Figure 2As shown, the computer device may include a processor 210, a communication bus 220, a memory 230, and a communication interface 240. The communication bus 220 is used for data and instruction transmission between the processor 210, the memory 230, and the communication interface 240.
[0040] Processor 210 can be a general-purpose processor or a special-purpose processor, exemplarily including a central processing unit (CPU), graphics processing unit (GPU), network processor (NP), microprocessor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or a combination thereof, for executing program instructions and performing operations such as feature calculation, graph structure propagation, attention pooling, alignment metric, and decision output. Memory 230 is used to store program instructions, model parameters, and intermediate calculation results, exemplarily including read-only memory (ROM), random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), and non-volatile storage media such as disks and optical discs; memory 230 can be disposed separately from processor 210 or integrated with processor 210.
[0041] The communication interface 240 is used to communicate with external networks or devices, and includes, for example, wired communication interfaces (such as Ethernet interfaces) and / or wireless communication interfaces (such as Wireless Local Area Networks (WLAN) interfaces, cellular communication interfaces, etc.) to enable data interaction with campus gateway 100, database 200 or other business systems.
[0042] In some embodiments, the memory 230 stores a computer program that, when executed by the processor 210, causes the computer device to implement the steps of the mental health assessment method based on dynamic temporal hypergraph representation learning provided in the embodiments of this application.
[0043] It should be noted that the above description of the system architecture and computer equipment architecture is intended to facilitate understanding of the technical solutions of the embodiments of this application, and does not constitute an exhaustive list or limitation of the implementation methods. It should be understood that with the emergence of new application scenarios and changes in the structure of data processing equipment, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0044] The mental health assessment method based on dynamic temporal hypergraph representation learning provided in the embodiments of this application will be explained in detail below.
[0045] Figure 3 This is a flowchart illustrating a mental health assessment method based on dynamic temporal hypergraph representation learning, provided in an embodiment of this application. It can be applied to... Figure 1 The data processing device shown can be... Figure 2 The computer equipment shown. Please refer to... Figure 3 The method includes the following steps:
[0046] Step 310: Obtain and process the time-series data of the target student's campus behavior. The time-series data of campus behavior includes N records of campus behavior data sorted by timestamp.
[0047] Each piece of campus behavior data describes a behavioral event triggered by a target student at a corresponding timestamp.
[0048] In some embodiments, step 310 is used to obtain and process the raw input data required for subsequent modeling in order to quantitatively characterize students’ internet usage behavior without introducing sensitive text content.
[0049] In some embodiments, each piece of campus behavior data is generated by a campus gateway, a network access authentication system, a Domain Name System (DNS) / Hypertext Transfer Protocol (HTTP) log system, or a combination thereof. Each piece of campus behavior data includes at least a timestamp and access target identification information, and may also include intensity-related statistical information such as session duration, number of accesses, and uplink / downlink traffic. It should be noted that the N pieces of campus behavior data obtained in this application embodiment do not contain webpage text, search terms, comment content, or chat content, thereby reducing privacy and compliance risks.
[0050] In some embodiments, step 310 includes the following processing steps 11-13:
[0051] Step 11: Anonymize or de-identify the information used to identify students so that a single record cannot directly point to their real identity;
[0052] Step 12: Remove duplicate reports, obviously non-human-caused abnormal access records, and records missing key fields;
[0053] Step 13: Map the target domain name or IP address to a category number in a predefined set of website categories. ,in Let K be the website category number corresponding to the i-th event, and K be the total number of categories in the predefined website category set; the access intensity is discretized and binned according to the access frequency and session duration indicators to obtain the intensity level. .
[0054] Step 320: Map the timestamps of N access behavior data to discrete time slice indices with a preset granularity, and generate time slice periodic coding features.
[0055] In this embodiment of the application, step 320 is used to convert the timestamp into a periodic encoding feature with a uniform period, so that the joint context of time-category-intensity can be preserved at the event level, and the alignment and comparison across users and time windows can be facilitated.
[0056] In some embodiments, step 320 includes the following processing steps 21-22:
[0057] Step 21: Time-slice discretization and periodic encoding construction. In one possible implementation, the time-slice granularity is fixed at 1 hour, and a week is discretized into 168 time-slice nodes; timestamps are recorded for any access behavior. Map it to a discrete time slice This represents the temporal location of the access behavior within a period (one week). For example, the following mapping method can be used: ,in, This represents the weekday index, with values ranging from 0 to 6 corresponding to Monday through Sunday. This represents the hour index, with values ranging from 0 to 23.
[0058] Furthermore, to simultaneously characterize daily and weekly cycles, in some implementation cases, for any... definition: mod 24, Based on this, the time-slice periodic coding feature can be constructed as shown in the following formula (1):
[0059] (1)
[0060] in, Reflecting intraday position, Reflecting the position within a week, this time-slice periodic coding feature can provide continuous periodic structure information to support rhythmic characterization while maintaining discrete time-slice indices.
[0061] It should be understood that the above encoding method is merely an example, and this application does not limit the specific encoding dimensions and granularity.
[0062] Step 22: After completing category mapping, intensity discretization, and time slice discretization, convert each access behavior record into a triplet event: ,in It is the time slice index of event i. It is the website category number of event i. This represents the access intensity level of event i. The triplet time series of target student u is then formed by sorting the data according to timestamps. ,in This refers to the total number of access events for the target student u.
[0063] Through the above steps 320, this application can transform the original access logs into standardized event-level inputs without using web page text, search terms, or chat content, and characterize the intraweek / intraday rhythm structure with a unified time coordinate system of 1 hour to 168 time slices, providing a consistent data foundation for subsequent dynamic time series hypergraph modeling and risk assessment.
[0064] Step 330: Construct a network semantic graph that integrates the structural relationships of the classification system and the co-occurrence / transfer relationships of group behavior statistics, and generate category semantic features for each website category based on the network semantic graph.
[0065] In this embodiment of the application, step 330 is used to introduce a stable semantic prior for the category ID, so that the category is not only a discrete number, but also has a learnable semantic representation, thereby improving the robustness across scenarios and providing semantic support for subsequent hypergraph propagation and interpretation.
[0066] In some embodiments, the adjacency matrix of the network semantic graph is obtained by fusing the category architecture adjacency matrix and the statistical semantic adjacency matrix. The category architecture adjacency matrix is used to describe the structural similarity relationship of website categories in a preset classification system; the statistical semantic adjacency matrix is used to describe the category co-occurrence relationship and / or adjacent access transfer relationship obtained from the statistics of all student logs.
[0067] As an example, the adjacency matrix of the tag category architecture is The statistical semantic adjacency matrix is The fusion yields the category semantic matrix. It can be expressed by the following formula (2):
[0068] (2)
[0069] in, It is the fusion coefficient.
[0070] In some embodiments, a category one-hot matrix As the initial category feature, The category semantic features generated by the input semantic encoder can be represented by the following formula (3):
[0071] (3)
[0072] Where K is the number of categories, and d is the vector dimension. The c-th row vector represents the semantic feature of website category c. The semantic encoder used here It can be a graph convolutional network, a graph attention network, or other graph representation models, etc. The embodiments of this application do not limit its type.
[0073] Step 340: Construct a dynamic temporal hypergraph based on the triple event sequence. The hypergraph nodes include time slice nodes, category nodes, and intensity nodes. Each triple event corresponds to a hyperedge that connects the corresponding time slice node, the corresponding category node, and the corresponding intensity node. The hyperedge weight is calculated by the event semantic vector and the time difference from the evaluation time.
[0074] In this embodiment of the application, step 340 is used to explicitly model event-level high-order relations in a hyperedge manner, so that the time, category and intensity of a single access event are bound to the same structural unit, thereby preserving the joint context and supporting subsequent weighted structure propagation.
[0075] In one possible implementation, the evaluation window is set to W, and a dynamic temporal hypergraph is constructed. The node set includes a time slice node set, a website category node set, and a visit intensity node set. For any event... Constructing hyperedges .
[0076] In some embodiments, to calculate the hyperedge weights, a semantic vector for each event is first constructed. For example, concatenating category semantic features, time slice period encoding, and intensity embedding: .
[0077] Let the current evaluation time be... The time difference between the event and the occurrence of the event is = In one possible implementation, the hyperedge weight is determined by both a semantic saliency term and a time decay term, and can be obtained by the following formula (4):
[0078] (4)
[0079] in , For parameters, For activation function, This is used to reflect the timeliness characteristic where recent time contributes more. Furthermore, all hyperedge weights are constructed as diagonal matrices. .
[0080] Step 350: Perform weighted hypergraph convolutional propagation on the dynamic temporal hypergraph to update the node representations. Based on the weight values corresponding to the N hyperedges, update the initial features of each node in the dynamic temporal hypergraph to obtain the target features of each node in the dynamic temporal hypergraph.
[0081] In this embodiment of the application, step 350 is used to aggregate event-level context on the hypergraph structure, so that the node representation can simultaneously absorb information such as category semantics, temporal rhythm, intensity contribution and timeliness weight.
[0082] In one possible implementation, a hypergraph association matrix is constructed. This represents the connection relationship between nodes and hyperedges. Let the node characteristic matrix be... Then the first The update of the layered weighted hypergraph convolution can be expressed in the form of the following formula (5):
[0083] (5)
[0084] in It is a non-linear activation function. These are learnable parameters; and These are the node degree matrix and the hyperedge degree matrix, respectively, used to normalize the message passing between nodes, hyperedges, and nodes. Through the above propagation, time-slice nodes can aggregate their associated category and intensity information, and category nodes can also aggregate their co-occurring time-slice and intensity information, thereby organizing discrete events into a learnable structural representation.
[0085] In this embodiment, the initial characteristics of a node can be set according to the node type: the time-slice node characteristics can be determined by... The category node features are obtained through linear mapping, and are derived from the category semantic features obtained in step 330. Given, the strength node features can be given by the strength embedding emb(a); and different types of node features can be mapped to a unified dimension before entering the hypergraph convolution so as to perform unified propagation updates.
[0086] In this embodiment of the application, the number of layers of the hypergraph convolution is set to two. After completing the two-layer weighted hypergraph convolution, the updated target features of each node are obtained.
[0087] Step 360: Perform attention pooling on the time slice node set and the category node set respectively to form two types of view representation features.
[0088] In this embodiment of the application, step 360 is used to pool different types of nodes to obtain two complementary user structure representations, wherein the rhythmic representation feature is used to characterize the periodicity and stability of the time dimension, and the preference representation feature is used to characterize the semantic preference structure and changes of the category dimension.
[0089] Taking rhythmic representation features as an example, time slice nodes are recorded. The representation of is Then the attention weights can be calculated and summed using the following formula (6):
[0090] (6)
[0091] Where tanh(·) is a nonlinear activation function. and For learnable parameters, This refers to rhythmic representation features, used to characterize the distribution pattern, stability, and anomalies of target students' visit activities across 168 time slices. Similarly, category nodes are denoted... The representation of is The preference representation features can be obtained by the following formula (7):
[0092] (7)
[0093] in, and For learnable parameters, In other words, preference representation features are used to characterize the semantic preference structure and changes of target students for different website categories.
[0094] In this embodiment of the application, through shared hypergraph propagation and separate attention pooling, the same set of event structure information can be projected into two user representations: rhythm structure (time slice side) and preference structure (category side), providing input basis for cross-view alignment and alignment residual-driven risk assessment in subsequent step 360.
[0095] Step 370: Map rhythmic representation features and preference representation features to a unified latent space and perform cross-view alignment, calculate alignment residuals, and output risk probability, intensity index and mental health score based on the decision function driven by alignment residuals.
[0096] In this embodiment of the application, step 360 is used to characterize the consistency relationship between the rhythm structure and the preference structure, and to explicitly quantify the inconsistent part as alignment residuals, thereby forming interpretable risk clues: when rhythm abnormalities and preference mutations occur simultaneously or when the two are inconsistent, the alignment residuals tend to increase, and the corresponding risk probability increases.
[0097] In one possible implementation, the two representation features are mapped to a unified latent space, which can be obtained by the following formula (8):
[0098] (8)
[0099] in, (·)and (·) represents the mapping network. Further, the residual vector is defined. And its L2 norm is used as an index of alignment residual strength: .
[0100] In some embodiments, the risk probability output by the decision function driven by the aligned residual can be obtained by the following formula (9):
[0101] (9)
[0102] in, For learnable parameters, For the Sigmoid function, The risk probability is used as the basis for the mental health score. The mental health score can be generated from the risk probability through a monotonic mapping, and the risk probability and / or mental health score can be compared with a preset set of thresholds to obtain a graded prompt result. This application does not limit this.
[0103] In some embodiments, to achieve the cross-view semantic alignment learning, contrastive learning is used to constrain two latent representations of the same target student to remain similar in a unified space and to remain separable from the latent representations of other target students. Exemplarily, this can be obtained through the following formula (10):
[0104] (10)
[0105] Where sim(·) is the cosine similarity, exp(·) is the exponential function, log(·) is the natural logarithm function, N is the number of samples participating in contrastive learning in the batch, i is the anchor sample index, and j is the contrast sample index. This represents the temperature coefficient. Through the above method, the model can learn the correspondence between rhythm and preference in a unified latent space, thereby aligning the residuals. It more effectively reflects deviations between the two views that are outside the normal correspondence, thereby improving the sensitivity and interpretability of risk signals.
[0106] It should be noted that the semantic encoder, hyperedge weight calculation module, weighted hypergraph convolution propagation module, attention pooling module, mapping network, and decision function mentioned above all contain learnable parameters. These learnable parameters can be learned from the training data, and a joint objective function can be constructed during training to optimize and update these learnable parameters end-to-end.
[0107] In some embodiments, the joint objective function includes a contrastive learning loss term to constrain the alignment consistency between rhythmic representation features and preference representation features, and a classification loss term to constrain the consistency between the risk probability output and the sample label; wherein the classification loss term may employ cross-entropy loss. The joint objective function may be weighted and summed according to preset weights, and the learnable parameters may be updated using a gradient optimization method.
[0108] In other embodiments, the training process can be completed offline; during the deployment phase, the trained parameters are invoked to infer the target student data, thereby outputting risk probability, mental health score, and intensity index.
[0109] In summary, this application's embodiments are based on the campus network behavior data of target students. By converting N access behavior data into triple event sequences and introducing time-slice periodic encoding, the behavioral rhythms of target students are characterized. Furthermore, a network semantic graph is constructed by integrating the hierarchical structure relationship and the statistical relationship of group behavior, generating category semantic features. This transforms website categories from discrete numbers into vector representations that express semantic similarity and statistical correlation. Based on this, the joint relationship between event-level time slices, categories, and intensity is explicitly modeled in the form of hyperedges in a dynamic temporal hypergraph. The contribution of recent and semantically significant events is highlighted by combining the hyperedge weights of event semantics and time differences, thereby enhancing sensitivity to changes in risk-related patterns. Furthermore, rhythmic and preference representation features are extracted based on the target students' dynamic temporal hypergraph, and the deviation between rhythm and preference is analyzed through cross-view semantic alignment and alignment residual modeling, thereby assessing the target students' mental health status. Therefore, this application embodiment, based on N access behavior data of the target student, can objectively assess the target student's mental health risk and provide early warnings by analyzing the regularity and preference changes of the target student's online activities, especially when there are abnormal deviations between these two, without collecting or parsing the webpage text, search terms or chat content, thus taking into account compliance, sensitivity and interpretability.
[0110] The apparatus involved in the embodiments of this application will be described next.
[0111] Figure 4This is a schematic diagram of a mental health assessment device based on dynamic temporal hypergraph representation learning, provided in an embodiment of this application. This mental health assessment device based on dynamic temporal hypergraph representation learning can be implemented by software, hardware, or a combination of both. Figure 1 The data processing device shown may be part or all of the data processing device, and the data processing device may also be Figure 2 The computer equipment shown. Please refer to... Figure 4 The mental health assessment device based on dynamic temporal hypergraph representation learning includes: a data acquisition module 410, a data processing module 420, a hypergraph construction module 430, a weight determination module 440, a feature update module 450, a representation learning module 460, and an assessment module 470.
[0112] The data acquisition module 410 is used to acquire campus network behavior data of the target student. The campus network behavior data includes N access behavior data sorted by timestamp, where N is an integer greater than 1.
[0113] The data processing module 420 is used to convert N access behavior data into N triple events consisting of time slice index, website category number and access intensity, and sort the N triple events by timestamp to obtain a triple event sequence. The access intensity is determined based on the number of visits and / or dwell time of the corresponding website category.
[0114] The hypergraph construction module 430 is used to construct a dynamic temporal hypergraph of the target student based on the triple event sequence. The dynamic temporal hypergraph includes k1 time slice nodes, k2 website category nodes, k3 access intensity nodes, and N hyperedges connecting a single time slice node, a single website category node, and a single access intensity node. k1, k2, and k3 are all integers greater than 1. Each triple event corresponds to a hyperedge connecting the corresponding time slice node, the corresponding website category node, and the corresponding intensity node.
[0115] The weight determination module 440 is used to determine the weight values of the N hyperedges in the dynamic temporal hypergraph based on the event semantic features corresponding to the N triple events and the time difference between the occurrence time and the evaluation time of the N triple events. The event semantic features are composed of the time encoding features of the time slice nodes connected by the hyperedges describing the corresponding triple events in the dynamic temporal hypergraph, the category semantic features of the website category nodes, and the access intensity features of the access intensity nodes.
[0116] The feature update module 450 is used to update the initial features of each node in the dynamic temporal hypergraph based on the weight values corresponding to the N hyperedges, so as to obtain the target features of each node in the dynamic temporal hypergraph.
[0117] The representation learning module 460 is used to perform attention pooling on the target features of k1 time slice nodes to obtain rhythmic representation features, which indicate the time characteristics of the target student's use of the campus network; and to perform attention pooling on the target features of k2 website category nodes to obtain preference representation features, which indicate the target student's preference for accessing websites using the campus network.
[0118] Assessment module 470 is used to assess the mental health status of target students based on rhythmic representation features and preference representation features, and obtain mental health assessment results.
[0119] In one possible implementation, the N access behavior data do not include webpage content, search terms, comment content, or chat content; the aforementioned mental health assessment device based on dynamic temporal hypergraph representation learning is also used for:
[0120] Anonymize or de-identify the information identifying the target student in N access behavior data;
[0121] Remove duplicate reports and non-human-caused abnormal access behaviors from N access behavior data;
[0122] Map the target domain name or IP address accessed by N access behavior data to the corresponding website category number in the preset website category set;
[0123] Access intensity is discretized into bins based on the number of visits and the duration of stay to obtain access intensity levels.
[0124] In one possible implementation, the aforementioned mental health assessment device based on dynamic temporal hypergraph representation learning is also used for:
[0125] Map the timestamps of N access behavior data to discrete time slice indices with a preset granularity of 1 hour, and discretize a week into 168 time slice indices.
[0126] Based on the time slice index, sine and cosine codes are calculated according to the daily cycle and the weekly cycle respectively to obtain the coding features of the daily cycle and the coding features of the weekly cycle.
[0127] By splicing together the daily and weekly coding features, the time-cycle coding features are obtained.
[0128] In one possible implementation, the aforementioned mental health assessment device based on dynamic temporal hypergraph representation learning is also used for:
[0129] Based on a pre-defined set of website categories, construct a network semantic graph with website categories as nodes;
[0130] The adjacency matrix of the network semantic graph is determined. The adjacency matrix is obtained by fusing the category architecture adjacency matrix and the statistical semantic adjacency matrix. The category architecture adjacency matrix is used to describe the hierarchical adjacency relationship and / or structural similarity relationship of website categories in the preset classification system. The statistical semantic adjacency matrix is an undirected matrix constructed based on the category co-occurrence relationship and / or adjacent access transfer relationship obtained by statistically analyzing the campus network behavior data of all students in the student set, and obtained through symmetry processing.
[0131] Using the one-hot feature matrix of website categories as the initial category features, the initial category features and the adjacency matrix of the network semantic graph are input into the semantic encoder to obtain the category semantic features corresponding to each website category output by the semantic encoder.
[0132] In one possible implementation, the weight determination module 440 is specifically used for:
[0133] Calculate the time difference between the timestamps of N triplet events and the evaluation time to obtain N time differences;
[0134] The semantic features of the events corresponding to the N triplet events are input into a learnable function to obtain the semantic saliency term, and the N time differences are input into a time decay function to obtain the time decay term.
[0135] Based on semantic saliency and time decay terms, the weight values corresponding to the N hyperedges are determined so that the weight value of the hyperedge corresponding to the triple event with the smaller time difference is larger.
[0136] In one possible implementation, the feature update module 450 is specifically used for:
[0137] Based on the weight values corresponding to the N hyperedges, a hyperedge weight matrix is generated. The hyperedge weight matrix is a diagonal matrix with the weight values corresponding to the N hyperedges as the diagonal elements.
[0138] Construct a hypergraph incidence matrix, which is used to represent the membership relationship between nodes and hyperedges;
[0139] Based on the node degree matrix, hyperedge degree matrix, and hyperedge weight matrix, message passing is normalized to achieve weighted aggregation update of node-hyperedge-node, obtaining the target features of each node in the dynamic temporal hypergraph. The node degree matrix and hyperedge degree matrix are determined based on the hypergraph association matrix.
[0140] In one possible implementation, the representation learning module 460 is specifically used for:
[0141] Calculate the attention weights for the target features of k1 time slice nodes respectively, and obtain the attention weights corresponding to k1 time slice nodes respectively;
[0142] The result of weighted summation of the attention weights and target features of the k1 time slice nodes is determined as the rhythmic representation feature.
[0143] Calculate the attention weights for the target features of the k2 website category nodes respectively, and obtain the attention weights corresponding to the k2 website category nodes respectively;
[0144] The result of weighted summation of the attention weights and target features of the corresponding website category nodes for each of the k2 website category nodes is determined as the preference representation feature.
[0145] In one possible implementation, the evaluation module 470 is specifically used for:
[0146] The rhythm representation features are input into the mapping network to obtain the rhythm latent representation, and the preference representation features are input into the mapping network to obtain the preference latent representation;
[0147] The contrastive learning loss method maximizes the similarity between the rhythmic latent representation and the preference latent representation of the same student, while minimizing the similarity between different students.
[0148] The difference between the latent representation of rhythm and the latent representation of preference is used as the alignment residual, and the alignment residual is input into the decision function driven by the alignment residual to obtain the risk probability;
[0149] Based on risk probability, generate mental health scores for target students;
[0150] The mental health assessment results include risk probability, mental health score, and intensity index, with the intensity index determined by the L2 norm of the aligned residuals.
[0151] This application's embodiments are based on the campus network behavior data of target students. By converting N access behavior data into triple event sequences and introducing time-slice periodic encoding, the behavioral rhythms of target students are characterized. Furthermore, a network semantic graph is constructed by integrating the hierarchical relationship of the classification system and the statistical relationship of group behavior, generating category semantic features. This transforms website categories from discrete numbers into vector representations that express semantic similarity and statistical correlation. Based on this, the joint relationship of event-level time slices—categories—intensity is explicitly modeled in the form of hyperedges in a dynamic temporal hypergraph. The contribution of recent and semantically significant events is highlighted by combining the hyperedge weights of event semantics and time differences, thereby enhancing sensitivity to changes in risk-related patterns. Furthermore, rhythmic and preference representation features are extracted based on the target students' dynamic temporal hypergraph. The deviation between rhythm and preference is analyzed through cross-view semantic alignment and alignment residual modeling, thereby assessing the mental health status of target students. Therefore, this application embodiment, based on N access behavior data of the target student, can objectively assess the target student's mental health risk and provide early warnings by analyzing the regularity and preference changes of the target student's online activities, especially when there are abnormal deviations between these two, without collecting or parsing the webpage text, search terms or chat content, thus taking into account compliance, sensitivity and interpretability.
[0152] It should be noted that the mental health assessment device provided in the above embodiments is only illustrated by the division of the above functional modules when analyzing and assessing mental health status. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the mental health assessment device provided in the above embodiments and the aforementioned mental health assessment method embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0153] This application also provides a computer-readable storage medium storing computer program instructions. When these instructions are invoked and executed by a processor, they are used to implement the steps of the mental health assessment method described in the foregoing embodiments. Exemplarily, the computer-readable storage medium may include, but is not limited to, read-only memory, random access memory, erasable read-only memory, optical disk, magnetic disk, magnetic tape, flash memory, and other media capable of storing program instructions.
[0154] In some embodiments, the computer-readable storage medium is a non-volatile storage medium and / or a non-transient storage medium so as to retain the computer program instructions after a power outage or restart.
[0155] This application also provides a computer program product, which includes computer program instructions that can be loaded onto a computer device and run on the computer device to cause the computer device to perform the steps of the mental health assessment method described in the foregoing embodiments. It should be understood that all or part of the above method can be implemented in software, hardware, or a combination of both; when implemented in software, the process can be stored in a storage medium as a program module and executed by a processor.
[0156] It should be understood that "at least one" in this document means one or more, and "multiple" means two or more; unless otherwise expressly defined, "and / or" as used in this document is used to indicate that at least one of the related objects exists or exists simultaneously; "A / B" as used in this document is used to indicate A or B; in addition, the ordinal numbers such as "first" and "second" used in this document are only used to distinguish the described objects and facilitate expression, and do not constitute a limitation on quantity, order or necessary difference.
[0157] It should be noted that the data collection, storage, processing and output involved in the embodiments of this application shall be carried out under the premise of obtaining the corresponding authorization or legal basis, and shall comply with applicable laws and regulations and privacy protection requirements; wherein, the campus network behavior data does not contain sensitive text information such as web page text, search terms, chat content, etc., in order to reduce privacy risks and improve deployability in the campus scenario.
[0158] The embodiments of this application have been described above in an illustrative manner. These embodiments are only used to help understand the technical solutions of this application and do not constitute a limitation on the scope of protection of this application. Various modifications, substitutions, or equivalent improvements made by those skilled in the art to the above embodiments without departing from the technical solutions of this application should fall within the scope of protection of this application.
Claims
1. A mental health assessment method based on dynamic temporal hypergraph representation learning, characterized in that, The method includes: Obtain campus network behavior data of the target student, wherein the campus network behavior data includes N access behavior data sorted by timestamp, where N is an integer greater than 1; The N access behavior data are converted into N triple events consisting of time slice index, website category number and access intensity. The N triple events are sorted by timestamp to obtain a triple event sequence. The access intensity is determined based on the number of visits and / or dwell time of the corresponding website category. Based on the triple event sequence, a dynamic temporal hypergraph of the target student is constructed. The dynamic temporal hypergraph includes k1 time slice nodes, k2 website category nodes, k3 access intensity nodes, and N hyperedges connecting a single time slice node, a single website category node, and a single access intensity node. k1, k2, and k3 are all integers greater than 1. Each triple event corresponds to a hyperedge connecting the corresponding time slice node, the corresponding website category node, and the corresponding intensity node. Based on the event semantic features corresponding to the N triple events, and the time difference between the occurrence time and the evaluation time of the N triple events, the weight values corresponding to the N hyperedges in the dynamic temporal hypergraph are determined. The event semantic features are composed of the time encoding features of the time slice nodes connected by the hyperedges describing the corresponding triple events in the dynamic temporal hypergraph, the category semantic features of the website category nodes, and the access intensity features of the access intensity nodes. Based on the weight values corresponding to the N hyperedges, the initial features of each node in the dynamic temporal hypergraph are updated to obtain the target features of each node in the dynamic temporal hypergraph. Attention pooling is performed on the target features of the k1 time slice nodes to obtain rhythmic representation features, which indicate the time characteristics of the target student's use of the campus network; attention pooling is performed on the target features of the k2 website category nodes to obtain preference representation features, which indicate the target student's preference for accessing websites using the campus network; Based on the rhythmic representation features and the preference representation features, the mental health status of the target students is assessed, and mental health assessment results are obtained.
2. The method according to claim 1, characterized in that, The N access behavior data do not include webpage text, search terms, comment content, or chat content; Before converting the N access behavior data into N triplet events consisting of a time slice index, a website category number, and access intensity, the method further includes: The information identifying the target student's identity in the N access behavior data is anonymized or de-identified; Remove duplicate reports and non-human-caused abnormal access behaviors from the N access behavior data; The target domain name or IP address accessed by the N access behavior data is mapped to the corresponding website category number in the preset website category set; Access intensity is discretized into bins based on the number of visits and the duration of stay to obtain access intensity levels.
3. The method according to claim 1, characterized in that, The method further includes: The timestamps of the N access behavior data are mapped to discrete time slice indices with a preset granularity of 1 hour, and a week is discretized into 168 time slice indices. Based on the time slice index, sine and cosine codes are calculated according to the daily cycle and the weekly cycle respectively to obtain the coding features of the daily cycle and the coding features of the weekly cycle. By concatenating the daily cycle coding features and the weekly cycle coding features, the time cycle coding features are obtained.
4. The method according to claim 1, characterized in that, The method further includes: Based on a pre-defined set of website categories, construct a network semantic graph with website categories as nodes; The adjacency matrix of the network semantic graph is determined. The adjacency matrix is obtained by fusing the category architecture adjacency matrix and the statistical semantic adjacency matrix. The category architecture adjacency matrix is used to describe the hierarchical adjacency relationship and / or structural similarity relationship of website categories in the preset classification system. The statistical semantic adjacency matrix is an undirected matrix constructed based on the category co-occurrence relationship and / or adjacent access transfer relationship obtained by statistical analysis of the campus network behavior data of all students in the student set, and obtained through symmetry processing. Using the one-hot feature matrix of website categories as the initial category features, the initial category features and the adjacency matrix of the network semantic graph are input into the semantic encoder to obtain the category semantic features corresponding to each website category output by the semantic encoder.
5. The method according to any one of claims 1-4, characterized in that, The determination of the weight values corresponding to the N hyperedges in the dynamic temporal hypergraph based on the event semantic features corresponding to the N triple events and the time difference between the occurrence time and the evaluation time of the N triple events includes: Calculate the time difference between the timestamps of the N triplet events and the evaluation time to obtain N time differences; The semantic features of the events corresponding to the N triplet events are input into a learnable function to obtain a semantic saliency term, and the N time differences are input into a time decay function to obtain a time decay term; Based on the semantic saliency term and the time decay term, the weight values corresponding to the N hyperedges are determined respectively, so that the weight value of the hyperedge corresponding to the triple event with the smaller time difference is larger.
6. The method according to any one of claims 1-4, characterized in that, The initial features of each node in the dynamic temporal hypergraph are updated based on the weight values corresponding to the N hyperedges to obtain the target features of each node in the dynamic temporal hypergraph, including: Based on the weight values corresponding to the N hyperedges, a hyperedge weight matrix is generated, wherein the hyperedge weight matrix is a diagonal matrix with the weight values corresponding to the N hyperedges as the diagonal elements; Construct a hypergraph association matrix, which is used to characterize the membership relationship between nodes and hyperedges; Based on the node degree matrix, the hyperedge degree matrix, and the hyperedge weight matrix, message passing is normalized to achieve weighted aggregation update of node-hyperedge-node, thereby obtaining the target features of each node in the dynamic temporal hypergraph. The node degree matrix and the hyperedge degree matrix are determined based on the hypergraph association matrix.
7. The method according to any one of claims 1-4, characterized in that, The attention pooling of the target features of the k1 time slice nodes to obtain rhythmic representation features includes: Calculate the attention weights for the target features of the k1 time slice nodes respectively, and obtain the attention weights corresponding to the k1 time slice nodes respectively; The result of weighted summation of the attention weights and target features of the k1 time slice nodes is determined as the rhythm representation feature. Accordingly, the attention pooling of the target features of the k2 website category nodes to obtain preference representation features includes: Calculate the attention weights for the target features of the k2 website category nodes respectively, and obtain the attention weights corresponding to the k2 website category nodes respectively; The result of weighted summation of the attention weights and target features of the k2 website category nodes is determined as the preference representation feature.
8. The method according to any one of claims 1-4, characterized in that, The assessment of the target student's mental health status based on the rhythmic representation features and the preference representation features yields a mental health assessment result, including: The rhythmic representation features are input into the mapping network to obtain the rhythmic latent representation, and the preference representation features are input into the mapping network to obtain the preference latent representation; The contrastive learning loss method maximizes the similarity between the rhythmic latent representation and the preference latent representation of the same student, while minimizing the similarity between different students. The difference between the potential representation of rhythm and the potential representation of preference is used as the alignment residual, and the alignment residual is input into the decision function driven by the alignment residual to obtain the risk probability; Based on the risk probability, a mental health score for the target student is generated; The mental health assessment results include the risk probability, the mental health score, and the intensity index, wherein the intensity index is determined by the L2 norm of the aligned residual.