Personalized art therapy healing task generation method based on large language model

By identifying metaphorical visual schemas in images using a large language model and reconstructing them through three-stage semantic reasoning, combined with graph neural networks and semantic dependency analysis, personalized art therapy tasks are generated. This solves the problems of metaphorical semantic parsing and semantic consistency in existing technologies, and achieves personalized and safe immersive interaction.

CN121812082APending Publication Date: 2026-04-07SUZHOU HB AI TECH RES&DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing semantic analysis and text generation technologies struggle to interpret the metaphorical semantic symbols hidden behind images in visual-text cross-modal semantic understanding. They also fail to maintain semantic consistency for personalized tasks when generating long texts and lack effective syntactic constraint mechanisms, resulting in a disconnect between the generated text logic and the user's historical psychological state.

Method used

This method employs a large language model to identify metaphorical visual schemas in images, performs semantic reasoning reconstruction through a three-stage thought chain, constructs a user-specific metaphorical knowledge subgraph, and applies graph neural networks to generate context bias vectors. It decomposes structured semantic descriptors into spatial topological parameters and behavioral instruction parameters, and combines semantic dependency analysis and a domain language generator to generate immersive interactive tasks.

Benefits of technology

It achieves ultra-personalization of personalized art therapy tasks, improves the targeting and efficiency of interventions, ensures the semantic consistency and safety of immersive scenarios, and maintains semantic consistency of the interaction process by adjusting task parameters in real time through a dual closed-loop mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121812082A_ABST
    Figure CN121812082A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of semantic analysis, in particular to a personalized art therapy healing task generation method based on a large language model, which comprises the following steps: firstly, analyzing visual image data input by a user, extracting metaphor visual symbols and source domain semantic description, and performing semantic space alignment with a psychological model; a three-stage thinking chain technology is adopted to execute semantic reasoning reconstruction from a source domain to a target domain, a structured semantic descriptor is generated, in the process, a dynamic metaphor semantic topology network is constructed, a graph neural network is applied to aggregate global features to generate a language context bias vector, and the attention weight of a large language model is dynamically corrected; then deconstructing the descriptors into space and behavior semantic features by applying a semantic dependency syntactic analysis algorithm; the environment channel executes cross-modal semantic mapping from a text to a space; and the task channel accurately translates the natural language instruction into a cognitive interaction script by utilizing semantic role labeling and a syntactic constraint mechanism based on a finite state automaton.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of semantic analysis technology, specifically to a method for generating personalized art therapy tasks based on a large language model. Background Technology

[0002] With the rapid development of natural language processing and generative artificial intelligence technologies, digital cognitive healing is gradually shifting from traditional pre-defined rule-based models to generative interaction models based on semantic understanding. In this field, how to accurately parse the deep semantics of user expressions using computers and generate interactive text that conforms to psychological logic is an important direction for current applied research in computational linguistics.

[0003] However, existing semantic analysis and text generation technologies in visual-text cross-modal semantic understanding mostly employ shallow label extraction or keyword matching methods. These methods often only capture explicit object features of images (such as "mountain" or "tree"), failing to analyze the implicit metaphorical semantic symbols behind the image (such as "isolated tree" metaphorically representing "loneliness"). In terms of contextual modeling for long text generation, existing large language models often struggle to effectively utilize users' historical semantic information when handling personalized tasks. Most existing context management techniques are based on simple text concatenation or fixed window truncation, leading to semantic drift during generation—that is, the generated text logic becomes disconnected from the user's historical psychological state or current healing goals, failing to maintain long-term semantic consistency. Furthermore, existing technologies lack effective syntactic constraint mechanisms in the translation from natural language to formal instructions.

[0004] To address the technical challenge of efficiently and semantically converting personalized art therapy tasks into executable, immersive interactive tasks, a personalized art therapy task generation method based on a large language model is proposed. Summary of the Invention

[0005] The purpose of this invention is to provide a personalized art therapy task generation method based on a large language model. The purpose of this invention is to overcome the shortcomings of existing technologies in terms of insufficient personalization of therapy task generation, disconnect between environment and task logic, and lack of safe dynamic feedback and correction mechanisms. The aim is to provide a method that can automatically transform metaphorical projections in user images into personalized, semantically consistent, and securely verified immersive VR cognitive interaction tasks.

[0006] A method for generating personalized art therapy tasks based on a large language model includes: Acquire raw image data input by the user, and identify metaphorical visual schemas and corresponding source domain semantic tags in the image; The source domain semantic labels are semantically aligned with the PERMA model to form target domain semantic labels. A three-stage thinking chain is used to perform semantic reasoning reconstruction from the source domain to the target domain on the metaphorical visual schema to obtain a structured semantic descriptor. Construct a user-specific metaphorical knowledge subgraph and apply a graph neural network to perform a multi-layer global message passing algorithm on the subgraph to obtain a context bias vector. Then, fine-tune the attention weights during the semantic reasoning reconstruction process of the thought chain based on the context bias vector. The structured semantic descriptor is decomposed into spatial topology parameters and behavioral instruction parameters by applying a semantic dependency parsing algorithm. In the environment rendering channel, a 3D generative network is applied to perform semantic mapping from text to space to generate an immersive interactive scene. In the task generation channel, a domain language generator is applied to fill the behavioral instruction parameters into the syntactic logic skeleton to generate a cognitive interaction task script.

[0007] Preferably, the metaphorical visual schemas in the identified image and their corresponding source domain semantic labels specifically include: A large language model is applied to the original image data for natural language paraphrasing and visual question answering, resulting in an overall scene description and semantic annotations of key visual elements. By inputting metaphorical semantic prompt templates into the large language model, metaphorical visual schema semantic association analysis is performed on the key visual elements to obtain a set of candidate metaphorical visual schemas. Based on the source-target domain semantic mapping logic of conceptual metaphor theory, the source domain semantic confidence of the candidate set of metaphorical visual schemas is evaluated to obtain the metaphorical visual schema with the highest confidence and its corresponding source domain semantic label.

[0008] Preferably, the step of performing semantic reasoning reconstruction from the source domain to the target domain using a three-stage thought chain specifically includes: the first stage uses a metaphor source domain parser to lock the most significant unbalanced semantic features to obtain candidate terms for the source domain; the second stage uses cross-modal knowledge graph semantic alignment isomorphic concepts to obtain a set of metaphor bridging terms; and the third stage uses a large language model to perform semantic generation and reconstruction of the thought chain from the source domain to the metaphor bridge to the target domain, to obtain a complete structured semantic descriptor.

[0009] Preferably, the third stage, which employs a large language model to perform semantic generation and reconstruction of the thought chain from the source domain to the metaphor bridge to the target domain, to obtain a complete structured semantic descriptor, specifically includes the following steps: The source domain semantic labels are semantically aligned with the PERMA model to form target domain semantic labels. Starting from the source domain candidate terms and ending with the target domain semantic labels, the metaphor bridging term set is used as an intermediate node. The natural language reasoning ability of the large language model is applied to construct semantic association paths, and path branches with semantic relevance below a preset threshold are eliminated to form a multi-hop semantic evolution path with a directed acyclic graph structure. Based on the semantic distance between the source domain and the target domain, the rhythm of semantic evolution is planned to generate a temporal semantic transformation logic that controls the rate of environmental change.

[0010] Preferably, the step of obtaining the context bias vector and fine-tuning the attention weights during the semantic reasoning reconstruction of the thought chain based on the context bias vector specifically includes: Metaphorical entities and emotional association edges are extracted from the user's historical healing records to construct a user-specific metaphorical knowledge subgraph. A graph neural network is then applied to perform multi-layer global feature aggregation on the subgraph, performing multi-layer information transfer and semantic feature fusion on the metaphorical knowledge subgraph. Global average pooling is then performed on the output features of all nodes in the last layer to obtain a historical semantic embedding vector. A linear transformation layer is used to map the historical semantic embedding vector to a context bias vector with the same dimension as the hidden layer of the large language model. In each Transformer layer of the large language model, the context bias vector is applied to generate a residual adjustment term, which is then added to the original hidden state of the corresponding layer to correct the attention weights in the semantic reasoning reconstruction process of the thought chain.

