A method and system for biological geographic ancestor inference based on residual feature fusion

CN122930207APending Publication Date: 2026-10-16INST OF FORENSIC SCI OF MIN OF PUBLIC SECURITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611066582.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0003]然而,现有方法在处理遗传结构复杂的细粒度人群时仍存在明显局限:主流模型将祖先推断建模为离散分类任务,仅能输出概率标签而无法提供连续地理坐标;以坐标回归为目标的方法虽可输出经纬度预测值,却缺乏与离散参考人群的定性对应能力,导致定量定位与定性人群归属两类需求无法在同一框架内协同满足,制约了该技术在法医实践中的应用

Benefits of technology

输出模块:用于根据所述最终预测坐标计算所述待测样本与多个参考人群之间的球面几何距离,并结合人群距离似然比对所述待测样本进行人群映射,获得人群归属标签。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122930207A_ABST
    Figure CN122930207A_ABST
Patent Text Reader

Abstract

The present application relates to the field of bioinformatics, and provides a biological geographical ancestor inference method and system based on residual feature fusion. The method comprises the following steps: quality control is performed on a reference genotype dataset; genetic dimension reduction is performed on the quality-controlled genotype dataset to obtain a reference principal component feature vector and a reference ancestral component feature vector; a double-path prediction model is used to obtain double-path prediction coordinates; a residual correction model is obtained by fitting the deviation between the double-path prediction coordinates and the true geographical coordinates; the genotype data of a to-be-tested sample and the quality-controlled genotype data are combined and then subjected to genetic dimension reduction; based on the double-path basic prediction model and the residual correction model, final prediction coordinates are output; the spherical geometric distance between the to-be-tested sample and multiple reference populations is calculated, and the to-be-tested sample is subjected to population mapping to obtain a population attribution label. The present application improves the accuracy of biological geographical ancestral inference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of bioinformatics technology, and in particular to a method and system for inferring biogeographical ancestors based on residual feature fusion. Background Technology

[0002] Biogeographical ancestry inference is a technique that uses the analysis of an individual's genome data to trace their ancestral geographical origins. It has significant applications in forensic genetics, precision medicine, and population genetics. With the rapid development of high-throughput sequencing technology and the continuous expansion of human genome data, ancestry inference methods based on single nucleotide polymorphisms have been extensively studied. Principal component analysis, ancestry clustering analysis, and machine learning models have been introduced into this field, providing diverse technical pathways for biogeographical ancestry inference.

[0003] However, existing methods still have significant limitations when dealing with fine-grained populations with complex genetic structures: mainstream models model ancestor inference as a discrete classification task, which can only output probability labels and cannot provide continuous geographic coordinates; while methods with coordinate regression as the target can output latitude and longitude predictions, they lack the ability to qualitatively correspond to discrete reference populations. This results in the inability to coordinate the two types of needs, namely quantitative location and qualitative population attribution, within the same framework, which restricts the application of this technology in forensic practice. Summary of the Invention

[0004] This invention provides a biogeographical ancestor inference method and system based on residual feature fusion to overcome the shortcomings of existing technologies.

[0005] This invention provides a biogeographical ancestor inference method based on residual feature fusion, comprising: S1. Perform quality control on the reference genotype dataset to obtain the quality control genotype dataset; S2. Perform genetic dimensionality reduction on the quality control genotype dataset to obtain the reference principal component feature vector and the reference ancestor component feature vector. S3. Input the reference principal component feature vector and the reference ancestor component feature vector into the dual-path basic prediction model to obtain the dual-path prediction coordinates; S4. Using the dual-path predicted coordinates as input, the deviation between the dual-path predicted coordinates and the actual geographic coordinates is fitted by the residual stacking strategy to obtain the residual correction model. S5. Merge the genotype data of the sample to be tested with the quality control genotype dataset, perform genetic dimensionality reduction under a unified genetic background coordinate system, and obtain the feature vectors of the principal components to be tested and the feature vectors of the ancestral components to be tested. S6. Input the feature vector of the principal component to be tested and the feature vector of the ancestor component to be tested into the dual-path basic prediction model and the residual correction model in sequence, and output the final predicted coordinates of the sample to be tested; S7. Calculate the spherical geometric distance between the test sample and multiple reference populations based on the final predicted coordinates, and perform population mapping on the test sample by combining the population distance likelihood ratio to obtain the population affiliation label.

[0006] According to the biogeographical ancestor inference method based on residual feature fusion provided by the present invention, step S1 further includes: S11. Perform site filtering on the original genotype data in the reference genotype dataset to obtain preliminary filtered genotype data; S12. Perform linkage disequilibrium pruning on the preliminarily filtered genotype data to obtain a set of low-linkage independent SNP sites. S13. Merge and align the multi-source heterogeneous genotype data with the set of low-linkage independent SNP sites to obtain the quality control genotype dataset.

[0007] According to the biogeographical ancestor inference method based on residual feature fusion provided by the present invention, in step S11, the thresholds used for site filtering include: a deletion rate threshold, a minimum allele frequency threshold, and a Hardy-Weinberg equilibrium test threshold.

[0008] According to the biogeographical ancestor inference method based on residual feature fusion provided by the present invention, step S2 specifically includes: Principal component analysis was performed on the quality control genotype dataset to extract a preset number of principal components and obtain reference principal component feature vectors. The quality control genotype dataset is subjected to model-based ancestry clustering analysis with a preset number of ancestral populations to obtain a reference ancestral component feature vector that reflects the proportion of potential ancestral composition of multiple individuals.

[0009] According to the biogeographical ancestor inference method based on residual feature fusion provided by the present invention, step S3 further includes: S31. The reference principal component feature vector and the reference ancestor component feature vector are column-concatenated and fused to obtain a direct fused feature matrix, and the direct fused feature matrix is ​​input into the first path basic regression model to obtain the first path prediction coordinates. S32. The reference principal component feature vector and the reference ancestor component feature vector are interactively aligned through a bidirectional cross-attention module to obtain an interactive fusion feature vector; S33. After performing splicing and projection processing on the interactive fusion feature vector, the reference principal component feature vector, and the reference ancestor component feature vector, input the second path basic regression model to obtain the second path prediction coordinates. S34. The first path prediction coordinates and the second path prediction coordinates are averaged and merged to obtain dual path prediction coordinates.

