A method for identifying the origin of natural gas based on feature compensation and machine learning

CN122800033APending Publication Date: 2026-09-22CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611011902.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

[0005]针对现有技术的不足,本发明提供了一种基于特征补偿与机器学习的天然气成因判识方法,解决了天然气化验数据存在维度缺失与地质噪声干扰制约模型分类表现的问题

Benefits of technology

1、本发明通过提取基础数据集内的δ13C1、δ13C2与δ13C3执行减法运算生成碳同位素序列差值,并在判定碳同位素序列差值满足非递增关系时生成倒置特征输入多算法模型。倒置特征为多算法模型提供建立多源混合气分类边界的数据输入参量,消除传统二维分析图版区间交叉重叠造成的多解性判定偏差,提高多算法模型针对复杂天然气混合气成因类型的分类判别准确率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122800033A_ABST
    Figure CN122800033A_ABST
Patent Text Reader

Abstract

This invention relates to the field of natural gas geological exploration technology and discloses a method for identifying the genesis of natural gas based on feature compensation and machine learning. The method includes: extracting component data and isotope data to establish a basic dataset; performing subtraction operations on the isotope data to generate inverted features; calculating component data ratios to generate derived variables and logarithmic indices; calculating fitted values ​​and compensated feature parameters when hydrogen isotope analysis data is lacking, merging and retaining parameters to construct a candidate feature set; calling a recursive feature elimination algorithm and a sequence-forward search algorithm to remove redundant feature dimensions from the candidate feature set, retaining the optimal feature combination; and a multi-algorithm model receiving the optimal feature combination and outputting the identification result of the natural gas genesis type. This invention eliminates the multi-solution judgment bias caused by map overlap through inverted features, removes the dependence on measured hydrogen isotope extraction in the identification stage through data compensation, and reduces redundant dimensions of candidate features to prevent data overfitting in the multi-algorithm model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural gas geological exploration technology, specifically a method for identifying the genesis of natural gas based on feature compensation and machine learning. Background Technology

[0002] Identifying the genetic type of natural gas is a crucial reference for oil and gas exploration decisions. Clearly defining the source and evolution process of natural gas can help assess the hydrocarbon generation potential of source rocks and predict reservoir distribution. Current conventional methods for identifying the genetic origin of natural gas rely on laboratory sampling and analysis of natural gas samples, primarily determining the chemical composition and stable isotopes. These determinations include methane content, heavy hydrocarbon content, stable carbon isotopes, and stable hydrogen isotopes within the natural gas sample. Laboratory personnel need to manually identify these indicators using qualitative identification charts.

[0003] As natural gas exploration targets shift towards deeper structural zones, conventional methods for identifying the genesis of natural gas have revealed their technological limitations. Laboratory sampling and analysis are time-consuming and costly, resulting in scattered sampling points in the field and hindering the large-scale advancement of continuous classification and identification of gas-bearing areas. In environments with multi-source oil and gas accumulation and over-maturity, isotopic inversion occurs within natural gas samples, leading to overlapping data distribution intervals when traditional qualitative identification charts handle isotopic inversion, increasing the risk of computational errors in natural gas gene classification.

[0004] The high cost and stringent quality requirements of stable hydrogen isotope testing in natural gas have resulted in a large accumulation of testing records lacking measured values ​​for stable hydrogen isotopes in natural gas exploration databases. This missing characteristic data can cause classification and error errors in prediction models that rely on complete data input. Furthermore, conventional methods for identifying the genesis of natural gas involve numerous geochemical indicators. Directly substituting multiple geochemical indicators into the prediction model for classification can easily introduce redundant variables, leading to overfitting and reducing the model's ability to generalize to unknown data distribution ranges. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a natural gas origin identification method based on feature compensation and machine learning, which solves the problems of missing dimensions and geological noise interference in natural gas test data limiting the model's classification performance.

[0006] To achieve the above objectives, this invention provides a method for identifying the genesis of natural gas based on feature compensation and machine learning, comprising the following steps: Natural gas sample test records are obtained to generate a basic dataset, and data that deviates from the geological background noise in the basic dataset is removed to generate a filtered basic dataset. Subtraction is performed on the carbon isotope data in the filtered basic dataset, and the carbon isotope sequence difference is compared with the inversion judgment threshold to generate inversion features. Ratio calculations are performed on the component data within the filtered base dataset to generate derived variables, and logarithmic calculations are performed on the derived variables with long-tailed distribution patterns to generate logarithmic indices. Calculating δ using carbon isotope data and derived variables 2 D1 fit values ​​or equivalent reconstructed features will retain parameters, inverted features, derived variables, logarithmic indices, and δ values. 2 D1 fitting values ​​or equivalent reconstructed features are combined to establish a candidate feature set; The recursive feature elimination algorithm and the sequential forward search algorithm are used to extract variables from the candidate feature set and retain the preferred feature set. The preferred feature set is then input into the multi-algorithm model to output the identification result of the natural gas genesis type.

[0007] As a preferred approach, a basic dataset is generated by obtaining natural gas sample test records. Data deviating from geological background noise in the basic dataset is then removed to generate a filtered basic dataset, specifically including: The component data, isotope data and pre-labeled genetic types of the same natural gas sample are horizontally aligned to generate sample feature rows. Multiple sample feature rows belonging to the area to be tested are vertically stacked to generate a basic dataset in matrix format. By comparing the values ​​contained in the sample feature row with the corresponding geological background threshold range, the values ​​outside the geological background threshold range are classified as data deviating from geological background noise. The filtered base dataset is generated by removing sample feature rows that carry data that deviate from the geological background noise from the base dataset.

[0008] As a preferred approach, subtraction is performed on the carbon isotope data within the filtered base dataset, and the inversion feature is generated by comparing the carbon isotope sequence difference with the inversion determination threshold. Specifically, this includes: δ in the sample feature row 13 C2 minus δ 13 C1 generates the first carbon isotope sequence difference, and the δ within the sample feature row... 13 C3 minus δ 13 C2 generates the second carbon isotope sequence difference; Compare the difference between the first carbon isotope sequence and the difference between the second carbon isotope sequence with the inversion determination threshold; When the difference in the first carbon isotope sequence is less than the inversion determination threshold or the difference in the second carbon isotope sequence is less than the inversion determination threshold, an isotope inversion determination result is generated, and the difference in the first carbon isotope sequence is added as a quantized inversion feature to the corresponding sample feature row.

[0009] As a preferred option, the derived variables include the first total hydrocarbon ratio, the second total hydrocarbon ratio, and the third total hydrocarbon ratio; The first total hydrocarbon ratio is the quotient of the sum of the contents of ethane and heavier hydrocarbons corresponding to the methane content; the second total hydrocarbon ratio is the quotient of the sum of the contents of all hydrocarbons corresponding to the methane content; and the third total hydrocarbon ratio is the quotient of the sum of the contents of ethane and propane corresponding to the methane content. When calculating the first, second, and third total hydrocarbon ratios, a preset small positive factor is forcibly added to the denominator of the division expression; Logarithmic transformation formulas are used to perform logarithmic calculations on the third total hydrocarbon ratio, which exhibits a long-tailed distribution pattern, to generate logarithmic indices.

