Mental health state tracking and early warning method based on multi-modal sequences

By using multimodal data fusion and a dual-memory network model, the problem of data silos in existing mental health monitoring systems has been solved, enabling precise early warning and dynamic adjustment of mental states, and improving the accuracy and interpretability of the early warning system.

CN123182977APending Publication Date: 2026-11-27INGEMAR ROBOT TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611408399.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-11
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing mental health monitoring systems suffer from data silos and lack the ability to integrate and process multi-source heterogeneous data, resulting in one-sided identification of mental state, delayed early warning, and a high false alarm rate. Furthermore, they cannot quantify the impact of the quality of the care robot's response on the test subject's emotions.

Method used

A multimodal sequence-based method for tracking and early warning of mental health status is adopted. By collecting emotion, interaction logs, behavior and environmental data in parallel, data fusion is performed using a multi-head cross-modal attention mechanism and a dual memory network model. Interaction quality scores and environmental threshold judgments are introduced to generate a corrected probability distribution of mental health status and graded early warning.

Benefits of technology

It significantly improves the accuracy and robustness of the early warning system, can dynamically adjust the impact of interactive noise, refine the attribution of abnormal psychological states, extend the effective time window for psychological crisis intervention, and achieve proactive intervention through trend prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123182977A_ABST
    Figure CN123182977A_ABST
Patent Text Reader

Abstract

The application discloses a mental health state tracking and early warning method based on multi-modal sequences, and relates to the technical field of intelligent medical treatment.The four types of time sequence data, i.e., emotional multi-modal, human-computer interaction log, behavior sequence and environmental physics, are collected, and after space-time alignment and feature extraction, a fusion input sequence is constructed.To solve the problem that the false positive rate of the prior art is high and the emotional inducing source cannot be distinguished, the application introduces an interaction quality score as a confidence correction factor, when the interaction quality score is lower than a threshold value, a decay factor is generated to weight and correct the original mental state probability output by the double memory network, and the misjudgment caused by the robot interaction failure is eliminated.Combining with environmental data, attribution analysis is performed, the early warning is divided into environmental induced type and pathological spontaneous type, and a graded response is executed.Through the double debiasing mechanism of interaction correction and environmental attribution, the accuracy and interpretability of mental state recognition are significantly improved, and the transformation from passive response to active forward-looking early warning is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and health management technology, and more specifically, to a method for tracking and early warning of mental health status based on multimodal sequences. Background Technology

[0002] Mental health monitoring and intervention is one of the core technologies in the fields of smart healthcare and wellness. In existing technologies, the monitoring of emotions, behaviors, and environments usually relies on independent monomodal systems, such as classifying emotions solely through facial recognition, or collecting single physiological indicators through wearable devices.

[0003] However, existing technologies often suffer from "data silos," lacking the ability to integrate and process multi-source heterogeneous data, thus failing to comprehensively depict the true psychological state of test subjects. Specifically, existing methods mostly employ a static snapshot-style analysis logic, focusing only on the data characteristics of the current moment and ignoring the continuous evolution of psychological states and long-term temporal dependencies. This results in severely delayed early warnings and difficulty in capturing the "latent" signs of psychological crises. Furthermore, in scenarios involving human-computer interaction, existing systems cannot quantify the impact of the quality of the companion robot's responses on the test subject's emotions, often misjudging temporary emotional fluctuations caused by inappropriate machine responses as pathological features. At the same time, existing behavioral analysis systems do not consider the inducing effects of environmental noise, lighting, and other physical factors on behavior, leading to high false alarm rates and a lack of interpretability.

[0004] Therefore, there is an urgent need for a method that can integrate multimodal time-series data and combine interaction quality and environmental context for dynamic tracking and accurate early warning, in order to solve the problems of one-sided identification, delayed early warning and high false alarm rate in existing technologies. Summary of the Invention

[0005] The technical problem to be solved by this invention is the one-sided identification, delayed early warning and high false alarm rate, and provides a method for tracking and early warning of mental health status based on multimodal sequences.

[0006] The technical solution adopted by this invention to solve its technical problem is: on the one hand A method for tracking and early warning of mental health status based on multimodal sequences includes the following steps: S1. Parallel acquisition of multimodal time-series datasets, including emotional multimodal data, user-companion robot interaction log data, behavioral sequence data, and environmental physical data; S2. Preprocess the multimodal time-series dataset to extract emotion feature vectors, interaction quality feature vectors, behavioral feature vectors, and environmental feature vectors, and construct a fused input sequence using a multi-head cross-modal attention mechanism; S3. Input the fused input sequence into a pre-trained dual-memory network model to output the original psychological health status probability distribution. And the temporal sequence of emotional intensity; the dual memory network model includes short-term memory units and long-term memory units; S4. Calculate the interaction quality score based on the interaction log data. And determine the interaction quality score. Is it below the preset first quality threshold? ; S5, Response to Interaction Quality Score Below the first quality threshold Generate interactive fault correction factors (in ), and the interactive fault correction factor With respect to the probability distribution of the original mental health state By performing weighted calculations, the corrected probability distribution of mental health status is obtained. To reduce the weight of emotional misjudgment caused by inappropriate responses from companion robots; S6. Based on the corrected probability distribution of mental health status Based on the environmental physical data, perform anomaly attribution analysis: if the environmental indicators exceed a preset second environmental threshold... If the environmental indicators are normal and the interaction quality score is normal, then the warning type will be marked as "environmentally induced type"; Not lower than the first quality threshold If so, the warning type will be marked as "spontaneous pathological type"; S7. Execute a graded warning based on the warning type and the corrected emotional intensity value.

[0007] Preferably, the interaction quality score is calculated in step S4. The specific steps include: S41. Extract semantic difference feature vectors and response delay time features from multi-turn dialogues; S42. Based on word vector semantic analysis, calculate the matching score between the robot's response content and the user's intent. ; S43, Combining the matching score The interaction quality score is generated by weighted fusion based on the characteristics of response latency. The calculation formula is as follows: );in, For preset weighting coefficients, ) is a negative scoring function for response delay; The interactive fault correction factor The calculation formula is:

[0008] in, It is the Sigmoid activation function. A historical benchmark quality score.

[0009] Preferably, the dual memory network model in S3 includes short-term memory units and long-term memory units; The short-term memory unit employs a bidirectional long short-term memory network to capture instantaneous emotional fluctuations and changes in psychological state within the current conversation context; the long-term memory unit employs a gated recurrent unit combined with a time-attention mechanism to learn and store the user's long-term behavioral patterns and psychological baseline. The method also includes a baseline update step: when determining the interaction quality score... Below the first quality threshold When the data for the corresponding time period is marked as contaminated data, and when updating the individual baseline behavior pattern using the long-term memory unit, a mask is applied to the contaminated data on the gradient backpropagation path to set the gradient to zero, thereby removing the contaminated data to prevent machine interaction failures from interfering with the long-term modeling of user profiles.

[0010] Preferably, the weighted operation step in S5 specifically includes: For each moment in the time series ,like Then execute:

[0011] in, For a moment The probability distribution of the original mental health status For a moment Corrected probability distribution; like Then let ,and .

[0012] Preferably, the anomaly attribution analysis step further includes environmental and behavioral correlation verification: S61. Utilize graph convolutional networks to extract abnormal action patterns from behavioral feature vectors. The graph convolutional network uses key points of the human skeleton as graph nodes and the natural connection relationships of key points as edge structure spatial topology graphs. Through multi-layer graph convolution operations, it extracts spatiotemporal features from the skeleton sequence to identify abnormal action patterns. S62. Calculate the temporal correlation coefficient between the occurrence time of the abnormal action pattern and the noise peak or sudden change in illumination in the environmental physical data. ; S63, if the time correlation coefficient Greater than the preset threshold If the behavior is marked as "environmentally induced", an environmental adjustment strategy will be generated, and the warning level will be reduced according to the severity of the abnormal behavior.

[0013] Preferably, the method further includes trend prediction and closed-loop update steps: Using the Seq2Seq structure based on the corrected probability distribution of mental health status Predict the state trend over the next N time steps, where N is a positive integer; When a continuous downward trend in the emotional intensity value is predicted, a forward-looking warning is triggered even if the current intensity value does not exceed the warning threshold. The actual handling results after the warning are recorded, and the handling results are used as feedback labels to update the parameters of the dual memory network model at regular intervals through an online incremental learning algorithm.

[0014] Preferably, the preprocessing step specifically includes: S21. Perform frame segmentation and facial landmark detection on the video stream in the emotional multimodal data, and extract the facial action unit intensity value; perform noise reduction and prosodic feature extraction on the audio stream, and extract fundamental frequency, formants and Mel-frequency cepstral coefficient features; perform word segmentation and semantic embedding on the text interaction data, and convert it into a high-dimensional semantic embedding vector. S22. A multi-head cross-modal attention mechanism is used to fuse the emotion feature vector, interaction quality feature vector, behavior feature vector, and environmental feature vector. This multi-head cross-modal attention mechanism includes multiple parallel attention heads configured to calculate the consistency weights between text semantic features and facial expression features. And the inducing weights of environmental and behavioral characteristics. The modal features, after being weighted by two sets of weights, are concatenated along the feature dimension to form the fusion input sequence with unified dimensions.