[0010] According to the biogeographical ancestor inference method based on residual feature fusion provided by the present invention, step S32 further includes: S321. The reference principal component feature vector and the reference ancestor component feature vector are projected to the shared latent space through learnable linear transformations to obtain the latent representations of the principal components and the latent representations of the ancestor components. S322. Using the implicit representation of the principal component as the query and the implicit representation of the ancestor component as the key-value pair, perform a first-direction cross-attention calculation to obtain a first attention output from the principal component to the ancestor component; using the implicit representation of the ancestor component as the query and the implicit representation of the principal component as the key-value pair, perform a second-direction cross-attention calculation to obtain a second attention output from the ancestor component to the principal component. S323. The principal component hidden representation, the ancestor component hidden representation, the first attention output and the second attention output are concatenated and processed by a feedforward neural network and layer normalization to obtain an interactive fusion feature vector.

[0011] According to the biogeographical ancestor inference method based on residual feature fusion provided by the present invention, step S4 further includes: S41. Calculate the mean value of the dual-path predicted coordinates and the first path predicted coordinates and the second path predicted coordinates to obtain the mean coordinates. S42. The first path prediction coordinates, the second path prediction coordinates and the mean coordinates are used as joint inputs and fed into the first multilayer perceptron regressor and the second multilayer perceptron regressor respectively to fit the latitude prediction residuals and longitude prediction residuals respectively to obtain the residual correction model. S43. Based on the five-fold cross-validation on the preset reference dataset, the hyperparameters of the dual-path basic prediction model and the residual correction model are continuously optimized to obtain the optimal hyperparameter configuration.

[0012] According to the biogeographical ancestor inference method based on residual feature fusion provided by the present invention, step S6 further includes: S61. The feature vectors of the principal components to be tested and the feature vectors of the ancestor components to be tested are processed by the first path basic regression model and the second path basic regression model in sequence to obtain the predicted coordinates of the first path and the predicted coordinates of the second path to be tested, and the mean is merged to obtain the predicted coordinates of the dual paths to be tested. S62. Using the predicted coordinates of the first path to be measured, the predicted coordinates of the second path to be measured, and the predicted coordinates of the dual paths to be measured as joint inputs, the latitude residual correction and longitude residual correction are output through the first multilayer perceptron regressor and the second multilayer perceptron regressor, respectively. S63. Add the latitude mean of the predicted coordinates of the dual-path to be measured to the latitude residual correction amount, and add the longitude mean of the predicted coordinates of the dual-path to be measured to the longitude residual correction amount to obtain the final predicted coordinates.

[0013] According to the biogeographical ancestor inference method based on residual feature fusion provided by the present invention, step S7 further includes: S71. Based on the final predicted coordinates, calculate the spherical geometric distance between the test sample and all known sampling coordinates of multiple reference groups in the preset reference dataset one by one using the Haversine formula, and take the shortest spherical geometric distance among each reference group to obtain the group distance sorting sequence. S72. Using the nearest neighbor reference population distance in the population distance sorting sequence as a benchmark, calculate the population distance likelihood ratio of the test sample belonging to multiple candidate reference populations; S73. Based on the population distance likelihood ratio and the preset likelihood ratio threshold, determine the population affiliation label from the reference population corresponding to the shortest distance in the population distance sorting sequence, and mark the results that exceed the preset likelihood ratio threshold as a conclusion that is not excluded.

[0014] This invention also provides a biogeographical ancestor inference system based on residual feature fusion, used to implement a biogeographical ancestor inference method based on residual feature fusion as described in any of the above claims, comprising: Quality control module: Used to perform quality control on the reference genotype dataset to obtain a quality control genotype dataset; Dimensionality reduction module: used to perform genetic dimensionality reduction on the quality control genotype dataset to obtain the reference principal component feature vector and the reference ancestor component feature vector; First prediction module: used to input the reference principal component feature vector and the reference ancestor component feature vector into the dual-path basic prediction model to obtain dual-path prediction coordinates; Fitting module: Used to fit the deviation between the dual-path predicted coordinates and the real geographic coordinates using a residual stacking strategy, and obtain a residual correction model by taking the dual-path predicted coordinates as input. Merging module: used to merge the genotype data of the sample to be tested with the quality control genotype dataset, perform genetic dimensionality reduction under a unified genetic background coordinate system, and obtain the feature vectors of the principal components to be tested and the feature vectors of the ancestral components to be tested; The second prediction module is used to input the feature vector of the principal component to be tested and the feature vector of the ancestor component to be tested into the dual-path basic prediction model and the residual correction model in sequence, and output the final predicted coordinates of the sample to be tested. Output module: used to calculate the spherical geometric distance between the test sample and multiple reference populations based on the final predicted coordinates, and to perform population mapping on the test sample by combining the population distance likelihood ratio to obtain the population affiliation label.

[0015] This invention provides a biogeographical ancestor inference method and system based on residual feature fusion. By constructing a complete end-to-end process covering both the training and inference phases, it unifies quantitative coordinate regression and qualitative population attribution in biogeographical ancestor inference within the same methodological framework. This fundamentally overcomes the limitation of existing methods that can only complete a single task, enabling the inference results to possess both the spatial accuracy of continuous geographic coordinates and the interpretability of discrete population labels, significantly expanding the practical scope of this method in forensic genetics cases. At the feature expression level, this invention implements multi-level quality control processing on the reference genotype data through strict missing rate filtering, minimum allele frequency screening, Hardy-Weinberg equilibrium test, and linkage disequilibrium pruning. The resulting quality control genotype dataset exhibits high polymorphism and low redundancy, laying a reliable data foundation for the accurate extraction of principal component feature vectors and ancestor component feature vectors, effectively reducing the interference of noise sites on model predictions. Furthermore, in the dual-path basic prediction model, the direct fusion path of this invention preserves... The method retains the linear structural information of the original genetic features, while the bidirectional cross-attention path captures the nonlinear semantic association between two types of heterogeneous genetic features by constructing a bidirectional information interaction channel between the principal component latent representation and the ancestor component latent representation. The complementarity of the two paths enables the model to maintain stable coordinate prediction accuracy when facing Asian populations with strong genetic continuity and subtle differences between groups. Secondly, the introduction of the residual stacking strategy in this invention allows the meta-model to specifically correct the systematic prediction bias of the dual-path basic prediction model, achieving a low median error in geolocation on the independent test set and a high likelihood ratio classification accuracy in population mapping, indicating that the method has good generalization ability and robustness in complex genetic backgrounds. In addition, the processing method of merging the genotype data of the test sample and the reference dataset and uniformly extracting dimensionality reduction features in the inference stage ensures that the test sample and the reference population are under the same genetic background coordinate system, avoiding the interference of batch effect on feature projection, and further ensuring the reliability of population attribution labels. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 A schematic diagram of the process for a biogeographical ancestor inference method based on residual feature fusion provided by the present invention; Figure 2 This is a schematic diagram of a biogeographical ancestor inference system based on residual feature fusion, provided by the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, embodiments of this invention, and should not be construed as limiting the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention. In the description of this invention, it should be understood that the terminology used is for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0019] like Figure 1 As shown, this invention provides a biogeographical ancestor inference method based on residual feature fusion, comprising: S1. Perform quality control on the reference genotype dataset to obtain the quality control genotype dataset.