[0010] As a preferred approach, δ is calculated using carbon isotope data and derived variables. 2 The D1 fit value specifically includes: For each sample feature row, the corresponding δ 2 The data storage unit of D1 performs a null value search, and when the corresponding δ is detected... 2 When the data storage unit of D1 does not contain a value, it is determined that the sample feature row contains δ. 2 D1 data missing status; Reading the existence of δ 2 The δ values ​​stored in the inline of the sample features corresponding to the missing data in D1 are... 13 C1, δ 13 C2, δ 13 C3 to third total hydrocarbon ratio; δ 13 C1, δ 13 C2, δ 13 Substituting the C3 to third total hydrocarbon ratio into a pre-determined hydrogen isotope multivariate regression fitting equation, a multiplication-addition operation is performed to generate the calculated δ. 2 D1 fitting value, and δ 2 The D1 fit value is written into the corresponding δ value in the corresponding sample feature row. 2 Data storage unit D1.

[0011] As a preferred approach, equivalent reconstructed features are calculated using carbon isotope data and derived variables, specifically including: For the existence of δ 2 For sample feature rows where D1 data is missing and fitted values ​​cannot be obtained, extract the δ values ​​stored within these sample feature rows. 13 The ratio of C1 to the third total hydrocarbon is set as a preset substitution index; Based on the feature reconstruction operation rules, δ 13 The value of C1 is coupled with the value of the third total hydrocarbon ratio by algebraic addition, and the combined value obtained by the addition operation is used to generate equivalent reconstructed features. Write the equivalent reconstructed features into the feature storage area corresponding to the feature row of the sample with extreme data missing conditions.

[0012] As a preferred approach, parameters, inverted features, derived variables, logarithmic indices, and delta values ​​will be retained. 2 Before merging D1 fit values ​​or equivalent reconstructed features to establish a candidate feature set, the process also includes performing Z-Score standardization: For those with complete δ 2 D1 data, δ 2 D1 fit value and equivalent reconstructed feature extract the corresponding feature value of the current input; The intermediate difference is generated by subtracting the average value of all sample data contained in the corresponding feature column from the corresponding feature value. The quotient of the sum of the standard deviation of all sample data contained in the corresponding feature column and the preset minimum constant is set as the standard alignment feature. Extracting δ contained within the sample feature rows 13 C1, δ 13 C2, δ 13 C3, the first carbon isotope sequence difference, the third total hydrocarbon ratio and logarithmic index, and the standard aligned features are combined to calculate and output the candidate feature set.

[0013] As a preferred approach, a recursive feature elimination algorithm and a sequence-forward search algorithm are used to extract variables from the candidate feature set and retain the preferred feature set. Specifically, this includes: The candidate feature set is input into the recursive feature elimination algorithm to calculate the feature weight value. The feature dimension corresponding to the smallest feature weight value at the end is identified as a redundant variable and deleted until the total number of retained feature dimensions reaches the preset target number of features, which is set as the initial screening feature set. The sequence forward search algorithm is called to extract single feature dimensions one by one from the initial feature set and temporarily write them into the preferred feature set. The combination generates a test feature subset, which is input into the multi-algorithm model to perform cross-validation calculation and obtain the cross-validation accuracy. The accuracy improvement is calculated by comparing the numerical difference between the cross-validation accuracy before and after a single feature dimension is written into the preferred feature set. The feature dimension corresponding to the maximum accuracy improvement is then formally written into the preferred feature set until the accuracy improvement corresponding to the remaining single feature dimensions is less than the preset improvement threshold.

[0014] As a preferred approach, branch matching of the input parameter matrix is ​​performed based on the specific feature dimensions contained in the preferred feature set: For those with complete δ 2 Extracting measured values ​​from the sample feature rows of D1 data to generate a standard optimal combination, and addressing the issue of supplemented δ... 2The first alternative optimal combination is generated by extracting the compensated values ​​from the sample feature rows of the D1 fitted value, and the second alternative optimal combination is generated by extracting the reconstructed values ​​from the sample feature rows carrying equivalent reconstructed features. Obtain the total sample set consisting of the standard optimal combination, the first alternative optimal combination, and the second alternative optimal combination, and divide the total sample set into a training feature set and a test feature set according to the proportional values; The training feature set is input into the multi-algorithm model, and the grid search cross-validation algorithm is called to perform automatic hyperparameter optimization on the multi-algorithm model to select the core basic model.

[0015] As a preferred approach, the preferred feature set is input into the multi-algorithm model to output the identification result of the natural gas genesis type, specifically including: The system acquires the blind sample data file of the natural gas to be tested, performs feature parameter extraction to generate unlabeled sample feature rows, and inputs them into the core basic model for establishing the target classification boundary; The core basic model calls the prediction probability function to obtain the probability distribution values ​​of the feature rows of the unlabeled samples belonging to the pre-labeled cause types; The maximum probability value is compared with the preset information tolerance threshold. When the maximum probability value exceeds the preset information tolerance threshold, the natural gas origin type corresponding to the maximum probability value is locked as the prediction classification result. When the maximum probability value does not exceed the preset information tolerance threshold, the probability values ​​of the top two are extracted, the normalized relative weights are calculated, and the mixture type is determined as the undetermined type. The identification result of the natural gas origin type is saved and output.

[0016] This invention provides a method for identifying the genesis of natural gas based on feature compensation and machine learning. It has the following beneficial effects: 1. This invention extracts δ from the basic dataset. 13 C1, δ 13 C2 and δ 13 C3 performs subtraction to generate carbon isotope sequence differences, and when the carbon isotope sequence differences satisfy a non-increasing relationship, it generates inverted features as input to the multi-algorithm model. These inverted features provide the multi-algorithm model with data input parameters for establishing the classification boundary of multi-source mixed gases, eliminating the multi-solution judgment bias caused by the overlapping of intervals in traditional two-dimensional analysis charts, and improving the classification accuracy of the multi-algorithm model for complex natural gas mixture origin types.

[0017] 2. This invention utilizes the presence of δ in natural gas samples 2 In the case of missing D1 data, the component data and carbon isotope data available in the natural gas sample are substituted into the multiple regression fitting equation to generate δ. 2 D1 fitting value, or extract δ 13 The ratio of C1 to the third total hydrocarbon is used to perform an algebraic addition operation to generate an equivalent reconstructed feature. δ 2D1 fit values ​​and equivalent reconstructed features fill in the missing data positions within the sample feature rows, thus removing the influence of multiple algorithm models on δ. 2 The D1 test data dependency constraints prevent natural gas samples with missing feature dimensions from being excluded by the system, and maintain the stability of the multi-algorithm model in the cause determination under data gap environment.

[0018] 3. This invention employs a recursive feature elimination algorithm to remove redundant variables from the candidate feature set based on the minimum feature weight value. It also combines this with a sequence-forward search algorithm to introduce specific feature dimensions based on the improvement in classification accuracy. The optimal feature combination is then extracted and input into a multi-algorithm model for classification. The recursive feature elimination algorithm and the sequence-forward search algorithm reduce the redundant feature dimensions carried within the candidate feature set, thereby reducing the computational resource consumption of the multi-algorithm model when constructing the classification boundary. This prevents overfitting in the multi-source heterogeneous high-dimensional parameter space, ensuring the accuracy of the final natural gas genesis type identification result. Attached Figure Description

[0019] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a block diagram of the hardware structure of the computer device of the present invention; Figure 3 This is a flowchart of the missing data compensation and fitting process of the present invention; Figure 4 This is a flowchart of the bidirectional feature optimization and model prediction sub-process of the present invention. Detailed Implementation