[0011] Preferably, after generating the structured semantic descriptor, a semantic consistency verification and correction step is also required, specifically including: The generated structured semantic descriptor is mapped to a high-dimensional vector, and the semantic consistency confidence between it and the historical semantic embedding vector is calculated using cosine similarity to quantify the fit between the new task and the historical pattern. The semantic consistency confidence is compared with a preset semantic drift threshold. If the confidence is lower than the threshold, it is determined that there is an unexpected logical break in the current generation result, and a counterfactual correction mechanism is triggered. The difference features that cause the low confidence are extracted as negative constraints and added to the negative constraints of the prompting project. The large language model is forced to perform a regeneration operation until the output descriptor passes the consistency verification.

[0012] Preferably, the step of decomposing the structured semantic descriptor into spatial topology parameters and behavioral instruction parameters, and generating immersive interactive scene and cognitive interactive task scripts respectively, specifically includes: Dependency parsing is performed on the structured semantic descriptor to construct a semantic dependency tree. The semantic dependency tree includes, based on part-of-speech tagging and dependency relations, nodes describing static scene attributes and environmental atmosphere are divided into spatial topology parameters, and nodes describing dynamic interaction logic and triggering conditions are divided into behavioral instruction parameters. In the environment rendering channel, the spatial topology parameters are encoded and input into a conditional generative adversarial network. A neural radiation field model is applied to perform cross-modal semantic mapping from text to three-dimensional space, determining the geometric density field and radiation field parameters of the scene. An immersive interactive scene is then generated through a VR device. In the task generation channel, a syntactic template matching algorithm is executed based on the semantic evolution target. The most matching syntactic logic skeleton is retrieved from the domain language template library, and behavioral instruction parameters are filled into the syntactic logic skeleton to generate a cognitive interaction task script. The behavioral instruction parameters include: interaction duration, repetition count, action type, guiding prompts, and task difficulty coefficient.

[0013] Preferably, the application domain language generator fills the behavioral instruction parameters into the logical skeleton specifically by: A semantic role parsing model is applied to decompose the natural language description in the behavioral instruction parameters into fine-grained units, extracting atomic semantic units of action agent, semantic predicate, and patient object. Based on a predefined domain semantic mapping table, the semantic predicates in the atomic semantic units are mapped to executable semantic operators of the cognitive interaction script. A finite state automaton based on the domain-specific language grammar is constructed. During the decoding stage of the domain language generator, the state transition path of the finite state automaton is used to generate a vocabulary mask, and the output probability distribution of the large language model is syntactically constrained and filtered to ensure that the generated cognitive interaction task script meets the syntactic compliance of the domain-specific language.

[0014] Preferably, the method further includes: during the process of the user executing the cognitive interaction task script, applying gaze point semantic anchoring to parse the semantic labels of the user's gaze area in real time, calculating the cosine similarity between the semantic labels and the semantic vector of the target domain, and triggering a feedback mechanism when the cosine similarity exceeds a preset threshold to generate visual guidance text cues and dynamically adjust task parameters to maintain semantic consistency in the interaction process.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. By using GNN to encode user metaphorical knowledge subgraphs and generate contextual biases, and by fine-tuning the attention weights of the three-stage thought chain through an adapter mechanism, we can gain a deeper understanding of users’ historical emotional preferences and metaphorical patterns, generate task scripts that are highly consistent with the subconscious, achieve ultra-personalized healing, and significantly improve the pertinence and efficiency of intervention.

[0016] 2. The structured semantic descriptor is precisely decomposed into dual-channel output; the environment channel uses NeRF to ensure that the scene atmosphere accurately embodies the psychological state; the task channel uses DSL to ensure that the user's actions correspond precisely to the goal of the PERMA model; this unified semantic control eliminates the logical disconnect between the environment and the task, ensuring that every element of the immersive scene serves the ultimate purpose of the cognitive interaction task.

[0017] 3. It has a dual closed-loop security mechanism; during the generation stage, semantic consistency is verified by cosine similarity. If there is a discrepancy, counterfactual correction is triggered to force the large language model to regenerate; during the execution stage, gaze point semantic feedback is applied to calculate the similarity between the gaze point and the target domain in real time, and guidance is triggered immediately when there is a deviation; thus, it achieves truly real-time, flexible and controllable psychological intervention. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the steps of a personalized art therapy task generation method based on a large language model according to the present invention. Figure 2 This is a flowchart illustrating a personalized art therapy task generation method based on a large language model according to the present invention. Figure 3 This is a schematic diagram of the mapping path from the source domain to the target domain according to the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please see Figures 1 to 3 This invention provides a method for generating personalized art therapy tasks based on a large language model, referring to... Figure 1 For the step-by-step flowchart, refer to Figure 2 The process diagram is shown below, and the technical solution is as follows: A method for generating personalized art therapy tasks based on a large language model includes: Acquire raw image data input by the user, and identify metaphorical visual schemas and corresponding source domain semantic tags in the image; The source domain semantic labels are semantically aligned with the PERMA model to form target domain semantic labels. A three-stage thinking chain is used to perform semantic reasoning reconstruction from the source domain to the target domain on the metaphorical visual schema to obtain a structured semantic descriptor. Construct a user-specific metaphorical knowledge subgraph and apply a graph neural network to perform multi-layer information transfer and semantic feature fusion on the subgraph to obtain a context bias vector. Based on the context bias vector, fine-tune the attention weights in the semantic reasoning reconstruction process of the thought chain. A semantic dependency parsing algorithm is applied to decompose the structured semantic descriptor into spatial topology parameters and behavioral instruction parameters. In the environment rendering channel, a 3D generative network is applied to perform semantic mapping from text to space, generating an immersive interactive scene. In the task generation channel, a domain language generator is applied to fill the behavioral instruction parameters into a syntactic logic skeleton, generating a cognitive interaction task script. The coupling between the technical elements is presented.

[0021] Example 1 In a typical embodiment of the present invention, when a user draws and uploads a free painting that expresses their current mood through a touch drawing board, a targeted cognitive interaction task script is generated by deep analysis of the metaphorical visual patterns in the image and using thought chain reasoning to reconstruct the script, and the terminal device is driven to execute an immersive task.

[0022] First, when a user completes a painting on the drawing board or uploads a hand-drawn image, the metaphorical visual schema recognition process is initiated. The collected raw image data is preprocessed and then input into a pre-trained multimodal large language model. At this point, the image description natural language paraphrasing and visual question answering steps are executed.

[0023] Furthermore, a first-level visual perception prompt is constructed, with the prompt content configured to require the model to objectively describe the image and extract elements. For example, when the original image is a painting about "a person walking in the rain," the large language model outputs the overall scene description text of the image: "The center of the picture shows a black figure walking with his head down in the heavy rain, without an umbrella. The background is a gray sky and sloping rain lines, with puddles reflecting on the ground." At the same time, through a visual question-and-answer mechanism, the model is asked: "What are the key objects in the picture that have representational significance?" The model identifies and outputs semantic labels for key visual elements, specifically including: "pouring rain," "the person with their head down," "an unused umbrella," and "gray background."