[0020] Step S1 further includes: S11. Perform site filtering on the original genotype data in the reference genotype dataset to obtain preliminary filtered genotype data; among which, the thresholds used for site filtering include: missing rate threshold, minimum allele frequency threshold, and Hardy-Weinberg equilibrium test threshold.

[0021] Furthermore, the reference genotype dataset of this invention is derived from multiple heterogeneous databases and data collected independently by our laboratory, specifically covering whole-genome sequencing data, targeted capture sequencing data, and genotyping microarray data, with the number of original SNPs ranging from hundreds of thousands to tens of millions. Since data from different sources exhibit significant differences in sequencing platforms, coverage depth, and site density, direct merging would introduce a large number of noisy sites. Therefore, in step S11 of this invention, site filtering is first performed on each dataset separately.

[0022] Specifically, this invention filters the proportion of genotype deletions at a given SNP locus for each individual using a deletion rate threshold, removing loci with a deletion rate exceeding 1%. Subsequently, it filters low-polymorphism loci in the population with a minor allele frequency below 1% using a minimum allele frequency threshold. Finally, it removes loci that significantly deviate from Hardy-Weinberg equilibrium using a Hardy-Weinberg equilibrium test threshold. Hardy-Weinberg equilibrium refers to the state in which allele frequencies and genotype frequencies remain stable across generations in an ideal randomly mating population; loci significantly deviating from this state often reflect data quality issues. After these three rounds of filtering, preliminary filtered genotype data is obtained.

[0023] S12. The preliminary filtered genotype data is subjected to linkage disequilibrium pruning to obtain a set of low linkage independent SNP sites.

[0024] In step S12, this invention performs linkage disequilibrium pruning on the initially filtered genotype data. Linkage disequilibrium refers to the phenomenon where alleles between adjacent loci on the genome tend to be co-inherited. A large number of highly linked SNP loci carry redundant genetic information, which can interfere with subsequent principal component analysis and ancestry clustering analysis in estimating population structure. Specifically, this invention employs a sliding window strategy, using 500 SNPs as a window with a step size of 50 for scanning. For locus pairs with a linkage greater than 0.1, one is retained and the other is removed, ultimately resulting in a set of low-linkage independent SNP loci.

[0025] S13. Merge and align the multi-source heterogeneous genotype data with the set of low-linkage independent SNP sites to obtain the quality control genotype dataset.

[0026] After obtaining the set of low-linkage independent SNP loci for each dataset, in step S13 of this invention, the mergeit module of EIGENSOFT software is used to merge and align the datasets from the five sources, take the intersection of the SNP loci of each dataset, and map all individuals to the same locus coordinate system, finally obtaining the quality control genotype dataset.

[0027] S2. Perform genetic dimensionality reduction on the quality control genotype dataset to obtain the reference principal component feature vector and the reference ancestor component feature vector.

[0028] Specifically, step S2 includes: Principal component analysis is performed on the quality control genotype dataset to extract a preset number of principal components and obtain a reference principal component feature vector. Model-based ancestry clustering analysis is then performed on the quality control genotype dataset with a preset number of ancestral populations to obtain a reference ancestral component feature vector that reflects the proportion of potential ancestral composition of multiple individuals.

[0029] In step S2, based on the quality control genotype dataset, the present invention extracts model input features through two genetic dimensionality reduction methods, as detailed below.

[0030] First, this invention performs principal component analysis on the quality control genotype dataset. Specifically, based on principal component analysis, this invention projects the high-dimensional SNP genotype matrix (individual × locus) onto the orthogonal direction that maximizes variance through eigenvalue decomposition of the covariance matrix. Each principal component corresponds to a linear combination direction that captures the maximum genetic variation. After analysis, this invention extracts the first few principal components. The projection values ​​of each individual onto each principal component constitute the reference principal component feature vector for that individual, including corresponding parts reflecting east-west longitude variation and north-south latitudinal gradient.

[0031] Secondly, this invention performs ADMIXTURE ancestral clustering analysis on the quality control genotype dataset with a preset number of ancestral populations (in one specific embodiment, the preset number of ancestral populations is K=6). Specifically, ADMIXTURE is a model based on maximum likelihood estimation, assuming that the genotype of each individual is composed of K hypothetical ancestral populations mixed in a certain proportion, and estimating the composition proportion of each individual in the K ancestral populations through iterative optimization. In implementation, the value of K is predetermined by the cross-validation error minimization criterion, and K=6 corresponds to the most biologically reasonable ancestral population division in this invention. The proportion values ​​of each individual in the 6 ancestral components constitute the reference ancestral component feature vector of that individual. Thus, each individual in the reference set corresponds to a reference principal component feature vector and a reference ancestral component feature vector, both of which serve as inputs to the subsequent dual-path basic prediction model.

[0032] Before inputting the reference principal component feature vector and the reference ancestor component feature vector into the dual-path basic prediction model, this invention conducts a confirmatory analysis on the degree of linear correlation between the extracted genetic dimensionality reduction features and the real geographic coordinates of the samples to confirm that the genetic features have sufficient predictive information for geographic coordinates.

[0033] Specifically, this invention pairs PC1 to PC10 in the principal component eigenvectors with the true longitude and true latitude coordinates of all reference samples, and uses Pearson correlation analysis to calculate the linear correlation coefficient r between each pair of features and coordinates. The Pearson correlation coefficient reflects the direction and strength of the linear association between two continuous variables, ranging from -1 to +1. A larger absolute value indicates a stronger linear association; a positive value indicates a positive association, and a negative value indicates a negative association. Statistical significance is assessed using a two-tailed t-test, and the original p-value is corrected for multiple comparisons using the false discovery rate method. A corrected p-value (Q-value) less than 0.05 is considered statistically significant.