[0020] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] See attached document Figure 1 and attached Figure 2 This invention provides a method for identifying the genesis of natural gas based on feature compensation and machine learning, which relies on computer equipment for execution; Computer devices include a communication bus, a processor, memory, and input / output interfaces. The communication bus is connected to the processor, memory, and input / output interfaces, respectively. The processor interacts with the memory and input / output interfaces through the communication bus. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores computer-readable instructions, and the internal memory provides the execution space for the computer-readable instructions in the non-volatile storage media.

[0022] The input / output interface acquires the composition and isotope data of the natural gas in the area to be tested. The composition data includes methane, ethane, and propane content, and the isotope data includes delta content. 13 C1, δ 13 C2, δ 13 C3 and δ 2 D1. The input / output interface transmits component data and isotope data to the processor. The processor reads and executes computer-readable instructions stored in the non-volatile storage medium. It uses the component data and isotope data to perform inverted feature extraction, derived variable calculation, missing data compensation and fitting, feature optimization, and multi-algorithm model comparison and optimization to generate the identification result of natural gas genetic type. The identification result is transmitted to the input / output interface for the input / output interface to output the identification result of natural gas genetic type.

[0023] The component data and isotope data transmitted to the processor via the input / output interface constitute the basic dataset. The processor removes data from the basic dataset that deviates from the geological background noise, outputs the filtered basic dataset, and extracts the δ values ​​from the filtered basic dataset. 13 C1, δ 13 C2 and δ 13 C3 performs sequence difference calculation and determines δ. 13 C1, δ 13 C2 and δ 13 When C3 has a non-increasing relationship, an inverted feature is generated. Ratio calculation is performed on the component data to generate derived variables. For derived variables with numerical differences, logarithmic transformation is performed to generate logarithmic indices.

[0024] The filtered base dataset lacks δ 2 In the case of D1, the processor calculates δ by combining component data with carbon isotope data. 2 The D1 fit value, or the equivalent substitute parameters calculated to generate compensating feature parameters, will be used to retain the parameters, inverted features, derived variables, logarithmic indices, and δ values ​​from the filtered base dataset. 2 The D1 fit values ​​and compensation feature parameters are combined to establish a candidate feature set. A recursive feature elimination algorithm and a sequence-forward search algorithm are then used to perform variable removal and introduction calculations on the candidate feature set, retaining the optimal feature combination. A pre-built multi-algorithm model receives the optimal feature combination, performs classification operations, and outputs the identification result of the natural gas genesis type.

[0025] This invention transforms the carbon isotope inversion phenomenon into an inverted feature input multi-algorithm model, eliminating the multi-solution judgment bias caused by overlapping intervals in two-dimensional analysis charts. Data fitting and feature reconstruction provide δ 2 D1 fitting value and compensated characteristic parameters, eliminating discriminant analysis for natural gas genesis type for δ 2Dependency constraints of the D1 measured data. The recursive feature elimination algorithm and the sequential forward search algorithm reduce the data redundancy dimension contained in the candidate feature set, prevent overfitting of multiple algorithm models in high-dimensional parameter space, and ensure the accuracy of the final output of natural gas genesis type identification results.

[0026] See attached document Figure 1 The present invention provides a method for identifying the genesis of natural gas based on feature compensation and machine learning, which specifically includes the following steps: S1. The input / output interface receives the test record of a natural gas sample from the area to be tested from an external source. The natural gas sample test record includes component data, isotope data, and a label column. The component data records the methane, ethane, and propane content values ​​within the natural gas sample. The isotope data records the carbon and hydrogen isotope data within the natural gas sample; the carbon isotope data includes δ¹⁸O⁻. 13 C1, δ 13 C2 and δ 13 C3, hydrogen isotope data includes δ 2 D1. The label column records the known genetic type of the natural gas sample. Known genetic types include oil-type gas, coal-derived gas, biogenic gas, inorganic gas, and mixed gas.

[0027] In this embodiment, the processor reads the natural gas sample test records transmitted through the input / output interface, performs multi-source test index matching and verification based on the sampling timestamp and sampling well coordinates, and associates the methane content, ethane content, propane content, and δ-values ​​of the same natural gas sample. 13 C1, δ 13 C2, δ 13 C3, δ 2 D1 aligns the data horizontally with known causal types to generate sample feature rows. After the sample feature rows are constructed, the processor stacks multiple sample feature rows belonging to the test region vertically to generate a base dataset in matrix format. The known causal types in the base dataset provide training and comparison parameters for multi-algorithm models.

[0028] The processor sets corresponding methane content, ethane content, propane content, and δ for the area to be tested. 13 C1, δ 13 C2, δ 13 C3 and δ 2 The geological background threshold range for D1. As a preferred method, the geological background threshold range is defined based on the 5%–95% confidence interval distribution of the corresponding indicator in the historical exploration records of the area to be measured. The geological background threshold range for methane content is set at 50%–99.9%, δ 13The C1 geological background threshold range is set to -80‰ to -20‰. The processor reads the values ​​contained in the sample feature rows within the basic dataset and compares the values ​​contained in the sample feature rows with the corresponding geological background threshold range.

[0029] When a sample feature row contains values ​​outside the geological background threshold range, the processor classifies these values ​​as data deviating from the geological background noise range. The sample feature rows carrying this data are then removed from the base dataset, generating a filtered base dataset. This process of removing data deviating from the geological background noise range from the base dataset eliminates data extremum bias caused by geological sampling errors, preventing this bias from interfering with the numerical distribution feature learning of the multi-algorithm model and ensuring the model's robustness in predicting natural gas genesis types.

[0030] S2. The filtered base dataset stores multiple sample feature rows. The processor processes the δ values ​​recorded within each sample feature row. 13 C1, δ 13 C2 and δ 13 C3 performs a subtraction operation, subtracting the δ values ​​within the sample feature rows. 13 C2 minus δ 13 C1 generates the first carbon isotope sequence difference value, reflecting the difference in carbon isotope enrichment of ethane relative to methane in the natural gas sample, and sets the δ values ​​within the sample feature rows. 13 C3 minus δ 13 C2 generates a second carbon isotope sequence difference that reflects the difference in carbon isotope enrichment between propane and ethane in the natural gas sample. The processor performs a cyclic subtraction operation on all sample feature rows in the filtered base dataset.

[0031] The differences in the first and second carbon isotope sequences provide numerical comparison parameters to the processor. The processor has a built-in preset tolerance as an inversion threshold, with a range of -0.2‰ to 0, used to absorb system testing errors from isotope analysis instruments. The processor extracts the first carbon isotope sequence difference corresponding to the sample feature row and performs a comparison calculation with the inversion threshold. A first carbon isotope sequence difference less than the inversion threshold indicates the presence of δ0 within the sample feature row. 13 C2 is less than δ 13 The first isotope inversion trigger condition of C1. The processor further compares the difference in the second carbon isotope sequence corresponding to the sample feature row with the inversion determination threshold. If the difference in the second carbon isotope sequence is less than the inversion determination threshold, it means that δ exists within the sample feature row. 13 C3 is less than δ 13 The second isotope inversion trigger condition for C2.