[0024] Specifically, after obtaining the aforementioned key visual elements, the process enters the metaphorical visual schema semantic association analysis stage; the preset metaphorical semantic prompt template in the memory is invoked, which is constructed as follows: "Based on the psychological projection principle of art therapy, analyze the metaphorical meaning that the visual element [input element] may represent at the psychological level, and list no less than three possible interpretations." Specifically, the metaphorical semantic cue template adopts a hybrid form of natural language and structured parameters, and its core structure is as follows: Based on the principles of psychological projection in art therapy, this paper analyzes the metaphorical meanings that visual elements may represent in the following dimensions: Emotional dimension: This element may map to an emotional or psychological state. Behavioral dimension: The behavioral pattern or body language corresponding to this element. Social dimension: The meaning of this element in interpersonal relationships or social context. Cognitive dimension: The way of thinking or cognitive framework represented by this element. Furthermore, the steps of the source domain semantic confidence evaluation algorithm are as follows: The first step is to represent each candidate metaphor schema as a feature vector. For a candidate schema P, its feature vector consists of the following dimensions: (1) the CLIP cross-modal similarity (range 0-1) between the candidate metaphor keywords and the visual features of the original image is calculated. (2) By querying the psychology literature knowledge base or the metaphor psychology mapping table marked by experts, the generality score of the metaphor in implementation (range 0-1) is returned; (3) The cosine similarity between the candidate metaphor vector and the user's historical metaphor entity vector is calculated.

[0025] The second step is to perform a weighted summation of the three features mentioned above to obtain the confidence score: In the default configuration, the weight for cross-modal similarity is α=0.4, the weight for generality score is β=0.35, and the weight for cosine similarity is γ=0.25. These can be adjusted according to specific application scenarios.

[0026] The third step is to sort all candidate schemas in descending order of confidence score. By default, the schema with the highest confidence score is selected as the determined metaphorical visual schema. If the user specifies to retain multiple alternatives, the top N schemas in terms of confidence score can be retained, where N is usually set to 3-5.

[0027] The previously identified "torrential rain" and "people with their heads down" are filled into the template and input into the large language model; the model outputs a set of candidate metaphorical visual schemas for "torrential rain", including: "immense external pressure", "uncontrollable emotional venting", "washing and rebirth"; and outputs a set of candidates for "people with their heads down", including: "lack of confidence", "frustration and avoidance", "contemplation"; at this point, a set of candidate metaphorical schemas containing polysemy is obtained.

[0028] Furthermore, in order to determine the metaphor that best fits the current context, a source domain semantic confidence assessment is performed; this step is based on conceptual metaphor theory, namely the logic of “mapping from the source domain (concrete physical experience) to the target domain (abstract mental state)”; each schema in the candidate set is checked for graph-text consistency and psychologic.

[0029] Specifically, the model analyzes the visual features of "dark background" and "no umbrella" in the image, concluding that these features have a low correlation with positive emotions (such as "rebirth" and "contemplation"), but a high correlation with negative or stressful situations. The model also calculates the source domain semantic confidence scores for each candidate schema. For example, for the element "pouring rain," the model evaluates its confidence score for mapping to "external pressure" to 0.92, its confidence score for mapping to "emotional catharsis" to 0.75, and its confidence score for mapping to "washing" to 0.3.

[0030] Finally, based on confidence scores, the highest-scoring "external pressure" was selected as the definitive metaphorical visual schema for "torrential rain," and its corresponding source domain semantic label was established as "natural force / irresistible force." "Frustration and avoidance" was selected as the definitive metaphorical visual schema for "a person with their head down," and its corresponding source domain semantic label was established as "body posture / withdrawal." These determined schemas and labels were then stored and transmitted to the subsequent task generation module as the core basis for generating personalized healing tasks.

[0031] This invention applies a large language model to transform visual features into natural language descriptions and establishes a source-target domain mapping logic based on conceptual metaphor theory. This method breaks through the limitation of traditional image recognition, which can only mark explicit objects, and can accurately analyze the deep symbolic semantics implied in visual scenes, providing precise semantic anchors for subsequent healing script generation.

[0032] After identifying the metaphorical visual schemas in the original image, a three-stage thought chain processing flow is initiated, aiming to transform the user's current negative or highly evocative visual schemas into target schemas with positive healing significance. The following is a detailed exposition of this three-stage reasoning and reconstruction process: First, the first stage of source domain feature locking is performed; then, the metaphor source domain parser is invoked to perform deep analysis of the metaphorical visual schemas identified in the previous steps; the goal of the metaphor source domain parser is to extract the core and representative semantic features from the identified metaphorical visual schemas. The specific steps are as follows: First, the metaphorical visual schema, such as "a lonely tree," is converted into a multi-dimensional semantic vector representation. A pre-trained multimodal language model (such as CLIP or ViLBERT) is then used to encode this schema, resulting in a d-dimensional semantic vector. Next, "imbalanced semantic features" are identified. Imbalanced features refer to contradictory or disharmonious semantic components contained in the metaphorical schema. Specifically, dimensions with high variance or large deviation from the mean are extracted from the d-dimensional semantic vector. These dimensions typically correspond to key semantic components that create metaphorical tension. The top K dimensions with the highest scores (usually K=3-5) are retained, and the semantic features corresponding to these dimensions are the most significant imbalanced features.

[0033] Finally, using inverse embedding or attention visualization methods, the features corresponding to the high-variance dimensions are mapped back to natural language representations. For example, if the feature corresponding to dimension i is closest to the words "conflict," "asymmetry," or "crack" in the vector space, it is extracted as a candidate term. The final output is a set of terms that constitute the "candidate term set" of the source domain.

[0034] Specifically, assuming the metaphorical visual schema identified in the previous step is "surging waves", its corresponding source domain semantic label is "natural fluid / dynamic force"; the metaphorical source domain parser performs visual tension analysis on the schema and locks out the most significant non-equilibrium semantic features that deviate from the visual equilibrium state; in this embodiment, the parser identifies "high frequency amplitude", "sharp edge" and "collision and breakage" as core features; based on these features, the parser outputs a set of source domain candidate terms, specifically including: "chaos", "conflict" and "runaway energy".

[0035] The pre-built cross-modal semantic knowledge graph is a vast semantic association topology network. Based on conceptual metaphor theory, it pre-establishes deep semantic mapping relationships between visual symbols, emotional states, and psychological concepts. This graph provides the system with human-like background knowledge, supporting reasoning from representational visual features to abstract psychological semantics.

[0036] Specifically, this knowledge graph is constructed using a multi-layered heterogeneous graph structure. The bottom layer is a visual semantic layer, containing semantic descriptions of many common visual elements, such as "dark clouds" and "chains." The top layer is a psychological concept layer, containing psychological states from the PERMA model, such as "repression" and "hope." The middle layer is a bridging network composed of metaphorical mapping edges, such as "chains" - [metaphor] -> "binding" - [cause] -> "repression." During the graph construction process, large-scale corpus mining techniques were applied to calculate the mutual information between different modalities as edge weights. When the system inputs visual symbols, the inference engine performs a random walk algorithm or multi-hop path search on this graph, automatically inferring the implicit psychological intent along high-weight semantic edges, rather than simple keyword matching. This knowledge graph provides interpretable semantic inference paths for large language models, greatly improving the accuracy and depth of metaphor recognition, and making the generated healing tasks more in line with personalized task requirements.

[0037] Furthermore, the second phase of metaphor bridging term extraction is performed; a pre-built cross-modal knowledge graph is accessed, which stores isomorphic mapping relationships between physical phenomena and mental concepts.

[0038] The pre-built cross-modal knowledge graph is a heterogeneous graph structure containing: a set of visual symbol nodes, such as visual adjectives or nouns like "sharp," "broken," and "blooming"; a set of emotional state nodes, such as psychological emotion words like "anxiety," "calm," and "hope"; a set of psychological concept nodes, such as clinical psychology terms like "defense mechanism," "self-cognition," and "relationship pattern"; and multiple types of edge sets, including visual → "emotion," "emotion → psychological concept," and "synonymous relationship."

[0039] This graph was constructed based on data from: metaphor research in psychology literature, case studies of art therapy, and a large-scale corpus of psychological counseling. Each edge is associated with a weight, representing the strength of the semantic association between two nodes.

[0040] For the input set of source domain candidate terms, the second stage task is to find "intermediate nodes" in the knowledge graph that connect these source domain terms with the target domain semantic labels (such as PERMA dimensions).