[0034] Based on Pearson analysis, this invention confirms that both the reference principal component eigenvector and the reference ancestor component eigenvector carry genetic structural information that is highly correlated with geographic coordinates, providing a data-level basis for the dual-path basic prediction model to perform coordinate regression using both as inputs.

[0035] S3. Input the reference principal component feature vector and the reference ancestor component feature vector into the dual-path basic prediction model to obtain the dual-path prediction coordinates.

[0036] Step S3 further includes: S31. The reference principal component feature vector and the reference ancestor component feature vector are column-concatenated and fused to obtain a direct fused feature matrix, and the direct fused feature matrix is ​​input into the first path basic regression model to obtain the first path prediction coordinates.

[0037] In step S31, the present invention directly concatenates the reference principal component feature vector and the reference ancestor component feature vector column-wise to form a direct fusion feature matrix. Each row of the matrix corresponds to an individual, and the column dimension is the sum of the number of principal components and the number of ancestor components. Subsequently, the present invention inputs this matrix into the first path basic regression model (TabPFN). The TabPFN is a table-based model based on the Transformer architecture and pre-trained on a large amount of synthetic tabular data. It has context learning capabilities. After input, the model models complex feature interactions under limited samples by alternately performing attention calculations on the sample dimension and the feature dimension, and outputs the latitude and longitude prediction values ​​of each individual to obtain the first path prediction coordinates.

[0038] S32. The reference principal component feature vector and the reference ancestor component feature vector are interactively aligned using a bidirectional cross-attention module to obtain an interactive fusion feature vector.

[0039] Step S32 further includes: S321. The reference principal component feature vector and the reference ancestor component feature vector are projected to the shared latent space through learnable linear transformations to obtain the latent representations of the principal components and the latent representations of the ancestor components.

[0040] In step S32, this invention introduces a bidirectional cross-attention module to perform deep interactive alignment processing on the reference principal component feature vector and the reference ancestor component feature vector. First, in step S321, this invention uses two independent learnable linear transformation matrices to map the reference principal component feature vector and the reference ancestor component feature vector from their respective original dimensions to the same shared latent space dimension, obtaining the principal component latent representation and the ancestor component latent representation, enabling the two heterogeneous features to have the dimensionality condition for attention calculation in the same space.

[0041] S322. Using the implicit representation of the principal component as the query and the implicit representation of the ancestor component as the key-value pair, perform a first-direction cross-attention calculation to obtain a first attention output from the principal component to the ancestor component; using the implicit representation of the ancestor component as the query and the implicit representation of the principal component as the key-value pair, perform a second-direction cross-attention calculation to obtain a second attention output from the ancestor component to the principal component.

[0042] In step S322, the present invention constructs two symmetrical cross-attention flows. The first direction uses the implicit representation of the principal component as the query matrix and the implicit representation of the ancestor component as both the key matrix and the value matrix. After scaling dot product attention calculation, a first attention output from the principal component to the ancestor component is obtained, which reflects the semantic alignment result of the principal component features in the ancestor component space. The second direction uses the implicit representation of the ancestor component as the query matrix and the implicit representation of the principal component as both the key matrix and the value matrix. After the same calculation, a second attention output from the ancestor component to the principal component is obtained, which reflects the semantic alignment result of the ancestor component features in the principal component space.

[0043] Furthermore, first-direction cross-attention The calculation formula is:

[0044] in, The query matrix corresponding to the implicit representation of the principal components. This represents the key matrix corresponding to the implicit representation of ancestor components. Let be the value matrix corresponding to the implicit representation of ancestor components. Let be the dimension of the key vector. This is a scaling factor used to prevent the dot product result from entering the gradient saturation region of the Softmax function due to excessive dimensionality. The function normalizes the scaled dot product result into an attention weight distribution.

[0045] Second direction cross attention The calculation formula is:

[0046] in, This is the query matrix corresponding to the implicit representation of ancestor components. The key matrix corresponding to the principal component implicit representation. The value matrix corresponding to the principal component implicit representation is used, and the meanings of the other parameters are consistent with those of the first direction.

[0047] S323. The principal component hidden representation, the ancestor component hidden representation, the first attention output and the second attention output are concatenated and processed by a feedforward neural network and layer normalization to obtain an interactive fusion feature vector.

[0048] Furthermore, in step S323, the present invention concatenates the four parts—principal component latent representation, ancestor component latent representation, first attention output, and second attention output—in the feature dimension. The concatenated vector is then processed sequentially through a linear transformation layer, a ReLU activation function, and layer normalization to normalize the mean and variance of each sample in the feature dimension, stabilize the feature distribution during training, and finally obtain an interactive fusion feature vector.

[0049] In step S323, the expression for the concatenation operation is:

[0050] in, This is the fused vector after concatenating the four parts. Principal component implicit representation. This represents the implicit representation of ancestral components. This represents a concatenation operation along the feature dimension.

[0051] for After processing with a feedforward neural network and layer normalization, the final interactive fusion feature vector is obtained. The expression for the calculation process is:

[0052] in, This represents a fully connected linear transformation layer. To correct the activation function of the linear unit, negative values ​​in the input are set to zero, while positive values ​​remain unchanged. For layer normalization, the mean and variance of each sample are calculated along the feature dimension and then normalized. The outer layer... The normalized vector is projected back into a target dimension space that fits the input dimension of TabPFN, and the final output is the interactive fusion feature vector. .

[0053] S33. After performing splicing and projection processing on the interactive fusion feature vector, the reference principal component feature vector, and the reference ancestor component feature vector, input the result into the second path basic regression model to obtain the second path prediction coordinates.

[0054] After obtaining the interactive fusion feature vector in step S323, this vector already contains a comprehensive expression processed by a feedforward network after concatenating four parts: the principal component latent representation, the ancestor component latent representation, the first attention output, and the second attention output. However, during the interactive alignment of the two types of features by the bidirectional cross-attention module, the direct linear structure information carried by the original reference principal component feature vector and the reference ancestor component feature vector is compressed to a certain extent during the attention transformation. To retain this part of the original feature information, in step S33 of this invention, the interactive fusion feature vector is concatenated again with the original reference principal component feature vector and the original reference ancestor component feature vector in the feature dimension to form a concatenated vector with a higher dimension. The column dimension of this concatenated vector is the sum of the dimensions of the interactive fusion feature vector, the principal component feature vector, and the ancestor component feature vector.