[0015] Preferably, the parallel acquisition of multimodal time-series datasets in S1 specifically includes: S11. Captures user facial video stream at a frame rate of 25-30fps using a high-definition camera, captures voice audio stream at a sampling rate of 16kHz-44.1kHz using an array microphone, and records user-input text interaction data in real time through the interactive interface. S12. Completely record the interaction information of each round of dialogue between the user and the companion robot, including the user's query text, the robot's reply text, the response timestamps of each round, and dialogue interruption and resumption events; S13. Collect user head posture, coordinates of key points of human skeleton, gaze focus area and dwell time, and operation click stream data through depth camera or terminal device to form a time-series behavior sequence. S14. Real-time collection of environmental index data such as temperature, relative humidity, PM2.5 concentration, ambient noise, and light intensity through an IoT sensor network deployed in the user's activity space; All data is tagged with a uniform timestamp during collection and uploaded in real time via wireless network; In step S2, after extracting the feature vectors of each modality and before constructing the fused input sequence, a data quality screening and repair step is also included: audio segments with a signal-to-noise ratio lower than a preset threshold, video frames with a face detection confidence level lower than a preset threshold, or data packets with timestamp drift exceeding a preset deviation are automatically marked as low-quality data; for the low-quality data, the corresponding sensor's re-acquisition command is triggered first; if re-acquisition fails or real-time requirements do not allow it, the weighted average of valid data within the adjacent time window is used for interpolation to fill the gap.

[0016] on the other hand A mental health status tracking and early warning system based on multimodal sequences, comprising: The Zhikang Real-time Emotion Perception Module is configured to collect video, audio, and text data and extract emotion feature vectors. The companion robot interaction quality assessment module is configured to parse interaction logs and calculate interaction quality scores. And based on the quality of interaction scores Generate interactive fault correction factor ; The smart environment IoT monitoring module is configured to collect environmental physical data and provide environmental threshold judgment. The central fusion and early warning engine is connected to the above modules respectively, and the engine includes: Dual-memory network units are used to receive multimodal features output from each module and perform deep fusion to output the probability distribution of the original mental health status. ; The correction calculation unit is used to receive the interactive fault correction factor. And the probability distribution of the original mental health state. Perform weighted calculations and output the corrected probability distribution. ; Attribution decision unit, used to combine environmental physical data, abnormal behavior identification results, and corrected probability distribution. Perform anomaly attribution analysis and generate tiered early warning information; The baseline management unit is used to receive the interaction quality score. When the interaction quality score Below the first quality threshold At the same time, write permissions for the baseline model of the long-term memory unit are blocked for the corresponding time period data, so as to achieve interference-resistant user profile modeling.

[0017] Preferably, the central fusion and early warning engine further includes: The trend prediction and closed-loop update unit has a built-in Seq2Seq sequence predictor, which is used to predict the state trend of the next NN time steps based on the corrected historical state sequence, and trigger the generation of forward-looking early warning information when a continuous downward trend is detected. The trend prediction and closed-loop update unit also includes an online incremental learner, which is used to update the parameters of the dual memory network model and the Seq2Seq prediction model online at regular intervals according to the feedback of the actual handling results after the early warning. The multi-terminal collaboration and visualization service unit is used to respond to hierarchical early warning information, issue linkage control commands to the broadcast system and security access control system through API interface, push encrypted status briefings according to preset de-identification strategy, and encapsulate and push the processed data to multiple terminals for visualization display; The Permissions and Compliance Management Unit is used to establish a role-based access control multi-role permission system, controlling different roles' read and write permissions for emotional data, behavioral trajectories, and original audio and video files. All API calls and data access involving personal identity information are logged, and the system has a built-in data anonymization engine.

[0018] Third aspect The beneficial effects of this invention are as follows: 1. This application introduces a dynamic correction mechanism based on interaction quality perception, and calculates the interaction quality score in real time based on interaction log data. and in Below the first quality threshold An interaction fault correction factor is generated in real time to weight and correct the probability distribution of the original mental health status. This technique enables the companion robot to adaptively reduce the contribution weight of data from the fault period to the evaluation result when the emotional judgment is misjudged due to interaction faults such as inappropriate response, low semantic matching degree, or excessive response delay. It effectively suppresses the interference of interaction noise on the inference of mental health status, thereby significantly improving the output accuracy and robustness of the early warning system under non-ideal interaction conditions.

[0019] 2. This application configures short-term memory units and long-term memory units in a dual-memory network model and sets a baseline update step, when determining... When data falls below a first quality threshold, all data for the corresponding time period is marked as contaminated data. This contaminated data is proactively removed when updating individual baseline behavioral patterns using long-term memory units. This technique cuts off the infiltration path of low-quality interaction data into long-term user profiles at the data source, preventing occasional machine interaction malfunctions from accumulating and contaminating individual baseline models over time. It ensures that user behavioral patterns stored in long-term memory units always reflect the true evolution of psychological states, thus providing a reliable data foundation for long-term, stable, and personalized mental health tracking.

[0020] 3. This application constructs a binary attribution decision framework of "environmentally induced" and "pathologically spontaneous" causes. Based on the corrected probability distribution of mental health states, and combined with threshold judgments from environmental physical data, it systematically classifies the causes of abnormal mental states. Simultaneously, it further utilizes graph convolutional networks to extract abnormal action patterns from behavioral features and calculates their temporal correlation coefficients with noise peaks or sudden changes in illumination. When the temporal correlation coefficient exceeds a preset threshold, the warning level is adjusted accordingly, and an environmental adjustment strategy is generated. This technique achieves refined tracing of the sources of abnormal mental states, avoiding false alarms caused by accidental environmental factors, and triggering differentiated graded warnings and intervention strategies for different causes, effectively improving the accuracy and interpretability of the warning system.

[0021] 4. This application deploys a trend prediction step using a Seq2Seq structure after a tiered early warning system. Based on the corrected probability distribution of mental health status, it predicts the state evolution trend over the next N time steps. When a continuous downward trend in emotional intensity is predicted, a forward-looking early warning is triggered even if the intensity value has not yet exceeded the warning threshold at the current moment. Simultaneously, the actual handling results after the early warning are recorded and used as a supervisory signal for online incremental learning and updating of the dual-memory network model. This technique elevates the early warning mechanism from a traditional passive "threshold-triggered" response to a proactive "trend-predictive" intervention, significantly extending the effective time window for psychological crisis intervention. Furthermore, the closed-loop update mechanism enables the model to continuously adapt to the dynamic changes in individual mental states, achieving self-evolution and continuous optimization of the early warning system's performance.

[0022] 5. In the preprocessing stage, this application employs a multi-head cross-modal attention mechanism to fuse emotion feature vectors, interaction quality feature vectors, behavioral feature vectors, and environmental feature vectors. This attention mechanism is specifically configured to calculate the consistency weights between textual semantic features and facial expression features, as well as the causal weights between environmental features and behavioral features. This technique enables the cross-modal fusion process to explicitly model the semantic consistency and causal causal relationships between different modalities. When there are local missing data or intermodal conflicts in the multimodal heterogeneous data, the attention weights can dynamically adjust the fusion strategy, thereby extracting a more discriminative and robust fusion input sequence. This provides high-quality feature input for subsequent temporal inference in the dual-memory network, ensuring the overall performance ceiling of the early warning method from the data source. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be further described below in conjunction with the accompanying drawings and embodiments. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort: Figure 1 This is a flowchart illustrating the steps of the mental health status tracking and early warning method based on multimodal sequences in this application embodiment.

[0024] Figure 2 This is a schematic diagram of the preprocessing, dual-memory network inference, and interactive fault correction steps in an embodiment of this application.

[0025] Figure 3 This is a schematic diagram of the steps of anomaly attribution analysis, hierarchical early warning, and closed-loop update in an embodiment of this application. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, a clear and complete description will be provided below in conjunction with the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the protection scope of the present invention.

[0027] Example 1 This application provides an embodiment of a method for tracking and early warning of mental health status based on multimodal sequences, referring to... Figures 1 to 3 This includes the following steps: S1. Parallel acquisition of multimodal time-series datasets. The datasets include emotional multimodal data, user-companion robot interaction log data, behavioral sequence data, and environmental physical data.

[0028] Specifically, parallel data acquisition is achieved through multi-source sensing and the access layer.

[0029] S11. Emotional Multimodal Data Acquisition. A high-definition RGB camera (1920×1080 resolution, 30fps frame rate, H.264 hardware compression) deployed directly in front of the interactive space continuously acquires user facial video streams. The camera's field of view (FOV) is ≥70°, covering a ±45° deflection range of the user's face, with an effective acquisition distance of 0.5-3.0 meters. The camera has a built-in infrared supplementary lighting module (wavelength 850nm) to ensure stable acquisition of facial features within an illumination range of 30-300Lux. In low-light environments (<30Lux), it automatically switches to infrared mode and activates the infrared cutoff filter removal mechanism.