[0041] Specifically, for each candidate term in the source domain, a breadth-first search or heuristic search (such as the A* algorithm) is performed in the knowledge graph, with the path length limited to L steps (usually L=2-3). The search endpoint is the node with the smallest semantic distance to the target domain semantic label or a predefined "psychological concept" node. All reachable nodes obtained from the search are then judged as "isomorphic concepts." Two nodes are considered "isomorphic" if and only if they are highly similar in the neighborhood structure of the knowledge graph, i.e., their neighbor node sets have a high degree of overlap. From the isomorphic concepts, intermediate nodes located "between the source and target domains" are selected, i.e., nodes that can connect source domain features and point to target domain semantics. These nodes constitute the set of metaphorical bridging terms.

[0042] Specifically, using "water morphology" as the retrieval key, the system searches the knowledge graph for intermediate concepts that connect "chaotic state" and "ordered state". After aligning isomorphic concepts, a set of metaphorical bridging terms is output. In this embodiment, the set contains words with transformative properties, specifically: "dredging", "flowing", "pacifying", and "accommodating". These terms serve as semantic bridges connecting the source domain (current state) and the target domain (desired state).

[0043] Furthermore, we move into the third stage: semantic generation and reconstruction of the thought chain; referring to... Figure 3 This invention, based on the flowchart of the PERMA model's mapping path from the source domain to the target domain, utilizes a large language model to perform complete reasoning from the source domain to the target domain via a metaphorical bridge, and generates a structured semantic descriptor. This step includes the following sub-processes: By utilizing large language models (such as GPT-4, LLaMA, etc.), multi-step reasoning is performed to generate a complete semantic transformation sequence from the source domain to the target domain via a metaphor bridge.

[0044] The design of the prompt engineering instructions is as follows: [System Prompt] You are an expert in art therapy psychology and metaphor, skilled at analyzing the deeper psychological meanings of visual symbols and guiding people from their current psychological state to a more positive and healthier one.

[0045] [User Input] Source domain semantic features (current mental projection): [List of candidate terms in the source domain, such as "chaos, out of control, collision"] Source domain semantic tags (corresponding psychological states): [e.g., "stress and anxiety"] Metaphorical bridging terms (intermediate stage of transformation): [e.g., "flowing," "dredging," "calming"] Target domain semantic label (desired psychological state): [e.g., "tranquility and order, corresponding to the positive emotion dimension in the PERMA model"] [Task] Please complete the reasoning following the logical chain: 1. Explain the positive significance or potential for transformation inherent in the "chaos" of the source domain (e.g., chaotic water contains energy, not just destruction). 2. Gradually introduce metaphorical bridging terms to describe the gradual transformation from "chaotic energy" to "orderly flow" (for example, this energy can be channeled, just like guiding a river into a channel). 3. Ultimately achieve the semantic meaning of the target domain, and explain the psychological significance and positive effects of "tranquil order" (for example, orderly flow symbolizes a sense of control over life and inner peace). First, perform the target domain semantic label establishment steps; then, semantically align the aforementioned source domain semantic label "natural fluid / dynamic force" with the PERMA model, which includes five dimensions: positive emotion, engagement, interpersonal relationships, meaning, and achievement.

[0046] Specifically, the analysis suggests that the steady state of "natural fluids" best matches the "tranquility" subclass of the "positive emotions" dimension in the PERMA model; therefore, the semantic label for the target domain is determined to be "tranquility / order".

[0047] Secondly, the multi-hop semantic evolution path construction step is executed; starting from the source domain candidate word "chaos" and ending with the target domain semantic label "tranquility", the metaphor bridging words such as "dredging" and "flowing" are used as intermediate nodes to input the path construction instructions into the large language model.

[0048] Specifically, the large language model attempts to construct multiple semantic association paths; for example, path one is: "chaos" → "dredging" → "flowing" → "tranquility"; path two is: "chaos" → "collision" → "breakage" → "tranquility". The semantic relevance values ​​between adjacent nodes in the path are calculated; in path one, the relevance score from "chaos" to "dredging" is 0.85, and from "dredging" to "flowing" is 0.9; in path two, the relevance score from "breakage" to "tranquility" is only 0.15; a preset threshold of 0.6 is set, and path two is eliminated accordingly; the highly relevant path one is retained, and combined with other retained paths, such as "out of control" → "accommodation" → "stable" → "tranquility", a multi-hop semantic evolution path with a directional and acyclic directed acyclic graph structure is constructed.

[0049] Finally, the temporal semantic transformation logic generation step is executed; the semantic distance between the source domain "chaos" and the target domain "tranquility" in the vector space is calculated.

[0050] Specifically, the semantic distance between the two was measured to be 0.75 (normalized value). Based on this distance, the rhythm of semantic evolution was planned and divided into three evolutionary time segments: the first segment was defined as the "energy guidance period", corresponding to the semantic node "dredging", with a fast-paced environmental change rate; the second segment was defined as the "morphological reshaping period", corresponding to the semantic node "flowing", with a medium-speed environmental change rate; and the third segment was defined as the "order return period", corresponding to the semantic node "tranquility", with a slow-speed environmental change rate. The final output is a structured semantic descriptor containing the above-mentioned time control parameters. This descriptor is read by the subsequent image generation module and used to generate dynamically changing healing task guidance, such as guiding the user to gradually modify the sharp waves in the image into gentle ripples.

[0051] By constructing a closed-loop thinking chain of "source domain - metaphor bridge - target domain" and a multi-hop semantic evolution path, the generative divergence of the large language model is effectively constrained; by planning the semantic evolution rhythm and eliminating low-relevance paths, the narrative logic of task generation is ensured to strictly follow psychological principles, avoiding logical jumps and semantic illusions in long text generation.

[0052] In generating personalized art therapy tasks, the method introduces a context bias mechanism based on user historical data to ensure that the generated thought chain reasoning results are highly consistent with the user's long-term cognitive habits and emotional tendencies. The following is a detailed explanation of this step: In a specific implementation, the first step is to construct a user-specific metaphorical knowledge subgraph; then, the user's historical healing record database in the memory is accessed to extract high-frequency metaphorical entities used by the user in past tasks and the emotional state associated edges recorded at that time.

[0053] The following is the process for constructing and aggregating user-specific dynamic metaphorical knowledge subgraphs: Step 1: Historical Data Preprocessing and Node Extraction. Data is retrieved from users' past healing records, and a metaphor detection model is used to automatically identify metaphorical expressions in the text. By filtering high-probability words, removing duplicates, and merging synonyms, a user-specific set of metaphorical entities is extracted.

[0054] Step 2: Define the emotional association edge, which defines the strength of the association between metaphorical entities. The calculation is based on: the time interval between the entities' appearances in historical records, the similarity of emotional states, whether there is a positive psychological transformation relationship, and the user's satisfaction feedback on the task.

[0055] Step 3: Dynamic knowledge subgraph construction and time-sensitivity processing. A dynamic knowledge graph is constructed based on the extracted entities and calculated association weights. A time decay mechanism is introduced, giving higher weight to recent historical records while gradually reducing the influence of older records, to reflect the evolution of the user's psychological state.

[0056] Step 4: Feature aggregation of the graph neural network. The dynamic knowledge subgraph is input into the graph attention network. Through a multi-layer aggregation mechanism, combined with attention weight calculation, each metaphor node integrates the features of its neighboring nodes, thereby capturing deep semantic relationships.

[0057] Step 5: Global Pooling and Vector Generation. Weighted global average pooling is performed based on node centrality or frequency, transforming the complex graph structure into a compact historical semantic embedding vector. This vector highly summarizes the user's long-term metaphorical patterns and emotional evolution trajectory, serving as the contextual basis for subsequent large-scale model generation.