[0055] Subsequently, the present invention applies a linear projection layer to the above-mentioned spliced ​​vector, compressing and mapping it from the current high-dimensional space to a dimensional space that matches the input dimension of the second path basic regression model (TabPFN), to obtain the projected feature matrix. This linear projection layer consists of a set of learnable weight matrices, which maps each row of the spliced ​​vector (corresponding to each individual) from the high dimension to the target dimension through matrix multiplication. During the compression process, the feature direction that contributes the most to the coordinate prediction task is retained.

[0056] Subsequently, the projected feature matrix is ​​input into the second path basic regression model. The second path basic regression model has the same structure as the first path basic regression model, both being TabPFN architectures. By alternately performing attention calculations on the sample dimension and the feature dimension, the relative relationship between the feature vectors of each individual in the input feature matrix and the feature vectors of other individuals is modeled. Finally, the latitude and longitude coordinate prediction values ​​are independently output for each individual, thus obtaining the second path prediction coordinates.

[0057] The second path prediction coordinates obtained in step S33 are fundamentally different from the first path prediction coordinates in terms of feature source. The first path prediction coordinates are derived from a feature matrix that is directly linearly concatenated, while the second path prediction coordinates are derived from a feature matrix that is aligned by bidirectional cross-attention interaction and then fused with the original features. The two predict the geographic coordinates of the same group of individuals from different feature expression perspectives.

[0058] S34. The first path prediction coordinates and the second path prediction coordinates are averaged and merged to obtain dual path prediction coordinates.

[0059] In step S34, after obtaining the first path predicted coordinates and the second path predicted coordinates, the present invention takes the arithmetic mean of the two sets of coordinates in both latitude and longitude dimensions. Specifically, for each individual, the latitude mean is obtained by adding the first path predicted latitude and the second path predicted latitude and dividing by 2, and the longitude mean is obtained by adding the first path predicted longitude and the second path predicted longitude and dividing by 2. The two means together constitute the dual-path predicted coordinates of the individual, serving as the input benchmark for the subsequent residual fitting stage. The mean merging operation integrates the prediction results of the two paths, making the dual-path predicted coordinates numerically between the individual predicted values ​​of the two paths, providing a benchmark prediction starting point for the residual correction model that integrates the two types of feature expressions.

[0060] S4. Using the dual-path predicted coordinates as input, the deviation between the dual-path predicted coordinates and the actual geographic coordinates is fitted using a residual stacking strategy to obtain a residual correction model.

[0061] Step S4 further includes: S41. Calculate the mean value of the dual-path predicted coordinates and the first path predicted coordinates and the second path predicted coordinates to obtain the mean coordinates.

[0062] After obtaining the dual-path predicted coordinates, step S41 of this invention further introduces a residual stacking strategy to correct the prediction bias. Specifically, in step S41, this invention takes the arithmetic mean of the first path predicted coordinates and the second path predicted coordinates in latitude and longitude dimensions to obtain the mean coordinates.

[0063] S42. The first path prediction coordinates, the second path prediction coordinates, and the mean coordinates are used as joint inputs and fed into the first multilayer perceptron regressor and the second multilayer perceptron regressor, respectively, to fit the latitude prediction residuals and longitude prediction residuals to obtain the residual correction model.

[0064] In step S42, the present invention concatenates the above three sets of coordinate data into a joint input vector, which is then fed into the first multilayer perceptron regressor and the second multilayer perceptron regressor, respectively. In this invention, the first multilayer perceptron regressor specifically fits the prediction residuals in the latitude dimension, i.e., the difference between the latitude mean and the true latitude coordinates in the dual-path prediction coordinates; the second multilayer perceptron regressor specifically fits the prediction residuals in the longitude dimension, i.e., the difference between the longitude mean and the true longitude coordinates in the dual-path prediction coordinates. The two regressors use the residual values ​​of their respective dimensions as training targets and output latitude residual corrections and longitude residual corrections.

[0065] After the outputs of the first and second multilayer perceptron regressors, this invention adds them to the latitude and longitude mean values ​​in the mean coordinates, respectively, to obtain the final predicted coordinates after residual correction. Thus, the residual correction model is composed of the trained first and second multilayer perceptron regressors, with a hidden layer size of (64, 32), a dropout ratio of 0.1, a learning rate of 1e-3, a weight decay of 1e-5, and 200 training epochs.

[0066] S43. Based on the five-fold cross-validation on the preset reference dataset, the hyperparameters of the dual-path basic prediction model and the residual correction model are continuously optimized to obtain the optimal hyperparameter configuration.

[0067] In step S43, this invention performs five-fold cross-validation to optimize the hyperparameters of the dual-path basic prediction model and the residual correction model. Specifically, this invention randomly divides the reference dataset into five subsets of similar size, using four subsets as training data and the remaining subset as validation data each time, repeating this process five times. Each time, the geolocation error index is calculated on the validation subset. After validation, this invention takes the average of the five validation results for different hyperparameter configurations and selects the optimal hyperparameter configuration from the candidate configurations based on the mean minimization criterion.

[0068] S5. Merge the genotype data of the sample to be tested with the quality control genotype dataset, perform genetic dimensionality reduction under a unified genetic background coordinate system, and obtain the feature vectors of the principal components to be tested and the feature vectors of the ancestral components to be tested.

[0069] In the inference phase, this invention merges the genotype data of the test samples with the quality control genotype dataset, and performs principal component analysis and ancestry cluster analysis uniformly within the same dataset. This merging operation ensures that the test samples and reference individuals are in the same genetic background coordinate system, making the principal component projection values ​​and ancestry component ratios of the test samples directly comparable to those of the reference set individuals, eliminating the coordinate system offset problem introduced by batch-based independent analysis. The merged dataset is then subjected to principal component analysis to extract the corresponding number of principal components; the projection values ​​of each test individual on each principal component constitute the feature vector of the test principal components. Finally, ancestry cluster analysis with K=6 is performed, and the ratio values ​​of each test individual on the six ancestry components constitute the feature vector of the test ancestry components.

[0070] S6. Input the feature vector of the principal component to be tested and the feature vector of the ancestor component to be tested into the dual-path basic prediction model and the residual correction model in sequence, and output the final predicted coordinates of the sample to be tested.