[0030] Audio communication acquisition. User voice audio stream is acquired via a linear 4-microphone array (signal-to-noise ratio ≥65dB, sampling rate 16kHz, 16-bit quantization). The microphone array supports beamforming directional pickup, with the main lobe pointing ±15° towards the user, effectively suppressing environmental noise interference beyond a 2-meter radius. A single microphone is also configured as an environmental noise reference channel for subsequent adaptive noise cancellation.

[0031] Text data collection. The system records user-inputted text interaction data in real time via the companion robot's 10.1-inch touchscreen (1920×1200 resolution) or a mobile app (iOS / Android). Two input modes are supported: ① Speech-to-text (using an offline ASR engine, supporting Mandarin Chinese, word error rate <8%); ② Direct text input (via on-screen keyboard or handwriting recognition). Input timestamps (accurate to milliseconds) and input method markers are recorded simultaneously during text data collection.

[0032] Assisted physiological signal acquisition (optional mode). Connects to smart bracelets (such as Xiaomi Mi Band 7 Pro or Huawei Mi Band 8) or single-lead heart rate straps (such as Polar H10) via Bluetooth Low Energy (BLE) 5.0 protocol to collect physiological signals such as heart rate variability (HRV, unit: ms, using the root mean square difference (RMSSD) of the NN interval as the primary indicator), electrical activity of the skin (EDA, unit: μS, sampling rate 256Hz), and body surface temperature (unit: ℃). Physiological signals serve as an auxiliary verification data source for emotion perception; this is not mandatory, but is automatically enabled when the device connection is successful and automatically downgraded when the connection is lost.

[0033] Data acquisition anomaly handling mechanism: The system has a built-in three-level acquisition status management (normal / degraded / interrupted), and the specific handling logic is as follows: Status monitoring: The system polls the last valid data timestamp of each data source at a frequency of 1Hz to calculate the data latency. .

[0034] Degradation trigger condition: When any data source At a certain time, the channel is automatically marked as "acquisition interrupted".

[0035] Tiered handling logic: Level 1 (short interruption, ≤10 seconds): The system keeps the current acquisition window open and waits for the data to be recovered before using forward and backward linear interpolation to fill in the missing interval. The interpolation weight decays over time.

[0036] Level 2 (moderate interruption, 10 seconds < duration ≤ 60 seconds): The system fills the corresponding timestamp position in the fused input sequence with NaN placeholders, and in the subsequent multi-head cross-modal attention calculation, it assigns zero weight to this channel through the attention mask. Within this time window, the model inference only depends on other available channels.

[0037] Level 3 (Long Interruption, >60 seconds): The system pushes a "sensor offline alarm" to the maintenance personnel's terminal (via WeChat Work robot or SMS gateway), and simultaneously queries backup sensors (such as other redundant cameras in the room) to switch channels. If no backup source can be found, the fusion processing of the channel's data is suspended until recovery, and degradation inference is performed using environmental and behavioral characteristics as the primary signals.

[0038] S12. Interaction Log Data Collection. Completely record every round of dialogue interaction information between the user and the companion robot, including user query text, robot response text, response timestamps for each round, dialogue interruption and resumption events, etc. The log data structure is shown in Table 1 below:

[0039] All logs are appended line by line in JSON Lines format to the NVMe SSD (Non-Volatile Memory Fast Channel Solid State Drive) on the edge node. The size of a single log is controlled within 2KB. The logs are automatically rotated and archived to the cloud for cold storage at 3:00 AM every day.

[0040] S13. Behavioral Sequence Data Acquisition. This involves collecting behavioral data such as user head posture, 2D / 3D coordinates of key points in the human skeleton, gaze focus area and dwell time, and operation click flow via depth cameras or terminal devices, forming a temporal behavioral sequence.

[0041] S14. Environmental Physical Data Acquisition: Based on Internet of Things (IoT) technology, a sensor network deployed within the user's activity space is used to collect real-time data on temperature (°C), relative humidity (%RH), and PM2.5 concentration (μg / m³). 3 Environmental indicators such as ambient noise (unit: dB) and light intensity (unit: Lux) are included.

[0042] All data is tagged with a uniform timestamp (millisecond precision) during collection and uploaded to the data preprocessing center in real time via 5G or WiFi network to ensure accurate alignment and fusion analysis of subsequent multimodal data on the timeline.

[0043] S15. Multi-source timestamp synchronization mechanism. All acquisition terminals synchronize with the local time server at the millisecond level via NTP (Network Time Protocol, version v4), with a calibration cycle of once every 5 minutes. Synchronization accuracy requirements: the maximum deviation between each data source and the time server ≤ 50ms, and the relative deviation between different data sources ≤ 30ms.

[0044] The specific synchronization scheme is as follows: For sensors that do not have NTP capability (such as some environmental sensors), the gateway timestamp is inserted into the data packet through the IoT gateway (the gateway has synchronized NTP).

[0045] After receiving data from each channel, the data preprocessing center uses linear interpolation to resample the data from each channel to a unified time axis, with a reference frequency of 1Hz (i.e., one fused sampling point per second).

[0046] For channels with a sampling rate higher than 1Hz (e.g., audio at 16kHz, behavior at 30fps), downsampling is performed before resampling: prosodic feature statistics are extracted per second from the audio channel.

[0047] S2. Preprocess the multimodal time-series dataset to extract emotion feature vectors, interaction quality feature vectors, behavioral feature vectors, and environmental feature vectors, and construct a fused input sequence. Convert the original multimodal data into standardized, aligned numerical feature vectors, and achieve deep fusion at the feature level through a multi-head cross-modal attention mechanism to provide a highly discriminative input representation for subsequent time-series inference.

[0048] The preprocessing steps specifically include: S21. Single-modal feature extraction. The video stream in the emotion multimodal data is processed by frame segmentation, the audio stream is denoised and its prosodic features are extracted, and the text interaction data is segmented and semantically embedded.

[0049] Specifically, for multimodal emotion data: After segmenting the video stream into frames at 30fps along a uniform timeline, 478 facial key points were extracted using a pre-trained MediaPipe Face Mesh model (based on transfer learning, pre-trained on the WFLW and 300W-LP datasets). The following features were then further calculated: The intensity values ​​of 18 core facial action units (AUs) were extracted according to the FACS (Facial Action Coding System) standard: AU1 (inner eyebrow lift), AU2 (outer eyebrow lift), AU4 (eyebrow down), AU5 (upper eyelid lift), AU6 (cheek lift), AU7 (eyelid tightening), AU9 (nose wrinkling), AU10 (upper lip lift), AU12 (corner of mouth lift), AU14 (corner of mouth contraction), AU15 (corner of mouth down), AU17 (lower lip down), AU20 (corner of mouth flattening), AU23 (lip tightening), AU24 (lip pressing), AU25 (lip separation), AU26 (jaw drop), and AU27 (mouth opening). Each AU intensity value was normalized to the [0, 1] interval using a regression model.

[0050] Head attitude angles (3D): pitch angle, yaw angle, roll angle.

[0051] Facial movement: the sum of the squares of displacements at all key points It reflects the intensity of changes in facial expressions.

[0052] Ultimately forming a visual feature sequence (18 AUs + 3 attitude angles + 1 activity).

[0053] The audio stream was pre-emphasized (coefficient 0.97), framed (frame length 25ms, frame shift 10ms, Hamming window), and denoised (using spectral subtraction or RNNoise algorithm, denoising intensity -15dB) to extract the following acoustic features: Fundamental frequency F0: Calculated by autocorrelation method, ranging from 50-400Hz (male) or 150-600Hz (female), automatically adapting to gender.

[0054] The first three formants F1, F2, and F3 were calculated using linear predictive coding (LPC, order 12).

[0055] Short-time energy: Mean energy within a frame, reflecting speech loudness.

[0056] Mel-frequency cepstral coefficients (MFCC): The first 13 fundamental coefficients and their first and second differences are taken, for a total of 39 dimensions.

[0057] Speech rate: syllables per minute, calculated by segmenting speech segments using speech activity detection (VAD) and normalized to [0, 1].

[0058] Voice interruption frequency: The number of voice segment interruptions detected by VAD per second.

[0059] Fundamental frequency variation rate: The mean absolute value of the first-order difference of the fundamental frequency, reflecting the degree of emotional fluctuation.

[0060] Finally, a speech feature sequence is formed. (1 fundamental frequency + 3 formants + 1 energy + 39 MFCCs + 1 speech rate + 1 interruption frequency).

[0061] The text interaction data is processed as follows: Preprocessing: Jieba segmentation (precise mode, with a custom dictionary loaded) was used to remove the Harbin Institute of Technology stop word list (a total of 1893 stop words).

[0062] Semantic embedding: The text is converted into a 768-dimensional semantic embedding vector using the pre-trained language model BERT-base-Chinese (12-layer Transformer, 768-dimensional output, pre-trained on CLUECorpus2020). For single-round texts with fewer than 10 characters, padding [PAD] is used to reach a fixed length (maximum length 64 tokens); for texts with more than 512 tokens, a sliding window is used to truncate the text (window size 512, stride 256) and average pooling is applied.