[0032] If a sample feature row meets the first isotope inversion trigger condition, the processor generates an isotope inversion determination result for that sample feature row. If a sample feature row meets the second isotope inversion trigger condition, the processor generates an isotope inversion determination result for that sample feature row. If a sample feature row does not meet either the first or second isotope inversion trigger condition, it means that the difference in the first carbon isotope sequence and the difference in the second carbon isotope sequence within the sample feature row are both greater than the inversion determination threshold. In this case, the processor generates a normal isotope sequence determination result for that sample feature row. The isotope inversion determination result reflects the multi-source mixing of the natural gas sample and provides a clear boundary for multi-algorithm models to handle complex gas mixtures.

[0033] The processor reads the isotope inversion determination result and the normal isotope sequence determination result. The isotope inversion determination result reflects the multi-source mixing of the natural gas sample, providing a clear boundary for multi-algorithm models to handle complex gas mixtures. The processor appends the first carbon isotope sequence difference as a quantified inversion feature to the corresponding sample feature row. The numerical state of the first carbon isotope sequence difference being negative naturally constitutes the mathematical expression of the inversion feature.

[0034] The known origin types associated with the sample feature rows include oil-type gas, coal-derived gas, biogenic gas, inorganic gas, and mixed gas. The processor performs classification statistics on the sample feature rows within the filtered base dataset based on the known origin types, calculating a first number of sample feature rows belonging to inorganic gas and a second number of sample feature rows belonging to inorganic gas and simultaneously carrying isotope inversion determination results. Before performing the division operation, the processor determines whether the first number is close to 0. If the first number is less than the preset effective sample base of 1 and close to 0, the processor forcibly assigns a default value of 0 to the inorganic gas isotope inversion ratio to prevent system crashes caused by division by 0. If the first number is greater than or equal to the preset effective sample base of 1 and does not approach 0, the processor divides the second number by the first number to calculate the inorganic gas isotope inversion ratio. The processor uses the same division operation rules to calculate the isotope inversion ratios of mixed gas, oil-type gas, coal-derived gas, and biogenic gas in sequence.

[0035] Numerical differences exist among the isotope inversion ratios of inorganic gas, mixed gas, oil-type gas, coal-derived gas, and biogenic gas. These numerical differences validate that the inversion feature possesses numerical discriminative power among multiple known genetic types. The inversion feature provides an independent data input dimension to multiple algorithmic models, which rely on it to establish classification boundaries distinguishing between single-source gas and multi-source mixed gas. The inversion feature also intercepts classification confusion caused by mixed gas.

[0036] S3. The relative abundance variation of hydrocarbon components within natural gas directly reflects the thermal evolution maturity of the parent material. The methane, ethane, and propane contents included in the sample feature row provide the processor with the basic parameters for derived calculations. The processor performs ratio calculations to generate derived variables, which include the first total hydrocarbon ratio, the second total hydrocarbon ratio, and the third total hydrocarbon ratio. In this embodiment, to address the computational singularity caused by the lack of heavy hydrocarbon components in pure methane natural gas samples, the processor forcibly adds a preset small positive factor to the denominator of the division expression when calculating the first, second, and third total hydrocarbon ratios. The preset small positive factor is set to 10. -6 The first total hydrocarbon ratio is the result of dividing the methane content by the sum of the ethane and heavier hydrocarbon contents; that is, calculating C1 / C2. 2+ The second total hydrocarbon ratio is the numerical result of dividing the methane content by the sum of the contents of all hydrocarbons, i.e., calculating C1 / C2. 1+ The third total hydrocarbon ratio is used to measure the dryness factor; it is the result of dividing the methane content by the sum of the ethane and propane contents, i.e., calculating C1 / (C2+C3). The processor appends the derived variables to the sample feature rows of the filtered base dataset.

[0037] The filtered base dataset contains multiple sample feature rows with numerical difference derived variables. The third total hydrocarbon ratio within some sample feature rows exhibits a non-linear magnitude difference, forming a long-tailed distribution in the data space. This long-tailed distribution causes computational bias in high-value intervals when receiving feature inputs from multiple algorithm models, reducing the accuracy of feature weight allocation.

[0038] The processor reads the third total hydrocarbon ratio, which exhibits a long-tailed distribution, and uses a logarithmic transformation formula to perform logarithmic calculations on the third total hydrocarbon ratio to generate a logarithmic index. The logarithmic transformation formula is as follows: ; In the formula, Represents the logarithmic index. This represents a commonly used logarithmic function with base 10. Represents methane content, Represents ethane content, This represents the propane content.

[0039] The processor appends the logarithmic index to the corresponding sample feature rows in the filtered base dataset. Logarithmic calculation of the original dynamic range of convergent derived variables transforms the numerical distribution structure of the logarithmic index into a quasi-normal distribution, eliminating the feature weight allocation bias caused by nonlinear magnitude differences in multi-algorithm models and ensuring the balance of numerical scale when multi-algorithm models receive input parameters.

[0040] See attached document Figure 3S4, the filtered basic dataset contains multiple sample feature rows. Each sample feature row has a corresponding δ... 2 Data storage unit D1. δ 2 D1 is an isotope parameter with high testing costs, and there are instances where it is not collected or recorded during field sampling and testing. The processor targets the corresponding δ within each sample feature row. 2 The data storage unit D1 performs null value retrieval.

[0041] When the processor detects the corresponding δ 2 When the data storage unit D1 does not contain a valid value, it is determined that the sample feature row has δ. 2 D1 data missing status, and mark the presence of δ 2 The sample feature rows with missing D1 data enter the missing data compensation and fitting calculation stage. When the corresponding δ is detected... 2 When the data storage unit of D1 contains a definite value, the processor determines that the sample feature row has a complete δ. 2 D1 data, retaining complete δ 2 The sample feature rows corresponding to the D1 data are used in subsequent feature set construction. Null value retrieval intercepts isotope parameters that have not recorded valid values, preventing invalid null value parameters from being directly input into multiple algorithm models and causing classification errors.

[0042] The δ is marked 2 The sample feature rows with missing data in D1 provide a data extraction source to the processor, which then reads the δ stored in the corresponding sample feature rows. 13 C1, δ 13 C2, δ 13 C3 to third total hydrocarbon ratio. During the thermal evolution of a natural gas sample, formation thermodynamic conditions simultaneously control the fractionation degree of carbon and hydrogen isotopes, and the δ¹⁴ ... 13 C1, δ 13 C2, δ 13 C3, the third total hydrocarbon ratio and δ 2 There is a numerical co-variation relationship between D1.

[0043] The processor constructs a hydrogen isotope multiple regression fitting equation that correlates measured carbon isotope data, derived variables, and hydrogen isotope parameters, and stores the δ values ​​within the sample feature rows. 13 C1, δ 13 C2, δ 13 Substituting the C3 to third total hydrocarbon ratio into the hydrogen isotope multivariate regression fitting equation and performing multiplication and addition operations, the calculated δ is generated. 2 D1 fit value. The multivariate regression fitting equation for hydrogen isotopes is as follows: ; In the formula, Represents δ 2 D1 fitted value, Represents the regression constant parameter. Represents the first partial regression coefficient. Represents δ 13 The measured value of C1 Represents the second partial regression coefficient. Represents δ 13 The measured value of C2 Represents the third partial regression coefficient. Represents δ 13 The measured value of C3, Represents the fourth partial regression coefficient. The numerical value representing the third total hydrocarbon ratio; , , , and The numerical mapping benchmark, which reflects the thermodynamic fractionation coupling effect of carbon and hydrogen isotopes, is determined by using the least squares method iterative optimization based on a historical verification dataset with complete isotope test records extracted in advance.