[0071] Step S6 further includes: S61. The feature vectors of the principal components to be tested and the feature vectors of the ancestor components to be tested are processed sequentially by the first path basic regression model and the second path basic regression model to obtain the predicted coordinates of the first path and the predicted coordinates of the second path to be tested, and the mean is merged to obtain the predicted coordinates of the dual paths to be tested.

[0072] In the inference phase, the present invention feeds the feature vectors of the principal components to be tested and the feature vectors of the ancestor components to be tested obtained in step S5 into the trained dual-path basic prediction model according to the feature processing flow that is strictly consistent with the training phase.

[0073] Specifically, for the first path, this invention directly concatenates the feature vectors of the principal components and ancestor components to be tested column-wise to form a direct fusion feature matrix to be tested. The number of rows in this matrix corresponds to the number of individuals to be tested, and the column dimensions are consistent with the direct fusion feature matrix input to the first path during the training phase. Subsequently, this invention inputs the direct fusion feature matrix to be tested into the trained first path basic regression model. During inference, the model performs contextual comparison between the feature vectors of the individuals to be tested and the feature vectors of the reference individuals seen during the training phase. Based on the relative relationship patterns between samples learned during the training phase, it outputs predicted latitude and longitude coordinates for each individual to be tested, thus obtaining the predicted coordinates of the first path to be tested.

[0074] For the second path, the present invention feeds the feature vector of the principal component to be tested and the feature vector of the ancestor component to be tested into the trained bidirectional cross-attention module, and performs linear projection, bidirectional cross-attention calculation and feedforward network processing in sequence according to the complete processing flow of training phase S321 to S323 to obtain the interactive fusion feature vector to be tested.

[0075] Subsequently, the present invention concatenates the interaction fusion feature vector to be tested with the original principal component feature vector and the ancestor component feature vector to be tested in the feature dimension. After being compressed to the target dimension by the trained linear projection layer, it is input into the trained second path basic regression model and outputs the latitude and longitude coordinate prediction value of each individual to be tested, thus obtaining the predicted coordinates of the second path to be tested.

[0076] After obtaining the predicted coordinates of the first path to be tested and the predicted coordinates of the second path to be tested, the present invention takes the arithmetic mean of the two in latitude and longitude dimensions to obtain the predicted coordinates of the two paths to be tested. The mean merging operation is the same as the processing method in step S34 in the training stage, ensuring the consistency of the coordinate merging logic between the inference stage and the training stage.

[0077] S62. Using the predicted coordinates of the first path to be measured, the predicted coordinates of the second path to be measured, and the predicted coordinates of the dual paths to be measured as joint inputs, the latitude residual correction and longitude residual correction are output through the first multilayer perceptron regressor and the second multilayer perceptron regressor, respectively.

[0078] In step S62, after obtaining the predicted coordinates of the dual paths to be tested, the present invention concatenates the three sets of data—the predicted coordinates of the first path to be tested, the predicted coordinates of the second path to be tested, and the predicted coordinates of the dual paths to be tested—into a joint input vector. The composition of this joint input vector corresponds exactly to the training inputs of the first multilayer perceptron regressor and the second multilayer perceptron regressor in step S42 of the training phase.

[0079] This invention feeds the joint input vector into a pre-trained first multilayer perceptron regressor and a second multilayer perceptron regressor, respectively. After receiving the joint input vector, the first multilayer perceptron regressor performs a layer-by-layer nonlinear transformation through hidden layers (two fully connected layers with sizes 64 and 32), ultimately outputting a scalar value—the latitude residual correction for the individual under test. This value corresponds to the predicted output of the latitude residual function fitted by the first multilayer perceptron regressor during the training phase, under the current input. The second multilayer perceptron regressor, using the same joint input vector and the same network structure, outputs the longitude residual correction for the individual under test, corresponding to the predicted output of the longitude residual function fitted by the second multilayer perceptron regressor during the training phase, under the current input.

[0080] S63. Add the latitude mean of the predicted coordinates of the dual-path to be measured to the latitude residual correction amount, and add the longitude mean of the predicted coordinates of the dual-path to be measured to the longitude residual correction amount to obtain the final predicted coordinates.

[0081] After obtaining the latitude residual correction and longitude residual correction, this invention directly adds the latitude mean and latitude residual correction in the predicted coordinates of the two paths to obtain the final predicted latitude; and directly adds the longitude mean and longitude residual correction in the predicted coordinates of the two paths to obtain the final predicted longitude.

[0082] Ultimately, the final predicted latitude and the final predicted longitude together constitute the final predicted coordinates of the individual to be measured, that is, the predicted geographical latitude and longitude coordinates after residual correction, which serve as the input for subsequent population mapping processing.

[0083] S7. Calculate the spherical geometric distance between the test sample and multiple reference populations based on the final predicted coordinates, and perform population mapping on the test sample by combining the population distance likelihood ratio to obtain the population affiliation label.

[0084] Step S7 further includes: S71. Based on the final predicted coordinates, calculate the spherical geometric distance between the test sample and all known sampling coordinates of multiple reference groups in the preset reference dataset one by one using the Haversine formula, and take the shortest spherical geometric distance among each reference group to obtain the population distance sorting sequence.

[0085] In step S71, after obtaining the final predicted coordinates, this invention maps the sample to be tested to a specific reference population based on these coordinates. Specifically, this invention uses the final predicted coordinates as a starting point and calculates the spherical geometric distance for each known sampling coordinate of each reference population in the reference dataset using the Haversine formula. The Haversine formula is a method specifically used for calculating the arc length between two points in a spherical coordinate system. It uses the Earth's radius as a reference and calculates the actual arc distance on the Earth's surface based on the difference in latitude and longitude between the two points. The specific expression is:

[0086] in, For the Earth's radius, and These are the latitudes of the actual geographic point and the predicted geographic point, respectively. and These are the longitudes of the actual and predicted geographic points, respectively. Due to latitude difference, This is due to the difference in longitude.

[0087] Since the same reference population corresponds to multiple different geographical sampling coordinates in the reference dataset, this invention takes the minimum spherical geometric distance between the final predicted coordinates of the sample to be tested and all known sampling coordinates of the population as the representative distance from the sample to be tested to the reference population. Finally, after completing the above calculation for all reference populations in the reference dataset, they are arranged in ascending order of distance to obtain the population distance sorting sequence.