[0063] Sentiment polarity score: The sentiment polarity of the text is output by the sentiment analysis sub-model (fine-tuned based on ERNIE 3.0 and trained on the ChnSentiCorp dataset), with a value range of [-1, +1] (negative to positive).

[0064] Emotional intensity: The absolute value of the emotional polarity score, reflecting the intensity of emotional expression.

[0065] Forming text feature vectors (768-dimensional embedding + 1 emotional polarity + 1 emotional intensity).

[0066] Extract the following interaction quality features from the interaction logs: Response delay The time interval (in seconds) from when the user finishes speaking (VAD (Voice Activity Detection) determines the end of the user's speech or when the input completion event is triggered) to when the robot begins to reply. If the interval exceeds 10 seconds, it is truncated to 10 seconds.

[0067] Dialogue turn length The ratio of the number of characters in a user's message to the number of characters in a robot's reply, calculated using the following formula. .

[0068] Dialogue interruption marker : Did any interruption / retry events occur during this round of dialogue?

[0069] Response confidence : Confidence score of the robot response generation model for the current response (from the softmax output of the generation model, in the range [0, 1]).

[0070] Forming interactive quality feature vectors .

[0071] For behavioral sequence data: Processing the coordinates of key points on the human skeleton: Normalization: The scale is normalized with the hip center (key point index 11) as the origin and the spine length (Euclidean distance from key point 0 to key point 23) as the benchmark to eliminate the influence of user body shape differences.

[0072] Smoothing filtering: Kalman filtering is used (process noise covariance Q=0.01, measurement noise covariance R=0.1), with the state vector being position and velocity (4-dimensional state), to smooth the time series fluctuations of the skeleton coordinates.

[0073] Calculate the following dynamic behavioral characteristics: Limb movement speed (The first-order difference of the displacement of key points is taken as the average value of the main key points of the torso: both shoulders, both hips, and both hands).

[0074] Limb acceleration (First-order difference of velocity).

[0075] angular velocity (First-order difference of head pose angle).

[0076] physical activity level SS is a set of 17 core key points.

[0077] Activity area distribution: The space is divided into 3×3 grids, and the percentage of time a user spends at each key point in each grid is counted (9 dimensions).

[0078] Body symmetry index: Calculates the ratio of displacement differences at key points of left and right symmetry (such as left and right shoulders, left and right hips), reflecting the coordination of movements.

[0079] Forming behavioral feature vectors (3 velocities + 3 accelerations + 3 angular velocities + 1 activity level + 9 regional distributions + 1 symmetry index).

[0080] For environmental physical data: Preprocessing of time-series data from various environmental sensors: Outlier removal: A sliding window median filter is used with a window size of 5 and a threshold factor of 3. If a data point deviates from the median within the window by more than 3 times the absolute deviation of the median, it is considered an outlier and replaced with the median.

[0081] Time interpolation: Linear interpolation is used to resample the data of each channel to a unified time axis (reference frequency 1Hz).

[0082] Output the following environmental metrics (all normalized to [0,1]): Temperature T (mapping range -10℃ to 40℃, cut off outside the range); Humidity H (mapping range 0~100%RH); PM2.5 concentration (Mapping range 0~500μg / m 3 ); Noise level N (mapping range 30~100dB); Illuminance L (mapping range 0~10000 Lux, logarithmic mapping is more in line with human eye perception); The time-series rate of change (absolute value of first-order difference) of each indicator.

[0083] Forming environmental feature vectors (5 index values ​​+ 5 rates of change + 2 derived indicators: temperature and humidity comfort index) and noise peak marker .

[0084] Data quality screening and repair: After performing the feature extraction described above, a quality screening sub-step is added: audio segments with a signal-to-noise ratio below a preset threshold (e.g., SNR < 10dB), video frames with a face detection confidence level below 0.7, or data packets with timestamp drift (offset exceeding 500ms) are automatically marked as "low-quality data". For low-quality data, the system prioritizes triggering a re-acquisition command for the corresponding sensor; if re-acquisition fails or real-time requirements do not permit, the system uses the weighted average of valid data within the nearest time window (5 frames before and after) for interpolation to ensure the integrity and reliability of the input data sequence.

[0085] S22. Multi-head cross-modal attention fusion. A multi-head cross-modal attention mechanism is used to fuse the emotion feature vector. Interaction quality feature vector behavioral feature vector and environmental feature vectors Deep fusion is performed. Specifically, the multi-head cross-modal attention mechanism calculates the consistency weights between text semantic features and facial expression features. And the inducing weights of environmental and behavioral characteristics. .

[0086] Specifically, the multi-head cross-modal attention mechanism comprises eight parallel attention heads, each independently computing the correlation weights between different modalities. The mechanism is configured to compute two sets of core weights in parallel: Consistency weight between text semantic features and facial expression features This weight measures the consistency between the emotional polarity (positive / negative / neutral) of the user's current round of text semantic expression and the emotional valence reflected by facial expression action units. Specifically, the text semantic embedding vector and the facial AU intensity vector are mapped to the same semantic space through a linear projection layer, and the cosine similarity is calculated as the consistency score. When the two are highly consistent (similarity > 0.8), the consistency score is considered high. A similarity close to 1 indicates high credibility of the current emotional expression; when there is a significant discrepancy (e.g., the text expresses "I'm fine" but the facial AU combination shows strong sadness, with a similarity < 0.3), then... A value below 0.5 suggests possible emotional masking or cognitive bias, and the credibility weight of emotional features at that moment should be reduced during subsequent fusion processes.

[0087] Induced weights of environmental and behavioral characteristics This weight is used to calculate the probability that current environmental physical data (especially noise and lighting abrupt changes) will induce abnormal user behavior (such as sudden startle reflexes, violent head avoidance movements, and limb stiffness). Specifically, the environmental feature vector is... The noise change rate and illumination change rate in the behavioral feature vector The acceleration abrupt change amplitude is used to calculate the cross-modal temporal correlation. If an anomalous behavior occurs immediately after an environmental noise peak (with a time difference of < 2 seconds), then... An increase to above 0.7 provides early environmental clues for subsequent attribution analysis of abnormalities.

[0088] Finally, the modal features after being weighted by the two sets of weights are concatenated along the feature dimension to form the fused input sequence with unified dimensions.

[0089] S3. Input the fused input sequence into a pre-trained dual-memory network model, which outputs the probability distribution of the original mental health state. And the temporal sequence of emotional intensity. By utilizing a dual memory network, we can simultaneously capture the instantaneous fluctuations and long-term evolution patterns of psychological states, and output a quantitative probability estimate of the current psychological state.

[0090] The overall architecture of the dual-memory network model is as follows: S31. Short-Term Memory Unit (STM): A two-layer bidirectional long short-term memory network (Bi-LSTM) is employed. Specific configuration: Number of layers: 2 stacked layers; Hidden dimensions at each level: ; Output dimension after bidirectional merging: 512; The forget gate bias is initialized to 1.0 (to enhance long-term dependency retention). Dropout rate: 0.3 (applied between layers, non-circular connections); Input dimension: 256 (consistent with the fusion feature dimension).

[0091] The processing procedure for short-term memory units: ; ; .

[0092] The output of the STM unit focuses on a rapid and dynamic response to the user's emotions within the last 5 time steps (corresponding to the last 5 minutes), is sensitive to sudden stimuli, and has a response delay of <3 seconds.

[0093] S32. Long-Term Memory Unit (LTM): The following configuration is used, employing a gated recurrent unit (GRU) combined with a time attention mechanism: Number of layers: 3 stacked layers; Hidden dimensions at each level: ; Dropout rate: 0.25; Temporal attention mechanism: It uses additive attention to automatically weight historical moments; Calculation of temporal attention weights: .

[0094] in , , These are learnable parameters.

[0095] Long-term memory status It is the attention-weighted sum of the hidden states of the GRU at each historical moment: .

[0096] The LTM unit is responsible for learning users' long-term (weeks to months) behavioral patterns and psychological baselines, focusing on the most representative stable behavioral patterns through a time-attention mechanism.

[0097] S33, Dual-Memory Fusion Gate: Short-term memory status With long-term memory state Dynamic combination via learnable fusion gating: ; .

[0098] The physical meaning of fusion gating: Currently, it primarily focuses on short-term memory and is suitable for scenarios involving emotional fluctuations caused by sudden events (such as sudden environmental changes or unexpected interactions).

[0099] It combines short-term and long-term memory, making it suitable for stable states or transitional periods.

[0100] The current state is dominated by long-term memory and is suitable for a stable state, indicating that the user's current state is within the range of their historical typical patterns.

[0101] S34, Output Layer: The merged memory state .

[0102] The system sequentially passes through two fully connected layers and a Softmax activation function, outputting a probability distribution of mental health status. ; .

[0103] The number of emotion categories K=6 (calm, anxiety, depression, tension, joy, anger), and the corresponding emotion intensity values. .

[0104] S35. Model pre-training scheme: The dual-memory network model is pre-trained offline, and the training dataset consists of the following: Sources (e.g.): Psychological monitoring data from 3 partner elderly care institutions and 2 schools (after ethical review and informed consent from users); Sample size: no less than 5000 hours of multimodal synchronously labeled data; Annotation method: Each 10-second window was independently annotated by two or more psychiatrists (Kappa consistency coefficient ≥ 0.75); Optimizer: AdamW (weight decay) ); Initial learning rate: Cosine annealing was used to attenuate the temperature to... Training period: maximum 50 epochs, early stopping condition is that the validation set loss does not decrease for 5 consecutive epochs; Loss function: a weighted combination of cross-entropy loss and mean squared error loss of sentiment intensity (weight coefficients 0.8 and 0.2).