[0044] The processor will δ 2 The D1 fit value is written into the corresponding δ value in the corresponding sample feature row. 2 The data storage unit D1 ensures that the missing data positions recorded within the sample feature row are precisely δ. 2 The D1 fit value is fully covered. The multi-algorithm model receives supplementary δ values. 2 The sample feature rows of the D1 fit value participate in classification boundary learning. The hydrogen isotope multivariate regression fitting equation provides alternative isotope dimension parameters to multi-algorithm models, avoiding the sample feature rows from being affected by the lack of δ. 2 The measured data of D1 is discarded to eliminate the interruption in the identification of natural gas genesis type caused by the lack of a single parameter, and to ensure the integrity of the multi-algorithm model when receiving input feature dimensions.

[0045] For the existence of δ 2 For sample feature rows where D1 data is missing and high-confidence fit values ​​cannot be obtained through regression fitting, the processor executes the equivalent feature reconstruction operation rule to extract the δ values ​​stored within the sample feature rows. 13 The ratio of C1 to the third total hydrocarbon is set as a preset equivalent index, and the calculation rules are reconstructed based on the equivalent characteristics to determine δ. 13 The value of C1 is coupled with the value of the third total hydrocarbon ratio using algebraic addition, specifically the operation combination δ. 13 C1+C1 / (C2+C3), the processor uses the combined values ​​obtained by addition to generate equivalent reconstructed features.

[0046] The processor writes the equivalent reconstruction features into the feature storage region corresponding to the feature rows of samples with extreme data loss. The first carbon isotope sequence difference, the second carbon isotope sequence difference, and the logarithmic index are similarly controlled by thermal evolution maturity and parent material type in natural gas geological evolution. The equivalent reconstruction features reuse existing carbon isotope sequence distribution relationships and light and heavy hydrocarbon component content values ​​in the basic dataset to establish numerical criteria for distinguishing various known genetic types, especially in natural gas samples completely lacking δ¹⁴ ... 2 In the case of measured D1 value and lack of data fitting conditions, functional replacement δ 2 D1 provides discriminative classification and comparison feature dimensions to the multi-algorithm model. Equivalent feature reconstruction ensures the alignment of feature input dimensions when feature rows of samples with extreme data gaps are input into the multi-algorithm model, preventing the removal of feature rows with extreme data gaps and increasing the total number of sample feature rows from the base dataset that are actually input into the multi-algorithm model for classification calculation.

[0047] The filtered base dataset contains data with complete delta values. 2 D1 data sample feature rows, supplemented with δ 2 Sample feature rows of D1-fitted values ​​and sample feature rows carrying equivalent reconstructed features. Complete δ 2 D1 data, δ 2 There is a dimensional difference between the D1 fitted value and the equivalent reconstructed feature. The processor targets the complete δ... 2 D1 data, δ 2 The D1 fit value and the equivalent reconstructed features are subjected to Z-Score standardization. The formula for Z-Score standardization is as follows: ; In the formula, Z represents the standard alignment feature, X represents the corresponding feature value of the current input, μ represents the average value of all sample data contained in the feature column, and σ represents the standard deviation value of all sample data contained in the feature column. This represents a preset minimum constant used to prevent division by zero errors when the standard deviation value approaches 0. The processor generates standardized features with uniform dimensions and a zero-mean, unit variance distribution based on Z-score normalization.

[0048] The processor extracts the δ contained in the sample feature row. 13 C1, δ 13 C2, δ 13 C3, the first carbon isotope sequence difference, the third total hydrocarbon ratio, and the logarithmic index, will be used to determine δ 13 C1, δ 13 C2, δ 13C3, the first carbon isotope sequence difference, the third total hydrocarbon ratio, the logarithmic index and the standard alignment feature are combined and calculated as a vector, and a candidate feature set is output for the sample feature rows in the filtered basic dataset.

[0049] Standardization converges the differences in numerical distribution caused by different data sources, enabling the candidate feature set to integrate measured parameters, fitted parameters, and equivalent reconstructed parameters. The candidate feature set provides multi-algorithm models with dimension-aligned feature input matrices without missing data nodes, ensuring that multi-algorithm models have a definite uniform scale benchmark when receiving heterogeneous data from multiple sources.

[0050] See attached document Figure 4 S5. The processor extracts the candidate feature set and inputs it into the Recursive Feature Elimination (RFE) algorithm. The RFE algorithm calculates the feature weight value for each feature dimension within the candidate feature set based on the feature weight subtraction principle. The processor reads the feature weight value for each feature dimension, performs ascending order calculation on the feature weight values, locates the feature dimension corresponding to the smallest feature weight value at the end of the ascending order calculation, and identifies the feature dimension corresponding to the smallest feature weight value as a redundant variable.

[0051] The processor removes redundant variables from the candidate feature set and generates a candidate feature set after a single feature space shrinkage. For the candidate feature set after a single feature space shrinkage, the recursive feature elimination algorithm is repeatedly called to calculate the feature weight values ​​and remove redundant variables until the total number of feature dimensions retained in the candidate feature set after a single feature space shrinkage is equal to the total number of preset target features.

[0052] The processor sets the retained feature dimensions as the initial feature set. The recursive feature elimination algorithm successively reduces the feature space based on feature weight values, which not only reduces the computational power consumption when multiple algorithm models read data features, but also prevents irrelevant data dimensions from lowering the accuracy of classification and comparison calculations performed by multiple algorithm models by removing redundant variables.

[0053] The processor reads the initial feature set, creates a preferred feature set containing no data, and calls the Sequence Forward Search (SFS) algorithm. Based on the additive principle of model performance, the processor extracts single feature dimensions one by one from the initial feature set and temporarily writes them into the preferred feature set, combines them to generate a test feature subset, and inputs the test feature set into the multi-algorithm model to perform cross-validation calculation. The multi-algorithm model outputs the cross-validation accuracy.

[0054] The processor calculates the accuracy improvement by comparing the numerical difference between the cross-validation accuracy before and after writing a single feature dimension into the preferred feature set. It then traverses the test feature subset to obtain the specific feature dimension corresponding to the maximum accuracy improvement and formally writes the specific feature dimension into the preferred feature set.

[0055] For the remaining single feature dimensions within the initial feature set, the processor repeatedly executes verification instructions to generate a test feature subset and calculate the accuracy improvement. When the accuracy improvement corresponding to the remaining single feature dimension is less than a preset improvement threshold, the processor interrupts the sequence forward search algorithm to extract the optimal feature set after feature writing is completed.

[0056] The sequence-forward search algorithm verifies the positive impact of each single feature dimension on the cross-validation accuracy, enabling the optimal feature set to provide data input dimensions with definite classification contributions to the multi-algorithm model, while blocking data dimensions with zero or negative contributions from being input into the multi-algorithm model, thus maintaining the numerical calculation accuracy of the multi-algorithm model when determining known causal types.

[0057] The processor reads the preferred feature set after the feature writing is completed, and performs locking and branch matching of the input parameter matrix based on the specific feature dimensions contained in the preferred feature set.

[0058] For those with complete δ 2 The processor uses the feature rows of the D1 data sample to extract measured values ​​and generate a standard optimal combination based on the feature selection results of the sequence-forward search algorithm. The standard optimal combination includes the following six feature dimensions: δ 13 C1, δ 13 C2, δ 13 C3, complete δ 2 D1 data, logarithmic index, and first carbon isotope sequence difference.

