Hierarchical data generation method and system based on hierarchical quantization tree
By using a method based on hierarchical quantization trees, a hierarchical data generation model is constructed, which solves the problems of low computational efficiency, limited generation capability and difficulty in tree structure representation in the existing technology, and realizes efficient and accurate data generation. In particular, a hierarchical data generation model is constructed by combining a multi-layer perceptron feature encoder and a hierarchical tree code book with soft contrastive learning loss and hierarchical quantization loss, which solves the problems of low computational efficiency, limited generation capability and difficulty in tree structure representation in the existing technology, and realizes efficient and accurate data generation.
Patent Information
- Application Number
- CN202510800813.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-09-23
AI Technical Summary
In the field of single-cell genomics and image generation, existing technologies such as hierarchical clustering, variational autoencoders, and diffusion models have problems such as low computational efficiency, limited generation capabilities, insufficient lineage analysis accuracy, and difficulty in tree structure representation, and are unable to effectively capture complex hierarchical relationships.
A hierarchical data generation model is constructed by using a hierarchical quantized tree-based method, through a multi-layer perceptron feature encoder and a hierarchical tree codebook, combined with soft contrastive learning loss and hierarchical quantization loss, to achieve multi-scale semantic encoding and dynamic tree structure, supporting large-scale data processing.
It improves computing efficiency, reduces the number of parameters, shortens training time, generates data that is both biologically reasonable and diverse, supports large-scale single-cell data processing, improves parallelization capabilities, and generates accurate results.
Smart Images