[0105] S36. Baseline Update Steps (Anti-interference Gradient Isolation Mechanism): This method includes a robust baseline update mechanism, whose core principle is "gradient isolation" rather than "data discarding." The specific process is as follows: When the model updates individual baseline behavioral patterns using new data (i.e., online incremental updates of LTM units), the interaction quality score is called first. As a control signal. When determining the interaction quality score for a certain period of time. Below the first quality threshold ( )hour: Polluted area labeling: the fused input sequence for the corresponding time period and the model's internal states (including the hidden states of the GRU) Cell state Attention weight The data is marked as "contaminated data" and the time period of contamination is recorded. The start and end timestamps (accurate to the second) are stored in the pollution log table for auditing purposes.

[0106] Gradient mask generation: During backpropagation in the long-term memory unit, the system automatically generates a mask matrix with the same dimensions as the gradient tensor. : .

[0107] The mask matrix is ​​generated using PyTorch's register_backward_hook mechanism, which does not require modification of the core forward propagation code of the model and has good engineering maintainability.

[0108] Gradient isolation execution: The original gradient is calculated during backpropagation. Then, element-wise multiplication is performed to force the gradient of the pollution period to zero: .

[0109] Parameter update: Use only the corrected gradient Perform parameter updates for long-term memory units (using the Adam optimizer, learning rate). Data from the pollution period contributes nothing to the model parameters, but information from the data during forward propagation is preserved (maintaining the continuity of the time series).

[0110] The technical essence and effect of this mechanism: Compared with the traditional "data discarding" (directly deleting low-quality data segments, resulting in discontinuity of time series and information loss), this mechanism adopts an asymmetric strategy of "forward retention and backward blocking". The data still participates in context modeling in forward computation (maintaining the integrity of the time series), but is shielded in backward propagation (blocking the contamination of the long-term baseline), realizing refined data governance that is "usable but not learned". This is one of the core technical contributions of this invention.

[0111] S4. Calculate the interaction quality score based on the interaction log data. And determine the interaction quality score. Is it below the preset first quality threshold? .

[0112] Calculate the interaction quality score The specific steps include: S41. Extract semantic difference feature vectors and response delay time features from multi-turn dialogues; specifically, the semantic difference feature vector is calculated by taking the cosine distance between the semantic embedding vector of the user's previous question text and the semantic embedding vector of the robot's current response text. The smaller the distance, the closer the response is to the question semantically, meaning it's more "relevant." The response latency feature is the time interval recorded from the moment the user ends their message to the moment the robot begins its response. (Unit: seconds).

[0113] S42. Based on word vector semantic analysis, calculate the matching score between the robot's response content and the user's intent. : ,in, The cosine distance, after normalization It is mapped to the [0,1] interval, and the closer the value is to 1, the higher the degree of match between the response and the user's intent.

[0114] S43. Combining the matching score and response latency characteristics, the interaction quality score is generated through weighted fusion. :

[0115] in, This is the weighting coefficient (default value is 0.6). A negative scoring function for response delay: This represents the maximum acceptable delay (default is 3 seconds). A higher score indicates a smoother interaction and a more effective robot response.

[0116] S5, Response to Interaction Quality Score Below the first quality threshold Generate interactive fault correction factors (in ), and the interactive fault correction factor With respect to the probability distribution of the original mental health state By performing weighted calculations, the corrected probability distribution of mental health status is obtained. This reduces the weight of emotional misjudgments caused by inappropriate responses from companion robots.

[0117] The interactive fault correction factor The calculation formula is:

[0118] in, It is the Sigmoid activation function. ; For historical baseline quality scores, all valid interactions within the past week are taken (i.e. The interaction quality score is a weighted moving average, initially set to 0.75 by default. This design allows... The value decays smoothly as the current interaction quality decreases, and its range is limited to (0,1) to avoid overly drastic correction or failure.

[0119] The specific steps of the weighted operation include: For each moment in the time series ,like Then execute:

[0120] in, Let be the probability distribution of the original mental health state at time t. Let be the probability distribution after correction at time t, and the multiplication is element-wise multiplication. At this point, the probability values ​​of all emotional states in the original probability distribution are proportionally reduced, indicating that the system has a "low trust" attitude towards the emotional judgment output by the model at that time, effectively reducing the weight of misjudgment of emotions caused by improper responses or interaction failures of the companion robot.

[0121] like Then let ,and This indicates that the current interaction quality is normal, the original model output is completely preserved, and no correction is performed.

[0122] S6. Based on the corrected probability distribution of mental health status Based on the aforementioned environmental physical data, perform anomaly attribution analysis.

[0123] If any one or more of the environmental indicators (temperature, humidity, noise, light intensity, PM2.5) exceed the preset second environmental threshold (For example, noise > 65dB or light < 100Lux), then the warning type will be marked as "Environmentally Induced". If all environmental indicators are within the normal range, and the interaction quality score is [not specified], then the warning type will be [not specified]. Not lower than the first quality threshold If so, the warning type will be marked as "spontaneous pathological type".

[0124] The anomaly attribution analysis process also includes verifying the correlation between environment and behavior: S61. Graph Convolutional Network (GCN) is used to extract abnormal action patterns from behavioral feature vectors. The GCN constructs a spatial topology graph using key points of the human skeleton as graph nodes and the natural connections between key points as edges (e.g., head-neck-shoulder-elbow-wrist). GCN extracts spatiotemporal features from the skeleton sequence through multi-layer graph convolution operations, enabling accurate identification of abnormal action patterns such as repeated scratching, sudden stiffness, withdrawal and avoidance, and collision.

[0125] S62. Calculate the time correlation coefficient between the occurrence time of the abnormal action pattern and the noise peak (instantaneous noise exceeding the background noise by more than 15 dB) or the moment of sudden change in illumination (illuminance change rate exceeding 500 Lux / s) in the environmental physical data. Specifically, the Pearson correlation coefficient was used for calculation, and the maximum correlation coefficient within the time window of 5 seconds before and 2 seconds after the occurrence of the abnormal action was examined:

[0126] in, This is an abnormal action intensity sequence. This is a sequence of environmental indicator change rates.

[0127] S63, if the time correlation coefficient Greater than the preset threshold (The default value is 0.7), which proves that there is a strong correlation between environmental factors and behavioral abnormalities. At this point, while finally marking the warning type as "environmentally induced type", the system automatically generates specific and actionable environmental adjustment strategies (such as "it is recommended to reduce the environmental noise in the activity area to below 40dB" or "it is recommended to increase the light intensity to above 300Lux"). Based on the severity of the abnormal behavior (determined by the abnormality confidence score output by GCN), the system automatically lowers the preset warning level by one level (for example, from "high risk" to "medium risk", or from "medium risk" to "low risk") to avoid over-medicalizing the user's own psychological problems and achieve accurate and differentiated warning management.

[0128] S7. Based on the aforementioned warning type and the corrected emotional intensity value, execute a tiered warning system. Specifically, comprehensively... The highest probability emotion category and its corresponding corrected intensity value The results of the attribution analysis in step S6 ("environmentally induced type" or "pathologically spontaneous type") are used to generate tiered early warning information according to a pre-defined multidimensional rule base. The tiered early warning information includes the warning type, warning level, occurrence time, corrected emotional intensity value, and suggested intervention measures, and is pushed to each terminal via a message queue. Example rules are shown in the table below:

[0129] S8. Trend Prediction and Closed-Loop Update Steps: Using a Seq2Seq sequence prediction model (encoder-decoder architecture, both employing LSTM units), based on the corrected mental health status probability distribution sequence... (Where L is the backtracking window length, defaulting to 60 time steps), predicting the state trend over the next N time steps (e.g., the next 2 hours, N=120 steps, each step 1 minute). When it is predicted that the sentiment intensity value will show a continuous downward trend in the future (i.e., the intensity values ​​of the last three time steps in the prediction sequence are all lower than the current value and monotonically decreasing), even if the intensity value at the current moment has not exceeded any warning threshold, the system will trigger a "proactive warning" to buy valuable time for intervention.

[0130] Closed-loop update: The system records the actual handling results after an alert and the user's subsequent state changes through operation logs, including but not limited to "emotional recovery after medical staff intervention," "emotional return to normal after environmental adjustment," "user calms down on their own," and "false alarms." These handling results are used as feedback labels, and the parameters of the dual memory network model and the Seq2Seq prediction model are updated periodically (e.g., every 6 hours) using a small-batch online incremental learning algorithm (such as using the Adam optimizer, with new data accumulated in the past 24 hours as a small batch). This allows the model to continuously adapt to the latest psychological change patterns and behavioral habits of individual users, realizing a smart closed loop of "perception-analysis-early warning-handling-learning."

[0131] Furthermore, the embodiments of this application also include method S9, and the steps of multi-terminal collaborative early warning distribution and data visualization service.

[0132] After generating tiered early warning information and completing trend prediction, this method also performs the following multi-terminal collaboration and data service operations: S91. Issuance of Linked Response Command: In response to the aforementioned graded early warning information, especially when the early warning type is "environmentally induced" and accompanied by high-intensity abnormal behavior (such as a collision confidence level > 0.8 or a self-harm tendency confidence level > 0.7 output by the GCN), the system issues a linked control command to the local broadcasting system and security access control system via a standard RESTful API interface. This command triggers a voice reassurance announcement (playing preset soothing music or guiding text) within a preset area and automatically removes or reduces access restrictions in the corresponding activity area (such as opening emergency exit access control), providing physical access support for rapid staff intervention and shortening emergency response time.

[0133] S92. Anonymized Home-School Information Push: Upon triggering an alert or daily status update (e.g., generating a daily overview at 8:00 PM), the system calls the preset parent-authorized contact list and push strategy to generate an anonymized "User's Emotional and Environmental Status Briefing at the Kindergarten / Under Management." This briefing only includes trend descriptions (e.g., "Emotional fluctuations this afternoon were 15% higher than usual, lasting approximately 20 minutes before recovering on their own") and an overview of environmental indicators (e.g., "Noise peak in the activity area reached 65dB; parents are advised to pay attention to evening moods"). It strictly excludes original audio and video recordings, detailed behavioral trajectory coordinates, and original emotional probability distribution data to ensure user privacy. The briefing is sent to both the parent and corresponding teacher's ends via encrypted information channels (e.g., encrypted messages on WeChat Work or push notifications from a dedicated app) to improve the efficiency of home-school collaborative management.

[0134] S93. Multi-terminal visual situation display: The system backend will display the processed correction probability distribution. Environmental heat map data (heat map data with activity areas as grids) and behavioral trajectory points (region-level trajectories after fuzzification) are encapsulated into JSON data streams and pushed to the large-screen dashboard, PC management backend, and mobile APP, respectively. The front end uses visualization libraries such as ECharts and D3.js to display sentiment trends with line charts, environmental distribution with heat maps, and activity area distribution with trajectory maps. It supports managers to filter in real time and review historical data by time (day / week / month), region (different activity areas), and risk level (red / orange / yellow / blue).

[0135] Example 2 This system is a multimodal sequence-based mental health status tracking and early warning system, employing a cloud-edge hybrid deployment architecture. Edge computing devices are deployed in user activity locations (nursing home floors, school classrooms, medical clinics), equipped with NVIDIA Jetson Xavier NX edge computing devices (21TOPS INT8 computing power, 8GB LPDDR4x memory), responsible for data acquisition, real-time preprocessing, and low-latency early warning response (end-to-end latency <500ms from sensor data acquisition to early warning issuance). The cloud computing device is deployed in a private cloud or Alibaba Cloud / Tencent Cloud VPC, equipped with an NVIDIA A10 GPU (24GB VRAM), responsible for model training, complex inference, historical data storage (hot / cold tiering: hot data stored on SSD for 90 days, cold data archived to object storage for 7 years), and cross-institutional aggregation and analysis (excluding personally identifiable information). The edge and cloud communicate via dual-path communication: 5G (primary link) and wired network (backup link), supporting independent edge operation during network interruptions (degradation mode) and data synchronization after recovery (breakpoint resumption). This includes: The Zhikang Real-time Emotion Perception Module is used to collect users' video streams, audio streams, and text interaction data through the multimodal perception access layer; perform preprocessing operations such as noise reduction, frame segmentation, normalization, time synchronization, and quality screening on the above input data; and extract multi-dimensional emotion feature vectors including facial expression action unit intensity, speech prosody parameters, and text semantic embedding.

[0136] The companion robot interaction quality assessment module is used to parse interaction log data, extract semantic difference features and response latency features; calculate the response-intent matching score based on word vector semantic analysis; and generate an interaction quality score through weighted fusion. Further based on Compared with historical benchmarks The ratio is used to generate a dynamic interactive fault correction factor through the Sigmoid activation function. .

[0137] The smart environment IoT monitoring module is used to collect environmental physical data in real time through an IoT sensor network (including temperature and humidity sensors, PM2.5 detectors, noise detectors, and illuminance sensors) deployed in the activity space, and to provide threshold judgment and alarm functions for each environmental indicator.

[0138] The Smart Health Behavior Analysis Module is configured to access video streams from depth cameras and data reported by terminal devices, extract behavioral features such as key points of the user's human skeleton, head posture, and area of ​​gaze; and use graph convolutional networks (GCN) to model the spatiotemporal features of the skeleton sequence to identify abnormal behavioral patterns such as repetitive actions, impulsive reactions, and withdrawal avoidance, and output abnormal action categories and confidence scores.

[0139] The central fusion and early warning engine is deployed on a cloud GPU server (NVIDIA A10, 24GB GDDR6 memory). It communicates with each edge module via the gRPC protocol (Protobuf serialization, bidirectional streaming communication), with a 5-second timeout and an automatic reconnection mechanism. The engine comprises the following core units: Dual-memory network unit: It incorporates a Bi-LSTM short-term memory subunit (2 layers, 256 hidden layers) and a GRU+attention mechanism long-term memory subunit (3 layers, 512 hidden layers), implemented using the PyTorch 2.0+ framework. It loads pre-trained model weights (model file size approximately 450MB, exported in ONNX format for easy cross-platform deployment). The unit receives multimodal features from each module (gRPC streaming input, one feature packet per second) and outputs the original probability distribution of mental health states. And the corresponding temporal sequence of emotion intensity. Inference latency <200ms / sample (on an A10 GPU with a batch size of 1).

[0140] Correction processing unit: Receives interactive fault correction factors (Obtained from the interaction quality assessment module at the edge via gRPC), based on the current moment. and The comparison results are for the original probability distribution. Perform selective weighting operation and output The unit maintains a time window buffer (implemented as a ring buffer) of size 60, storing the historical probability distribution sequence of the most recent 60 minutes.

[0141] Attribution Decision Unit: Combining environmental physical data (obtained via MQTT subscription), abnormal action recognition results output by the behavior analysis module (obtained via gRPC), and the corrected probability distribution, it performs attribution analysis for "environmentally induced type" and "pathologically spontaneous type." It calculates the environment-behavior time correlation coefficient. (Calculated within a dynamic window of -5 seconds to +2 seconds), and graded early warning information is generated according to 8 multi-dimensional rule bases (stored in JSON format, supporting hot updates).

[0142] Baseline Management Unit: Receives interaction quality scores ,when At this time, PyTorch's register_backward_hook mechanism is used to generate gradient mask control signals, which mask the data gradients for the corresponding time period during the backpropagation phase of the long-term memory unit. This unit has independent model copy management capabilities and can perform baseline updates without interfering with the main inference process.

[0143] Trend Prediction and Closed-Loop Update Unit: This unit incorporates a Seq2Seq sequence predictor (encoder-decoder LSTM, 2 layers, 256 hidden layer dimensions) to predict the state trend for the next 30 minutes using a corrected historical state sequence (60 steps back window, 30 steps prediction window) as input. A forward-looking alert (rule R8) is triggered when a continuous downward trend is detected. This unit includes an online incremental learner with an asynchronous background update strategy: when the number of feedback samples is ≥100, an incremental update task is automatically triggered (using an independent thread pool, without blocking the main inference process). After the update is completed, the new and old models are compared on the validation set (data from the most recent 24 hours). The new model is only officially switched when its alert accuracy improves by ≥2%.

[0144] Multi-terminal Collaboration and Visualization Service Unit: Responding to tiered early warning information, it issues linkage control commands to the broadcast system and security access control system via RESTful API (FastAPI framework, HTTPS / TLS 1.3, JWT authentication) (command issuance delay <100ms). Following a preset anonymization strategy (compliant with the Personal Information Protection Law, GDPR (General Data Protection Regulation), and HIPAA compliance requirements), it pushes encrypted status briefings (AES-256-GCM, each user's independent key, distributed via asymmetric encryption) to parents' and teachers' devices. The processed corrected probability distribution, environmental heat map data (GeoJSON format), and behavioral trajectory data (region-level obfuscation) are encapsulated and pushed via WebSocket (Socket.IO, automatic reconnection, 25-second heartbeat interval) to large screens, PCs, and mobile devices for visualization.

[0145] All API calls and data accesses involving personally identifiable information are logged (fields: Operator ID, Operation Time, Operation Type URI, Data Range, Source IP Address, User-Agent, Request ID), and the logs are retained for no less than 180 days (to meet medical data compliance requirements). The system has a built-in data masking engine (using a deterministic masking strategy, based on the HMAC-SHA256 hash value of the user ID as the masked identifier, ensuring that the masked ID of the same user is consistent across different data tables), ensuring that externally output reports, briefings, and visualizations do not contain personally identifiable information.

[0146] System startup and initialization process: The system will automatically perform the following 5 initialization steps upon initial deployment (total time ≤ 15 minutes): Device discovery and access (approximately 2 minutes): Automatically scans all sensor devices in the network using SSDP (Simple Service Discovery Protocol) and mDNS (Multicast DNS), generating a list of candidate devices for administrator confirmation and addition.

[0147] Model weight loading (approximately 1 minute): Download the pre-trained dual memory network model weights (version ≥ v2.3.1, SHA-256 checksum) from the model repository (private Docker Registry or OSS).

[0148] Environmental baseline acquisition (approximately 5 minutes): Perform environmental indicator baseline acquisition, calculate the mean and standard deviation of each indicator, and establish an initial environmental baseline (for subsequent use). (Dynamic adjustment reference).

[0149] Interaction baseline calibration (approximately 3 minutes): Conduct 5 rounds of standardized question-and-answer dialogue with the user (using a preset template), record response latency and response matching degree, and establish an initial interaction quality benchmark. .

[0150] Behavioral baseline acquisition (approximately 4 minutes): Guide the user to complete four standard actions: standing naturally (10 seconds), walking in a straight line (5 meters), sitting (10 seconds), and free head rotation (±45°, 5 times in each direction) to establish an initial behavioral baseline (the normal range of motion and speed distribution of each joint).

[0151] Example 3 To further illustrate the complete operational logic of the present invention in a practical application scenario and the sequential relationship between each step, this embodiment uses an elderly user receiving companionship services in a smart elderly care institution as an example to describe the complete operation process of the system over a 4-hour period: Scenario: User Zhang, 75 years old, with mild cognitive impairment (MCI) and depressive tendencies, is admitted to room 302 in the south building of a smart elderly care facility. The system of this invention has been fully deployed in the room (camera 1, microphone array 1, environmental sensor terminal 1, companion robot 1, IoT gateway 1, edge computing device 1, all devices have been configured through the above initialization process).

[0152] 14:00, Baseline Phase: The user wakes up after their lunch break and sits quietly reading in their room. All system sensors are operating normally, and environmental indicators are stable within normal ranges: noise 32dB, illumination 480Lux, temperature 24℃, humidity 52%RH, PM2.5 18μg / m³. 3 The emotional intensity value output by the dual memory network is 0.23 (classified as "calm"), and the fusion gating coefficient g=0.28 (dominated by long-term memory). The system enters a regular monitoring state, generating a status log every 5 minutes and writing it to the local time-series database.

[0153] At 15:00, a normal interaction was triggered: a user asked the companion robot, "Are there any activities this afternoon?" The robot responded with a 1.2-second delay, replying, "There's a craft class at the activity center at 3:30 this afternoon." The system calculates the interaction quality score in real time. (Match score 0.91 × 0.6 + Delay score 0.68 × 0.4 = 0.818), which is higher than the threshold. No correction is triggered. The model outputs normally. This interaction also updates the interaction quality history cache for future use. Rolling updates.

[0154] 15:07, Environmental abrupt changes and multimodal response: 15:07:12: The outdoor construction team started using electric drills, and the noise level inside the room jumped from 34dB to 72dB within 3 seconds (far exceeding the 55dB threshold). The smart environment IoT monitoring module immediately triggered an "environmental anomaly" flag at 15:07:15 and pushed it to the central fusion engine via MQTT (push delay 42ms).

[0155] 15:07:13-15:07:18: Simultaneously, an anomaly occurred in the user behavior data synchronization—the depth camera detected that the user's head deflected from 0° to -28° within 1.5 seconds (a head-down avoidance action). At 15:07:18, the GCN model output an anomaly confidence score of 0.82 (classified as "withdrawal avoidance"). The behavior analysis module pushes the results to the central fusion engine via gRPC (pushing delay 28ms).

[0156] 15:07:19: After receiving two sets of events, environmental anomalies and behavioral anomalies, the attribution decision unit of the central fusion engine automatically triggers the calculation of the environmental-behavior temporal correlation, which is performed within the window from 5 seconds before t_0=15:07:18 to 2 seconds after t_0=15:07:18. The cross-correlation analysis results between the noise change rate sequence within the window and the environmental data are as follows: The value was far above the threshold of 0.7, confirming it as a strong environmental trigger.

[0157] 15:07:20: Attribution decision-making unit according to rule R5 (environmentally induced type) The system outputs a "blue (prompt)" warning instead of the possible orange one. At the same time, the system automatically generates an environmental adjustment strategy: "Notify the construction team to suspend high-noise operations (if it cannot be suspended, provide users with active noise-canceling earplugs), and suggest temporarily moving the activity area to a quiet room on the south side (302B spare rest room)."

[0158] 15:08, Multi-device collaborative command execution: The multi-terminal collaboration and visualization service unit will push a vibration reminder (including user ID, room number, warning type, and summary of handling suggestions) to the caregiver's wristband within 100ms (15:07:20.1) after receiving the warning.

[0159] At the same time, detailed environmental adjustment strategies (including noise spectrum analysis charts and environmental adjustment priority suggestions) are pushed to the environmental administrator terminal.

[0160] After receiving the PLAY_SOOTHE command, the broadcast system automatically broadcast a voice prompt at 15:07:22: "The noise level in the current area is too high. It is recommended that users go to the rest area. Staff will come to assist you." (Volume 50dB, played twice).

[0161] Caregivers arrived at the user's room at 15:08:45 (response time approximately 85 seconds), calmed the user, and assisted them to move to the 302B backup rest room. The entire process, from the sudden environmental change to the completion of physical intervention, took approximately 93 seconds.

[0162] 15:30, Post-intervention verification and feedback: After the user was moved to a quiet room, the noise level dropped to 36 dB. The system continuously monitored the user's emotional and behavioral indicators: the emotional intensity value dropped from 0.52 to 0.31 within 6 minutes after the transfer (a decrease of 40.4%), and the GCN abnormal confidence score dropped to 0.12 within 9 minutes (a decrease of 85.4%).

[0163] The system automatically determines that the "effective environmental intervention" condition is met (environmental indicators recover within 10 minutes + abnormal confidence decrease >30%), marks the event as "emotional recovery to normal after environmental adjustment" (label +1), and stores the complete intervention process record (including environmental change curve, behavioral change curve, and intervention response time) in the closed-loop update queue.

[0164] 16:00, Forward-looking trend prediction: The Seq2Seq model predicts trends for the next 30 minutes based on a historical state sequence (60 sampling points) from 15:00 to 16:00. The predicted sequence shows a slight upward trend in sentiment intensity values ​​(0.31→0.33→0.35→0.36), which does not meet the criteria for a continuous downward trend (the last three values ​​are all higher than the current value), therefore, no forward-looking warning is triggered. The system writes this prediction result into the situation dashboard for reference by on-duty personnel.

[0165] 17:50, Verification of interactive fault and correction mechanism: After returning to their original room, the user asked the robot, "What's for dinner?" Due to network latency (DNS resolution timeout causing a retry), the robot replied after 7.3 seconds, "Dinner menu: porridge, vegetables, and fish." The system calculated the quality score for this interaction. (Match score 0.52 × 0.6 + Delay score 0.09 × 0.4 = 0.35, below the 0.6 threshold), generate a correction factor. If the model outputs a low probability of 0.68 at this time, after correction and normalization, it drops to about 0.54, effectively reducing the weight of misjudgment of emotion caused by interaction failure and avoiding unnecessary orange warnings.

[0166] At 18:00, a closed-loop update was triggered: A total of 127 feedback samples were accumulated that day (including the positive feedback event at 15:30). The closed-loop update unit initiated a background incremental update task (using an independent thread to avoid blocking the main process). Mini-batch parameter optimization was performed on the dual-memory network model (batch size 127, learning rate...). (1 epoch), taking approximately 94 seconds.

[0167] After the update is completed, the new and old models are compared on the validation dataset (containing 83 labeled samples) in the most recent 24 hours: the new model's warning accuracy has increased from 82.3% to 84.1% (+1.8%), meeting the switching condition (≥2%). The model version is automatically updated from v2.3.1 to v2.3.2, and a model snapshot is saved to the cloud model repository.

[0168] This scenario demonstrates the collaborative operation of the entire chain of this invention, encompassing perception, fusion, reasoning, correction, attribution, early warning, learning, and linkage. Particularly noteworthy is: ① When the environmental noise suddenly changes at 15:07, the system... The strong temporal correlation was accurately attributed to environmental factors, and the potential "orange" was downgraded to "blue," avoiding over-medicalization; ② Physical intervention was completed within 93 seconds through multi-terminal collaboration, demonstrating the value of engineering implementation; ③ In the low-quality interaction at 17:50, the correction factor effectively suppressed the risk of misjudgment; ④ Adaptive evolution of the model was achieved through the closed-loop update at 18:00.

[0169] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A method for tracking and early warning of mental health status based on multimodal sequences, characterized in that, Includes the following steps: S1. Parallel acquisition of multimodal time-series datasets, including emotional multimodal data, user-companion robot interaction log data, behavioral sequence data, and environmental physical data; S2. Preprocess the multimodal time-series dataset to extract emotion feature vectors, interaction quality feature vectors, behavioral feature vectors, and environmental feature vectors, and construct a fused input sequence using a multi-head cross-modal attention mechanism; S3. Input the fused input sequence into a pre-trained dual-memory network model to output the original psychological health status probability distribution. And the temporal sequence of emotional intensity; the dual memory network model includes short-term memory units and long-term memory units; S4. Calculate the interaction quality score based on the interaction log data. And determine the interaction quality score. Is it below the preset first quality threshold? ; S5, Response to Interaction Quality Score Below the first quality threshold Generate interactive fault correction factors (in ), and the interactive fault correction factor With respect to the probability distribution of the original mental health state By performing weighted calculations, the corrected probability distribution of mental health status is obtained. To reduce the weight of emotional misjudgment caused by inappropriate responses from companion robots; S6. Based on the corrected probability distribution of mental health status Based on the environmental physical data, perform anomaly attribution analysis: if the environmental indicators exceed a preset second environmental threshold... If so, the warning type will be marked as "environmentally induced type"; If environmental indicators are normal and the interaction quality score is... Not lower than the first quality threshold If so, the warning type will be marked as "spontaneous pathological type"; S7. Execute a graded warning based on the warning type and the corrected emotional intensity value.

2. The method for tracking and early warning of mental health status based on multimodal sequences according to claim 1, characterized in that, In S4, the interaction quality score is calculated. The specific steps include: S41. Extract semantic difference feature vectors and response delay time features from multi-turn dialogues; S42. Based on word vector semantic analysis, calculate the matching score between the robot's response content and the user's intent. ; S43, Combining the matching score The interaction quality score is generated by weighted fusion based on the characteristics of response latency. The calculation formula is as follows: );in, For preset weighting coefficients, ) is a negative scoring function for response delay; The interactive fault correction factor The calculation formula is: ; in, It is the Sigmoid activation function. A historical benchmark quality score.