[0059] For the supplement, there is δ 2 The processor extracts the compensated values ​​from the sample feature rows of the D1 fitted values ​​to generate the first alternative optimal combination. The first alternative optimal combination contains the following six feature dimensions: δ 13 C1, δ 13 C2, δ 13 C3, δ 2 D1 fit value, logarithmic index, and first carbon isotope sequence difference.

[0060] For sample feature rows carrying equivalent reconstructed features, the processor extracts the reconstructed values ​​to generate a second alternative optimal combination. The second alternative optimal combination includes the following six feature dimensions: δ 13 C1, δ 13 C2, δ 13 C3, equivalent reconstruction features, logarithmic index, and first carbon isotope sequence difference.

[0061] The processor inputs the standard optimal combination, the first alternative optimal combination, and the second alternative optimal combination into the multi-algorithm model, respectively. The standard optimal combination provides the multi-algorithm model with classification and discrimination benchmark parameters based on the full measured data. The first and second alternative optimal combinations remove the mandatory dependency of the multi-algorithm model on the full measured data when performing classification calculations. The branch matching setting ensures that the multi-algorithm model has a stable and dimension-aligned feature input source when receiving sample feature rows containing different data completeness states, maintaining the consistency of the classification numerical output of the multi-algorithm model in both data complete and missing data environments.

[0062] The processor acquires a sample set consisting of the standard optimal combination, the first alternative optimal combination, and the second alternative optimal combination. It then divides this sample set into a training feature set and a test feature set in a 7:3 ratio. During the sample set division, the processor executes stratified sampling rules, extracting the known causal types associated with the sample feature rows as the stratification basis. This ensures that the proportions of oil-type gas, coal-derived gas, biogas, inorganic gas, and mixed gas in the training feature set are equal to their proportions in the test feature set, thereby maintaining a balanced distribution of sample categories within both sets.

[0063] The processor inputs the training feature set into the multi-algorithm model. The multi-algorithm model pre-constructs architectures for logistic regression, support vector machine, XGBoost, and random forest algorithms. To determine the optimal parameter combination for the multi-algorithm model, the processor invokes a grid search cross-validation algorithm to perform automated hyperparameter optimization. The grid search cross-validation algorithm traverses the pre-defined parameter matrix and applies tree node constraint parameters specifically to the tree-based algorithms. These tree node constraint parameters include a maximum tree depth limited to 2 to 6 levels and a minimum number of leaf nodes with a branch threshold.

[0064] To address the imbalance in sample sizes across different known causal types, a grid search cross-validation algorithm incorporates class weight balancing parameters into the multi-algorithm model. These parameters are inversely proportional to the number of samples for each known causal type, automatically adjusting the classification loss weights. Within the multi-algorithm model, 5-fold cross-validation is performed on the logistic regression, support vector machine, XGBoost, and random forest architectures. This involves five iterations of training and validation using the training feature set, calculating the F1-macro metric to comprehensively evaluate the accuracy of multi-class classification, and selecting the parameter combination corresponding to the maximum F1-macro metric for each architecture as the optimal parameter combination for a single algorithm. After cross-validation comparison and comprehensive performance evaluation, the processor compares the recall and accuracy performance of logistic regression, support vector machine, XGBoost, and random forest algorithms across different known natural gas causal types. The random forest algorithm, demonstrating the best performance in complex classification problems, is selected as the core model for natural gas causal classification and prediction. As a preferred approach, the core model aggregates 100 to 500 parallel classification and regression tree decision units, constructing a differentiated structure among the trees using the autonomous sampling and recombination method. Each classification and regression tree decision unit receives input variables, passes the data flow downwards along the tree hierarchy nodes, and calculates the splitting benefit of the feature variables by calling the Gini impurity evaluation function when dividing feature nodes, establishing the tree topology branches according to the principle of maximizing the Gini impurity decay.

[0065] The processor, relying on the optimal parameter combination, establishes a deterministic classification boundary for the core basic model. The test feature set is then input into this model to perform cross-validation calculations. After the core basic model outputs cross-validation accuracy and recall values ​​for oil-type gas, coal-derived gas, biogenic gas, inorganic gas, and mixed gas, the processor extracts these values ​​and performs graph mapping calculations to generate a comparative indicator visualization chart showing the alignment of different algorithms. This chart includes a comparative bar chart showing the accuracy for each type of formation and a distribution radar chart showing the distribution of various performance evaluation indicators. The processor then transmits this chart to the input / output interface for display. The chart visually demonstrates the differences in discrimination performance among different algorithms in a multi-source heterogeneous natural gas data environment, providing a quantitative evaluation basis for selecting the random forest algorithm as the core natural gas formation type discrimination model.

[0066] The processor acquires the natural gas blind sample data file to be tested and performs feature parameter extraction to generate unlabeled sample feature rows. All columns indicating known origin types are removed from the unlabeled sample feature rows to present an unlabeled state. Based on the completeness of isotope and component parameters within the unlabeled sample feature rows, the processor adaptively matches the standard optimal combination, the first alternative optimal combination, or the second alternative optimal combination, and inputs the unlabeled sample feature rows into the saved core model.

[0067] The core model receives unlabeled sample feature rows. Based on the deterministic classification boundary, it performs multi-classification decision matrix operations on the input variables contained in the unlabeled sample feature rows, and calls the prediction probability function to obtain the probability distribution values ​​of the unlabeled sample feature rows belonging to oil-type gas, coal-derived gas, biogas, inorganic gas, and mixed gas, respectively. The processor compares the maximum probability value with a preset confidence tolerance threshold, which is set to 60%. When the maximum probability value exceeds the preset confidence tolerance threshold, the processor locks the specific natural gas origin type corresponding to the maximum probability value as the prediction classification result. When the maximum probability value does not exceed the preset confidence tolerance threshold, the processor jointly calculates the weighted features of the top two natural gas origin types. The processor extracts the probability values ​​of the top two and divides them by the sum of the two probability values ​​as normalized relative weights, determining that the current prediction classification result belongs to the undetermined mixed gas type composed of the combination of the top two natural gas origin types, avoiding the one-sided judgment error with low confidence caused by the forced output of a single probability extreme value. The processor saves the prediction classification result and the confidence probability of each type to the results file.

[0068] The processor extracts the reserved answer file containing known true labels, establishes a comprehensive evaluation matrix, and performs backtesting comparison, checking the point-to-point association alignment between the predicted classification results and the known true labels. For each specific natural gas gene type, the processor calculates the total blind sample size and the number of correctly predicted samples for that type, and outputs the blind sample validation accuracy according to the accuracy calculation formula: ; In the formula, Representing the Accuracy of causal type Representing the The number of samples that correctly predict the causal type. Representing the Total sample size of blind samples of the same causal type.

[0069] After validation, the core basic model achieved a classification accuracy of 91.23% for oil-type gas, 97.25% for coal-derived gas, and 95.83% for inorganic gas, with an overall blind sample validation accuracy of 93.67%. The processor then outputs high-precision identification results of natural gas genesis types, including confidence probabilities. Blind sample validation successfully verified the core basic model's ability to classify unknown samples, maintaining the strong industrial application potential and data stability of the high-precision identification results for natural gas genesis types in practical geological exploration applications.