Figure CN120687735A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the intersection of deep learning, computational biology and computer vision, and specifically relates to a hierarchical data generation method and system based on a hierarchical quantization tree. Background Art
[0002] In fields such as single-cell genomics and image generation, hierarchical data modeling and generation are core challenges. Traditional and existing methods have the following limitations:
[0003] 1. Limitations of Hierarchical Clustering and Variational Autoencoders
[0004] Low computational efficiency: The time complexity of traditional hierarchical clustering algorithms (such as Ward method) is O(N2), which is difficult to process large-scale data (such as single cell data >10 5 sample).
[0005] Limited generation capabilities: Variational autoencoders (VAEs) model data distributions through a single latent space but cannot explicitly capture hierarchical structures. For example, TreeVAEs require independent network modules for each tree branch, resulting in a surge in parameter count (over 40%), poor training stability (loss fluctuations >30%), and an inability to effectively capture deep tree structure relationships.
[0006] Insufficient accuracy of pedigree analysis: Methods based on pseudo-time ordering (such as Monocle and Slingshot) rely on predefined distance metrics (such as Euclidean distance), cannot model unobserved intermediate states, and their accuracy drops significantly in noisy data.
[0007] 2. Unsolved Issues in Diffusion Models
[0008] Lack of structural guidance: Traditional diffusion models (such as DDPM) lack hierarchical constraints in the generation process, resulting in semantic confusion in the generated data. For example, in single-cell generation tasks, diffusion models may generate abnormal cell states that do not conform to the differentiation path (accounting for >15%).
[0009] Lack of multi-scale modeling: Although existing methods use vector quantization (VQ) to improve generation quality, the quantization process is limited to a single level and cannot distinguish between global differentiation paths and local subtype branches.
[0010] 3. Technical bottlenecks of tree structure representation
[0011] Static tree construction: Traditional tree generation methods (such as hierarchical clustering and HGNN) rely on fixed distance metrics (such as cosine similarity) and cannot adapt to changes in data distribution.
[0012] Difficulty in dynamic optimization: Existing tree-structured models (such as GAN-Tree) generate hierarchies through a greedy splitting strategy, but node splitting is irreversible, resulting in poor model flexibility (such as node utilization <50% in ECL data).
[0013] The static tree structure and fixed quantization strategy limit the model's adaptability to complex hierarchical relationships (such as the dynamic branching of cell fate in embryonic development). Summary of the Invention
[0014] In view of the shortcomings of the existing technology, the present invention proposes a hierarchical data generation method and system based on a hierarchical quantization tree. The specific technical solution is as follows:
[0015] A hierarchical data generation method based on a hierarchical quantization tree comprises the following steps:
[0016] Step 1: Perform data augmentation on the original data to expand the sample size of the input data, and standardize all the augmented data;
[0017] Step 2: Construct and train a hierarchical data generation model, which includes a feature encoder and a hierarchical tree codebook; the feature encoder is a multi-layer perceptron, which is used to extract features from the data after the normalization process in step 1 to obtain potential features that can characterize the input data; the hierarchical tree codebook constructs a rooted binary tree, and the hierarchical tree codebook uses a quantization function to hierarchically quantize and match the potential features with multi-level coding vectors, thereby forming a hierarchical tree structure;
[0018] Step 3: The data to be predicted is subjected to the same data enhancement and standardization processing as in step 1, and then input into the hierarchical data generation model trained in step 2. The trained hierarchical data generation model outputs hierarchical data.
[0019] Furthermore, the specific process of hierarchical quantization matching of the potential features with the multi-level coding vectors by the hierarchical tree codebook through the quantization function is as follows:
[0020] (1) Initialize the tree structure of the root binary tree. The maximum depth is L, and the number of nodes in each layer is 2 l , l∈{1,…,L}; root node Sampling is done using a standard normal distribution, and child nodes are generated layer by layer through K-means clustering. Each child node has a corresponding associated learnable code vector at each depth.
[0021] (2) The potential characteristics z i Starting from the root node, select the potential features z layer by layer. iThe child node with the closest Euclidean distance is used to obtain the encoding vector; the L layers are screened in sequence to finally generate a hierarchical encoding sequence;
[0022] (3) During each batch training, the code vector is updated by exponential moving average smoothing.
[0023] Furthermore, in the step 2, the composite loss function when training the hierarchical data generation model includes soft contrast learning loss and hierarchical quantization loss;
[0024] The soft contrastive learning loss specifically constructs a similarity matrix in the hyperbolic space to enhance local similarity and hierarchical relationships;
[0025] The hierarchical quantization loss ensures hierarchical consistency by aligning the latent features with the encoding vector.
[0026] Furthermore, the hierarchical data is image data or single cell data.
[0027] Furthermore, in the step 1, the single cell raw data line is logarithmically normalized, and then the normalized data is enhanced, and finally standardized.
[0028] A hierarchical data generation system based on a hierarchical quantization tree includes a data preprocessing module and a hierarchical data generation module;
[0029] The data preprocessing module is used to perform data enhancement and standardization on the input data;
[0030] The hierarchical data generation module is used to generate hierarchical data. It has a built-in hierarchical data generation model. The hierarchical data generation model includes a feature encoder and a hierarchical tree code book. The feature encoder is a multi-layer perceptron, which is used to extract features from the standardized data and obtain potential features that can characterize the input data. The hierarchical tree code book constructs a rooted binary tree. The hierarchical tree code book uses a quantization function to hierarchically quantize and match the potential features with multi-level coding vectors, thereby forming a hierarchical tree structure.
[0031] The beneficial effects of the present invention are as follows:
[0032] 1. In the system of the present invention, a hierarchical codebook module is used to replace the branch-specific module. This combines a binary tree structure with vector quantization for the first time, achieving multi-scale semantic encoding and resolving the hierarchical ambiguity problem of traditional methods. The system reduces the number of parameters by 40% and shortens training time by over 30%. This system supports large-scale parallel processing, and a single GPU (NVIDIA A100) can process 1 million single-cell data.
[0033] 2. The method and system of the present invention guide the diffusion process through hierarchical coding sequences, generating data that is both biologically reasonable and diverse. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of a hierarchical data generation model according to an embodiment of the present invention.
[0035] Figure 2 This is the result diagram obtained after performing pedigree analysis and visualization on the hierarchical data obtained in Example 1.
[0036] Figure 3 Schematic diagram of a model for adding a diffusion decoder to generate reconstructed samples.
[0037] Figure 4 This is a generated result diagram after the hierarchical data obtained in Example 2 is further decoded by a diffusion decoder.
[0038] Figure 5 This is a generated result diagram after the hierarchical data obtained in Example 3 is further decoded by a diffusion decoder. DETAILED DESCRIPTION
[0039] The present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments, and the purpose and effects of the present invention will become more apparent. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0040] The present invention provides a hierarchical data generation method based on a hierarchical quantization tree, where hierarchical data specifically refers to data with parent-child relationships. For example, in the field of computer vision, the categories of an image might be mammal, dog, and Labrador. In a single cell, hierarchical data can be understood as the cell's differentiation into different cells at different stages, with the cell types before and after differentiation forming a parent-child relationship.
[0041] like Figure 1 As shown, on the one hand, one embodiment of the present invention provides a hierarchical data generation method based on a hierarchical quantization tree, comprising the following steps:
[0042] Step 1: Perform data augmentation on the original data to expand the sample size of the input data, and standardize all the augmented data.
[0043] Specifically, for image data, the original image is randomly cropped, rotated (±15°), and Gaussian noise with σ=0.1 is injected to obtain enhanced samples, and then the data is normalized;
[0044] For single-cell data, we first log-normalize the raw data, then perform data augmentation on the normalized data, and finally perform standardization. For biological single-cell data, we randomly mask the genes (masking 20% of the gene expression values) and inject Gaussian noise with σ = 0.05 to obtain enhanced samples.
[0045] Among them, the calculation formula for logarithmic normalization of single-cell data is as follows:
[0046]
[0047] The calculation formula for normalizing the image data and single-cell data after data enhancement is as follows:
[0048]
[0049] in, is the standardized data, μ is all the input data x i The mean of all input data x i The calculated standard deviation.
[0050] Step 2: Build and train a hierarchical data generation model, which includes a feature encoder and a hierarchical tree codebook.
[0051] 1. Feature Encoder
[0052] The feature encoder is used to extract features from the data after the normalization process in step 1, and obtain potential features that can characterize the input data. The feature encoder uses a multi-layer perceptron, which includes an input layer, two hidden layers, and an output layer. The dimension of the input layer is D, the dimensions of the two hidden layers are 512 and 256 respectively, and the dimension of the output layer is d, which is the dimension of the latent space. Except for the output layer, each layer uses the GeLU activation function; the output layer linearly projects the features into the latent space.
[0053] 2. Hierarchical tree codebook
[0054] The hierarchical tree codebook is used to hierarchically quantize and match the potential features with the multi-level coding vectors within it through a quantization function, thereby forming a hierarchical tree structure;
[0055] (1) Tree structure initialization
[0056] Construct a rooted binary tree with a maximum depth of L in the hierarchical tree codebook Number of nodes per layer 2 l , l∈{1,…,L}. Root node Sub-nodes are generated layer by layer through K-means clustering and sampled from a standard normal distribution. Each sub-node has a corresponding associated learnable code vector at each depth.
[0057] (2) Hierarchical Quantization Matching
[0058] The latent feature z output by the feature encoder i Starting from the root node, select the potential feature z layer by layer i The child node with the closest Euclidean distance is obtained to obtain the encoding vector; the L layers are screened in sequence to finally generate a hierarchical encoding sequence:
[0059]
[0060] Among them, s i represents the final generated hierarchical coding sequence, Represents the lth layer distance potential feature z i The most recent encoding vector; represents the learnable code vector associated with node j at depth l, Children() represents all child nodes connected to the upper-level node; argmin represents the minimization function, and |·|2 represents the L2 norm.
[0061] (3) Dynamic update strategy
[0062] Code vector update: In each batch of training, the code vector is updated by exponential moving average (EMA) smoothing
[0063]
[0064] Here, γ represents the smoothing coefficient, γ=0.95.
[0065] 3. Composite loss function for training hierarchical data generation models
[0066] The composite loss function includes Soft Contrastive Loss (SCL) and Hierarchical Quantization Loss (HQL)
[0067] Among them, soft contrastive learning loss Specifically: construct a similarity matrix in hyperbolic space to enhance local similarity and hierarchical relationships:
[0068]
[0069] in, For two different input data and Corresponding latent features and Hyperbolic similarity of;
[0070] For input data x i The corresponding latent feature z i The hyperbolic similarity space similarity of itself, N b is the number of data in a mini-batch.
[0071] Hierarchical Quantization Loss By aligning the latent features z i With the encoding vector Ensure hierarchical consistency:
[0072]
[0073] Where sg(·) is the stop gradient operation, λ is the balance coefficient, λ = 2; is the distance encoding vector in the latent space Recent latent features. Represents the square of the L2 norm.
[0074] 4. Optimizer Configuration
[0075] Use AdamW optimizer with a learning rate of 1×10 -4 , weight decay 0.01.
[0076] Batch size N b =128, training rounds 1000, using the learning rate cosine annealing strategy.
[0077] Early stopping mechanism: If the validation loss does not decrease for 10 consecutive rounds, the training is terminated.
[0078] Step 3: Perform the same data augmentation and standardization processing as step 1 on the data to be predicted, and then input it into the hierarchical data generation model trained in step 2. The model outputs hierarchical data.
[0079] Example 1 Reconstruction of single cell differentiation trajectory
[0080] (1) Data preparation: 12,000 cells, 15,000 genes → PCA dimensionality reduction to 500 dimensions. The data are from the public literature of Packer JS et al. (Packer JS, Zhu Q, Huynh C, et al. Lineage-resolved transcriptome map during C. elegans embryonic development at single-cell resolution [J]. Science, 2019, 365(6459): eaax1971.). The data were augmented before preprocessing by randomly masking 20% of the gene expression values and adding Gaussian noise with σ = 0.05. The data volume did not change before and after data augmentation.
[0081] (2) Training configuration: tree depth L = 8, diffusion steps T = 800, batch size 64.
[0082] In order to achieve single cell trajectory reconstruction, it is necessary to first construct a graph structure. That is, when performing lineage inference, the binary tree structure corresponding to the hierarchical tree codebook must first be constructed. Convert to weighted graph During the conversion process, all corresponding tree edges of the original binary tree are retained, and the weight is the Euclidean distance between the corresponding node code vectors. For each node in the same layer of the original tree structure, the same layer K nearest neighbor edges (K = 5) are added, and the weight is Finally, the corresponding weighted graph is formed
[0083] In the weighted graph Later, the time complexity is adopted The Dijkstra algorithm for priority queue optimization specifies the corresponding starting point w start (such as stem cell nodes), end point w end After that, a path node sequence on the weighted graph is searched through the Dijkstra algorithm (such as the terminal differentiation cell node). This is the inferred lineage trajectory.
[0084] In this example, we visualize the inferred lineage trajectory by using UMAP to reduce the latent space to 2D for high-dimensional features, encoding the visualization color using cell type or pseudo-time, and connecting the path nodes using B-spline curves, with arrows indicating the direction of differentiation, to show the inferred trajectory process. The specific results are shown in Figure 2 middle.
[0085] At the same time, in order to highlight the effect of this embodiment, the existing TreeVAE model (Manduchi L, Vandenhirtz M, Ryser A, Vogt J E. Tree Variational Autoencoders[C] / / 37th Conference on Neural Information Processing Systems (NeurIPS2023). 2023.) is also used to generate hierarchical data and perform pedigree analysis and pedigree trajectory visualization. The results are also shown in Figure 2 The results obtained are:
[0086] Track length error: HDTree is 2.3±0.5 hours, which is lower than TreeVAE's 4.1±1.2 hours.
[0087] Unlabeled intermediate state coverage: HDTree is 83%, and TreeVAE is 62%.
[0088] like Figure 2 As shown in the figure, it is a schematic diagram of pedigree analysis of the C.elegans dataset, which is divided into two rows, representing TreeVAE (existing method) and HDTree (the present invention) respectively. Among them, the first column represents the feature visualization results obtained by different methods of the original single cell data, the second column represents the pedigree differentiation trajectory predicted by the pedigree analysis method based on the hierarchical tree structure, and the third column represents the developmental visualization result with real time labels as color coding. By comparing the consistency of the color change of the differentiation trajectory in the second column and the third column, the accuracy of the model for the pedigree analysis results can be analyzed. It can be seen from the real label of TreeVAE (the third column of the first row) that the color change of the feature visualization obtained using TreeVAE is not continuous, and the root node of the predicted differentiation trajectory of TreeVAE (the second column of the first row) is in the upper left corner, extending from the upper left corner to the edge in sequence. The differentiation path of this trajectory is inconsistent with the real label, indicating that TreeVAE has limited ability to capture hierarchical structures and cannot perform pedigree analysis well. As for the real label of HDTree (second row, third column), the visual color change of the real label is consistent and continuous, gradually changing from red to blue from the lower left corner to the edge, which is completely consistent with the predicted differentiation trajectory of HDTree. This shows that the method and system of the present invention have good ability to capture hierarchical structures, and can well capture the segmented developmental structure of cells for lineage analysis.
[0089] Example 2 Cross-modal Generation (MNIST → Fashion-MNIST)
[0090] In this embodiment, the data is derived from the literature of Deng L (Deng L. Application of MNIST handwritten digital image database in machine learning research [J]. IEEE Signal Processing Magazine, 2012, 29 (6): 141-142.). The data of Fashion-MNIST is derived from the public literature of Han Xiao et al. (Han Xiao, Rasul K, Vollgraf R. Fashion-MNIST: A new benchmark image dataset for machine learning algorithms [J / OL]. arXiv: 1708.07747 [cs.LG], 2017.). The original image is randomly selected for cropping, rotated by ±15°, and Gaussian noise of σ = 0.1 is added. The enhancement operation does not change the amount of data.
[0091] In order to demonstrate the effect of the method of the present invention on hierarchical data generation in cross-modal generation, it is necessary to add a diffusion decoder on the basis of the hierarchical data generation model. The diffusion decoder is used to gradually generate data for the hierarchical coding sequence obtained by traversing the hierarchical tree structure through the denoising diffusion probability model driven by the conditional noise prediction network. At the same time, during model training, the loss function adds the diffusion reconstruction loss (DDP). The model after adding the diffusion decoder is shown as follows Figure 3 shown.
[0092] The diffusion decoder uses a multilayer perceptron network structure, consisting of an input layer, three hidden layers, and an output layer. The input layer has a dimension of d × L; the three hidden layers are all 512 in dimension, and the output layer has a dimension of D. Except for the output layer, each layer uses the GeLU activation function.
[0093] The input of the diffusion decoder consists of noisy data Time step embedding t (sinusoidal positional encoding) and hierarchical encoding sequence The diffusion decoder combines the time step t with the hierarchical encoding sequence s i After splicing, it is projected to 512 dimensions through the linear layer, added to the noise data, and finally outputs the noise
[0094] Noise scheduling uses linear noise planning The total number of diffusion steps is T = 1000. Gradually transform the data from Gaussian noise to Reconstructed into original data x0:
[0095]
[0096] Among them, α t is the noise scheduling parameter, t is the corresponding time step, t∈{1,2,…,T}
[0097] The diffusion process is based on the hierarchical coding sequence s i Conditional, diffusion decoder network Drive iterative denoising:
[0098]
[0099] in, ∈ is random noise, is the corresponding noise variance; represents the estimated sample after denoising in the Ttth step, Represents the estimated samples before Tt-step denoising;
[0100] By adjusting the tree depth L to control the generation granularity, shallow nodes control the global structure, deep nodes refine local features, and by selecting different levels of hierarchical coding s i Ability to control the characteristic scale of generated samples.
[0101] The diffusion reconstruction loss DDP is used to minimize the noise prediction error:
[0102]
[0103] In this embodiment, a comparison is also made with the HDTree model. In this embodiment, during transfer learning, the Hierarchical Tree Codebook (HTC) and encoder of the hierarchical data generation model are frozen, and only the diffusion decoder is fine-tuned.
[0104] The composite loss function at this time is:
[0105]
[0106] The FID scores of images generated by HDTree and TreeVAE models are: HDTree is 12.5, which is better than TreeVAE's 18.7.
[0107] Training time: HDTree fine-tuning takes 15 minutes, and TreeVAE takes 45 minutes.
[0108] The final visualization result obtained in this embodiment is as follows Figure 4 shown. Figure 4This is a schematic diagram generated by Example 2 in Mnist, showing the results of the diffusion decoder when selecting code vectors at different depths in the hierarchical codebook. In the Mnist dataset, 6 is a high-level node (root node), and 9, 3, and 1 are low-level nodes (leaf nodes). When the code vector at the root node is selected as the condition, a precise handwritten digit "6" can be generated. However, as the selected level decreases (the depth in the hierarchical codebook gradually deepens), the corresponding code vector is used as the condition, and the result is a blurred digital image, representing the process of transitioning from the digit represented by the root node to the digit represented by the leaf node. This is the result of decoding using code vectors representing nodes with gradually deepening depths from the center to the edge as the condition. Taking the transition path from 6 to 3 as an example, it can be seen that the precise digit 6 gradually blurs and gradually takes on the characteristics of the digit 3, ultimately forming a precise digit 3. This demonstrates that the diffusion decoder of this embodiment can effectively adjust the level of sample feature generation under the conditions of different hierarchical code vectors. By selecting code vectors at a specific level, the desired sample can be accurately generated.
[0109] Example 3 Large-scale single-cell data (ECL embryo dataset)
[0110] In this example, the data is from a publicly available source (Qiu C, Martin BK, Welsh IC, et al. Single-cell time series analysis of mouse embryos from gastrula to birth [J]. Nature, 2024, 626:1084-1093. DOI: 10.1038 / s41586-024-07069-w.). Data were augmented before preprocessing by randomly masking 20% of gene expression values and adding Gaussian noise with σ = 0.05. Data volume did not change before and after data augmentation.
[0111] Training configuration: tree depth L = 8, diffusion steps T = 800, batch size 64.
[0112] As in Example 2, to demonstrate the effectiveness of the hierarchical data generation method of the present invention, a diffusion decoder is added to the hierarchical data generation model, and the model with the added diffusion decoder is trained using the diffusion reconstruction loss. The diffusion decoder and diffusion reconstruction loss in this example are the same as those in Example 2.
[0113] The training in this embodiment is distributed training, executed on 4×NVIDIAA100, and data parallel (batch size=512).
[0114] The calculation results are as follows:
[0115] Training time: 52 minutes for HDTree and 6 hours and 10 minutes for TreeVAE.
[0116] Memory usage: HDTree is 18GB, TreeVAE is 42GB.
[0117] The final visualization result of this embodiment is as follows Figure 5 As shown, Figure 5 This is a schematic diagram generated by Example 3 in the C.elegans data set, which shows the generation results of code vectors at different depths in the hierarchical code book after passing through the diffusion decoder. In the C.elegans data set, the unannotated ones are high-level (root nodes), and the cells that are accurately annotated are low-level (leaf nodes). When the code vector under the root node is selected as a condition, unknown cells are generated, and as the selected level gradually decreases (the depth in the hierarchical code book gradually deepens), the corresponding code vector is used as a condition, and annotated cell results are gradually generated. That is, as shown in the figure, as the bottom moves to the top, the cells change from unannotated cells to annotated ciliated (non-)amphibious neuronal cells. This shows that under the control of the code vector at a specified level, new and reliable samples can be accurately generated.
[0118] Those skilled in the art will understand that the foregoing descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art will still be able to modify the technical solutions described in the foregoing examples or substitute equivalents for some of the technical features therein. Any modifications, equivalent substitutions, etc. made within the spirit and principles of the invention shall be included within the scope of protection of the invention.
Claims
1. A hierarchical data generation method based on a hierarchical quantization tree, characterized in that: The method comprises the following steps: Step 1: Perform data augmentation on the original data to expand the sample size of the input data, and standardize all the augmented data; Step 2: Build and train a hierarchical data generation model, which includes a feature encoder and a hierarchical tree codebook; The feature encoder is a multi-layer perceptron, which is used to extract features from the data after the standardization process in step 1 to obtain potential features that can characterize the input data; A rooted binary tree is constructed in the hierarchical tree codebook, and the hierarchical tree codebook performs hierarchical quantization matching on the potential features and the multi-level coding vectors through a quantization function, thereby forming a hierarchical tree structure; Step 3: The data to be predicted is subjected to the same data enhancement and standardization processing as in step 1, and then input into the hierarchical data generation model trained in step 2. The trained hierarchical data generation model outputs hierarchical data.
2. The hierarchical data generation method based on the hierarchical quantization tree according to claim 1, characterized in that: The specific process of hierarchical tree codebook performing hierarchical quantization matching on the potential features and multi-level coding vectors through quantization function is as follows: (1) Initialize the tree structure of the root binary tree. The maximum depth is L, and the number of nodes in each layer is 2 l , l∈{1,…,L}; root node Sampling is done using a standard normal distribution, and child nodes are generated layer by layer through K-means clustering. Each child node has a corresponding associated learnable code vector at each depth. (2) The potential characteristics z i Starting from the root node, select the potential features z layer by layer. i The child node with the closest Euclidean distance is used to obtain the encoding vector; the L layers are screened in sequence to finally generate a hierarchical encoding sequence; (3) During each batch training, the code vector is updated by exponential moving average smoothing.
3. The hierarchical data generation method based on the hierarchical quantization tree according to claim 2, characterized in that: In the step 2, the composite loss function when training the hierarchical data generation model includes soft contrast learning loss and hierarchical quantization loss; The soft contrastive learning loss specifically constructs a similarity matrix in the hyperbolic space to enhance local similarity and hierarchical relationships; The hierarchical quantization loss ensures hierarchical consistency by aligning the latent features with the encoding vector.
4. The hierarchical data generation method based on the hierarchical quantization tree according to claim 1, characterized in that: The hierarchical data is image data or single cell data.
5. The hierarchical data generation method based on the hierarchical quantization tree according to claim 1, characterized in that: In the step 1, the single cell raw data line is logarithmically normalized, and then the normalized data is enhanced and finally standardized.
6. A hierarchical data generation system based on a hierarchical quantization tree, characterized in that: It includes data preprocessing module and hierarchical data generation module; The data preprocessing module is used to perform data enhancement and standardization on the input data; The hierarchical data generation module is used to generate hierarchical data. It has a built-in hierarchical data generation model. The hierarchical data generation model includes a feature encoder and a hierarchical tree code book. The feature encoder is a multi-layer perceptron, which is used to extract features from the standardized data to obtain potential features that can characterize the input data. A rooted binary tree is constructed in the hierarchical tree codebook, and the hierarchical tree codebook performs hierarchical quantization matching on the potential features and multi-level coding vectors through a quantization function, thereby forming a hierarchical tree structure.