3. The method for tracking and early warning of mental health status based on multimodal sequences according to claim 1, characterized in that, The dual-memory network model in S3 includes short-term memory units and long-term memory units; The short-term memory unit employs a bidirectional long short-term memory network to capture instantaneous emotional fluctuations and changes in psychological state within the current conversation context; the long-term memory unit employs a gated recurrent unit combined with a time-attention mechanism to learn and store the user's long-term behavioral patterns and psychological baseline. The method also includes a baseline update step: when determining the interaction quality score... Below the first quality threshold When the data for the corresponding time period is marked as contaminated data, and when updating the individual baseline behavior pattern using the long-term memory unit, a mask is applied to the contaminated data on the gradient backpropagation path to set the gradient to zero, thereby removing the contaminated data to prevent machine interaction failures from interfering with the long-term modeling of user profiles.

4. The method for tracking and early warning of mental health status based on multimodal sequences according to claim 1, characterized in that, The weighted operation steps in S5 specifically include: For each moment in the time series ,like Then execute: ; in, For a moment The probability distribution of the original mental health status For a moment Corrected probability distribution; like Then let ,and .

5. The method for tracking and early warning of mental health status based on multimodal sequences according to claim 1, characterized in that, The anomaly attribution analysis step also includes environmental and behavioral correlation verification: S61. Utilize graph convolutional networks to extract abnormal action patterns from behavioral feature vectors. The graph convolutional network uses key points of the human skeleton as graph nodes and the natural connection relationships of key points as edge structure spatial topology graphs. Through multi-layer graph convolution operations, it extracts spatiotemporal features from the skeleton sequence to identify abnormal action patterns. S62. Calculate the temporal correlation coefficient between the occurrence time of the abnormal action pattern and the noise peak or sudden change in illumination in the environmental physical data. ; S63, if the time correlation coefficient Greater than the preset threshold If the behavior is marked as "environmentally induced", an environmental adjustment strategy will be generated, and the warning level will be reduced according to the severity of the abnormal behavior.