[0058] Specifically, assuming a user created four works in the past month, the metaphorical entity nodes are identified as "a rose with thorns," "a closed window," "melting snow," and "a sprouting seed." At the same time, the emotional states corresponding to these entities, such as "defense," "closed," "relief," and "hope," are extracted as edge attributes connecting the entity nodes. These nodes and edges are connected based on a timestamp sequence to construct a user-specific metaphorical knowledge subgraph. This subgraph contains node feature vectors, with each node initialized as a 512-dimensional semantic feature vector.

[0059] Furthermore, in order to capture global patterns of user emotional changes, a graph neural network is applied to perform multi-layer global feature aggregation on the subgraph; the constructed metaphorical knowledge subgraph is then input into a pre-built graph neural network module. Specifically, a three-layer graph convolution operation is performed to pass information across multiple layers. In the first layer, the node "rose with thorns" aggregates the feature information of its neighbor node "closed window". In subsequent layers, information from nodes further away, such as "germinating seed", is aggregated through the passing mechanism. After three iterations, the graph neural network completes the deep fusion of semantic features. Subsequently, a global average pooling operation is performed on all node features output from the last layer. For example, the feature vectors of all nodes are averaged in their corresponding dimensions to obtain a historical semantic embedding vector that can represent the user's long-term emotional cognitive pattern. This vector maintains a dimension of 512.

[0060] Furthermore, in order to integrate this historical feature into the reasoning space of the large language model, vector dimension mapping and context bias vector generation steps are performed.

[0061] Specifically, a linear transformation layer is set up with an input dimension of 512 and an output dimension of 4096 for its weight matrix. This output dimension is completely consistent with the hidden layer dimension of the current large language model, such as LLaMA or GPT architecture variants. The aforementioned historical semantic embedding vector is input into this linear transformation layer. After matrix multiplication, a context bias vector with a dimension of 4096 is output. This vector numerically encodes the user's preference for metaphors such as "natural plants" and the evolutionary logic of "from closed to open".

[0062] Finally, an attention weight correction step based on context bias is performed; this step is carried out during the real-time computation of semantic reasoning reconstruction of the thought chain in the large language model.

[0063] Specifically, in each Transformer layer of the large language model, the aforementioned context bias vector is introduced; when the model processes the current metaphorical visual schema, such as "dry riverbed", before calculating the self-attention mechanism, the context bias vector is used as a residual adjustment term and directly added bitwise with the original hidden state vector of that layer.

[0064] For example, in the twelfth Transformer layer, the original hidden state tends to infer "dry riverbed" as "scarcity of resources" (based on the probability of the general corpus). However, after adding a context bias vector containing the user's preference for "plant growth", the mixed vector, when calculating the attention weight after Softmax normalization, increases the attention weight pointing to the semantic branch of "dormancy and waiting for revival" from 0.25 to 0.68, while the weight pointing to "scarcity of resources" decreases from 0.6 to 0.3. In this way, the large language model is forced to reason along the path that conforms to the user's historical cognitive habits when generating thought chains, and finally generates more targeted and acceptable healing task descriptions.

[0065] By constructing a dynamic metaphorical semantic topology network and injecting context bias vectors, the attention weights of the large model are directly corrected. This enables the model to continuously maintain the "memory" of the user's historical semantic state during long text generation, preventing semantic drift as the interaction deepens and maintaining long-term semantic consistency throughout the entire cycle.

[0066] After generating the structured semantic descriptor, this method does not directly output it to the user. Instead, it enters a rigorous semantic consistency verification and correction process. This process aims to ensure that the newly generated healing task content does not deviate from the user's long-term cognitive and emotional expression habits, avoiding abrupt or uncomfortable guidance. The following is a detailed explanation of this step: Specifically, after obtaining the structured semantic descriptor output by the large language model generated in the third stage, such as the text content "build a strong metal fortress to resist the outside world", the vector space mapping and similarity calculation steps are performed; the pre-built text embedding model (such as the Sentence-Encoder based on the Transformer architecture) is called to convert the text descriptor into a high-dimensional semantic feature vector. The dimension configuration of this vector is consistent with the historical semantic embedding vector, which is 512 dimensions.

[0067] Furthermore, the historical semantic embedding vector generated by the aggregation of graph neural networks is retrieved from the memory; this historical vector represents the user's past tendency to express "soft, natural, and fluid" expression patterns; and the cosine similarity between the current task vector and the historical semantic embedding vector is calculated in the vector space.

[0068] Specifically, a normalized dot product operation is performed; in this embodiment, the calculated cosine similarity value, i.e., the semantic consistency confidence, is 0.35; and a preset semantic drift threshold is read, which is set to 0.65.

[0069] Further, threshold comparison and logical judgment steps are performed; the comparison reveals that the current confidence level of 0.35 is far lower than the preset threshold of 0.65; based on this, it is determined that there is a significant semantic drift between the currently generated "metal fortress" image and the user's commonly used "natural flow" image, that is, it is determined that an unexpected logical break has occurred. At this point, the counterfactual correction mechanism is triggered; first, the feature differences between the current task vector and the historical vector are compared, and the difference features that cause low confidence are extracted; "metal", "solid" and "rigid structure" are identified as the main high-frequency feature words that cause similarity deviation.

[0070] Specifically, these feature words are transformed into negative constraints; a new set of prompt engineering instructions is constructed, which includes negative constraint fields: "In this generation, the use of metaphors related to industry, metal, and rigid buildings is strictly prohibited; related concepts such as 'fortress' and 'defense' are excluded." Furthermore, the large language model is forced to perform a regeneration operation; the correction instructions containing the above negative constraints are input into the model; the model re-executes the thought chain reasoning, adjusts the metaphor path from "defense" to "soft inclusion", and generates a new structured semantic descriptor: "weave a soft grass ring to contain emotions".

[0071] Finally, the newly generated descriptor is validated again; "weave a soft grass ring to contain emotions" is mapped to a new vector, and the cosine similarity with the historical semantic embedding vector is calculated again; at this time, the calculated semantic consistency confidence score is increased to 0.78; since 0.78 is higher than the preset threshold of 0.65, the result is determined to pass the consistency verification; then the descriptor is locked and sent to the front-end interaction module as the final instruction to guide the user to perform specific artistic creation tasks.

[0072] A semantic consistency verification and counterfactual correction mechanism is introduced, and vector similarity is used to quantify the fit between new tasks and historical patterns. By automatically extracting difference features as negative constraints for forced regeneration, the semantic robustness of the generated content is significantly improved, ensuring that the output results are always within the expected psychosemantic framework.

[0073] After generating the structured semantic descriptor, the descriptor is further transformed into specific instructions that can be directly rendered and executed by the terminal device. This process involves precisely decomposing the natural language description into parameters of spatial and behavioral dimensions, and generating an immersive scene and an executable script through a dual-channel mechanism. The following is a detailed explanation of this process: Specifically, the first step is to perform the syntactic decomposition of the structured semantic descriptor; then, the structured semantic descriptor generated in the previous stage is received, for example, the text content is: "In a tranquil forest filled with soft blue light, guide the user to draw circular ripples at a frequency of ten times per minute for five minutes to complete the goal." Dependency parsing is performed on the text to construct a semantic dependency tree. The tree nodes are classified and traversed according to part-of-speech tagging and dependency relations. "Forest" is identified as the core noun node, along with its modifiers "soft blue light" and "tranquil". Its dependency subtree is divided into spatial topological parameters describing static scene attributes and environmental atmosphere. At the same time, "drawing" is identified as the core verb node, along with its related adverbs "ten times per minute", "circular ripples", and "lasts for five minutes". Its dependency subtree is divided into behavioral instruction parameters describing dynamic interaction logic and triggering conditions.