[0088] S72. Using the nearest neighbor reference population distance in the population distance sorting sequence as a benchmark, calculate the population distance likelihood ratio of the test sample belonging to multiple candidate reference populations.

[0089] In step S72, this invention uses the distance to the nearest neighbor reference group ranked first in the population distance ranking sequence as the denominator, and divides the distance of each candidate reference group in the ranking sequence by this denominator to obtain the population distance likelihood ratio corresponding to each candidate reference group. The obtained population distance likelihood ratio reflects the relative distance relationship between the final predicted coordinates of the test sample and each candidate reference group. The closer the value is to 1, the smaller the distance difference between the candidate group and the nearest neighbor group, and the higher the uncertainty of attribution.

[0090] Specific crowd distance likelihood ratio The calculation formula is:

[0091] in, It is the nearest neighbor reference population distance ranked first in the population distance sorting sequence, which is the minimum value among the final predicted coordinates of the test sample and the representative distances of all reference populations. Ranked in the sorted sequence Distance to the candidate reference population.

[0092] S73. Based on the population distance likelihood ratio and the preset likelihood ratio threshold, determine the population affiliation label from the reference population corresponding to the shortest distance in the population distance sorting sequence, and mark the results that exceed the preset likelihood ratio threshold as a conclusion that is not excluded.

[0093] In step S73, the present invention determines the reference population corresponding to the shortest distance in the population distance ranking sequence as the population attribution label of the test sample. For candidate groups whose population distance likelihood ratio exceeds a preset likelihood ratio threshold, the present invention marks the corresponding inference conclusion as a non-exclusion conclusion, indicating that the candidate group cannot be completely excluded in a statistical sense. Finally, the output population attribution label and the non-exclusion conclusion together constitute the complete population inference result of the present invention for the test sample.

[0094] like Figure 2 As shown, the present invention also provides a biogeographical ancestor inference system based on residual feature fusion, used to implement a biogeographical ancestor inference method based on residual feature fusion as described in any of the above claims, comprising: Quality control module 100: Used to perform quality control on the reference genotype dataset to obtain a quality control genotype dataset; Dimensionality reduction module 200: used to perform genetic dimensionality reduction on the quality control genotype dataset to obtain the reference principal component feature vector and the reference ancestor component feature vector; First prediction module 300: used to input the reference principal component feature vector and the reference ancestor component feature vector into the dual-path basic prediction model to obtain dual-path prediction coordinates; Fitting module 400: Used to fit the deviation between the dual-path predicted coordinates and the real geographic coordinates using the dual-path predicted coordinates as input, and obtain a residual correction model by means of a residual stacking strategy; Merging module 500: used to merge the genotype data of the sample to be tested with the quality control genotype dataset, perform genetic dimensionality reduction under a unified genetic background coordinate system, and obtain the feature vectors of the principal components to be tested and the feature vectors of the ancestral components to be tested; The second prediction module 600 is used to sequentially input the feature vector of the principal component to be tested and the feature vector of the ancestor component to be tested into the dual-path basic prediction model and the residual correction model, and output the final predicted coordinates of the sample to be tested. Output module 700: is used to calculate the spherical geometric distance between the test sample and multiple reference populations based on the final predicted coordinates, and to perform population mapping on the test sample by combining the population distance likelihood ratio to obtain the population affiliation label.

[0095] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0096] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the biogeographical ancestor inference method based on residual feature fusion described in the various embodiments or some parts of the embodiments.

[0097] The model built based on the biogeographical ancestor inference method based on residual feature fusion proposed in this invention, namely the end-to-end deep learning framework (DeepBGA) based on the residual feature fusion integration strategy, consists of two base models and a meta-model. The two base models use different feature fusion methods. Base model I adopts a direct column-wise concatenation strategy (PCs + 6ACs) to preserve the linear information of the original features. Base model II introduces a bidirectional cross-attention mechanism to mine the nonlinear semantic alignment between genetic principal components (PCs, with dimensions ranging from 10 to 755) and ancestral components (6 ACs) at different scales. In addition, the bidirectional attention mechanism introduced in this invention, unlike the traditional unidirectional feature extraction, allows the model to simultaneously aggregate positive and negative information in the global context, thereby effectively achieving semantic alignment between cross-modal or heterogeneous data (such as gene sequence text, 3D facial images, and fingerprint patterns), and introducing more feature inputs to further improve prediction accuracy. Furthermore, the framework proposed in this invention can accommodate multiple base models in parallel, allowing users to integrate models that capture features at different scales (e.g., linear regression models that primarily capture linear relationships, Transformer models that capture long-range dependencies, and CNN models that capture local features) according to specific task requirements. By increasing the number and diversity of base models, the variance of the system can be further reduced, and the prediction residuals of the base models can be fitted and corrected using meta-models to approximate the true values.