6. The method for tracking and early warning of mental health status based on multimodal sequences according to claim 1, characterized in that, The method also includes trend prediction and closed-loop update steps: Using the Seq2Seq structure based on the corrected probability distribution of mental health status Predict the state trend over the next N time steps, where N is a positive integer; When a continuous downward trend in the emotional intensity value is predicted, a forward-looking warning is triggered even if the current intensity value does not exceed the warning threshold. The actual handling results after the warning are recorded, and the handling results are used as feedback labels to update the parameters of the dual memory network model at regular intervals through an online incremental learning algorithm.

7. The method for tracking and early warning of mental health status based on multimodal sequences according to claim 1, characterized in that, The preprocessing steps specifically include: S21. Perform frame segmentation and facial landmark detection on the video stream in the emotional multimodal data, and extract the facial action unit intensity value; perform noise reduction and prosodic feature extraction on the audio stream, and extract fundamental frequency, formants and Mel-frequency cepstral coefficient features; perform word segmentation and semantic embedding on the text interaction data, and convert it into a high-dimensional semantic embedding vector. S22. A multi-head cross-modal attention mechanism is used to fuse the emotion feature vector, interaction quality feature vector, behavior feature vector, and environmental feature vector. This multi-head cross-modal attention mechanism includes multiple parallel attention heads configured to calculate the consistency weights between text semantic features and facial expression features. And the inducing weights of environmental and behavioral characteristics. The modal features, after being weighted by two sets of weights, are concatenated along the feature dimension to form the fusion input sequence with unified dimensions.

8. The method for tracking and early warning of mental health status based on multimodal sequences according to claim 1, characterized in that, The parallel acquisition of multimodal time-series datasets in S1 specifically includes: S11. Captures user facial video stream at a frame rate of 25-30fps using a high-definition camera, captures voice audio stream at a sampling rate of 16kHz-44.1kHz using an array microphone, and records user-input text interaction data in real time through the interactive interface. S12. Completely record the interaction information of each round of dialogue between the user and the companion robot, including the user's query text, the robot's reply text, the response timestamps of each round, and dialogue interruption and resumption events; S13. Collect user head posture, coordinates of key points of human skeleton, gaze focus area and dwell time, and operation click stream data through depth camera or terminal device to form a time-series behavior sequence. S14. Real-time collection of environmental index data such as temperature, relative humidity, PM2.5 concentration, ambient noise, and light intensity through an IoT sensor network deployed in the user's activity space; All data is tagged with a uniform timestamp during collection and uploaded in real time via wireless network; In step S2, after extracting the feature vectors of each modality and before constructing the fused input sequence, a data quality screening and repair step is also included: audio segments with a signal-to-noise ratio lower than a preset threshold, video frames with a face detection confidence level lower than a preset threshold, or data packets with timestamp drift exceeding a preset deviation are automatically marked as low-quality data; for the low-quality data, the corresponding sensor's re-acquisition command is triggered first; if re-acquisition fails or real-time requirements do not allow it, the weighted average of valid data within the adjacent time window is used for interpolation to fill the gap.

9. A mental health status tracking and early warning system based on multimodal sequences, characterized in that, include: The Zhikang Real-time Emotion Perception Module is configured to collect video, audio, and text data and extract emotion feature vectors. The companion robot interaction quality assessment module is configured to parse interaction logs and calculate interaction quality scores. And score based on interaction quality Generate interactive fault correction factor ; The smart environment IoT monitoring module is configured to collect environmental physical data and provide environmental threshold judgment. The central fusion and early warning engine is connected to the above modules respectively, and the engine includes: Dual-memory network units are used to receive multimodal features output from each module and perform deep fusion to output the probability distribution of the original mental health status. ; The correction calculation unit is used to receive the interactive fault correction factor. And the probability distribution of the original mental health state. Perform weighted calculations and output the corrected probability distribution. ; Attribution decision unit, used to combine environmental physical data, abnormal behavior identification results, and corrected probability distribution. Perform anomaly attribution analysis and generate tiered early warning information; The baseline management unit is used to receive the interaction quality score. When the interaction quality score Below the first quality threshold At the same time, write permissions for the baseline model of the long-term memory unit are blocked for the corresponding time period data, so as to achieve interference-resistant user profile modeling.

10. The mental health status tracking and early warning system based on multimodal sequences according to claim 9, characterized in that, The central fusion and early warning engine also includes: The trend prediction and closed-loop update unit has a built-in Seq2Seq sequence predictor, which is used to predict the state trend of the next NN time steps based on the corrected historical state sequence, and trigger the generation of forward-looking early warning information when a continuous downward trend is detected. The trend prediction and closed-loop update unit also includes an online incremental learner, which is used to update the parameters of the dual memory network model and the Seq2Seq prediction model online at regular intervals according to the feedback of the actual handling results after the early warning. The multi-terminal collaboration and visualization service unit is used to respond to hierarchical early warning information, issue linkage control commands to the broadcast system and security access control system through API interface, push encrypted status briefings according to preset de-identification strategy, and encapsulate and push the processed data to multiple terminals for visualization display; The Permissions and Compliance Management Unit is used to establish a role-based access control multi-role permission system, controlling different roles' read and write permissions for emotional data, behavioral trajectories, and original audio and video files. All API calls and data access involving personal identity information are logged, and the system has a built-in data anonymization engine.