[0074] The pre-built conditional generative adversarial network is a deep cross-modal semantic generation architecture responsible for performing high-dimensional mapping from the "textual semantic space" to the "visual geometric space"; Specifically, the network consists of two parts: a semantic generator and a semantic discriminator. The semantic generator receives "spatial topology parameters" output by the large language model as a condition vector. After being embedded by the text encoder, this vector guides the generator to output the corresponding three-dimensional scene density field and color field parameters. Unlike traditional image generation, the generator in this embodiment introduces a semantic consistency loss function, forcing the generated geometric structure to be isomorphic to the dependency syntax structure of the input text in terms of topological features. For example, the semantic meaning of "enclosed" in the text must be transformed into a closed geometric structure in space. The semantic discriminator not only judges the visual realism of the generated scene, but also determines whether the generated scene accurately expresses the metaphorical atmosphere in the text by calculating the semantic alignment between the visual features and the text embedding vector. This effectively solves the technical problem of the difficulty in visually representing abstract psychological healing texts, ensuring that the final generated immersive scene is highly consistent with the user's psychological description in terms of visual semantics.

[0075] Further, the process enters the environment rendering channel, generating an immersive interactive scene using spatial topology parameters. The extracted "soft blue light" and "tranquil forest" parameters are vectorized and encoded, then input into a pre-defined conditional generative adversarial network (cGAN) as constraints. The generator employs a U-Net structure incorporating 3D convolutional layers, taking random noise and conditional vectors as input, extracting features through the encoding path, and then recovering the 3D spatial structure through the decoding path, outputting a 3D feature mesh containing geometric and appearance encodings. The discriminator uses a 3D PatchGAN structure to determine the realism of local spatial regions in the generated 3D data.

[0076] The specific encoding method for spatial topology parameters adopts a multi-level encoding strategy: First, a pre-trained text encoder is used to transform keywords such as "quiet forest" into high-dimensional semantic feature vectors; second, a graph neural network is used to encode the dependency syntax tree of the text to extract the modification and structural relationships between words; finally, the semantic features and structural features are fused to generate a conditional vector containing content and structural information, which serves as the input to the generator.

[0077] The NeRF model is not trained as a standalone static model, but rather as part of the cGAN generator for end-to-end training, or as a generative-based fast fine-tuning model. The generative-based fast fine-tuning strategy involves: Pre-training the cGAN+NeRF architecture using large-scale public 3D scene datasets, such as ShapeNet or custom healing scene datasets. NeRF acts as a differentiable renderer, rendering the generator's output feature mesh as a 2D image, and is trained using adversarial loss against real 2D images. In the instance generation stage, when a specific user task (e.g., "Quiet Forest") is received, the pre-trained generator G is used to directly infer the initial 3D feature mesh.

[0078] Fine-tuning aims to further improve the matching accuracy of specific semantics. Based on the generated conditional vectors, a small number of iterations can be performed on the NeRF MLP parameters. This typically requires 50-100 iterations, taking minutes, and can generate high-quality personalized scenes. Computational complexity: By introducing methods such as Instant-NGP hash encoding, the inference and training speed of NeRF is improved by several orders of magnitude, enabling it to meet near real-time interaction requirements.

[0079] Specifically, the NeRF (Neural Radiation Field) model is used in conjunction to perform cross-modal semantic mapping from text to three-dimensional space. The model outputs geometric density field data of the scene, for example, setting the density distribution coefficient of trees and vegetation to 0.75, and the radiation field parameters, for example, setting the dominant wavelength of ambient light to 450 nanometers of blue light, and the light intensity attenuation coefficient to 0.2. Based on these parameters, a panoramic three-dimensional environment with specific light and shadow depth information is generated in real time through a virtual reality (VR) rendering engine, serving as an immersive background for users to perform art therapy.

[0080] At the same time, the task generation channel is entered to generate a cognitive interaction task script; based on the current healing goal, the behavioral instruction parameters are parsed.

[0081] Domain Language Template Library is a corpus that stores formalized syntactic rules for cognitive interaction tasks. It does not store specific code snippets, but rather a highly generalized syntactic logic skeleton. It is used to provide strict syntactic constraints for the natural language generation process of large language models, ensuring that the generated instructions conform to machine execution logic.

[0082] Specifically, this template library is built on an extended Backus paradigm and contains various abstract syntax tree subtree templates customized for healing scenarios. Each template represents a specific cognitive interaction logic structure, such as "progressive desensitization logic" and "attention-focusing loop," and reserves standardized semantic slots. For example, a "breathing guidance" template includes semantic slots such as [action type], [duration], and [guiding words]. After the large language model parses the behavioral instruction parameters in the natural language, the system retrieves the most suitable logical skeleton from the library through a syntactic pattern matching algorithm and accurately fills the parsed atomic semantic units into the corresponding semantic slots, thereby transforming unstructured natural language into a rigorously structured executable script. By introducing a pre-set syntactic skeleton, this invention shields the ambiguity and arbitrariness of natural language, forces the output of the large language model to follow strict formal grammar, and avoids the risk of syntactic errors or logical loops in the generated script, as well as a wide range of mistranslations from natural language to machine instructions.

[0083] Specifically, a syntactic template matching algorithm is used to search a pre-stored domain language template library; a syntactic logic skeleton with the ID "Rhythmic_Motion_03" is matched, which is specifically used to generate rhythmic action tasks; the parsed specific parameters are filled into the skeleton, and the determined parameters include: the interaction duration is set to 300 seconds (i.e., five minutes), the number of repetitions is set to 50 times, the action type is marked as "circular motion", the guiding prompt is configured as "please follow the cursor to slowly draw a circle", and the task difficulty coefficient is set to 0.3, which is low difficulty.

[0084] Furthermore, to ensure that the generated script can be accurately recognized by the execution engine, the application domain language generator performs logic skeleton filling and syntactic compliance constraint steps. Specifically, the semantic role parsing model is first applied to decompose the behavioral instruction parameters in a fine-grained manner. For the text "draw circular ripples", the model extracts atomic semantic units with "user" as the agent, "draw" as the semantic predicate, and "circular ripples" as the object. The predefined domain semantic mapping table is queried to map the natural language predicate "draw" to the executable semantic operator RENDER_STROKE in the cognitive interaction script, and "circular ripples" to the parameter object PATTERN_TYPE_CIRCLE.

[0085] To prevent large language models from generating code scripts, a finite state automaton (FSM) based on domain-specific language grammars is constructed. Specifically, the following is the construction process of the syntactic constraint mechanism based on finite state automata: This paper utilizes the extended Backus paradigm to define the legal grammatical structure of cognitive interaction scripts, explicitly specifying the format and parameter rules for task declarations, loops, conditional control blocks, and specific actions (such as rendering, guidance, and feedback). Based on these grammatical rules, a deterministic automaton is constructed, defining a state set including initialization, task declaration, action recognition, parameter parsing, and termination. The paper also strictly defines the legal transition logic between different states based on input keywords or symbols. During word-by-word decoding in the large language model, the current state of the automaton is tracked in real time to determine the next legal vocabulary set. By generating mask vectors, all words that do not conform to the syntactic rules are probably masked, forcing the model to sample only from the legal vocabulary, ensuring that the generation process strictly follows syntactic constraints. After script generation, the entire content is scanned and verified offline using the automaton. Only when the input sequence successfully reaches the accepting state is it considered passed. Furthermore, deep semantic checking can be performed in conjunction with syntax tree construction to ensure that the output script is unambiguous and fully executable.

[0086] During the decoding phase of the domain language generator, this finite state automaton is used for real-time monitoring.

[0087] For example, when the automaton is in the "defining action type" state node, its state transition path is only allowed to point to a predefined set of actions (such as "click", "swipe", "draw a circle"). Based on this, a vocabulary mask vector is generated, masking the probability of all non-action words in the vocabulary (such as "forest" and "today") as negative infinity. The output probability distribution of the large language model is filtered, forcing the model to sample only on compliant syntactic paths. After this constraint process, a cognitive interaction task script that strictly conforms to grammatical rules is finally output, for example: TASK_ID: 1001; ACTION: RENDER_STROKE(PATTERN_TYPE_CIRCLE); DURATION: 300s; FREQUENCY: 10 / min; DIFFICULTY: 0.3. This script is then transmitted to the interactive terminal to drive the execution of specific healing tasks.

