Generative AI-based image variation phenotype genetic analysis method and device
By employing a generative AI-based image variant phenotypic genetic analysis method, the problem of the inability to interpret the biological significance of digital phenotypes in existing technologies has been solved. This method enables the visual analysis of image variant phenotypes, improves the efficiency of genetic discovery and biological understanding, and is applicable to image data from multiple species.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies cannot intuitively explain the biological significance of significant gene associations when using deep learning to extract digital phenotypes. Traditional methods rely on prior knowledge and are difficult to accurately explain complex phenotypic variations, hindering the understanding from genetic discovery to biological mechanisms.
A generative AI-based genetic analysis method for image variant phenotypes is adopted. A phenotypic analysis model is constructed through a generator and encoder. Generative adversarial networks and cross-modal multi-head attention modules are used to preprocess and decouple biological image data, extract interpretable basis vectors, and combine GWAS for genome association analysis to achieve visual analysis of image variant phenotypes.
It enhances the efficiency of genetic discovery, automatically and comprehensively capturing subtle and complex variations in images, extracting rich image variation phenotypes, achieving intuitive interpretability, promoting biological discovery, verifying known associations and discovering new gene loci, and possessing versatility and flexibility.
Smart Images

Figure CN121661322A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of statistical genetics, digital imaging and artificial intelligence, specifically relating to a genetic analysis method for image variation phenotypes based on generative AI, and also relates to computer equipment. Background Technology
[0002] The genetic analysis of complex traits has long relied on genome-wide association studies (GWAS), which typically associates human-defined phenotypes (HDPs) with genetic variations. However, this traditional approach has significant limitations. First, the number of human-defined phenotypes is small, and their definitions heavily depend on prior knowledge, failing to comprehensively capture the variation spectrum of complex phenotypes, thus limiting the efficiency of genetic discovery.
[0003] With the development of digital phenotyping technologies (such as medical imaging and wearable device signals) and data-driven representation learning techniques, automated, high-throughput phenotyping analysis has become possible. These technologies have shown great potential in enhancing the efficiency of genetic discovery and identifying novel gene loci by extracting digital phenotypes from high-dimensional data. For example, deep learning analysis of human retinal fundus images and cardiac magnetic resonance imaging (MRI) data has successfully identified multiple novel gene loci associated with ophthalmic diseases and cardiac morphology.
[0004] However, existing research using deep learning to extract digitized phenotypes generally faces a core challenge: the inability to intuitively interpret the specific biological meaning represented by digitized phenotypes that are significantly associated with genes. This "black box" characteristic hinders the leap from genetic discovery to understanding biological mechanisms. Currently, methods for interpreting these digitized phenotypes mainly rely on indirect evidence, such as functional annotation of identified genes, conducting phenotypic association analysis (PheWAS), or searching for known high-density phenotypic (HDPs) that are highly associated with the digitized phenotype. However, these methods are still limited by prior knowledge. Other visualization-based methods, such as inferring phenotypic trends by comparing average images of individuals with different genotypes, also struggle to accurately and intuitively reveal the function of specific genes because they cannot exclude interference from other irrelevant phenotypic variations. Summary of the Invention
[0005] The purpose of this invention is to address the aforementioned problems in the existing technology by providing a generative AI-based method for genetic analysis of image variation phenotypes, and also to provide computer equipment.
[0006] The above-mentioned objectives of the present invention are achieved by the following technical means: A generative AI-based method for genetic analysis of image variant phenotypes includes the following steps: Step 1: Obtain the original biological image dataset and preprocess it to obtain the preprocessed biological image dataset. Step 2: Construct a phenotypic analysis model, set the total loss function, and train the phenotypic analysis model using the preprocessed biological image dataset; The phenotypic analysis model includes a generator and an encoder, with the encoder outputting biological image data in an extended latent space. The latent vectors of the layers are respectively The generator will The latent vectors of the layer are decoded to reconstruct biological image data; Step 3: Decouple the extended latent space using a data-driven approach to construct... Given a set of independent or orthogonal interpretable basis vectors, The latent vectors of the layers are projected onto... Given interpretable basis vectors, we obtain... Individual image variant phenotypes; Step 4: Perform genome association analysis (GWAS) and threshold correction on each image variant phenotype to identify the genetic loci corresponding to each image variant phenotype; Step 5: Perform a linear traversal of each image variant phenotype in the latent space along the corresponding interpretable basis vector, and use the trained generator to decode each point on the traversal path into a biological image data. After the traversal is completed, a set of biological image data corresponding to each image variant phenotype is obtained, and interpretable analysis of a set of biological image data based on visualization is performed for each image variant phenotype.
[0007] As described above, the preprocessing in step 1 specifically includes the following steps: Step 1.2.1: Perform preliminary screening on the original biological image dataset by human intervention, remove the original biological image data with poor quality, and the remaining original biological image data constitute the biological image dataset after quality screening. Step 1.2.2: Separate the Region of Interest (ROI) containing the core biological features from the background or irrelevant regions of the original biological image data to obtain the biological image dataset after region filtering. Step 1.2.3: Standardize and center the biological image dataset after region filtering to obtain a standardized biological image dataset; Step 1.2.4: Scale the standardized biological image dataset to a set resolution to obtain the preprocessed biological image dataset.
[0008] As mentioned above, the generator employs the style-based generative adversarial network StyleGAN2; The encoder includes a Swin Transformer-based backbone network, a multi-layered cross-modal multi-head attention X-MHA, and a learnable token sequence. Preprocessed biological image data is input into the Swin Transformer-based backbone network, which outputs local feature maps LIF1~LIF with different spatial resolutions. n Local feature maps LIF1~LIF n Local feature maps LIF1 are obtained after passing through convolutional modules. * ~LIF n * ; where the j-th local feature map is denoted as LIF j j is the index, which can be 1 to n, and n is the total number of local feature maps; The minimum resolution local feature map LIF4 is then passed through convolutional layers and average pooling layers to obtain the global feature vector GIF. The dimension of the global feature vector GIF is... The global feature vector GIF is then processed repeatedly to obtain a dimension of... Global Feature Vector GIF * ;in, Number of channels; The multi-layered cross-modal multi-head attention module includes multiple X-MHA modules. The number of X-MHA modules is the same as the number of local feature maps output by the SwinTransformer-based backbone network. The multiple X-MHA modules are designated as X-MHA1 to X-MHA2. n The j-th X-MHA module is X-MHA j ; When j is 1, the initialized learnable token sequence is passed through a fully connected layer and then combined with the local feature map LIF4. * They are input together into the j-th X-MHA module; When j is 2 to n, the input of the j-th X-MHA module is the feature map X. j-1 * Feature map X j-1 * The feature map X is obtained by upsampling the output feature map of the (j-1)th X-MHA module as follows: j-1 Feature map X j-1 Then, with local feature maps LIF n+1-j * The feature map X is obtained after addition. j-1 * ; The nth X-MHA module outputs preprocessed biological image data in the extended latent space. Hidden vectors of the layer.
[0009] As mentioned above, the total loss function is calculated based on the following formula: ; In the formula, The total loss function between the preprocessed biological image data and the reconstructed biological image data is... The mean squared error loss between the preprocessed biological image data and the reconstructed biological image data. Mean square error loss The weight, The loss is calculated based on the learned perceptual image patch similarity based on the features of the pre-trained VGG network. For loss Weights, Losses Calculated based on the following formula: ; In the formula, It is the L2 norm. For preprocessed biological image data, To reconstruct biological image data; The training of the phenotypic analysis model includes the following process: first, the generator is trained, and after the generator training is completed, the generator model parameters are saved; then, the encoder is trained, and after the encoder training is completed, the model parameters are saved.
[0010] As described above, cross-modal multi-head attention X-MHA employs a dual-path cross-attention structure, which includes a token-side information interaction path and a local feature map-side information interaction path. The j-th cross-modal multi-head attention X-MHA is specifically as follows: The input to the token-side information interaction path includes a learnable token sequence and a Local Feature Map (LIF) processed by the Flatten operation. j * First, the token sequence can be learned as a query matrix, and the local feature map LIF is processed by the Flatten operation. j * The query matrix, key matrix, and value matrix are used as key and value matrices. Next, a multi-head cross-attention mechanism is performed on the query matrix, key matrix, and value matrix. Finally, the result of the multi-head cross-attention mechanism is processed sequentially through residual connections and layer normalization operations, a feedforward network (FFN), and another residual connection and layer normalization operation to output an updated sequence of learnable tokens. In the local feature map side information interaction path, firstly, the local feature map LIF after Flatten operation is processed. j *As the query matrix, the token sequence can be learned as the key matrix and value matrix; secondly, the query matrix, key matrix, and value matrix undergo a multi-head cross-attention mechanism; finally, the result of the multi-head cross-attention mechanism is processed sequentially through residual connections and layer normalization operations, a feedforward network (FFN), and residual connections and layer normalization operations, and then the feature dimensions are restored through a reshape operation. Output the updated local feature map LIF j * ; The updated learnable token sequence output from the token-side information interaction path and the updated local feature map (LIF) output from the local feature map-side information interaction path. j * Together, they constitute the output feature map of the j-th cross-modal multi-head attention X-MHA; The updated learnable token sequence output by the token-side information interaction path of the j-th cross-modal multi-head attention X-MHA is the preprocessed biological image data in the extended latent space. Hidden vectors of the layer.
[0011] As mentioned above, the multi-head cross-attention mechanism is calculated based on the following formula: ; in, , , The first The query matrix, key matrix, and value matrix of each header. , It is the total number of attention heads set in the multi-head cross-attention calculation mechanism. For key The transpose of the matrix, Let be the attention function. For feature dimensions; function Based on the following formula: ; In the formula, For function Input, The input is , The length of the key matrix. For serial number, .
[0012] As described above, step 3 specifically includes the following steps: Step 3.1, construct The process involves identifying mutually independent or orthogonal interpretable basis vectors, specifically including the following steps: Step 3.1.1: Use the preprocessed biological image dataset to generate a latent vector sample set through the trained generator; Step 3.1.2: Apply Independent Component Analysis (ICA) to the latent vector sample set to expand the latent space. Decouple and calculate the extended latent space. Using 10 mutually independent directions as interpretable bases, each interpretable base is constructed into an interpretable basis vector, thus constructing... A set of mutually independent interpretable basis vectors; or, Principal Component Analysis (PCA) is used to extend the latent space of the latent vector sample set. Decouple and calculate the extended latent space. Using mutually orthogonal directions as interpretable bases, each interpretable base is constructed into an interpretable basis vector, thus constructing... One interpretable basis vector; Step 3.2, based on Using interpretable basis vectors, image variation phenotypes are extracted, specifically including the following steps: Step 3.2.1: Input the preprocessed biological image data into the trained encoder to obtain the preprocessed biological image data in the extended latent space. In Hidden vectors of layers ; Step 3.2.2, the first Hidden vectors of layers Projected to Given interpretable basis vectors, obtain Each projection vector has a scalar value, and each scalar value of a projection vector represents an image variant phenotype (IVP); where... For direction index, , Let be the total number of interpretable basis vectors. For serial number, ; Step 3.2.3: Repeat step 3.2.2 until... The latent vector data of the layer are all projected to Given interpretable basis vectors, obtain Each image variant phenotype constitutes an image variant phenotype set (IVPs) corresponding to the preprocessed biological image data.
[0013] As described above, step 5 involves a linear traversal within the latent space based on the following formula: ; In the formula, For the change, For the first The latent vectors of the layer, For the first Interpretable basis vectors For the new latent vector, i.e. Centered on, in direction A linear shift is performed on the vector to generate a series of new latent vectors; And new biological image data are generated using the new latent vectors based on the following formula: ; In the formula, To generate new biological image data using new latent vectors, This is the synthesis network for the generator.
[0014] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the image variation phenotypic genetic analysis method based on generative AI as described above.
[0015] A computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to perform the steps of a generative AI-based image variation phenotypic genetic analysis method as described above.
[0016] Compared with the prior art, the present invention has the following advantages: 1. Enhance the efficiency of genetic discovery: By using a data-driven approach, it automatically and comprehensively captures subtle and complex variations in images, extracting IVPs that provide richer phenotypic information than traditionally manually defined phenotypic data. This significantly improves the statistical power of GWAS and enables the discovery of more new genetic loci associated with complex traits.
[0017] 2. Achieving intuitive interpretability: By innovatively combining generative models, abstract, gene-related digital image variant phenotypes (IVPs) are analyzed into a series of intuitive and understandable biological image data. It is possible to directly observe how genotypic changes lead to continuous changes in specific features (such as tissue morphology and color) in biological image data, providing unprecedented visual evidence for understanding gene function.
[0018] 3. Facilitating New Biological Discoveries: This method not only verifies known gene-phenotype associations but also, through its powerful explanatory capabilities, supplements undiscovered biological mechanisms within these associations. More importantly, it can provide functional hypotheses for newly discovered gene loci, accelerating the translation from association signals to biological mechanisms.
[0019] 4. High versatility and flexibility: The framework of this invention has good versatility and can be widely applied to image data of multiple species, including humans, animals, and plants (such as fundus images, CT scans, crop morphology images, etc.). The modular design also allows for flexible replacement of components (such as encoders, generators, and orientation discovery algorithms) to adapt to the needs of different data types. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the generator and training process of the present invention; Figure 2 This is a schematic diagram of the encoder and training of the present invention; Figure 3 This is a schematic diagram illustrating the acquisition of interpretable basis vectors according to the present invention; Figure 4 This is a schematic diagram illustrating the acquisition of image variation phenotypes according to the present invention; Figure 5 This is a schematic diagram illustrating the interpretable analysis of image variation phenotypes according to the present invention; Figure 6 This is a schematic diagram of the encoder and generator of the present invention; Figure 7 This is a schematic diagram of the cross-modal multi-head attention module of the present invention; Figure 8 This is a schematic diagram of the image variation phenotype extraction based on interpretability according to the present invention. Detailed Implementation
[0021] To facilitate understanding and implementation of the present invention by those skilled in the art, the present invention will be further described in detail below with reference to embodiments. The embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0022] Example 1: A generative AI-based method for genetic analysis of image variant phenotypes includes the following steps: Step 1: Obtain the original biological image dataset and preprocess it to obtain the preprocessed biological image dataset. This includes the following steps: Step 1.1: Obtain the original biological image dataset; This embodiment presents three types of raw biological datasets and corresponding preprocessing methods. The three types of raw biological datasets include a human retinal fundus dataset, a domestic pigeon iris dataset, and a potted rice dataset. The method of this invention is not limited to these three types of raw biological datasets and can also use other raw biological datasets.
[0023] Step 1.2: Preprocess the original biological dataset to obtain the preprocessed biological dataset. The preprocessing specifically includes the following steps: Step 1.2.1, Quality Control and Screening: First, the original biological image data in the original biological image dataset is manually screened to remove the original biological image data with poor quality. The remaining original biological image data constitutes the biological image dataset after quality screening.
[0024] Step 1.2.2, Region of Interest (ROI, i.e., the region in the original biological image data that represents the core biological features of the organism): Using cropping or deep learning segmentation models, the ROI, which includes the core biological features (such as the retina, iris, and rice plant), is separated from the background or irrelevant regions of the original biological image data to obtain the biological image data after region filtering. All the biological image data after region filtering constitute the biological image dataset after region filtering.
[0025] Step 1.2.3: In order to eliminate the size and position deviations caused by inconsistent shooting distances and angles, the biological image dataset after region filtering is standardized and centered to obtain standardized biological image data. All standardized biological image data constitute a standardized biological image dataset. In some embodiments, the biological image data after region filtering can be uniformly squared by pasting the ROI to the center of a blank square canvas of uniform size, or by filling the biological image data after region filtering with zero pixels. This ensures that the ROI, including the core biological features, is centered and will not undergo geometric distortion during subsequent scaling, thus completing the standardization and centering processing of the biological image data after region filtering.
[0026] Step 1.2.4 Finally, the standardized biological image dataset is uniformly scaled: all standardized biological image data are uniformly scaled to a set resolution to obtain preprocessed biological image data. All preprocessed biological image data constitute the preprocessed biological image dataset, which can be used as the standard input for subsequent deep learning models.
[0027] In some embodiments, for the human retinal fundus image dataset, the human retinal fundus image data can be collected from the UK Biobank (UKB) and the EyePACS dataset on the Kaggle platform. The preprocessing of the human retinal fundus image dataset includes the following steps: first, the central circular region is detected and cropped using the Hough transform algorithm, and finally, images with extreme brightness values (0.5% at the highest and lowest) are removed to ensure data quality.
[0028] In some embodiments, the images of the domestic pigeon iris dataset are mainly crawled from public channels such as the Youth Pigeon Information Network through web crawlers, supplemented by samples taken by researchers themselves. The preprocessing of the images of the domestic pigeon iris dataset includes the following steps: First, a U-Net semantic segmentation model is trained to automatically segment the iris region. Then, the iris region is cropped and filled with zero pixels to form a square to keep the iris centered. Finally, all images are uniformly adjusted to 512×512 pixels to eliminate differences in position and size.
[0029] In some embodiments, the potted rice dataset is obtained by imaging 529 rice germplasms from 15 different lateral angles at 22 developmental time points. The preprocessing of the images of the potted rice dataset includes the following steps: first, the foreground of the plant in the image is cropped out, then it is pasted into the center of a blank square image of uniform size, and finally uniformly scaled to 256×256 pixels to avoid distortion caused by direct scaling.
[0030] Step 2: Construct a phenotypic analysis model, set the total loss function, and train the phenotypic analysis model using the preprocessed biological image dataset. This includes the following steps: The phenotypic analysis model includes a generator and an encoder. The encoder outputs biological image data in an extended latent space. The latent vectors of the layers are respectively The generator will The latent vectors of the layer are decoded to reconstruct biological image data.
[0031] Step 2.1: Build and train the generator. After training, save the model parameters to obtain the trained generator. This includes the following steps: Step 2.1.1: Construct the generator. The generator uses a style-based generative adversarial network, StyleGAN2. StyleGAN2 learns the intrinsic distribution of image data through unsupervised learning. StyleGAN2 includes a mapping network and a synthesis network. .
[0032] Mapping networks are used to map data from standard Gaussian distributions. The initial latent vectors of the intermediate sampling are mapped to an intermediate extended latent space. Mapping networks include Affine transformation A at each level, with initial implicit vectors respectively undergoing... A affine transformation A at each level maps to an intermediate extended latent space. The affine transformations A at different levels output their corresponding latent vectors, the th... The latent vectors output by each level of affine transformation are denoted as latent vectors. , Take 1~ .
[0033] In the standard StyleGAN, the entire synthesis network uses the same source... Latent vectors in space However, in order to achieve more refined control over different levels of image features (such as contours, textures, and colors), the StyleGAN2 generative adversarial network in this embodiment employs an extended latent space. Expanding the hidden space yes The space is expanded by copying and extending a single implicit vector into a set of vectors.
[0034] Synthetic Networks (Synthesis network) is used to decode latent vectors into images; the synthesis network... Each layer can receive an independent latent vector as input, and the mathematical relationship of the image generation process can be optimized as follows: ,in This represents a set of hidden vectors injected into different layers of the synthetic network (i.e. ~ This allows for decoupled control of the image generation process.
[0035] Step 2.1.2, Generator Training: Construct an unconditional generator to perform unsupervised learning on the input preprocessed biological image dataset to approximate the spatial distribution of the image data. The termination conditions are: the accuracy of the discriminator output on the preprocessed biological image data and the reconstructed biological image data approaches 0.5 (that is, the reconstructed biological image data generated by the generator can no longer be distinguished by the discriminator as real or fake), or the maximum number of pre-set training rounds is reached, or the early stopping strategy is satisfied.
[0036] Step 2.2: With the generator parameters trained and fixed, construct an encoder model and train it, specifically including the following steps: Step 2.2.1: Construct the encoder, which includes a backbone network based on Swing Transformer, a multi-layer cross-modal multi-head attention module (X-MHA), and a sequence of learnable tokens (including a set of learnable tokens). In this process, the preprocessed biological image data is input into a Swing Transformer-based backbone network, which outputs a series of local image features with different spatial resolutions, denoted as LIF1~LIF1. n The j-th local feature map is denoted as LIF. j j is the index, which can be 1 to n, from LIF1 to LIF n The spatial resolution decreases sequentially, and the local feature maps capture information from the preprocessed biological image data at different scales (including shallow layers capturing edges, contours, shapes, etc., and deep layers capturing semantic information). In this embodiment, the backbone network based on SwinTransformer outputs local feature maps LIF1~LIF4. n The local feature maps LIF1 are obtained after passing through a convolutional module (CONV). * ~LIF n * .
[0037] The minimum resolution local feature map LIF4 is then passed through a convolutional layer (CONV) and an average pooling layer (AVGPooling), and finally compressed into a single global feature vector (Global ImageFeature) that incorporates global information. The resulting global feature vector GIF has a dimension of [missing information]. The global feature vector summarizes the macroscopic information of the entire input image, and then through repeated operations, a dimension of [missing information] is obtained. Global Feature Vector GIF * ,in, This represents the number of channels.
[0038] The multi-layered cross-modal multi-head attention module includes multiple X-MHA modules. The number of X-MHA modules is the same as the number of local feature maps output by the SwinTransformer-based backbone network, and they are denoted as X-MHA1 to X-MHA1 respectively. n The j-th X-MHA module is denoted as X-MHA. j ; In this embodiment, the multi-layered cross-modal multi-head attention module includes a four-layered X-MHA module.
[0039] When j is 1, the initialized learnable token is passed through a fully connected layer (MLP) and then compared with the local feature map LIF4. * They are input together into the j-th X-MHA module; When j is between 2 and m, the input of the j-th X-MHA module is the feature map X. j-1* Feature map X j-1 * The feature map X is obtained by passing the output feature map of the (j-1)th X-MHA module through an upsampling module (UP). j-1 Feature map X j-1 Then, with local feature maps LIF 5-j * The feature map X is obtained after addition. j-1 * The upsampling module is used to compare the output feature map of the (j-1)th X-MHA module with the local feature map LIF. 5-j * Align in spatial dimensions.
[0040] Finally, the nth X-MHA module outputs an optimized sequence of learnable tokens with dimension . At this point, the optimized learnable token sequence has fully absorbed multi-scale local detail information from the image after flowing through all X-MHA modules.
[0041] Global Feature Vector GIF * The optimized learnable token sequence is fused with the optimized learnable token sequence through an addition operation to obtain a dimension of The latent vectors are used to fuse global information from the image. The latent vectors are the final output of the encoder; the learnable token sequences can be regarded as the "embryos" of the variant phenotypes of the final output image, which will continuously absorb information from the image in the subsequent fusion process.
[0042] The X-MHA module described in this invention employs a dual-path cross-attention structure to achieve bidirectional information fusion between local features and global tokens. The dual-path cross-attention structure includes a token-side information interaction path and a local feature map-side information interaction path. Specifically, the j-th cross-modal multi-head attention X-MHA is as follows: The input to the token-side information interaction path includes a learnable token sequence (dimension: The number of tokens in the learnable token sequence is (Number) are used as the query matrix, and the local feature map LIF after Flattening operation is also used. j * (Original dimension is) The dimensions after flattening are ,in and These are the height and width of the feature map, respectively. The key and value matrices are calculated as follows: The query matrix, key matrix, and value matrix are then processed using a multi-head cross-attention mechanism. This allows the learnable token sequence to absorb local detail information through interaction with local feature maps. After the multi-head cross-attention mechanism, the sequence is processed sequentially through residual connections and layer normalization operations (Add & Norm operations), a feedforward network (FFN), and another residual connection and layer normalization operation to output an updated learnable token sequence (dimension preserved). The updated learnable token sequence output carries fused local details.
[0043] The multi-head cross-attention calculation mechanism is based on the following formula: (1); in, , , The first The query matrix, key matrix, and value matrix of each header. For key The transpose of the matrix, For attention function; The index represents the attention head, used to distinguish different attention sub-heads in multi-head attention. In the mechanism of multi-head cross-attention calculation, the query matrix, key matrix, and value matrix are split into multiple sub-matrices (i.e., "heads") according to the feature dimension, and attention is calculated independently for each sub-matrix. Used to identify the first one Height, The range of values is ,in The total number of attention heads is set by the multi-head cross-attention calculation mechanism. In this embodiment, the total number of attention heads is... If it is 4, then ; As a feature dimension, in multi-head cross-attention, The feature dimension of a single attention head (i.e., the sub-vector dimension of the query matrix, key matrix, or value matrix for each head), and the total feature dimension of the model in this embodiment. Total number of attention points The total dimension will be evenly distributed among the heads, therefore... .
[0044] function Based on the following formula: (2); in, For function Input, The input is , This indicates the length of the key matrix in the current attention calculation. The specific value dynamically adapts to the sequence length based on the source of the key (K) (image features or tokens). For serial number, .
[0045] In the local feature map side information interaction path, the local feature map LIF after Flatten operation is... j * ( (dimension) ) as the query matrix, and the learnable token sequence (dimension) The query matrix, key matrix, and value matrix are used as the key and value matrices. Next, a multi-head cross-attention mechanism is applied to the query matrix, key matrix, and value matrix, allowing the local feature map to acquire global context information through interaction with the token sequence. After computation via the multi-head cross-attention mechanism, the features are processed sequentially through residual connections and layer normalization operations, a feedforward network (FFN), and another residual connection and layer normalization operation. Finally, a reshape operation restores the feature dimensions to their original values. Output spatial dimension aligned updated local feature maps (LIF) j * The updated local feature map LIF j * It possesses enhanced global semantic understanding capabilities.
[0046] Through the aforementioned dual-path structure, the X-MHA module achieves bidirectional information interaction and fusion between local feature maps and token sequences. This not only enhances the token sequence's ability to capture local details but also strengthens the local feature map's ability to perceive the global context, providing subsequent processing modules with feature inputs that combine local details and global semantics.
[0047] Step 2.2.2: Construct the total loss function for encoder training. The encoder is trained and optimized by minimizing the reconstruction loss between the preprocessed biological image data and the reconstructed biological image data. The total loss function is as follows: (3); In the formula, The total loss function between the preprocessed biological image data and the reconstructed biological image data is... The mean squared error loss between the preprocessed biological image data and the reconstructed biological image data. Mean square error loss The weight, The loss is calculated based on the learned perceptual image patch similarity based on the features of the pre-trained VGG network. For loss The weights (which can be set independently; in this embodiment,) =1.0, The value is 0.8 in the rice data and 4 in other data (loss). Calculated based on the following formula: (4); In the formula, It is the L2 norm. For preprocessed biological image data, To reconstruct biological image data; after training, the encoder can quickly "invert" any new image into its precise latent vector representation in the generator's latent space.
[0048] Step 3: Decouple the extended latent space using a data-driven approach to construct... Given a set of independent or orthogonal interpretable basis vectors, The latent vectors of the layers are projected onto... Given interpretable basis vectors, we obtain... One image variant phenotype; specifically including the following steps: Step 3.1: Within the generator's latent space, use data-driven methods (such as Independent Component Analysis (ICA) or Principal Component Analysis (PCA)) to expand the latent space. Decouple and identify A number of independent or The mutually orthogonal directions each represent an interpretable basis, and each direction corresponds to an independent, interpretable image variation trend (such as the overall color intensity, the size of a specific structure, the coarseness of texture, etc.). Each interpretable basis is constructed into an interpretable basis vector, specifically including the following steps: Extended hidden space of generators Although low-dimensional, complex entanglements may exist between its different dimensions. To obtain the direction corresponding to a specific, single phenotypic variation, this step expands the latent space. Decouple them.
[0049] Step 3.1.1 First, the preprocessed biological image dataset is used to generate a latent vector sample set through a trained generator. The latent vector sample set includes a large number (e.g., 100,000) of latent vector samples.
[0050] Step 3.1.2: Apply Independent Component Analysis (ICA) to the latent vector sample set to expand the latent space. Decouple and calculate the extended latent space. Using 10 mutually independent directions as interpretable bases, each interpretable base is constructed into an interpretable basis vector, thus constructing... A set of mutually independent interpretable basis vectors; or, Principal Component Analysis (PCA) is used to extend the latent space of the latent vector sample set. Decouple and calculate the extended latent space. Using mutually orthogonal directions as interpretable bases, each interpretable base is constructed into an interpretable basis vector, thus constructing... One interpretable basis vector; Step 3.2, based on Using interpretable basis vectors, image variation phenotypes are extracted, specifically including the following steps: Step 3.2.1: Input the preprocessed biological image data into the trained encoder to obtain the preprocessed biological image data in the extended latent space. In Hidden vectors of layers ; Step 3.2.2, the first Hidden vectors of layers Projected to Given interpretable basis vectors, obtain The scalar value of each projection vector is used as a quantitative trait and is defined as an image variation phenotype (IVP).
[0051] Step 3.2.3: Repeat step 3.2.2 until... The latent vectors of the layer are all projected to Given interpretable basis vectors, obtain Each image variant phenotype constitutes an image variant phenotype set (IVPs) corresponding to the preprocessed biological image data.
[0052] For example, if 30 interpretable basis vectors are found, and the latent space is expanded... With 14 layers, each preprocessed biological image data can ultimately yield 420 image variant phenotypes.
[0053] Step 4: Perform genome association analysis (GWAS) and threshold correction on each image variant phenotype to identify the corresponding genetic loci for each image variant phenotype. Specifically: Step 4.1.1: For each image variant phenotype in the image variant phenotype set IVPs, use standard genome association analysis (GWAS, such as mixed linear model (MLM)) and a strict threshold correction method (such as Bonferroni correction) to control false positives caused by multiple testing. Analyze its association with genome-wide genetic variations (such as SNPs) to identify the genomic regions (sites) that are significantly associated with each image variant phenotype in the organism. Finally, construct the genetic loci that are significantly associated with the image variant phenotype set IVPs.
[0054] Step 5: Perform a linear traversal of each image variant phenotype in the latent space along the corresponding interpretable basis vectors, and use the trained generator to decode each point on the traversal path into a biological image data. After the traversal is completed, a set of biological image data corresponding to each image variant phenotype is obtained, and interpretable analysis based on visualization of the set of biological image data corresponding to each image variant phenotype is performed. Specifically, this includes the following steps: Step 5.1: For IVPs that show significant signals in the association analysis, perform a linear traversal in the latent space along their corresponding interpretable direction, and use a generator to decode each point on the traversal path into a high-quality image.
[0055] For an image variation phenotype in which a significant signal is detected in GWAS, find its corresponding interpretable basis vectors. and the corresponding hierarchy of the hidden space .
[0056] Linear traversal within the latent space is based on the following formula: (5); In the formula, For the change, For the first The latent vectors of the layer, For the first Interpretable basis vectors For the new latent vector, i.e. Centered on, in direction A linear shift is performed on the vector to generate a series of new latent vectors; And new biological image data are generated using the new latent vectors based on the following formula: (6); In the formula, To generate new biological image data using new latent vectors, This is the synthesis network for the generator.
[0057] Step 5.2, Explanation of Biological Mechanisms: By observing the series of images generated in Step 3.2, the phenotypic change trends (such as the gradual changes in size, color, and texture) controlled by a single IVP can be visually observed, thereby explaining how candidate genes associated with this IVP regulate the corresponding traits and gaining insights into the biological mechanisms.
[0058] A new set of biological image data is generated and displayed side by side. The observer can clearly see that, as... The changes in values indicate a smooth, continuous alteration of a specific feature in the image. For example, in human fundus images, one might observe a gradual lightening of the optic disc, thickening of blood vessels, or worsening of macular degeneration. This visual change represents the biological significance of the image variation phenotype. Because this image variation phenotype is significantly associated with a specific gene locus, this series of images visually reveals how allele variations at that locus affect retinal morphology or pathological features, thus providing strong, visual evidence for understanding gene function.
[0059] This invention successfully transforms complex, high-dimensional image data into a series of quantifiable and interpretable phenotypes, and "decodes" abstract genetic association signals into intuitive visual evidence through generative models, greatly advancing the application of image data in genetic research.
[0060] It should be noted that the embodiments described in this invention are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains can make various modifications or additions to the described embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.
Claims
1. A genetic analysis method for image variation phenotypes based on generative AI, characterized in that, Includes the following steps: Step 1: Obtain the original biological image dataset and preprocess it to obtain the preprocessed biological image dataset. Step 2: Construct a phenotypic analysis model, set the total loss function, and train the phenotypic analysis model using the preprocessed biological image dataset; The phenotypic analysis model includes a generator and an encoder, with the encoder outputting biological image data in an extended latent space. The latent vectors of the layers are respectively The generator will The latent vectors of the layer are decoded to reconstruct biological image data; Step 3: Decouple the extended latent space using a data-driven approach to construct... Given a set of independent or orthogonal interpretable basis vectors, The latent vectors of the layers are projected to... Given interpretable basis vectors, we obtain... Individual image variant phenotypes; Step 4: Perform genome association analysis (GWAS) and threshold correction on each image variant phenotype to identify the genetic loci corresponding to each image variant phenotype; Step 5: Perform a linear traversal of each image variant phenotype in the latent space along the corresponding interpretable basis vector, and use the trained generator to decode each point on the traversal path into a biological image data. After the traversal is completed, a set of biological image data corresponding to each image variant phenotype is obtained, and interpretable analysis of a set of biological image data based on visualization is performed for each image variant phenotype.
2. The method for genetic analysis of image variation phenotypes based on generative AI according to claim 1, characterized in that, The preprocessing in step 1 specifically includes the following steps: Step 1.2.1: Perform preliminary screening on the original biological image dataset by human intervention, remove the original biological image data with poor quality, and the remaining original biological image data constitute the biological image dataset after quality screening. Step 1.2.2: Separate the Region of Interest (ROI) containing the core biological features from the background or irrelevant regions of the original biological image data to obtain the biological image dataset after region filtering. Step 1.2.3: Standardize and center the biological image dataset after region filtering to obtain a standardized biological image dataset; Step 1.2.4: Scale the standardized biological image dataset to a set resolution to obtain the preprocessed biological image dataset.
3. The method for genetic analysis of image variation phenotypes based on generative AI according to claim 1, characterized in that, The generator employs a style-based generative adversarial network, StyleGAN2. The encoder includes a Swin Transformer-based backbone network, a multi-layered cross-modal multi-head attention X-MHA, and a learnable token sequence. Preprocessed biological image data is input into the Swin Transformer-based backbone network, which outputs local feature maps LIF1~LIF with different spatial resolutions. n Local feature maps LIF1~LIF n Local feature maps LIF1 are obtained after passing through convolutional modules. * ~LIF n * ; where the j-th local feature map is denoted as LIF j j is the index, which can be 1 to n, and n is the total number of local feature maps; The minimum resolution local feature map LIF4 is then passed through convolutional layers and average pooling layers to obtain the global feature vector GIF. The dimension of the global feature vector GIF is... The global feature vector GIF is then processed repeatedly to obtain a dimension of... Global Feature Vector GIF * ;in, Number of channels; The multi-layered cross-modal multi-head attention module includes multiple X-MHA modules. The number of X-MHA modules is the same as the number of local feature maps output by the SwinTransformer-based backbone network. The multiple X-MHA modules are designated as X-MHA1 to X-MHA2. n The j-th X-MHA module is X-MHA j ; When j is 1, the initialized learnable token sequence is passed through a fully connected layer and then combined with the local feature map LIF4. * They are input together into the j-th X-MHA module; When j is 2 to n, the input of the j-th X-MHA module is the feature map X. j-1 * Feature map X j-1 * The feature map X is obtained by upsampling the output feature map of the (j-1)th X-MHA module as follows: j-1 Feature map X j-1 Then, with local feature maps LIF n+1-j * The feature map X is obtained after addition. j-1 * ; The nth X-MHA module outputs preprocessed biological image data in the extended latent space. Hidden vectors of the layer.
4. The method for genetic analysis of image variation phenotypes based on generative AI according to claim 1, characterized in that, The total loss function is calculated based on the following formula: ; In the formula, The total loss function between the preprocessed biological image data and the reconstructed biological image data is... The mean squared error loss between the preprocessed biological image data and the reconstructed biological image data. Mean square error loss The weight, The loss is calculated based on the learned perceptual image patch similarity based on the features of the pre-trained VGG network. For loss Weights, Losses Calculated based on the following formula: ; In the formula, It is the L2 norm. For preprocessed biological image data, To reconstruct biological image data; The training of the phenotypic analysis model includes the following process: first, the generator is trained, and after the generator training is completed, the generator model parameters are saved; then, the encoder is trained, and after the encoder training is completed, the model parameters are saved.
5. The method for genetic analysis of image variation phenotypes based on generative AI according to claim 3, characterized in that, The cross-modal multi-head attention X-MHA includes a dual-path cross-attention structure, which comprises a token-side information interaction path and a local feature map-side information interaction path. The j-th cross-modal multi-head attention X-MHA is specifically as follows: The input to the token-side information interaction path includes a learnable token sequence and a Local Feature Map (LIF) processed by the Flatten operation. j * First, the token sequence can be learned as a query matrix, and the local feature map LIF is processed by the Flatten operation. j * The query matrix, key matrix, and value matrix are used as key and value matrices. Next, a multi-head cross-attention mechanism is performed on the query matrix, key matrix, and value matrix. Finally, the result of the multi-head cross-attention mechanism is processed sequentially through residual connections and layer normalization operations, a feedforward network (FFN), and another residual connection and layer normalization operation to output an updated sequence of learnable tokens. In the local feature map side information interaction path, firstly, the local feature map LIF after Flatten operation is processed. j * As the query matrix, the token sequence can be learned as the key matrix and value matrix; secondly, the query matrix, key matrix, and value matrix undergo a multi-head cross-attention mechanism; finally, the result of the multi-head cross-attention mechanism is processed sequentially through residual connections and layer normalization operations, a feedforward network (FFN), and residual connections and layer normalization operations, and then the feature dimensions are restored through a reshape operation. Output the updated local feature map LIF j * ; The updated learnable token sequence output from the token-side information interaction path and the updated local feature map (LIF) output from the local feature map-side information interaction path. j * Together, they constitute the output feature map of the j-th cross-modal multi-head attention X-MHA; The updated learnable token sequence output by the token-side information interaction path of the j-th cross-modal multi-head attention X-MHA is the preprocessed biological image data in the extended latent space. Hidden vectors of the layer.
6. The method for genetic analysis of image variation phenotypes based on generative AI according to claim 5, characterized in that, The multi-head cross-attention mechanism is calculated based on the following formula: ; in, , , The first The query matrix, key matrix, and value matrix of each header. , It is the total number of attention heads set in the multi-head cross-attention calculation mechanism. For key The transpose of the matrix, Let be the attention function. For feature dimensions; function Based on the following formula: ; In the formula, For function Input, The input is , The length of the key matrix. For serial number, .
7. The method for genetic analysis of image variation phenotypes based on generative AI according to claim 1, characterized in that, Step 3 specifically includes the following steps: Step 3.1, construct The process involves identifying mutually independent or orthogonal interpretable basis vectors, specifically including the following steps: Step 3.1.1: Use the preprocessed biological image dataset to generate a latent vector sample set through the trained generator; Step 3.1.2: Apply Independent Component Analysis (ICA) to the latent vector sample set to expand the latent space. Decouple and calculate the extended latent space. Using 1 set of mutually independent directions as interpretable bases, each interpretable base is constructed into an interpretable basis vector, thus constructing... A set of mutually independent interpretable basis vectors; or, Principal Component Analysis (PCA) is used to extend the latent space of the latent vector sample set. Decouple and calculate the extended latent space. Using mutually orthogonal directions as interpretable bases, each interpretable base is constructed into an interpretable basis vector, thus constructing... One interpretable basis vector; Step 3.2, based on Using interpretable basis vectors, image variation phenotypes are extracted, specifically including the following steps: Step 3.2.1: Input the preprocessed biological image data into the trained encoder to obtain the preprocessed biological image data in the extended latent space. In Hidden vectors of layers ; Step 3.2.2, the first Hidden vectors of layers Projected to Given interpretable basis vectors, obtain Each projection vector has a scalar value, and each scalar value of a projection vector represents an image variant phenotype (IVP); where... For direction index, , Let be the total number of interpretable basis vectors. For serial number, ; Step 3.2.3: Repeat step 3.2.2 until... The latent vector data of the layer are all projected to Given interpretable basis vectors, obtain Each image variant phenotype constitutes an image variant phenotype set (IVPs) corresponding to the preprocessed biological image data.
8. The method for genetic analysis of image variation phenotypes based on generative AI according to claim 1, characterized in that, Step 5, which involves performing a linear traversal in the latent space, is based on the following formula: ; In the formula, For the change, For the first The latent vectors of the layer, For the first Interpretable basis vectors For the new latent vector, i.e. Centered on, in direction A linear shift is performed on the vector to generate a series of new latent vectors; And new biological image data are generated using the new latent vectors based on the following formula: ; In the formula, To generate new biological image data using new latent vectors, This is the synthesis network for the generator.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the genetic analysis method for image variant phenotypes based on generative AI as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the genetic analysis method for image variant phenotypes based on generative AI as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Editable condition printing image generation method
CN119227549A
Image recognition and analysis system based on AI
CN120495674A
Method for unsupervised identification of single-cell morphological profiling based on deep learning
US20240112026A1