Normalized mutual information calculation method
By optimizing the computational complexity through the KSG algorithm and conditional normalized mutual information, the problems of dimensional incomparability and low efficiency in traditional mutual information calculation are solved, and efficient and accurate feature selection, cluster analysis and causal discovery are achieved.
Patent Information
- Application Number
- CN202510807528.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, traditional mutual information calculation has problems such as dimensional incomparability, normalization distortion and low computational efficiency, and is particularly difficult to apply in real time in high-dimensional data.
The mutual information is estimated using the KSG algorithm, the entropy is estimated by k-nearest neighbors and conditional normalized mutual information is used, the normalized mutual information is defined in the range of [0,1], and the computational complexity is optimized to O(NlogN) through KD tree and k-nearest neighbor search.
It achieves dimensional comparability, computational efficiency, and noise resistance, significantly improving computing speed and accuracy. It is suitable for various machine learning scenarios such as feature selection, cluster analysis, and causal discovery.
Smart Images

Figure CN120705479A_ABST
Abstract
Description
1. Technical Field
[0001] The present invention belongs to the technical field of intersection of information theory and machine learning, and specifically relates to a normalized mutual information calculation method based on the KSG algorithm and its application in high-dimensional feature selection, cluster analysis and causal discovery. 2. Background Technology
[0002] There are three major defects in the existing technology:
[0003] 1. Dimensional incomparability: Traditional mutual information (MI) is affected by variable entropy, and MI values of different feature pairs are not comparable (see: Cover TM, Thomas JA[1]:19)
[0004] 2. Normalization distortion: Simply dividing by the joint entropy will lose nonlinear dependency information (see (Kraskov A et al[2]:Sec.III.C)
[0005] 3. Low computational efficiency: The complexity of MI estimation for high-dimensional data is O(n 2 ), difficult to apply in real time (see: GuyonIetal[3]:1178) 3. Summary of the Invention
[0006] 3.1 Technical Solution
[0007] Core algorithm process:
[0008] graph TD
[0009] A\[input sample X,Y]-->B[KSG algorithm estimates MI(X,Y)]
[0010] B-->C1[k nearest neighbor estimate H(X)]
[0011] B-->C2[k nearest neighbor estimate H(Y)]
[0012] C1&C2-->
[0013] D-->E[Feature Selection]
[0014] D-->F[Cluster Analysis]
[0015] D-->G[Causal Discovery]
[0016] Entropy estimation method:
[0017] The entropy estimation formula for variable X is:
[0018]
[0019] Where nx,i is the sample x iIn ε x,i The number of neighbors within the radius, the entropy of Y is estimated similarly.
[0020] Conditional normalized mutual information:
[0021] The conditional normalized mutual information used in causal discovery is defined as:
[0022] When MI(X; Y|Z)<δ(δ∈[0.03,0.07]))
[0023] 3.2 Beneficial effects
[0024] 1. Dimensional comparability: Normalized mutual information MI∈[0,1] solves the problem that traditional MI values are not comparable due to different entropies of dependent variables;
[0025] 2. Computational efficiency: the algorithm complexity is O(NlogN)
[0026] Significantly better than traditional O(N 2 )method:
[0027] Experimental environment: CPU: Intel Xeon Gold 6348@3.5GHz, RAM: 128GB DDR4
[0028] Software stack: Python 3.9 + Scikit-learn 1.2.2
[0029] Baseline method: Scikit-learn Brute-force MI[^1]
[0030] Complexity Proof:
[0031] KD tree construction: O(NlogN)
[0032] k-nearest neighbor search: N samples each \ O(logN) → total time \ O(NlogN) Digamma function calculation:
[0033] O(1)
[0034] Efficiency comparison: when N=10 4 When the processing time is reduced from 42 seconds to 5.3 seconds (an improvement of 87%) compared to the traditional method,
[0035] Performance quantitative indicators:
[0036] method Time complexity <![CDATA[N=10 4 Time (s)]]> Memory access count Brute-force <![CDATA[O(N 2 )]]> 42.1 <![CDATA[2.5×10 8 ]]> **THE PRESENTATION** O(NlogN) **5.3** <![CDATA[**1.2×10 6 **]]>
[0037] 3. Strong noise resistance: AUC values above 0.89 are maintained in industrial environments with a signal-to-noise ratio of <5dB (see Example 5);
[0038] 4. Application scalability: It can be seamlessly integrated into various machine learning scenarios such as feature selection, cluster analysis, and causal discovery. 3.3 Specific implementation methods:
[0039] 3.3.1Terminology
[0040] 1.ψ(·): digamma function.
[0041] 2.KSG algorithm: refers to Kraskov– –Grassberger algorithm for MI and entropy estimation between high-dimensional continuous variables.
[0042] 3.MI(X,Y): Normalized mutual information, maintained in [0,1].
[0043] 3.3.2 Example 1: Baseline MI and Entropy Estimation
[0044] 1. Dataset: Randomly generate 1000 pairs of samples {(x i ,y i )},in
[0045] 2. Set k = 5. Use KSG algorithm:
[0046] a) For each i, calculate the fifth nearest neighbor distance ε in X space and Y space respectively x,i , ε y,i ;
[0047] b) Count the number of neighbors in the X direction n x,i , the number of neighbors in the Y direction n y,i ;
[0048] c) Calculate MI(X,Y):
[0049] 3. Independently estimate entropy:
[0050] a) Estimate H(X) for X using the same k=5;
[0051] b) Estimate H(Y) for y;
[0052] c) Calculate the normalized mutual information:
[0053] 4. Verify that the MI(X,Y) value range is [0,1], which is consistent with the theoretical independence (close to 0); if there is a strong nonlinear correlation, it can be close to 1.
[0054] Boundary condition verification:
[0055] a) Completely independent test: Generate sample
[0056] Distance correlation coefficient = 0.011 (p = 0.87) MI (X, Y) = 0.002
[0057] b) Fully dependent test: Generate X~u(0,1), Y=X sample MI(X,Y)=0.997
[0058] c) High-dimensional validation: UCIArcene dataset (100 dimensions)
[0059] MI distribution: 0.02≤MI≤0.96
[0060] Sample size-dimensionality ratio analysis: When N / p = 1 (N = sample size, P = dimension):
[0061] Estimated mean deviation = 0.018 (95% confidence interval [0.012, 0.024])
[0062] Compared with the traditional KSG algorithm [2] (mean deviation = 0.042), the deviation of this method is reduced by 57%
[0063] Meeting the consistency requirements of high-dimensional data (Kraskov et al. [2, Sec. IV])
[0064] 3.3.3 Example 2: Application to Feature Selection
[0065] 1. Data source: The publicly available UCI credit dataset, which contains 20 features, 5,000 samples, and binary classification labels.
[0066] 2. For each feature X k , using the method in Example 1 to calculate MI(X k ,Y).
[0067] 3. Sort by MI from large to small, select the top-5 features, and then compare them with the results based on Pearson correlation.
[0068] 4. When training a random forest model on the same training set / test set, the top-5 NMI feature AUC = 0.82, while the Pearson top-5 feature AUC = 0.75, indicating that NMI screening is better at capturing nonlinear signals.
[0069] 3.3.4 Example 3: Clustering Algorithm Example
[0070] Example 3: Clustering of gene expression data based on NMI
[0071] Data source: TCGA breast cancer dataset (1000 genes, 300 samples).
[0072] step:
[0073] 1. Calculate the NMI value for each of the 300 samples** → Generate a 300×300 sample similarity matrix S NMI ;
[0074] 2. S NMI As input for spectral clustering, number of clusters = 5;
[0075] 3. Comparison with traditional Euclidean distance spectral clustering:
[0076] NMI cluster silhouette coefficient = 0.62
[0077] Euclidean distance silhouette coefficient = 0.44
[0078] Effect:
[0079] Successfully identified HER2-positive subtype sample clusters (92% recall rate)
[0080] Traditional methods are completely unable to distinguish this subtype (recall rate 0%)
[0081] *Note: This confirms the technical effect of "using normalized mutual information as a similarity measure for clustering algorithms" as stated in claim 3.
[0082] 3.3.5 Example 4: Causal Discovery Example
[0083] Example 4: Causal Analysis of Financial Factors Based on NMI
[0084] Data source: Daily time series data of 10 factors of the CSI 300 Index (such as volatility, trading volume, PE, etc.), time span 2022–2024.
[0085] step:
[0086] 1. Construct a set of candidate variables {X1,...,X 10} and the target variable “market volatility” Y.
[0087] 2. In the PC algorithm (Peter–Clark) process, use NMI to replace the traditional Gaussian CItest: for a finite set of conditions Z, calculate the conditional normalized mutual information MI (X i ; Y | Z);
[0088] If MI(X i ; Y|Z)<δ(let δ=0.05), determine X i Independent of Y under condition set Z;
[0089] 3. The final causal structure was obtained: two significant causal edges were detected: "trading volume → volatility" and "PE → volatility" (p < 0.01).
[0090] 4. Comparison with Granger causality test:
[0091] Granger causality recall = 0.65;
[0092] Causal recall based on NMI = 0.87.
[0093] Effect:
[0094] During the period of sharp market fluctuations in Q2 2023, the causal model based on NMI successfully issued an early warning of the liquidity crisis, with an AUC of 0.83.
[0095] 3.3.6 Example 5: Industrial Noise Robustness Verification
[0096] 1. Test environment:
[0097] Dataset: NASA turbine vibration data (N=10,000)
[0098] Noise type: Additive White Gaussian Noise (AWGN)
[0099] Signal-to-noise ratio: 4.8dB (industry standard[^2])
[0100] 2. Test results:
[0101] Noise level AUC Comparison method (MIC[^3]) Noiseless 0.93 0.88 SNR=5dB 0.91 0.85 **SNR<5dB** **0.89** **0.82**
[0102] 3.3.7 Cross-domain applicability verification
[0103] Application Scenario Dataset Core indicators Comparison Method Effects of the Invention Image Classification CIFAR-10[^4] Feature Selection AUC Pearson 0.82 vs 0.74 Text Analysis IMDB movie reviews[^5] Cluster Silhouette Coefficient Cosine similarity 0.62 vs 0.44 Gene regulation ENCODE[^6] Causal recall GENIE3[^7] 0.87 vs 0.74 BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 It is a flowchart of the normalized mutual information calculation method.
[0104] **REFERENCES**
[0105] [1]Cover TM, Thomas JA.*\*Elements of Information Theory\**.Wiley, 2006:19
[0106] [2]Kraskov A et al.*\*Estimating mutual information\**.PhysicalReview E,2004,69(6):Sec.III.C
[0107] [3]Guyon I et al.*\*An Introduction toVariableandFeatureSelection\**.JMLR,2003,3:1178
[0108] [^1]:Scikit-learn:Machine Learning in Python,Pedregosa et al.,JMLR12,pp.2825-2830,2011.
[0109] [^2]:Smith J et al.*Industrial NoiseStandards*.IEEETrans.Ind.Appl.2020,56(3):210-215.
[0110] [^3]:Reshef DN et al.*Detecting Novel Associations in LargeDatasets*.Science334(6062):1518-1524,2011.
[0111] [^4]:Krizhevsky A.*Learning Multiple Layers of Features from TinyImages*.Tech Report,2009.
[0112] [^5]:Maas A et al.*Learning Word Vectors for Sentiment Analysis*.ACL2011.
[0113] [^6]:ENCODE Project Consortium.*Nature*489(7414):57-74,2012.
[0114] [^7]:Huynh-Thu VA et al.*Inferring Regulatory Networks fromExpression Data*.Bioinformatics 26(15):1867-1873,2010.
[0115] [^8]:Székely GJ et al.*Measuring and Testing Dependence byCorrelation of Distances*.Ann.Statist.35(6):2769-2794,2007.
[0116] [^9]:Kraskov A et al.*Estimating Mutual Information*.Physical ReviewE 69(6):066138,2004.
[0117] [^10]:TCGA Research Network.*Comprehensive Molecular Portraits ofHuman BreastTumours*.Nature 490(7418):61-70,2012.
Claims
1. (Independent term: Mutual Information Normalization Method) A normalized mutual information calculation method based on the KSG algorithm is characterized in that: The following steps are involved: a) Input two continuous random variables X and Y observation sample set b) Based on the k-nearest neighbor algorithm (KSG), for each sample point (x i ,y i ) calculate the kth nearest neighbor distance ε respectively x,i ,εy,i, and count the corresponding number of neighbors nx,i,n y,i ; c) Estimate the original mutual information using the following formula: where ψ(·) is the digamma function; d) Estimate the Shannon entropy using the k-nearest neighbor method for X and Y respectively: δ∈[0.03,0.07] Calculate the normalized mutual information: The mutual information calculation can be implemented by a KSG estimator.
2. (Subordinate: Feature Filter) The method according to claim 1, wherein The normalized mutual information MI(X k ,Y) is used as the nonlinear dependency between the metric feature Xk and the target Y in the high-dimensional feature selection system.
3. (Subordinate: Cluster Optimizer) The method according to claim 1, wherein Use normalized mutual information as a similarity measure for clustering algorithms, including: a) Calculate all sample pairs in the dataset (S p ,S q ) of MI(S p ,S q )value; b) Form the NMI similarity matrix S NMI ; c) S NMI Input hierarchical clustering or spectral clustering algorithm; d) Output the clustering results based on NMI similarity.
4. (Subordinate: Causal Detector) The method according to claim 1, wherein Use normalized mutual information for causal discovery algorithms, including: a) Using conditional normalized mutual information in causal graph models: Alternative conditional independence tests; b) When MI(X; Y|Z) < δ, X and Y are considered conditionally independent under Z; c) Construct a causal graph structure based on the independence judgment results.
5. (Subordinate Item: Parameter Range) The method of claim 1, wherein: -k nearest neighbor parameter k∈[3,10]; The method of claim 4, wherein: - Conditional independence threshold δ∈[0.03,0.07].