[0088] By using dependency parsing and semantic role labeling, natural language descriptions are precisely deconstructed, and a restricted decoding mechanism based on finite state automata is used for strict syntactic constraints. This approach of "deep semantic understanding + formal grammatical control" eliminates the ambiguity of natural language, ensures that the generated instruction scripts are semantically consistent with healing logic and syntactically fully meet machine execution specifications, and achieves zero-error translation.

[0089] During the execution of the aforementioned cognitive interaction task script on the user's end, a real-time feedback loop based on eye tracking runs in parallel to ensure that the user's attention is always focused on the semantic dimension with therapeutic efficacy; the following is a detailed explanation of this step: Specifically, when a user wears a virtual reality terminal with eye-tracking capabilities and begins to perform the cognitive interaction task of "drawing circular ripples," the gaze point semantic anchoring and real-time parsing process is initiated; the user's gaze is captured at a sampling frequency of 60 Hz, capturing the two-dimensional screen coordinates or three-dimensional spatial coordinates of the virtual scene.

[0090] Furthermore, the captured gaze coordinates are mapped to the scene graph of the current rendering frame to identify the specific virtual object that the user is currently gazing at; for example, if the user's gaze point in the current frame is detected to be focused on the "dark shadow area" in the lower right corner of the screen, a lightweight image semantic segmentation model is immediately invoked to perform semantic anchoring on the gaze area and extract the real-time semantic label corresponding to the area as "static darkness / undefined hole". Based on this, the semantic similarity calculation step is performed; the target domain semantic vector determined in the task initialization phase is retrieved, which is encoded by the target concept of "tranquility / order" and is a floating-point vector with a dimension of 512; at the same time, the semantic label "static darkness / undefined void" obtained by real-time parsing is mapped to the gaze semantic vector in the same vector space; the cosine similarity between the two vectors is calculated. Specifically, in one sampling of this embodiment, the cosine similarity value between the gaze semantic vector and the target domain semantic vector is calculated to be 0.82; the preset semantic focus threshold is read, which is set to 0.75.

[0091] Further, the threshold comparison and feedback mechanism trigger steps are executed; the comparison finds that the current similarity value of 0.82 exceeds the preset threshold of 0.75, which indicates that the visual element currently being focused on by the user is highly consistent with the healing goal, that is, the dark area being focused on by the user is judged to be an element that is conducive to immersive meditation in the current context; then the positive feedback mechanism is triggered. Specifically, to enhance this effective visual attention behavior, visual guidance text cues are generated; the current gaze label and target semantics are input into the large language model, and the model generates an instant guidance text: "In this tranquility, feel the depth of your breath"; this text is rendered in real time as a soft subtitle floating near the gaze point, with the transparency set to 60% to avoid obstructing the view. Simultaneously, dynamic task parameter adjustments are performed; to maintain semantic consistency in the interaction process and deepen the healing experience, the parameters of the running task script are modified in real time based on the high-confidence gaze state; instructions are sent to the rendering engine to slowly reduce the volume of the background ambient sound from 30 decibels to 20 decibels and slow the diffusion speed of the "circular ripples" from 5 centimeters per second to 3 centimeters per second; through this parameter adjustment, the rhythm of the interactive environment is semantically synchronized with the user's current gaze focus ("still darkness"), thereby constructing an adaptive, highly semantically consistent immersive healing field.

[0092] A real-time feedback mechanism based on gaze point semantic anchoring was established, which dynamically generates text clues by calculating the semantic similarity between the semantic labels of the gaze area and the target domain in real time. This enables the system to perceive the semantic flow of the user's attention in real time, maintain "semantic resonance" in the interaction process, and enhance the immersive feeling of healing.

[0093] In this embodiment, through the collaborative work of the environment rendering channel and the task generation channel, the abstract semantic description is transformed into an executable virtual reality interactive scene and script. During the user's task execution, the semantic similarity is monitored and calculated in real time using the gaze point semantic anchoring mechanism. Through dynamic feedback adjustment, it is ensured that the user's visual focus is consistent with the preset semantic evolution path, thereby realizing a complete logical closed loop and interactive implementation from the user's initial expression schema to the target healing schema at the technical level.

[0094] Example 2 This embodiment specifically addresses complex scenarios where users experience attention wandering or a significant deviation between the semantics of the fixation point and the healing goal during task execution, and further elaborates on the real-time analysis and dynamic feedback mechanism for fixation point semantic anchoring. In the complex application scenario of this embodiment, the user is performing a cognitive interaction task themed "emotional reconstruction" in a virtual reality environment. The specific script of the task is set as "using a virtual paintbrush to repair a broken stained glass window"; the target domain semantic vector is preset as "complete / harmonious / repair"; however, during the actual interaction, the user's gaze is not focused on the glass crack that needs to be repaired, but lingers for a long time on the "dark and sharp fragments" area in the background that symbolizes negative emotions. At this time, the following processing flow is initiated: Specifically, firstly, high-frequency gaze point semantic anchoring and multi-dimensional feature parsing are performed; the eye-tracking module captures the user's gaze data at a high sampling rate of 120 Hz; it detects that the user's gaze point coordinates fall on the background layer area of ​​the virtual scene for 1.5 seconds consecutively; it immediately calls the scene atlas index to lock the virtual object ID corresponding to the coordinates as "Shard_05" (sharp fragment); it extracts the object's metadata, including the shape feature "acute triangle" and the texture feature "rough and dark"; through the semantic mapping module, these visual features are converted into semantic labels for the gaze area in real time: "sharp / broken / untreated trauma"; Furthermore, differential calculation and judgment are performed in the semantic vector space; the semantic tags "sharp / broken / untreated trauma" obtained from the real-time parsing are mapped into high-dimensional semantic vectors and compared with the preset target domain semantic vectors "intact / harmonious / repaired"; cosine similarity calculation is performed, and the similarity value is 0.24; this value is compared with the preset compliance threshold of 0.6, and the current interaction state is determined to be in the "severe semantic deviation" range, indicating that the user's attention has been captured by negative interference elements and deviated from the predetermined healing path.

[0095] Based on this determination, a multi-level feedback adjustment mechanism is triggered, which includes two dimensions: visual guidance generation and dynamic reconstruction of environmental parameters. In terms of generating visually guiding text cues, instead of generating simple encouraging text, a contrastive rhetorical strategy is adopted. The current negative gaze semantics are sharp and the positive target semantics are repaired by inputting them into the large language model. The model generates guiding text cues: "Don't stare at the sharp edge, try to fill the crack with light". The text is rendered as particle flow text with dynamic lighting effects. The way it guides the eye is displayed on the line connecting the user's gaze point and the task target point (the glass crack), forming a visual connection bridge. In terms of dynamic adjustment of task parameters, in order to proactively intervene in the user's attention allocation, the physical property parameters and lighting parameters of the rendering engine are modified in real time. Specifically, the "dark and sharp fragments" currently being viewed by the user are subjected to visual weight reduction processing, and their texture transparency is gradually changed from 100% to 30% within two seconds, while the ambient light intensity around them is reduced by 40%, so that they appear to be in a state of regression. At the same time, visual processing was performed on the "glass crack" in the target area of ​​the mission, increasing the brightness of its edges by 50% and adding a faint breathing light effect at a frequency of 12 times per minute; through this dynamic parameter adjustment of "suppressing interference and enhancing the target", the salience distribution of the current field of view was reconstructed. Finally, the adjusted gaze data was continuously monitored. Within 0.8 seconds after the above feedback operation was performed, the user's gaze coordinates were detected to have smoothly moved from the background area to the "glass crack" area in the foreground. At this time, the semantic similarity was recalculated, and the value rose back to 0.85, which was confirmed as a valid regression. The environmental parameters were then restored to the standard rendering state, and the original interaction script was executed.