[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A biogeographical ancestor inference method based on residual feature fusion, characterized in that, include: S1. Perform quality control on the reference genotype dataset to obtain the quality control genotype dataset; S2. Perform genetic dimensionality reduction on the quality control genotype dataset to obtain the reference principal component feature vector and the reference ancestor component feature vector. S3. Input the reference principal component feature vector and the reference ancestor component feature vector into the dual-path basic prediction model to obtain the dual-path prediction coordinates; S4. Using the dual-path predicted coordinates as input, the deviation between the dual-path predicted coordinates and the actual geographic coordinates is fitted by the residual stacking strategy to obtain the residual correction model. S5. Merge the genotype data of the sample to be tested with the quality control genotype dataset, and perform principal component dimensionality reduction under a unified genetic background coordinate system to obtain the feature vectors of the principal components to be tested and the feature vectors of the ancestral components to be tested. S6. Input the feature vector of the principal component to be tested and the feature vector of the ancestor component to be tested into the dual-path basic prediction model and the residual correction model in sequence, and output the final predicted coordinates of the sample to be tested; S7. Calculate the spherical geometric distance between the test sample and multiple reference populations based on the final predicted coordinates, and perform population mapping on the test sample by combining the population distance likelihood ratio to obtain the population affiliation label.

2. The biogeographical ancestor inference method based on residual feature fusion according to claim 1, characterized in that, Step S1 further includes: S11. Perform site filtering on the original genotype data in the reference genotype dataset to obtain preliminary filtered genotype data; S12. Perform linkage disequilibrium pruning on the preliminarily filtered genotype data to obtain a set of low-linkage independent SNP sites. S13. Merge and align the multi-source heterogeneous genotype data with the set of low-linkage independent SNP sites to obtain the quality control genotype dataset.

3. The biogeographical ancestor inference method based on residual feature fusion according to claim 1, characterized in that, In step S11, the thresholds used for site filtering include: the deletion rate threshold, the minimum allele frequency threshold, and the Hardy-Weinberg equilibrium test threshold.

4. The biogeographical ancestor inference method based on residual feature fusion according to claim 1, characterized in that, Step S2 specifically includes: Principal component analysis was performed on the quality control genotype dataset to extract a preset number of principal components and obtain reference principal component feature vectors. The quality control genotype dataset is subjected to model-based ancestry clustering analysis with a preset number of ancestral populations to obtain a reference ancestral component feature vector that reflects the proportion of potential ancestral composition of multiple individuals.

5. The biogeographical ancestor inference method based on residual feature fusion according to claim 1, characterized in that, Step S3 further includes: S31. The reference principal component feature vector and the reference ancestor component feature vector are column-concatenated and fused to obtain a direct fused feature matrix, and the direct fused feature matrix is ​​input into the first path basic regression model to obtain the first path prediction coordinates. S32. The reference principal component feature vector and the reference ancestor component feature vector are interactively aligned through a bidirectional cross-attention module to obtain an interactive fusion feature vector; S33. After performing splicing and projection processing on the interactive fusion feature vector, the reference principal component feature vector, and the reference ancestor component feature vector, input the second path basic regression model to obtain the second path prediction coordinates. S34. The first path prediction coordinates and the second path prediction coordinates are averaged and merged to obtain dual path prediction coordinates.

6. The biogeographical ancestor inference method based on residual feature fusion according to claim 5, characterized in that, Step S32 further includes: S321. The reference principal component feature vector and the reference ancestor component feature vector are projected to the shared latent space through learnable linear transformations to obtain the latent representations of the principal components and the latent representations of the ancestor components. S322. Using the implicit representation of the principal component as the query and the implicit representation of the ancestor component as the key-value pair, perform a first-direction cross-attention calculation to obtain a first attention output from the principal component to the ancestor component; using the implicit representation of the ancestor component as the query and the implicit representation of the principal component as the key-value pair, perform a second-direction cross-attention calculation to obtain a second attention output from the ancestor component to the principal component. S323. The principal component hidden representation, the ancestor component hidden representation, the first attention output and the second attention output are concatenated and processed by a feedforward neural network and layer normalization to obtain an interactive fusion feature vector.

7. The biogeographical ancestor inference method based on residual feature fusion according to claim 1, characterized in that, Step S4 further includes: S41. Calculate the mean value of the dual-path predicted coordinates and the first path predicted coordinates and the second path predicted coordinates to obtain the mean coordinates. S42. The first path prediction coordinates, the second path prediction coordinates and the mean coordinates are used as joint inputs and fed into the first multilayer perceptron regressor and the second multilayer perceptron regressor respectively to fit the latitude prediction residuals and longitude prediction residuals respectively to obtain the residual correction model. S43. Based on the five-fold cross-validation on the preset reference dataset, the hyperparameters of the dual-path basic prediction model and the residual correction model are continuously optimized to obtain the optimal hyperparameter configuration.

8. The biogeographical ancestor inference method based on residual feature fusion according to claim 1, characterized in that, Step S6 further includes: S61. The feature vectors of the principal components to be tested and the feature vectors of the ancestor components to be tested are processed by the first path basic regression model and the second path basic regression model in sequence to obtain the predicted coordinates of the first path and the predicted coordinates of the second path to be tested, and the mean is merged to obtain the predicted coordinates of the dual paths to be tested. S62. Using the predicted coordinates of the first path to be measured, the predicted coordinates of the second path to be measured, and the predicted coordinates of the dual paths to be measured as joint inputs, the latitude residual correction and longitude residual correction are output through the first multilayer perceptron regressor and the second multilayer perceptron regressor, respectively. S63. Add the latitude mean of the predicted coordinates of the dual-path to be measured to the latitude residual correction amount, and add the longitude mean of the predicted coordinates of the dual-path to be measured to the longitude residual correction amount to obtain the final predicted coordinates.

9. The biogeographical ancestor inference method based on residual feature fusion according to claim 1, characterized in that, Step S7 further includes: S71. Based on the final predicted coordinates, calculate the spherical geometric distance between the test sample and all known sampling coordinates of multiple reference groups in the preset reference dataset one by one using the Haversine formula, and take the shortest spherical geometric distance among each reference group to obtain the group distance sorting sequence. S72. Using the nearest neighbor reference population distance in the population distance sorting sequence as a benchmark, calculate the population distance likelihood ratio of the test sample belonging to multiple candidate reference populations; S73. Based on the population distance likelihood ratio and the preset likelihood ratio threshold, determine the population affiliation label from the reference population corresponding to the shortest distance in the population distance sorting sequence, and mark the results that exceed the preset likelihood ratio threshold as a conclusion that is not excluded.

10. A biogeographical ancestor inference system based on residual feature fusion, used to implement the biogeographical ancestor inference method based on residual feature fusion as described in any one of claims 1 to 9, characterized in that, include: Quality control module: Used to perform quality control on the reference genotype dataset to obtain a quality control genotype dataset; Dimensionality reduction module: used to perform genetic dimensionality reduction on the quality control genotype dataset to obtain the reference principal component feature vector and the reference ancestor component feature vector; First prediction module: used to input the reference principal component feature vector and the reference ancestor component feature vector into the dual-path basic prediction model to obtain dual-path prediction coordinates; Fitting module: Used to fit the deviation between the dual-path predicted coordinates and the actual geographic coordinates using a residual stacking strategy, and obtain a residual correction model by taking the dual-path predicted coordinates as input. Merging module: used to merge the genotype data of the sample to be tested with the quality control genotype dataset, perform genetic dimensionality reduction under a unified genetic background coordinate system, and obtain the feature vectors of the principal components to be tested and the feature vectors of the ancestral components to be tested; The second prediction module is used to sequentially input the feature vectors of the principal components to be tested and the feature vectors of the ancestor components to be tested into the dual-path basic prediction model and the residual correction model, and output the final predicted coordinates of the sample to be tested. Output module: used to calculate the spherical geometric distance between the test sample and multiple reference populations based on the final predicted coordinates, and to perform population mapping on the test sample by combining the population distance likelihood ratio to obtain the population affiliation label.