[0070] To verify the actual effectiveness of the method described in this embodiment of the invention, the processor performs a comparative feature verification on the core basic model, comparing features including and lacking inverted features. In traditional charts for natural gas genesis discrimination, isotope sequence inversion generates overlapping data regions, leading to interpretation conflicts. The processor transforms the isotope sequence inversion phenomenon into quantified inverted features, directly inputting them as numerical parameters into the multi-algorithm model, thus realizing the transformation from interpreting interference terms to classification input parameters.

[0071] The processor extracts a contrast feature set lacking inverted features and inputs it into a multi-algorithm model. The multi-algorithm model outputs a classification accuracy of 71.2% for complex gas mixtures. The processor also extracts a preferred feature set containing inverted features and inputs it into the multi-algorithm model. The multi-algorithm model utilizes the inverse distribution structure of isotope fractionation provided by the inverted features to establish classification boundaries for different gas mixture types, such as mixtures of oil-type gas and coalbed methane, and mixtures of biogas and oil-type gas.

[0072] By inputting an optimized feature set containing inverted features, the multi-algorithm model improved the classification accuracy of complex gas mixtures to 96.5%. Comparative feature verification results show that the introduction of inverted features eliminates the overlapping state of classification boundaries caused by isotope inversion, achieves a quantitative improvement in the identification accuracy of complex gas mixtures, and ensures the identification efficiency of the multi-algorithm model in distinguishing the genetic types of multi-source superimposed natural gas.

[0073] The processor further performs comparative robustness tests on the multi-algorithm models, including and without compensation verification, and constructs a control group feature set lacking data fitting compensation and equivalent feature reconstruction. The control group feature set contains features exhibiting δ. 2 The sample feature rows with missing data in D1, and the existence of δ 2 For D1 data missing conditions, the data storage unit corresponding to the sample feature row remains in a null state.

[0074] The processor inputs the control group feature set into the multi-algorithm model. Since the multi-algorithm model cannot accept feature input matrices containing null states, it addresses the presence of delta... 2For samples with missing D1 data, feature rows were discarded. Processor statistics showed that, without data fitting compensation and equivalent feature reconstruction, 42.5% of the feature rows in the filtered base dataset were removed by the multi-algorithm model due to missing parameters, resulting in a reduction in the actual number of natural gas samples participating in the classification and comparison calculation. Because the large-scale missing samples distorted the classification boundaries, the causal classification accuracy of the multi-algorithm model for the test feature set dropped to 58.3%.

[0075] In contrast, with data fitting compensation and equivalent feature reconstruction enabled, the processor generates δ by calling the hydrogen isotope multivariate regression fitting equation. 2 The D1 fit value, or equivalent reconstructed features generated according to the equivalent feature reconstruction operation rules, fills in the missing data dimensions and outputs a complete candidate feature set. The candidate feature set maintains a 100.0% retention rate for sample feature rows with missing data. The multi-algorithm model, by receiving the first and second alternative optimal combinations, stably maintains the causal classification accuracy at 96.5%. The robustness test results demonstrate the irreplaceable role of data fitting compensation and equivalent feature reconstruction in dealing with parameter missing parameters in extreme engineering environments, ensuring the stability of the classification output of the multi-algorithm model in environments with missing multi-source data.

[0076] The processor performs comparative dimensionality reduction and generalization performance tests on a multi-algorithm model, including optimized feature combinations and full redundant features. A full redundant feature set without bidirectional feature optimization is constructed, containing all high-dimensional features from the candidate feature set. The processor then inputs this full redundant feature set into the multi-algorithm model for training. With the full redundant feature set as input, the training time for the multi-algorithm model is 158.4 seconds. Due to the presence of collinear perturbation variables and noisy data dimensions within the full redundant feature set, the multi-algorithm model overfits the local specific distribution within the training feature set when constructing the classification boundary. Statistical calculations show that the multi-algorithm model achieves a causal classification accuracy of 99.6% for the training feature set, but this accuracy drops to 72.1% for the test feature set, indicating overfitting.

[0077] In contrast, the processor extracts the optimal feature set generated after bidirectional filtering using a recursive feature elimination algorithm and a sequence-forward search algorithm. The optimal feature set corresponds to the standard optimal combination, the first alternative optimal combination, and the second alternative optimal combination under different complete sample data environments. The processor inputs the optimal feature set, containing the standard optimal combination, the first alternative optimal combination, and the second alternative optimal combination, into the multi-algorithm model for training. Because bidirectional optimization removes redundant variables from the candidate feature set and intercepts negative contribution data dimensions, the dimension of the input feature matrix of the multi-algorithm model is effectively reduced. The training time of the multi-algorithm model is reduced to 11.6 seconds, lowering the computational overhead during multi-algorithm model operation.

[0078] With the optimized feature set as input, the multi-algorithm model reconstructs the target classification boundary. The processor inputs the test feature set into the multi-algorithm model with the target classification boundary. Calculations show that the multi-algorithm model achieves a causal classification accuracy of 96.8% for the training feature set, while maintaining a stable causal classification accuracy of 96.5% for the test feature set. The classification accuracy values ​​of the training and test feature sets show a high degree of consistency. Comparative tests of dimensionality reduction and generalization performance demonstrate that using the optimized feature combination can block the interference of redundant variables on the classification decisions of the multi-algorithm model, reducing computational overhead while suppressing overfitting bias, and ensuring the stability of the multi-algorithm model's generalization identification when facing unknown geological data distributions.

Claims

1. A method for identifying the genesis of natural gas based on feature compensation and machine learning, characterized in that, Includes the following steps: Natural gas sample test records are obtained to generate a basic dataset, and data that deviates from geological background noise in the basic dataset is removed to generate a filtered basic dataset. Subtraction is performed on the carbon isotope data in the filtered basic dataset, and the carbon isotope sequence difference is compared with the inversion judgment threshold to generate inversion features. Ratio calculations are performed on the component data within the filtered basic dataset to generate derived variables, and logarithmic calculations are performed on the derived variables that exhibit a long-tailed distribution to generate logarithmic indices; δ is calculated using the carbon isotope data and the derived variables. 2 The D1 fit value or equivalent reconstructed feature will retain the parameters, the inverted features, the derived variables, the logarithmic index, and the δ. 2 D1 fitting values ​​or equivalent reconstructed features are combined to establish a candidate feature set; The candidate feature set is extracted using a recursive feature elimination algorithm and a sequential forward search algorithm to retain the preferred feature set. The preferred feature set is then input into a multi-algorithm model to output the identification result of the natural gas genesis type.

2. The method for identifying the genesis of natural gas based on feature compensation and machine learning according to claim 1, characterized in that, A basic dataset is generated by acquiring natural gas sample test records. Data deviating from geological background noise in this basic dataset is then removed to generate a filtered basic dataset. Specifically, this includes: The component data, isotope data and known genetic types of the same natural gas sample are horizontally aligned to generate sample feature rows. Multiple sample feature rows belonging to the area to be tested are vertically stacked to generate a basic dataset in matrix format. By comparing the values ​​contained in the sample feature row with the corresponding geological background threshold range, the values ​​outside the geological background threshold range are classified as data deviating from geological background noise. The filtered base dataset is generated by removing the sample feature rows that carry the data that deviates from the geological background noise from the base dataset.