[0096] This embodiment demonstrates in detail the dynamic adaptation mechanism of the method in handling complex interactive scenarios such as user attention wandering or semantic deviation, which redirects the user's attention focus to the target area that conforms to the task logic. This automatic correction capability based on real-time semantic computing can maintain the semantic coherence and logical stability of the task execution process.

[0097] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for generating personalized art therapy tasks based on a large language model, characterized in that, include: Acquire raw image data input by the user, and identify metaphorical visual schemas and corresponding source domain semantic tags in the image; The source domain semantic labels are semantically aligned with the PERMA model to form target domain semantic labels. A three-stage thinking chain is used to perform semantic reasoning reconstruction from the source domain to the target domain on the metaphorical visual schema to obtain a structured semantic descriptor. Construct a user-specific metaphorical knowledge subgraph and apply a graph neural network to perform multi-layer information transfer and semantic feature fusion on the subgraph to obtain a context bias vector. Based on the context bias vector, fine-tune the attention weights in the semantic reasoning reconstruction process of the thought chain. The structured semantic descriptor is decomposed into spatial topology parameters and behavioral instruction parameters by applying a semantic dependency parsing algorithm. In the environment rendering channel, a 3D generative network is applied to perform semantic mapping from text to space to generate an immersive interactive scene. In the task generation channel, a domain language generator is applied to fill the behavioral instruction parameters into the syntactic logic skeleton to generate a cognitive interaction task script.

2. The method for generating personalized art therapy tasks based on a large language model according to claim 1, characterized in that, The metaphorical visual schemas in the identified images and their corresponding source domain semantic labels specifically include: A large language model is applied to the original image data for natural language paraphrasing and visual question answering, resulting in an overall scene description and semantic annotations of key visual elements. By inputting metaphorical semantic prompt templates into the large language model, metaphorical visual schema semantic association analysis is performed on the key visual elements to obtain a set of candidate metaphorical visual schemas. Based on the source-target domain semantic mapping logic of conceptual metaphor theory, the source domain semantic confidence of the candidate set of metaphorical visual schemas is evaluated to obtain the metaphorical visual schema with the highest confidence and its corresponding source domain semantic label.

3. The method for generating personalized art therapy tasks based on a large language model according to claim 1, characterized in that, The steps of performing semantic reasoning reconstruction from the source domain to the target domain using the three-stage thinking chain specifically include: the first stage uses a metaphor source domain parser to lock the most significant unbalanced semantic features to obtain candidate terms for the source domain; the second stage uses cross-modal knowledge graph semantic alignment isomorphic concepts to obtain a set of metaphor bridging terms; and the third stage uses a large language model to perform semantic generation and reconstruction of the thinking chain from the source domain to the metaphor bridge to the target domain, resulting in a complete structured semantic descriptor.

4. The method for generating personalized art therapy tasks based on a large language model according to claim 3, characterized in that, The third stage, which employs a large language model to perform semantic generation and reconstruction of the thought chain from the source domain to the metaphor bridge to the target domain, and obtains a complete structured semantic descriptor, specifically includes the following steps: The source domain semantic labels are semantically aligned with the PERMA model to form target domain semantic labels. Starting from the source domain candidate terms and ending with the target domain semantic labels, the metaphor bridging term set is used as an intermediate node. The natural language reasoning ability of the large language model is applied to construct semantic association paths, and path branches with semantic relevance below a preset threshold are eliminated to form a multi-hop semantic evolution path with a directed acyclic graph structure. Based on the semantic distance between the source domain and the target domain, the rhythm of semantic evolution is planned to generate a temporal semantic transformation logic that controls the rate of environmental change.

5. The method for generating personalized art therapy tasks based on a large language model according to claim 1, characterized in that, The steps of obtaining the context bias vector and fine-tuning the attention weights during the semantic reasoning reconstruction of the thought chain based on the context bias vector specifically include: Metaphorical entities and emotional association edges are extracted from users' historical healing records to construct user-specific metaphorical knowledge subgraphs. Graph neural networks are then applied to perform multi-layer information transmission and semantic feature fusion on these subgraphs. Global average pooling is performed on the output features of all nodes in the last layer to obtain historical semantic embedding vectors. A linear transformation layer is used to map these historical semantic embedding vectors to context bias vectors with the same dimension as the hidden layers of the large language model. In each Transformer layer of the large language model, the context bias vectors are used to generate a residual adjustment term, which is then added to the original hidden state of the corresponding layer to correct the attention weights in the semantic reasoning reconstruction process of the thought chain.

6. The method for generating personalized art therapy tasks based on a large language model according to claim 5, characterized in that, After generating the structured semantic descriptor, a semantic consistency verification and correction step must be performed, which includes: The generated structured semantic descriptor is mapped to a high-dimensional vector, and the semantic consistency confidence between it and the historical semantic embedding vector is calculated using cosine similarity to quantify the fit between the new task and the historical pattern. The semantic consistency confidence is compared with a preset semantic drift threshold. If the confidence is lower than the threshold, it is determined that there is an unexpected logical break in the current generation result, and a counterfactual correction mechanism is triggered. The difference features that cause the low confidence are extracted as negative constraints and added to the negative constraints of the prompting project. The large language model is forced to perform a regeneration operation until the output descriptor passes the consistency verification.

7. The method for generating personalized art therapy tasks based on a large language model according to claim 1, characterized in that, The step of decomposing the structured semantic descriptor into spatial topology parameters and behavioral instruction parameters, and generating immersive interactive scenes and cognitive interactive task scripts respectively, specifically includes: Dependency parsing is performed on the structured semantic descriptor to construct a semantic dependency tree. The semantic dependency tree includes, based on part-of-speech tagging and dependency relations, nodes describing static scene attributes and environmental atmosphere are divided into spatial topology parameters, and nodes describing dynamic interaction logic and triggering conditions are divided into behavioral instruction parameters. In the environment rendering channel, the spatial topology parameters are encoded and input into a conditional generative adversarial network. A neural radiation field model is applied to perform cross-modal semantic mapping from text to three-dimensional space, determining the geometric density field and radiation field parameters of the scene. An immersive interactive scene is then generated through a VR device. In the task generation channel, a syntactic template matching algorithm is executed based on the semantic evolution target. The most matching syntactic logic skeleton is retrieved from the domain language template library, and behavioral instruction parameters are filled into the syntactic logic skeleton to generate a cognitive interaction task script. The behavioral instruction parameters include: interaction duration, repetition count, action type, guiding prompts, and task difficulty coefficient.

8. The method for generating personalized art therapy tasks based on a large language model according to claim 7, characterized in that, The application domain language generator fills the behavioral instruction parameters into the logical skeleton, specifically including: A semantic role parsing model is applied to decompose the natural language description in the behavioral instruction parameters into fine-grained units, extracting atomic semantic units of action agent, semantic predicate, and patient object. Based on a predefined domain semantic mapping table, the semantic predicates in the atomic semantic units are mapped to executable semantic operators of the cognitive interaction script. A finite state automaton based on the domain-specific language grammar is constructed. During the decoding stage of the domain language generator, the state transition path of the finite state automaton is used to generate a vocabulary mask, and the output probability distribution of the large language model is syntactically constrained and filtered to ensure that the generated cognitive interaction task script meets the syntactic compliance of the domain-specific language.

9. The method for generating personalized art therapy tasks based on a large language model according to claim 1, characterized in that, The method further includes: During the user's execution of the cognitive interaction task script, the semantic labels of the user's gaze area are parsed in real time using gaze point semantic anchoring, the cosine similarity between the semantic labels and the semantic vector of the target domain is calculated, and a feedback mechanism is triggered when the cosine similarity exceeds a preset threshold to generate visual guidance text cues and dynamically adjust task parameters to maintain semantic consistency in the interaction process.