A vectorization method, framework, and system based on tree-structured data
By introducing learnable hierarchical transformation matrices and weight matrices, the information of child nodes is fused to the parent node layer by layer, solving the problems of structural information loss and high computational complexity in tree-structured data. This achieves cross-modal semantic alignment and efficient scalability, and the generated vector representation has discriminative power and interpretability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-26
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies suffer from severe loss of structural information, high computational complexity, rigid feature fusion mechanisms, and lack of model interpretability and semantic alignment when processing tree-structured data, making them particularly difficult to apply to large-scale datasets.
By introducing learnable hierarchical transformation matrices and weight matrices, the information of child nodes is fused to the parent node layer by layer. The optimization objective function is Euclidean distance or cosine similarity to achieve bottom-up hierarchical fusion and generate a unified vector representation.
It effectively preserves the hierarchical structure of the data, achieves cross-modal semantic alignment, reduces computational complexity, and possesses high efficiency, scalability, and interpretability. The generated vector representation has discriminative and generalization capabilities.
Smart Images

Figure CN121722767B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of data mining, machine learning technology and vector representation, and specifically relates to a hierarchical fusion method, framework and system for converting tree-structured data into vector representations, which is applicable to information retrieval, recommendation systems and cross-modal representation learning and other application scenarios. Background Technology
[0002] With the development of big data technology, tree-structured data (such as academic document hierarchy, image spatial topology, document discourse structure, etc.) are widely existing. Currently, vectorization methods for such data are mainly divided into traditional models, tree-based indexing methods, and deep neural network models. Existing technologies have the following problems: (a) Severe loss of structural information. Traditional bag-of-words (BoW) models or flat neural network embeddings treat data as an unordered set or homogeneous vectors, ignoring the key hierarchical spatial information in the tree structure. (b) Prominent computational bottleneck: Early tree indexing and tree-edit-distance methods have a computational complexity as high as O(n^2). 3 (c) Rigid feature fusion mechanisms. Existing multi-level self-organizing maps (MLSOM) or spatial pyramid matching (SPM) methods mostly rely on fixed aggregation patterns and assume that all nodes contribute equally to their parent nodes, failing to generate discriminative embedding vectors. Early works attempted to address this issue, but still required a large number of pre-set artificial parameters to balance the contributions of parent and child nodes, lacking flexibility. (d) Lack of model interpretability and semantic alignment. Although deep models based on CNNs or GNNs can extract features, their hierarchical patterns often originate from artificial grid partitioning or graph message passing, rather than the inherent hierarchy of the data itself. This makes it difficult for the learned representations to maintain semantic alignment in cross-modal tasks (such as word-to-many graphs), and they lack structural transparency and interpretability. Summary of the Invention
[0003] This invention aims to overcome the shortcomings of the prior art and provide a general, efficient method, framework, and system for vectorizing tree-structured data that preserves hierarchical semantics. The core of this invention lies in introducing a learnable hierarchical transformation matrix and an automatically updating weight matrix to fuse child node information to parent nodes layer by layer, achieving bottom-up hierarchical fusion and ultimately converging the entire tree into a unified vector representation.
[0004] The first aspect of this invention is to propose a vectorization method based on tree-structured data, wherein the tree structure is a hierarchical data structure formed by organizing several nodes according to parent-child relationships, including at least one root node and several levels of intermediate nodes and leaf nodes, used to characterize the hierarchical semantic relationships between data objects, including the following steps:
[0005] S1. Tree structure modeling and feature extraction: For the input data, construct its corresponding tree structure; use a feature extractor corresponding to the node data modality to obtain the feature vector of each node, forming a feature-based tree;
[0006] S2. Hierarchical Fusion Vectorization: Starting from the leaf node level of the tree, the fusion operation is performed layer by layer upwards until the root node; for any two adjacent levels, i.e., the lower child node level and the upper parent node level, the fused parent node vector is generated by optimizing the objective function; the fusion process includes: using the transpose V of the transformation matrix T The features of child nodes are mapped to the feature space of parent nodes; the contribution weights of each child node to the parent node are adaptively learned using the weight matrix W; and the fusion vector of the corresponding parent node is generated by jointly constraining the distance or similarity relationship between the fusion vector and the original parent node features and the transformed weighted child node features.
[0007] S3. Output unified vector representation: The root node vector obtained after hierarchical fusion is output as the vectorized representation of the entire tree structure data.
[0008] Preferably, the optimization objective function in step S2 is implemented using a hierarchical fusion algorithm based on Euclidean distance (ELF) or a hierarchical fusion algorithm based on cosine similarity (CLF). The objective function of the Euclidean distance-based hierarchical fusion algorithm aims to minimize the Euclidean distance between the fusion vector and the transformed and weighted child node features, while simultaneously minimizing the Euclidean distance between the fusion vector and the original parent node features. The objective function of the cosine similarity-based hierarchical fusion algorithm aims to maximize the cosine similarity between the fusion vector and the transformed and weighted child node features, while simultaneously maximizing the cosine similarity between the fusion vector and the original parent node features.
[0009] The specific expression for the objective function of the hierarchical fusion algorithm based on Euclidean distance is as follows:
[0010] (1).
[0011] The objective function of the cosine similarity-based hierarchical fusion algorithm is specifically expressed as follows, and the maximization problem can be equivalently transformed into optimizing the minimization problem of its opposite:
[0012] (2).
[0013] Where X represents the feature matrix of the lower-level child nodes, Y k Indicates the first k The original feature vectors of the parent nodes, Z k For the first k The fusion vector of each parent node, where V is the transformation matrix and its transpose V T W is used to project the features of lower-level nodes onto the feature space of the parent node. k For the weight vector, To balance the coefficients of the two constraints; and W k The elements in satisfy and Constraints i Indicates the index of the lower-level child node. n This represents the total number of child nodes that are connected to a given parent node. k Indicates the index of the parent node, used to distinguish the fusion vector and weight vector corresponding to different parent nodes; m This indicates the total number of parent nodes in the current level. This indicates that the fusion objective is accumulated over all parent nodes; min represents minimizing the objective function, and max represents maximizing the objective function. Superscript T The transpose operation represents a matrix or vector. Let L2 be the norm of a vector, used to measure the length of the vector in Euclidean space. In the cosine similarity term (Equation (2)), The L2 norm of a vector is used to represent the vector's L2 norm.
[0014] Preferably, when solving the objective function to update the weight matrix W, gradient descent is used for approximate updating to avoid the high computational complexity of direct inversion.
[0015] Preferably, the gradient descent method for approximate updating includes the following iterative steps until the objective function converges: calculating the gradient; updating via gradient descent; and then... k The weight vector W of each upper-level parent node k Projection to satisfy and The constrained space, where the weight vector W k element w in ki Indicates the first i The lower-level child node pairs with the first k The semantic contribution of each parent node. n This represents the total number of child nodes that are connected to a given parent node.
[0016] The second aspect of this invention is to propose a vectorization framework based on tree-structured data. The framework includes a tree structure construction and feature extraction module, a hierarchical fusion vectorization module, and an output module. The tree structure construction and feature extraction module is used to construct its corresponding tree structure; it uses a feature extractor corresponding to the node data modality to obtain the feature vector of each node, forming a characteristic tree. The hierarchical fusion vectorization module is used to perform a fusion operation layer by layer upwards from the leaf node layer of the tree until the root node; for any two adjacent layers, i.e., the lower child node layer and the upper parent node layer, the fused parent node vector is generated by optimizing the objective function; the fusion process includes: using the transpose V of the transformation matrix... T The features of lower-level child nodes are mapped from their original feature space to a feature space that is consistent with or comparable to that of the upper-level parent node, thereby achieving cross-level and cross-modal feature alignment. The transformation matrix V is a set of learnable linear transformation parameters. The contribution weights of each child node to the parent node are adaptively learned using the weight matrix W. The weight matrix W is a learnable parameter matrix used to characterize the semantic contribution of different child nodes to their parent node, and its parameter values are adaptively updated according to the objective function during the hierarchical fusion process. By jointly constraining the distance or similarity relationship between the fusion vector and the original parent node features and the transformed weighted child node features, the corresponding parent node's fusion vector Z is generated. The fusion vector Z refers to the node representation vector generated by the hierarchical fusion operation, used to characterize the semantic representation of the corresponding node after integrating its own features and the features of its lower-level nodes. The output module is used to output the root node vector obtained after hierarchical fusion as the vectorized representation of the entire tree structure data.
[0017] In addition, the present invention also proposes a vectorization system based on tree-structured data, the system including a memory for storing computer programs and a processor for executing the computer programs stored in the memory, so that the system executes the vectorization method or the vectorization framework.
[0018] This invention achieves the following significant innovations.
[0019] 1. Highly efficient scalability based on vectorized structure alignment (solving computational efficiency issues). This invention transforms traditional discrete tree operations into a continuous vectorized fusion process. By reformulating hierarchical modeling as a differentiable representation learning task, the computational complexity of each layer fusion is reduced from O(n^2) in traditional methods. 3 The time complexity is reduced to approximately linear O(n). Combined with a momentum-driven stochastic gradient descent algorithm, real-time performance and scalability are ensured when processing large-scale, massive-node tree-structured data.
[0020] 2. Introducing a learnable transformation matrix V to achieve heterogeneous feature fusion (solving the spatial alignment problem). To address the inconsistency in dimensions and semantic space deviation in multimodal scenarios (such as 128-dimensional visual features and 768-dimensional text features), this invention introduces a hierarchical transformation space. Through a learnable transformation matrix V, lower-level features are explicitly mapped and aligned to the parent node's feature space, ensuring the semantic coherence and robustness of cross-modal information during the fusion process.
[0021] 3. Introducing an adaptive weight matrix W to achieve dynamic semantic capture (solving the problem of rigid weights). This invention breaks through the traditional assumption of "equal node contribution" and uses a learnable weight matrix W to automatically characterize the semantic contribution of child nodes to parent nodes. This mechanism learns node importance autonomously through gradient descent without the need for manual intervention in preset parameters, thus enabling more accurate suppression of noisy nodes while preserving core-level semantics.
[0022] 4. An unsupervised alignment mechanism with semantic interpretability (solving the problem of uninterpretability in black-box models). Unlike deep models that flatten hierarchical structures, this invention uses a bottom-up, layer-by-layer fusion strategy to force the fused vector to simultaneously approximate the features of its parent and child nodes in the feature space. This bidirectional alignment constraint not only preserves the hierarchical topology of the original data but also gives the final generated embedding vectors clear physical meaning and structural transparency, achieving high generalization and interpretability independent of the task.
[0023] The present invention has the following beneficial effects:
[0024] a) Hierarchical semantic preservation: Through bottom-up explicit fusion, the hierarchical structure in the data is effectively preserved;
[0025] b) Multimodal compatibility: The unified framework can handle tree structures with node features from different modalities, achieving cross-modal semantic alignment;
[0026] c) Adaptive fusion: Through a learnable weight matrix, it can automatically identify and emphasize important child nodes while suppressing noisy or redundant nodes;
[0027] d) High efficiency and scalability: The optimized iterative solution algorithm significantly reduces computational complexity, enabling it to be applied to large-scale tree-structured data;
[0028] e) Strong generalization ability: Experiments on various tasks show that the vector representation generated by this invention has high discriminative and generalization performance. Attached Figure Description
[0029] Figure 1 This is a flowchart illustrating the overall process of the method of the present invention.
[0030] Figure 2 This is a schematic diagram illustrating the principle of the hierarchical fusion framework of the present invention. Detailed Implementation
[0031] To facilitate understanding of the technical solution of this invention and avoid ambiguity in terminology, some terms involved in the specification are defined as follows.
[0032] (1) Multimodal
[0033] In this invention, "multimodal" refers to the fact that the feature information contained in a node can originate from different types of data modalities, including but not limited to text modalities, image modalities, video modalities, or feature representations formed by combinations of the above modalities. Features of different modalities can have different representation forms, feature dimensions, or embedding spaces.
[0034] (2) Tree Structure
[0035] In this invention, a "tree structure" refers to a hierarchical data structure formed by organizing several nodes according to parent-child relationships, wherein each node has at most one parent node and may have one or more child nodes. This structure includes at least one root node and several levels of intermediate and leaf nodes, used to characterize the hierarchical semantic relationships between data objects.
[0036] (3) Parent-child relationship
[0037] In this invention, "parent-child connection relationship" refers to the structural association between a parent node and its direct child nodes in a tree structure, which can be represented by a binary connection matrix Link, where the matrix elements are used to indicate whether a lower-level child node has a direct connection with its corresponding upper-level parent node.
[0038] (4) Node
[0039] In this invention, a "node" refers to a basic building block in a tree structure, used to represent a specific data entity or an abstract semantic unit. Each node corresponds to at least one feature vector, which is used to participate in subsequent hierarchical fusion calculations.
[0040] (5) Hierarchical Fusion
[0041] In this invention, "hierarchical fusion" refers to a bottom-up feature fusion process. By performing fusion operations layer by layer between adjacent levels, the feature information of the lower-level child nodes is combined with the original features of the corresponding parent nodes to generate a new upper-level node fusion vector.
[0042] (6) Adaptive Fusion
[0043] In this invention, "adaptive fusion" refers to the automatic adjustment of the contribution of different child nodes in the fusion process by introducing a learnable weight matrix and optimizing the objective function, rather than using a fusion method that manually sets or fixes weights.
[0044] (7) Transformation Matrix V
[0045] In this invention, "transformation matrix V" refers to a set of learnable linear transformation parameters, whose transpose matrix V T This is used to map the features of lower-level child nodes from their original feature space to a feature space that is consistent with or comparable to the features of the upper-level parent nodes, so as to achieve cross-level and cross-modal feature alignment.
[0046] (8) Weight Matrix W
[0047] In this invention, the "weight matrix W" refers to a learnable parameter matrix used to characterize the semantic contribution of different child nodes to their parent nodes. Its parameter values are adaptively updated according to the optimization objective function during the hierarchical fusion process.
[0048] (9) Fusion Vector Z
[0049] In this invention, "fusion vector Z" refers to the node representation vector generated through hierarchical fusion operation, which is used to characterize the semantic representation of the corresponding node after integrating its own features and the features of its lower-level nodes.
[0050] As attached Figure 1 The attached diagram shows the overall flowchart of the method of the present invention. Figure 2 The diagram shown is a schematic diagram of the hierarchical fusion framework of this invention. Figure 2 In the middle, the left side shows the hierarchical relationship of the tree structure, where nodes (such as N1, N2, ...) are merged in a bottom-up manner.
[0051] The specific process is as follows: In the input layer, the feature set X of the lower-level child nodes and the original feature set Y of the upper-level parent node are used as the initial input. Next, spatial mapping is performed: the learnable transformation matrix V is used to map the lower-level features X to the parent node's feature space, resulting in the transformed features V. T X. Next, weight allocation is performed: the weight matrix W is initialized based on the connection matrix Link, used to represent the semantic contribution of child nodes to their parent nodes. Then, iterative optimization is performed: by optimizing the hierarchical fusion objective function, the variables V, W, and the fusion vector Z are alternately updated iteratively until the objective function converges. Finally, the output result is: the final generated upper-level node fusion vector Z, which integrates the semantic information of the lower layers, is generated.
[0052] The principles, optimization process and strategies, hyperparameter settings, embodiments and application scenarios of this invention are described in detail below.
[0053] I. A hierarchical fusion general mathematical model.
[0054] The core of this invention is the fusion operation between adjacent layers of nodes. Assume the lower layer has... n There are n child nodes, and their feature matrix is: ,in, Indicates the first i The feature vectors of each child node. The upper layer has... m The nth parent node, where the nth k The original characteristics of the parent nodes are: The fusion process aims to learn a fusion vector for each parent node. And simultaneously learn a mapping matrix and weight vector Weight vector W k During initialization, the binary connection matrix `Link`, representing the parent-child node connection relationship, is used to set the weights. This matrix indicates whether each child node has a direct structural connection to its corresponding parent node. For example, all child nodes connected to their parent nodes are assigned the same initial weight to satisfy the weight non-negativity and normalization constraints. During subsequent training, W... k The objective function will be automatically updated to adaptively learn the relative importance of each child node. The entire fusion process is achieved by optimizing the objective function as shown in equation (1) or (2).
[0055] II. Expansion of the Objective Function
[0056] The hierarchical fusion framework of this invention iteratively optimizes the variables (transformation matrix V, fusion vector Z) in the objective function. k Weight vector W k This is achieved through [method / method]. The algorithms based on Euclidean distance and those based on cosine similarity differ in the form of their objective functions, and therefore their optimization processes also differ, which will be explained in detail below.
[0057] 2.1 Optimization of Hierarchical Fusion Algorithm Based on Euclidean Distance
[0058] The optimization term in formula (1) can be further expanded as follows:
[0059] (3).
[0060] The final optimization goal can be written as:
[0061] (4).
[0062] in, .
[0063] By analyzing Z k V and W k Alternating optimization is performed to gradually converge the objective function.
[0064] 1. Fixed Z k With W k Update the transformation matrix V:
[0065] Taking the gradient of the objective function with respect to V yields the computational expression for updating V, which takes the following form:
[0066] (5).
[0067] In the case that the matrix is not invertible, a solution can be obtained by introducing a regularization term or using a generalized inverse. This approach is a common technique used by those skilled in the art to solve the problem of non-invertible matrices in numerical optimization, and therefore will not be elaborated further.
[0068] 2. Fix V and W k Update the fusion vector Z k :
[0069] make Z can be obtained directly. k The analytical solution, which has a clear physical meaning, is the weighted average of the original parent node features and the transformed child node features:
[0070] (6).
[0071] 3. Fixed Z k With V, update the weight matrix W k
[0072] Under constraints and Optimize W k Its theoretical solution involves solving a system of linear equations, which can be obtained as follows: To overcome the challenges of matrix inversion in large-scale node scenarios. To overcome the computational bottleneck, the core of this invention employs the gradient descent method for efficient approximate updates.
[0073] (1) Calculate the gradient:
[0074] (7).
[0075] (2) Gradient descent update:
[0076] (8).
[0077] in, Let the learning rate be the time factor. This method reduces the complexity from about... n The cubic level is reduced to about n The approximate linearity significantly improves the algorithm's efficiency.
[0078] (3) Projection: W k Projection to satisfy and The constrained space.
[0079] First, update the weight vector Each element in the array is set to its non-negative value, that is:
[0080] (9).
[0081] This operation ensures the non-negativity of all weight components.
[0082] Then, the temporary weight vector after non-negativity truncation... Perform normalization so that the sum of its components is 1:
[0083] (10).
[0084] In summary, the entire projection operation can be expressed in the following compact form:
[0085] (11).
[0086] The ProjΔ(·) operator represents the projection process of the above-mentioned "non-negative truncation-normalization".
[0087] Optimization process: Repeat steps (1) to (3) until the objective function L is achieved. ELF convergence.
[0088] The alternating optimization strategy employed in this invention theoretically possesses good convergence. Because the objective function, with the remaining variables fixed, modulates Z... k With W k Both exhibit convexity, and alternating optimization ensures that the objective function value remains monotonically non-increasing. Given that the objective function has a lower bound (i.e., the squared distance is non-negative), according to the monotonically convergent theorem, the iterative process will inevitably converge to a local optimum or a saddle point. In practical applications, a threshold for the number of iterations or a threshold for the change in the objective function is typically set as a stopping criterion to balance computational efficiency and fusion accuracy.
[0089] 2.2 Optimization of the Hierarchical Fusion Algorithm Based on Cosine Similarity
[0090] The objective function formula (2) of the algorithm can be written as:
[0091] (12).
[0092] The solution process is as follows:
[0093] 1. Fixed Z k With W k Update V:
[0094] make Therefore, optimizing V requires maximizing Q. The gradient of the objective function with respect to V is calculated, and an update expression for V is constructed based on this gradient, in the following form:
[0095] (13).
[0096] The above expression describes the update trend of the transformation matrix V in the current iteration state. In actual implementation, V can be updated step by step by combining gradient iteration to avoid high-complexity matrix inversion operations.
[0097] 2. Fix V and W k Update Z k :
[0098] make After normalization, its update direction can be obtained as follows:
[0099] (14).
[0100] 3. Fixed Z k With V, update W k :
[0101] This step also applies to constraints. and The following steps are performed. Similar to the ELF algorithm, if we set the partial derivatives to zero, we can obtain the solution: ,in, , To avoid overly complex inversion calculations, this invention employs the gradient descent method.
[0102] (1) Calculate the gradient:
[0103] definition The gradient is:
[0104] (15).
[0105] (2) Gradient descent update:
[0106] Substituting this into the update rule, we get:
[0107] ,in, This is the learning rate.
[0108] (3) Projection: W k Projection to satisfy and The constrained space. Consistent with the projection procedure (11) in ELF: .
[0109] Optimization process: Repeat steps (1) to (3) until the objective function L is achieved. CLF convergence.
[0110] For the objective function L based on cosine similarity CLF Although its form is more complex than that of the Euclidean distance, its essence is gradient ascent on a unit hypersphere. The gradient descent update rule introduced in this invention, combined with the non-negative normalized projection operator ProjΔ, ensures the weight W... k It always evolves within the constraints of a valid probabilistic simplex. This constrained optimization method, when the learning rate η is chosen appropriately (such as using a decaying learning rate), can robustly converge to the optimal state of semantic alignment, thus ensuring the stability of multimodal feature fusion.
[0111] III. Computational Complexity Analysis
[0112] When processing tree-structured data, the computational efficiency of an algorithm is a key indicator for evaluating its feasibility and scalability. The hierarchical fusion framework proposed in this invention employs bottom-up iterative optimization, and its computational complexity mainly stems from the update operations on the transformation matrix V, fusion vector Z, and weight matrix W during each fusion layer. The complexity analysis of the Euclidean distance-based hierarchical fusion algorithm (ELF) and the cosine similarity-based hierarchical fusion algorithm (CLF) is presented below.
[0113] Assume that in a single hierarchical fusion, the number of lower-level child nodes is... n The number of parent nodes is m (generally m ≤ n The corresponding feature dimensions are d1 and d2, respectively. To simplify the analysis, let d = max(d1, d2) represent the main feature dimensions.
[0114] 3.1 Complexity Analysis of the Hierarchical Fusion Algorithm Based on Euclidean Distance
[0115] The ELF algorithm updates variables V and Z alternately by optimizing them. k and W k The complexity of each step in a single iteration is as follows:
[0116] 1. Update the transformation matrix V: According to its update formula, the computational complexity of this step is O(m(d)). 2 +nd)+d 3 );
[0117] 2. Update the fusion vector Z k According to the analytical solution This step can be calculated directly, with a complexity of O(m(d)). 2 +nd));
[0118] 3. Update the weight matrix W k This is the key to optimizing this algorithm. Directly solving for the theoretical solution involves matrix inversion, resulting in a complexity as high as O(m(n)). 3 +dn 2 +d 2 This invention employs gradient descent for approximate updates, successfully reducing the complexity to O(m(d)). 2 +nd)).
[0119] Based on the above analysis, the overall time complexity of the ELF algorithm for completing one fusion iteration between any two layers is: O(m(d)). 2 +nd) +d 3 ).
[0120] This complexity reflects the algorithm's performance on the number of nodes. n and feature dimensions d The algorithm optimizes weight updates through gradient descent, effectively avoiding large-scale matrix inversions and improving computational efficiency.
[0121] 3.2 Complexity Analysis of Cosine Similarity-Based Fusion Algorithm
[0122] The CLF algorithm also uses an alternating optimization framework, but because its objective function is based on cosine similarity, the gradient calculation formula is different. The complexity analysis of each step is as follows:
[0123] 1. Update the transformation matrix V: According to its update formula, the computational complexity is O(m(d)). 2 +nd)+d 3 );
[0124] 2. Update the fusion vector Z k According to its update formula, the complexity is O(m(d)). 2 +nd));
[0125] 3. Update the weight matrix W k Similar to the ELF algorithm, direct solution has high complexity. This invention also uses gradient descent for optimization and updating, reducing the complexity from the original O(m(n)). 3 +dn2 +d 2 n)) significantly decreased to O(m(d) 2 +nd)).
[0126] Therefore, the overall time complexity of the CLF algorithm for completing one fusion iteration between any two layers can be summarized as: O(m(d) 2 +nd)+d 3 ).
[0127] 3.3 Summary of Complexity and Extensibility Description
[0128] Analysis of both algorithms shows that their computational complexity is mainly determined by the feature dimension. d and the number of lower-level nodes n Decision. In real-world application scenarios, node feature dimensions. d The dimensionality can be compressed to a lower level (e.g., 100 dimensions) using techniques such as principal component analysis (PCA), while the number of nodes in the tree structure... n It could be very high.
[0129] Since d≪n is usually satisfied in practical applications, and the feature dimension d and the number of parent nodes m are relatively stable, the computational complexity of the two algorithms shows an approximately linear growth trend with respect to the number of lower-level nodes n. This characteristic ensures that the method proposed in this invention can maintain high computational performance and good scalability when dealing with large-scale tree-structured data with massive numbers of nodes, and can meet the stringent requirements for algorithm efficiency in practical industrial applications.
[0130] IV. Hyperparameter Setting and Optimization Strategies
[0131] The hierarchical fusion framework of this invention involves several key hyperparameters, the proper setting of which has a significant impact on model performance and convergence speed. This section will explain the meaning, typical value range, and optimization strategies of the core hyperparameters to guide those skilled in the art in implementation.
[0132] 1. Hierarchical fusion weight coefficients (φ1 and φ2)
[0133] Function: The coefficient φ in formulas (1) and (2) is used to balance the relative importance of the original parent node features and the transformed weighted child node features during the fusion process. In actual multi-layer tree fusion, different levels of fusion may require different balance strengths. Therefore, the framework of this invention introduces two independent coefficients: φ1 is used to control deep fusion (such as between the 2nd and 3rd layers), and φ2 is used to control shallow fusion (such as between the 1st and 2nd layers).
[0134] Typical values and their impact: Experiments show that the values of φ1 and φ2 jointly affect the discriminative power of the final vector representation. Generally, both are in the interval
[10] .-3 10 1 Internal adjustment can yield effective results. Specifically: For the Euclidean distance-based algorithm (ELF), the model is more sensitive to changes in φ2, and its optimal value usually appears in a smaller range (e.g., around 0.02), while φ1 maintains stable model performance over a wider range (e.g., 0.01 to 1). For the cosine similarity-based algorithm (CLF), the model is more sensitive to parameter adjustments, and the optimal intervals for φ1 and φ2 are relatively narrower (e.g., 10). -1 Up to 10 0 ), among which φ2 plays a particularly crucial role.
[0135] Optimization Strategy: Since shallow fusion (close to the root node) directly shapes the macroscopic semantics of the final representation, tuning φ2 is generally preferred over φ1. It is recommended to use grid search or random search within these ranges to find the optimal combination for the specific task. Experiments show that the ELF algorithm exhibits better parameter robustness overall.
[0136] 2. Learning rate ( η )
[0137] Function: Learning rate η In gradient descent (or ascent) methods, the update step size of the weight matrix W in each iteration directly affects the convergence and stability of the optimization process.
[0138] Typical value range: The learning rate setting needs to match the feature scale and data size. Generally, η The initial value can be set within the range of [0.0001, 0.1] for trial purposes.
[0139] Optimization strategy: To balance convergence speed and accuracy, a learning rate decay strategy is recommended. This involves using a large learning rate (e.g., 0.01) initially, followed by exponential or piecewise decay based on validation set performance. For large-scale data, a smaller learning rate (e.g., 0.0001) helps stabilize convergence.
[0140] V. Examples and Applications
[0141] The embodiments of the present invention will be described in detail below with reference to specific application scenarios.
[0142] Example 1: Collaborator Recommendation Scenario
[0143] In this embodiment, the tree structure represents a scholar.
[0144] S1. Modeling and Feature Extraction:
[0145] Construct a three-level tree structure: the root node represents the scholar, the second-level child nodes represent the papers they have published, and the third-level leaf nodes represent the references cited in the papers.
[0146] Text feature extraction was performed using the Word2Vec model: the titles of all the scholar's papers were concatenated and embedded to obtain the scholar node features; the abstracts of each paper were embedded separately to obtain the paper node features; and the titles of each reference were embedded to obtain the reference node features.
[0147] S2. Hierarchical Fusion Vectorization:
[0148] The hierarchical fusion algorithm based on Euclidean distance or based on cosine similarity described in this invention can be applied.
[0149] First, the features of the third layer (references) are integrated into their respective second layer (paper) nodes.
[0150] Then, the features of the second layer (paper) are merged into the root node of the first layer (scholar).
[0151] In this process, the transformation matrix V learns the mapping from the reference feature space to the paper feature space, and from the paper feature space to the scholar feature space; the weight matrix W automatically learns the different contribution weights of each reference to its corresponding paper, and each paper to the scholar.
[0152] S3. Output and Application:
[0153] Obtain a unified vector representation for each scholar.
[0154] By calculating the cosine similarity between these vectors, the system recommends other scholars who are most similar to the query scholar as potential collaborators.
[0155] Experimental Validation: On a dataset containing 4,762 scholars and over 11 million nodes, our method (ELF / CLF) was compared with several baseline methods. Experiments show that our method achieves the best results in key metrics such as Mean Reciprocal Rank (MRR), Success Rate (Success@k), and Normalized Discount Cumulative Gain (NDCG@k). Compared to traditional flattened text representation methods (such as VSM and Doc2vec), our method achieves an absolute improvement of over 2.7 percentage points in MRR; compared to the latest graph-based language models (WalkLM), the MRR improvement exceeds 6 percentage points; even compared to state-of-the-art tree-based representation methods (Tree2vector), our method still shows stable improvements in fine-grained metrics. This validates the effectiveness of our invention in capturing fine-grained semantic dependencies through hierarchical fusion.
[0156] Example 2: Image Retrieval Scenario
[0157] In this embodiment, the tree structure represents an image.
[0158] S1. Modeling and Feature Extraction:
[0159] Construct a three-level tree structure: the root node contains global image information, the second-level child nodes contain partial image regions, and the third-level leaf nodes contain attribute text descriptions of the regions.
[0160] Multimodal feature extraction using the CLIP model: The entire image is input into the CLIP visual encoder to obtain global node features; each region image is input into the CLIP visual encoder to obtain region node features; each attribute text is input into the CLIP text encoder to obtain attribute node features.
[0161] S2. Hierarchical Fusion Vectorization:
[0162] The fusion algorithm described in this invention is applied.
[0163] The attribute features are fused from the bottom up to the corresponding region nodes, and then the region features are fused to the global root node of the image.
[0164] The transformation matrix V and the weight matrix W adaptively learn the alignment and importance relationships between different modalities and different nodes during the fusion process.
[0165] S3. Output and Application:
[0166] Obtain a unified vector representation for each image.
[0167] Content-based image retrieval is achieved by performing similarity searches on the database using the vectors of the query images.
[0168] Experimental validation: Experimental results on the Fashionpedia dataset show that our method outperforms the comparison methods in terms of precision, recall, and AUC. For example, compared to the Deep Supervised Feature Histogram (DSFH) method, which relies on handcrafted features and global aggregation, our method (ELF) achieves an absolute improvement of approximately 10 percentage points in precision@1 and a 23.4% improvement in AUC; compared to the model based on a fixed convolutional region encoding spatial structure (SENet), precision@1 is improved by more than 14 percentage points; compared to advanced cross-modal retrieval methods (Pic2word, Context-I2W), our method achieves a higher AUC while maintaining high precision through explicit tree-structured multimodal fusion. This demonstrates the advantages of our invention in multimodal hierarchical alignment and fine-grained visual semantic modeling.
[0169] Example 3: Video Retrieval Scenario
[0170] In this embodiment, the tree structure represents a movie.
[0171] S1. Modeling and Feature Extraction:
[0172] Construct a three-level tree structure: the root node represents the movie, the second-level child nodes represent story segments, and the third-level leaf nodes represent shots.
[0173] Feature extraction is performed using the CLIP model: keyframes sampled uniformly from the film are visually encoded using CLIP and then averaged to obtain film node features; the visual features of keyframes for each story segment are averaged and added to the text description (CLIP text encoding) features of that segment to obtain story node features; the visual features of keyframes for each shot are averaged and added to the dialogue text (CLIP text encoding) features to obtain shot node features.
[0174] S2. Hierarchical Fusion Vectorization:
[0175] The fusion algorithm described in this invention is applied.
[0176] The camera features are merged from the bottom up to the corresponding story segment nodes, and then the story segment features are merged to the root node of the film.
[0177] S3. Output and Application:
[0178] Obtain a unified vector representation for each movie.
[0179] By calculating the similarity between movie vectors, video retrieval based on semantic content can be achieved.
[0180] Experimental validation: Our method achieves state-of-the-art performance on the MovieNet movie dataset. Compared to the hierarchical attention-based long video retrieval method (LF-VILA), our method significantly improves both Recall@5 and AUC. Compared to the temporal pooling-based method (Text4Vis), Precision@5 is improved by nearly 9 percentage points. Compared to the unified multimodal large model (Chat-UniVi), Precision@5 is improved by nearly 15 percentage points, and AUC is improved by 50.4%. These results highlight the crucial role of explicit hierarchical tree structure modeling in capturing complex video narrative structures and achieving fine-grained semantic alignment, validating the powerful representation capabilities of our framework for data with rich hierarchical relationships.
[0181] The generalizable application scenarios of this invention are described below:
[0182] In addition to its applications in scholar recommendation, image and video retrieval, the hierarchical fusion framework proposed in this invention, with its powerful heterogeneous feature alignment capability and linear computational efficiency, also has significant application potential in the following areas:
[0183] 1. Medical knowledge graph construction and clinical decision support
[0184] In the context of medical big data, patient medical records typically exhibit highly hierarchical characteristics (e.g., patient -- previous visits -- diagnosis / laboratory tests -- specific physiological indicators). This invention can transform the complex paths in a medical knowledge graph into a unified clinical feature vector. By aligning textual diagnostic reports with numerical physiological indicators through a transformation matrix V, and automatically identifying the core indicators that contribute most to disease prognosis using a weight matrix W, it assists doctors in making accurate disease predictions and evaluating treatment efficacy.
[0185] 2. Hierarchical intelligent question answering and government big data analysis
[0186] In intelligent question-answering (QA) systems, policy documents or legal provisions often have extremely strict chapter, section, article, and subsection hierarchies. This invention enables deep hierarchical modeling of long documents, encoding the logical dependencies between paragraphs into vector representations. Compared to traditional fragment extraction methods, the vectors generated by this framework can more completely preserve the contextual semantic logic of the document, effectively solving the problem of "taking things out of context" in complex policy consultations, and improving the accuracy and interpretability of intelligent QA in government affairs.
[0187] 3. Industrial Internet and Fault Diagnosis of Complex Equipment
[0188] In the field of Industry 4.0, the structure of complex mechanical equipment (such as aero engines and CNC machine tools) typically follows a tree-like topology of "system - subsystem - component - sensor data". This invention can fuse low-level temporal features such as vibration, temperature, and pressure collected by sensors layer by layer into a system-level state vector. Utilizing its efficient O(n) computational characteristics, it can achieve real-time monitoring and hierarchical fault location of massive equipment states, significantly improving the efficiency of industrial predictive maintenance.
[0189] 4. Multi-level product categorization and cross-referencing in e-commerce
[0190] In e-commerce platforms, product categories are typically organized as "major category -- sub-category -- leaf category". This invention can integrate user clicks, favorites, and comments across different categories to construct a hierarchical topology of user interests. Through an adaptive fusion mechanism, the system can identify user consumption tendencies at different levels, thereby maintaining recommendation accuracy while uncovering potential cross-category consumption interests and enhancing the diversity of e-commerce recommendation systems.
[0191] Algorithm and Data Availability Description. The algorithm flow, mathematical model, and parameter update method involved in this invention have been fully and clearly described in this specification. Those skilled in the art can implement the method of this invention based on the content of this specification without relying on specific open-source code or proprietary datasets. The implementation of this invention does not depend on unavailable proprietary algorithms or closed systems.
Claims
1. A vectorization method based on tree-structured data, wherein the tree structure is a hierarchical data structure formed by organizing several nodes according to parent-child relationships, including at least one root node and several levels of intermediate nodes and leaf nodes, used to characterize the hierarchical semantic relationships between data objects, characterized in that, Includes the following steps: S1. For the input data, construct its corresponding tree structure; use the feature extractor corresponding to the node data modality to obtain the feature vector of each node, forming a feature-based tree; S2. Hierarchical Fusion Vectorization: Starting from the leaf node level of the tree, the fusion operation is performed layer by layer upwards until the root node; for any two adjacent levels, i.e., the lower child node level and the upper parent node level, the fused parent node vector is generated by optimizing the objective function; the fusion process includes: Using the transpose V of the transformation matrix T The features of lower-level child nodes are mapped from their original feature space to a feature space that is consistent with or comparable to that of the upper-level parent node, so as to achieve cross-level and cross-modal feature alignment; the transformation matrix V is a set of learnable linear transformation parameters. The contribution weights of each child node to its parent node are adaptively learned using a weight matrix W. The weight matrix W is a learnable parameter matrix used to characterize the semantic contribution of different child nodes to their parent node, and its parameter values are adaptively updated according to the objective function during the hierarchical fusion process. By combining the distance or similarity relationship between the fusion vector and the original parent node features and the transformed weighted child node features, a fusion vector Z for the corresponding parent node is generated; the fusion vector Z refers to the node representation vector generated by the hierarchical fusion operation, which is used to characterize the semantic representation of the corresponding node after integrating its own features and the features of its lower-level nodes. S3: Output the root node vector obtained after hierarchical fusion as the vectorized representation of the entire tree structure data.
2. The vectorization method according to claim 1, characterized in that, The optimization objective function described in step S2 is implemented using either a hierarchical fusion algorithm based on Euclidean distance or a hierarchical fusion algorithm based on cosine similarity. Specifically, the objective function of the hierarchical fusion algorithm based on Euclidean distance aims to minimize the Euclidean distance between the fusion vector and the transformed and weighted child node features, while simultaneously minimizing the Euclidean distance between the fusion vector and the original parent node features. The objective function of the hierarchical fusion algorithm based on cosine similarity aims to maximize the cosine similarity between the fusion vector and the transformed and weighted child node features, while simultaneously maximizing the cosine similarity between the fusion vector and the original parent node features.
3. The vectorization method according to claim 2, characterized in that, The objective function of the hierarchical fusion algorithm based on Euclidean distance is The objective function of the cosine similarity-based hierarchical fusion algorithm is Where X represents the feature matrix of the lower-level child nodes, Y k Indicates the first k The original feature vectors of the parent nodes, Z k For the first k The fusion vector of each parent node, where V is the transformation matrix and its transpose V T W is used to project the features of lower-level nodes onto the feature space of the parent node. k For the weight vector, To balance the coefficients of the two constraints; and W k The elements in satisfy and Constraints Indicates the index of the lower-level child node. This represents the total number of child nodes that are connected to a given parent node. Indicates the index of the parent node, used to distinguish the fusion vector and weight vector corresponding to different parent nodes; This indicates the total number of parent nodes in the current level. This indicates that the fusion objective of all parent nodes is accumulated; min means minimizing the objective function, and max means maximizing the objective function.
4. The vectorization method according to claim 3, characterized in that, In the process of optimizing the objective function, the coefficients Including coefficients used to control the equilibrium strength of deep fusion. and the coefficient used to control the equilibrium strength of shallow fusion Both values are in the interval [10]. -3 [10] Internal regulation.
5. The vectorization method according to claim 1, characterized in that, When iteratively optimizing the three variables in the objective function, namely the transformation matrix V, the weight vector W, and the fusion vector Z, the process is carried out alternately by fixing two of them first and updating the third.
6. The vectorization method according to claim 1, characterized in that, When solving the objective function to update the weight matrix W, gradient descent is used for approximate updating.
7. The vectorization method according to claim 6, characterized in that, The gradient descent method for approximate updating includes the following iterative steps until the objective function converges: calculating the gradient; updating via gradient descent; and then... k The weight vector W of each upper-level parent node k Projection to satisfy and The constrained space, where the weight vector W k element w in ki Indicates the first The lower-level child node pairs with the first The semantic contribution of each parent node. This represents the total number of child nodes that are connected to a given parent node.
8. A vectorization framework based on tree-structured data, wherein the tree structure is a hierarchical data structure formed by organizing several nodes according to parent-child relationships, including at least one root node and several levels of intermediate nodes and leaf nodes, used to characterize the hierarchical semantic relationships between data objects, characterized in that... The vectorization framework includes: The tree structure construction and feature extraction module is used to construct its corresponding tree structure; the feature extractor corresponding to the node data modality is used to obtain the feature vector of each node, forming a feature-based tree; The hierarchical fusion vectorization module is used to perform fusion operations layer by layer upwards from the leaf node level of the tree until the root node. For any two adjacent levels, i.e., the lower child node level and the upper parent node level, the fused parent node vector is generated by optimizing the objective function. The fusion process includes: using the transpose V of the transformation matrix... T The features of lower-level child nodes are mapped from their original feature space to a feature space that is consistent with or comparable to that of the upper-level parent node to achieve cross-level and cross-modal feature alignment. The transformation matrix V is a set of learnable linear transformation parameters. The contribution weights of each child node to the parent node are adaptively learned using the weight matrix W. The weight matrix W is a learnable parameter matrix used to characterize the semantic contribution of different child nodes to their parent node, and its parameter values are adaptively updated according to the objective function during the hierarchical fusion process. By jointly constraining the distance or similarity relationship between the fusion vector and the original parent node features and the transformed weighted child node features, the corresponding parent node's fusion vector Z is generated. The fusion vector Z refers to the node representation vector generated through the hierarchical fusion operation, used to characterize the semantic representation of the corresponding node after integrating its own features and the features of its lower-level nodes. The output module is used to output the root node vector obtained after hierarchical fusion as a vectorized representation of the entire tree structure data.
9. The vectorization framework according to claim 8, characterized in that, The optimization objective function is implemented using either a hierarchical fusion algorithm based on Euclidean distance or a hierarchical fusion algorithm based on cosine similarity. Specifically, the objective function of the hierarchical fusion algorithm based on Euclidean distance aims to minimize the Euclidean distance between the fused vector and the transformed and weighted child node features, while simultaneously minimizing the Euclidean distance between the fused vector and the original parent node features. The objective function of the hierarchical fusion algorithm based on cosine similarity aims to maximize the cosine similarity between the fused vector and the transformed and weighted child node features, while simultaneously maximizing the cosine similarity between the fused vector and the original parent node features.
10. A vectorization system based on tree-structured data, characterized in that, The system includes a memory for storing a computer program and a processor for executing the computer program stored in the memory, so that the system performs the vectorization method as described in any one of claims 1 to 7 or the vectorization framework as described in any one of claims 8 to 9.
Citation Information
Patent Citations
Reviewer recommendation method based on tree structure representation
CN113568999A
Tree structure fusion algorithm and system based on semantic intelligence
CN118193952A