3. The method for identifying the genesis of natural gas based on feature compensation and machine learning according to claim 1, characterized in that, Subtraction is performed on the carbon isotope data within the filtered base dataset. The carbon isotope sequence differences are compared with the inversion threshold to generate inversion features. Specifically, this includes: δ in the sample feature row 13 C2 minus δ 13 C1 generates the first carbon isotope sequence difference, and the δ within the sample feature row... 13 C3 minus δ 13 C2 generates the second carbon isotope sequence difference; Compare the difference between the first carbon isotope sequence and the difference between the second carbon isotope sequence with the inversion determination threshold; When the difference in the first carbon isotope sequence is less than the inversion determination threshold or the difference in the second carbon isotope sequence is less than the inversion determination threshold, an isotope inversion determination result is generated, and the difference in the first carbon isotope sequence is added as a quantized inversion feature to the corresponding sample feature row.

4. The method for identifying the genesis of natural gas based on feature compensation and machine learning according to claim 1, characterized in that, The derived variables include a first total hydrocarbon ratio, a second total hydrocarbon ratio, and a third total hydrocarbon ratio; The first total hydrocarbon ratio is the quotient of the sum of the contents of ethane and heavier hydrocarbons corresponding to the methane content; the second total hydrocarbon ratio is the quotient of the sum of the contents of all hydrocarbons corresponding to the methane content; and the third total hydrocarbon ratio is the quotient of the sum of the contents of ethane and propane corresponding to the methane content. When calculating the first total hydrocarbon ratio, the second total hydrocarbon ratio, and the third total hydrocarbon ratio, a preset small positive factor is forcibly added to the denominator of the division expression; Logarithmic transformation formulas are used to perform logarithmic calculations on the third total hydrocarbon ratio that exhibits a long-tailed distribution pattern to generate a logarithmic index.

5. The method for identifying the genesis of natural gas based on feature compensation and machine learning according to claim 1, characterized in that, δ is calculated using the carbon isotope data and the derived variables. 2 The D1 fit value specifically includes: For each sample feature row, the corresponding δ 2 The data storage unit of D1 performs a null value retrieval, and upon detecting the corresponding δ... 2 When the data storage unit of D1 does not contain a valid value, it is determined that the sample feature row contains δ. 2 D1 data missing status; Reading the existence of δ 2 The δ stored in the corresponding sample feature row for the D1 data missing condition 13 C1, δ 13 C2, δ 13 C3 to third total hydrocarbon ratio; The δ 13 C1, the δ 13 C2, the δ 13 Substituting the ratio of C3 to the third total hydrocarbon into a pre-determined hydrogen isotope multivariate regression fitting equation, a multiplication and addition operation is performed to generate the calculated δ. 2 D1 fitting value, and the δ 2 The D1 fit value is written into the corresponding δ value in the corresponding sample feature row. 2 Data storage unit D1.

6. The method for identifying the genesis of natural gas based on feature compensation and machine learning according to claim 1, characterized in that, The calculation of equivalent reconstructed features using the carbon isotope data and the derived variables specifically includes: For the existence of δ 2 For sample feature rows where D1 data is missing and fitted values ​​cannot be obtained, extract the δ values ​​stored within those sample feature rows. 2 The ratio of D1 to the third total hydrocarbon is set as a preset equivalent index; Based on the equivalent feature reconstruction operation rules, the δ 13 The value of C1 is coupled with the value of the third total hydrocarbon ratio by algebraic addition, and the combined value obtained by the addition operation is used to generate an equivalent reconstructed feature. The equivalent reconstructed features are written into the feature storage area corresponding to the feature row of the sample where there are extreme data missing conditions.

7. The method for identifying the genesis of natural gas based on feature compensation and machine learning according to claim 1, characterized in that, The retained parameters, the inverted features, the derived variables, the logarithmic index, and the δ 2 Before merging the D1 fit value or the equivalent reconstructed features to establish the candidate feature set, the step of performing Z-Score standardization is also included: For those with complete δ 2 D1 data, the δ 2 The D1 fit value and the equivalent reconstructed feature extract the corresponding feature value of the current input; The intermediate difference is generated by subtracting the average value of all sample data contained in the corresponding feature column from the corresponding feature value. The quotient of the intermediate difference corresponding to the standard deviation value of all sample data contained in the corresponding feature column and the value of the sum of the preset minimum constant is set as the standard alignment feature. Extracting δ contained within the sample feature rows 13 C1, δ 13 C2, δ 13 C3, the first carbon isotope sequence difference, the third total hydrocarbon ratio, and the logarithmic index are combined with the standard alignment features to calculate and output a candidate feature set.

8. The method for identifying the genesis of natural gas based on feature compensation and machine learning according to claim 1, characterized in that, The candidate feature set is extracted and the preferred feature set is retained using a recursive feature elimination algorithm and a sequence forward search algorithm. Specifically, this includes: The candidate feature set is input into the recursive feature elimination algorithm to calculate the feature weight value. The feature dimension corresponding to the smallest feature weight value at the end is identified as a redundant variable and deleted until the total number of retained feature dimensions reaches the preset target feature total number and is set as the initial screening feature set. The sequence forward search algorithm is invoked to extract single feature dimensions one by one from the initial feature set and temporarily write them into the preferred feature set. The combination generates a test feature subset, which is input into a multi-algorithm model to perform cross-validation calculation and obtain the cross-validation accuracy. The accuracy improvement is calculated by comparing the numerical difference between the cross-validation accuracy before and after the single feature dimension is written into the preferred feature set. The feature dimension corresponding to the maximum accuracy improvement is then formally written into the preferred feature set until the accuracy improvement corresponding to the remaining single feature dimension is less than the preset improvement threshold.

9. The method for identifying the genesis of natural gas based on feature compensation and machine learning according to claim 8, characterized in that, Branch matching of the input parameter matrix is ​​performed based on the specific feature dimensions contained in the preferred feature set: For those with complete δ 2 Extracting measured values ​​from the sample feature rows of D1 data to generate a standard optimal combination, and then supplementing the δ... 2 The first alternative optimal combination is generated by extracting the compensated values ​​from the sample feature rows of the D1 fitted value, and the second alternative optimal combination is generated by extracting the reconstructed values ​​from the sample feature rows carrying the equivalent reconstructed features. Obtain a total sample set consisting of the standard optimal combination, the first alternative optimal combination, and the second alternative optimal combination, and divide the total sample set into a training feature set and a test feature set according to the proportional values; The training feature set is input into the multi-algorithm model, and the grid search cross-validation algorithm is called to perform automatic hyperparameter selection and optimization on the multi-algorithm model to determine the core basic model.

10. The method for identifying the genesis of natural gas based on feature compensation and machine learning according to claim 9, characterized in that, The preferred feature set is input into the multi-algorithm model to output the identification result of the natural gas genesis type, specifically including: The blind sample data file of the natural gas to be tested is obtained, and feature parameters are extracted to generate unlabeled sample feature rows, which are then input into the core basic model for establishing the target classification boundary. The core basic model calls the prediction probability function to obtain the probability distribution values ​​of the delabeled sample feature rows belonging to known causal types; The maximum probability value is compared with a preset information tolerance threshold. When the maximum probability value exceeds the preset information tolerance threshold, the natural gas origin type corresponding to the maximum probability value is locked as the prediction classification result. When the maximum probability value does not exceed the preset information tolerance threshold, the top two probability values ​​are extracted, the normalized relative weights are calculated, and the mixture type is determined as the undetermined type. The identification result of the natural gas origin type is saved and output.