#### Abstract

Nuclear magnetic resonance (NMR) technology provides an innovative method employed in detecting the porous structures in frozen rock and soil masses. On the basis of NMR relaxation theory, fuzzy random characteristics of the NMR *T*_{2} spectrum and pore structure are deeply analyzed in accordance with the complex and uncertain distribution characteristics of the underground rock and soil structure. By studying the fuzzy random characteristics of the NMR *T*_{2} spectrum, the fuzzy random conversion coefficient and conversion method of the *T*_{2} spectrum and pore size distribution are generated. Based on the niche principle, the traditional genetic algorithm is updated by the fuzzy random method, and the improved niche genetic algorithm is proposed. Then, the fuzzy random inversion of the conversion coefficient is undertaken by using the improved algorithm. It in turn makes the conversion curve of the *T*_{2} spectrum and pore size distribution align with the mercury injection test curve in diverse pore apertures. Compared with the previous least square fitting method, it provides a more accurate approach in characterizing complicated pore structures in frozen rock and soil masses. In addition, the improved niche genetic algorithm effectively overcomes the shortcomings of the traditional genetic algorithm, such as low effectiveness, slow convergence, and weak controllability, which provides an effective way for parameter inversion in the section of frozen geotechnical engineering. Finally, based on the *T*_{2} spectrum test of frozen sandstone, the fuzzy random characterization of frozen sandstone pore distribution is carried out by using this transformation method. The results illustrate that the conversion coefficient obtained through the improved algorithm indirectly considers the different surface relaxation rates of different pore sizes and effectively reduces the diffusion coupling effects, and the pore characteristics achieved are more applicable in engineering practices than previous methods.

#### 1. Introduction

As a key objective in frozen geotechnical engineering, frozen rock and soil masses are random, porous, and heterogeneous, characterised by noticeable composition complexity, structural diversity, and extreme anisotropy. Therefore, accurately obtaining the microscopic structures for frozen rock and soil under different conditions is of great significance when studying its physical and mechanical properties. Nowadays, there are a multitude of experimental approaches in detecting the pore structure of rock and soil. Amongst them, low-field nuclear magnetic resonance testing is a nondamaging and repeatable technology, known for its high effectiveness and reliability. This technology has become one of the important methods applied in detecting porous structure characteristics for frozen rock and soil masses [1].

The low-field nuclear magnetic resonance testing is based on the mechanism of nuclear magnetic resonance theory, and the NMR relaxation spectrum is acquired by measuring and inversing the relaxation signal. This technology establishes the conversion relationship between the relaxation time and pore size measurement and obtains the pore distribution rule [2]. Therefore, the accurate acquisition of the pore distribution law not only relies on nuclear magnetic resonance testing technology but also requires an accurate conversion method of relaxation time and pore size measurement.

In view of this problem, previous scholars had carried out a lot of research that generally fell among four types of methods: the first type was based on nuclear magnetic resonance test theory. Assuming the linear relationship between *T*_{2} spectrum and pore distributions, the NMR *T*_{2} spectrum detected was converted to the NMR capillary force curve and then fitted to determine the best conversion coefficient through the mercury intrusion test [3]. The second was underlaid on the principle of similarity. According to the NMR *T*_{2} spectrum, power functions were used to construct the NMR capillary force curve. Combined with test data from mercury injection or gas adsorption, the conversion coefficient was finally achieved by data inversion [4]. The third method was to modify the NMR *T*_{2} spectrum by eliminating the effects of boundary pores and then obtain the corresponding conversion coefficients through integration of first and second methods [5]. The fourth one was to compute the pseudocapillary pressure curve using the two-dimensional equilateral scale conversion coefficient and obtain the longitudinal conversions between the NMR *T*_{2} spectrum and pore distribution curve [6].

Due to lacking of computational models, former researchers, to a certain extent, chose neglecting the Brownian motion of the fluid molecules, which behaves in a highly degree of randomness, and specific physical and chemical environments where the fluid flows through when interpreting NMR relaxation signals [7]. Meanwhile, pore structures measured by methods such as mercury injection and gas adsorption were majorly restricted by the flow of working fluids and the relevant injecting pressures. Therefore, it also possessed a strong fuzziness [8]. It can be seen that existing testing and converting technologies are disputable in characterizing the complex structures of the rock and soil masses, and their anisotropic distribution characteristics, because of ignoring the natural phenomena of randomness and fuzziness, ultimately lead to misleading results in pore structure observation.

Hence, this study set forth to expound fuzzy and random properties existed in NMR *T*_{2} spectrum interpretation and pore structure observation. Based on fuzzy random theory, an improved niche genetic algorithm was proposed to enhance the intelligence of the existing computational model and furthermore applied in the domain of NMR *T*_{2} spectrum detecting optimization.

#### 2. Theoretical Basis

##### 2.1. Test Conditions and Basic Hypotheses

(1)The hydrogen nuclear resonance signal of the tested rock and soil can only be generated by the working fluid(2)The saturated pores of each aperture only produce a corresponding*T*

_{2}value, and perturbation and interference from echo train signal are ignored(3)The voids remain in only two states: fully saturated and fully unsaturated

##### 2.2. The Relationship between NMR Transverse Relaxation Characteristics and Pore Structure

The low-field NMR *T*_{2} spectrum test of the rock and soil mass is tested by CPMG (Carr–Purcell–Meiboom–Gill) pulse sequence. The direct result is a series of spin echo trains generated by a specific pulse sequence. The amplitude of the echo train represents the total magnetization signal under this relaxation time. The initial amplitude of the echo train is directly proportional to the number of hydrogen nuclei in the fluid under test. The amplitude of the spin echo train can be fitted with the sum of a set of exponential decay curves. The decay constant of each exponential curve is the *T*_{2} distribution.

Within a single pore, mathematically, the corresponding relationship between *T*_{2} distribution and pore size has proved, and the equation iswhere is the volume relaxation time, determined by the inherent properties of the fluid, is the surface relaxation time, is the diffusion relaxation time, is the hydrogen nuclear gyromagnetic ratio, is the effective magnetic field gradient, is the CPMG pulse sequence echo interval, is the effective diffusion coefficient, is the surface area of the pore, is the thickness of the fluid layer that can relax, is the volume of the pore, is the proportion of paramagnetic ions, is the relaxation time of coupling between paramagnetic ions and protons, is the surface lateral relaxation strength, is the geometric factor of pore shape, and is the capillary radius.

It can be seen from the above equation that the pore geometry is different; the ratio of the pore surface area to the volume and the lateral surface relaxation rate are also different. Therefore, the amplitude of the *T*_{2} spectrum represents signals of different strengths at this relaxation time, that is, indirectly indicates the number of specific pore shapes, as shown in Figure 1.

The *T*_{2} spectrum obtained by the nuclear magnetic resonance test can be considered as the statistical result of the pore distribution law of the tested rock and soil. However, a large number of experimental studies have shown that the geometry and distribution of pores in the tested rock and soil have fuzzy randomness. Consequently, the conversion parameters between the *T*_{2} spectrum and the aperture must be fuzzy and random. If the traditional conversion equation is directly used to convert the *T*_{2} spectrum and the aperture of the rock and soil mass, a certain degree of distortion will inevitably occur.

##### 2.3. Fuzzy Random Characteristics of Rock and Soil Pores

Under normal circumstances, in order to achieve the conversion of *T*_{2} spectrum and pore size, high-pressure mercury intrusion, gas adsorption, and micro-CT tests are used to determine the content of the known pore size and perform conversion calculations based on this [10–12].

Taking the mercury injection test as an example, the relationship between capillary pressure and capillary diameter can be expressed aswhere is the capillary pressure, is the fluid interfacial tension, and is the wetting contact angle.

According to equations (2) and (3), we can get

After the above equation is properly adjusted, the following can be obtained:where *C*_{1} is the conversion coefficient between *T*_{2} spectrum and capillary pressure, which can be expressed as the following equation:

It can be seen that there is a one-to-one correspondence between the mercury intrusion test and the free pore signal in the NMR *T*_{2} spectrum, that is, each of the mercury intrusion tests corresponds to a *C*_{1} value. Therefore, when the mercury intrusion test is used to convert the nuclear magnetic resonance *T*_{2} spectrum from a certain rock and soil mass, the conversion coefficient *C*_{1} should not be a fixed constant as stated in previous research literature. It is influenced by many factors in practical engineering, so it should be a fuzzy random value. The current conversion coefficient method is to use the least square method to fit the *T*_{2} spectrum and the mercury intrusion aperture cumulative curve, so as to obtain the best single-value conversion coefficient. Obviously, this method ignores the fuzzy random characteristics of pore distribution and pore geometry in the rock and soil mass.

According to equations (2) and (6), it can be derived that *T*_{2}, *r*, and *C*_{1} have the following relationship:where *C* is the conversion coefficient between the *T*_{2} spectrum and aperture, which can be expressed as

It can be seen from the above expression that when using the mercury intrusion capillary pressure curve and nuclear magnetic resonance *T*_{2} spectrum for aperture conversion, the conversion relationship between *T*_{2} and *r* can be obtained by inversion of the capillary pressure curve by combining equations (6) and (7).

When analyzing the pore characteristics of rock and soil, we often divide the aperture type into small, medium, and large pores with regard to their diameters. The pore diameters obtained by mercury intrusion testing are connected mesopores and macropores. When performing pore size conversion, we need to distinguish mesopores and macropores that are connected in the NMR *T*_{2} spectrum. However, the classification of pore size is a relatively fuzzy concept, and different classification standards immediately lead to different results. The results of the mercury intrusion test depend on its internal pore connectivity characteristics and pore wall structures, which also encompass a certain degree of randomness.

In summary, in the domain of engineering, due to the uncertainty of the pore distribution and pore geometry in the rock and soil mass, the conversion coefficient obtained by the traditional algorithm alone cannot accurately express the pore characteristics of the rock and soil mass. Therefore, the fuzzy random transformation of equation (7) can be adapted aswhere is the fuzzy random conversion coefficient.

According to equation (9), a fuzzy random intelligent algorithm should be introduced to optimize the conversion coefficient *C* so as to more effectively analyze the pore characteristics of the rock and soil mass.

#### 3. Improved Niche Genetic Algorithm

##### 3.1. Traditional Genetic Algorithm

The genetic algorithm originated from the imitation of biological heredity and evolution in nature. In the 1960s, Professor Holland of Michigan University in the United States proposed that when researching and designing artificial adaptive systems, he can learn from the mechanism of biological genetics and use the group method to perform adaptive search to achieve the purpose of optimizing actual engineering [13–15]. He randomly generates a set of initial solutions within the scope of the solution space and calculates the fitness of each individual in the population. If the termination condition is not satisfied, the program is coded, and then, the genetic operator is used to select, cross, and mutate the population to form a new population. The fitness of the population is calculated by decoding until the optimization criterion is satisfied, and the global optimal solution is finally obtained.

The characteristic of the algorithm is that the coding method uses a fixed-length binary symbol string to represent the individuals in the population, and three basic genetic operators are used in the iterative operation, namely, the selection operator, the crossover operator, and the mutation operator. However, when dealing with practical complex problems, the traditional genetic algorithm exposes some disadvantages, such as poor stability, large amount of computation, and difficulty in controlling nonlinear constraints. Especially, in the process of engineering fuzzy random problems, it appears powerless.

##### 3.2. Niche Improvement of Genetic Algorithm

The genetic algorithm adjusts the degree of similarity between individuals through the sharing function. Since the similarity has fuzzy randomness [16, 17], the fitness of the traditional genetic algorithm can be improved by fuzzy randomness based on the niche principle.

Niche originated from the concept of biology, which represents the special living environment of species under a few conditions. Therefore, the niche principle can be described as follows: classify individuals of a certain generation according to attributes and divide their respective categories. Rank individuals in the corresponding category according to fitness; then, select the top few in each category to form a new population. Under the condition that the niche criterion is not met, we adopt the methods of selection, crossover, and mutation to form a new individual and continue to cycle until the criterion is met. The niche principle can avoid the local optimum, while ensuring convergence efficiency by fuzzy random searching solution space through the genetic algorithm, which provides an effective tool for parameter optimization of the uncertain problem function [18].

The improved genetic algorithm is obtained by using the fuzzy random niche principle [19–21]. The concept is as follows:(1)Initialize the value of the genetic algebraic counter : categorize according to attributes, and randomly select *M* gene elements, which are arranged and combined as the individuals of the initial population , and then, the genetic fitness of each element is calculated by the equation: where is a random number and is a fuzzy number between 0 and 1.(2)Arrange in the descending order according to the fitness of the individual: the higher fitness is more likely to be inherited, and the previous individual with the greater fitness is retained ().(3)Random selection operator: according to the selection probability , the initial population is selected proportionally. The method is roulette random sampling to obtain the individual after the selection operation: where *M* is the group size and *F*_{i} is the fitness of the individual, which can be obtained by the equation: where *N*_{i} represents the expected survival number in the next generation group, *M* represents the group size, and #*N*_{i} is the integer part of *N*_{i}.(4)Fuzzy crossover operator: the crossover operation is performed on the selected individual according to the crossover probability . The method is single-point fuzzy crossover, and then, the individual after crossover is obtained: where represents the fuzzy crossover probability of the individual *i* and is the regular crossover probability.(5)Fuzzy mutation operator: the variation operation of the probability is carried out on the crossover individual. The method is Gaussian fuzzy mutation, and the individual after mutation is obtained: where represents the fuzzy mutation probability of the individual *i*the new individual gene value after Gaussian fuzzy mutation is where and are, respectively, the mean value and standard deviation of Gaussian fuzzy variation, which are obtained by equations (17) and (18), and are fuzzy numbers between 0 and 1: where and are the maximum and minimum of the gene at the mutation point.(6)Fuzzy genetic evolution based on the niche principle: *M* individuals obtained after Gaussian mutation are merged with *N* individuals retained with greater fitness to generate a new generation of population. The Hamming distance between any two individuals in the new population is calculated according to the equation: where and . When ( is the niche distance), its fitness is calculated according to equation (10). The values of and are compared, and niche punishment for individuals with small fitness is through the following equation: where is the original adaptation function of the individual at the time of initialization, is the new adaptive function of the individual after the correction of the niche penalty function, and is the niche fuzzy penalty function, which is obtained by the fuzzy coefficient method or Lagrange method.(7)The individuals of the new generation of population are recalculated according to equation (20) to obtain the new fitness, and the individual values are arranged in the descending order. As in step (2), the individual with the greater value of new fitness () is re-retained.(8)Set the termination condition of the genetic algorithm: if the threshold value does not meet the conditions, the first *M* individuals are selected as a new round of continuous evolution according to step (7). Until the criteria are met, output the best individual and exit the loop.

According to the above idea, a flowchart about the improved niche genetic algorithm is created, as shown in Figure 2.

#### 4. Fuzzy Random Inversion of Conversion Coefficient between *T*_{2} Spectrum and Pore Size Distribution

##### 4.1. Fuzzy Random Inversion of Conversion Coefficient

In order to verify the effect of the improved algorithm, the NMR test data of sandstone samples in [9] is taken as an example to analyze. The fuzzy random inversion of the conversion coefficients for different pore sizes is undertaken by using the improved niche genetic algorithm to analyze the fuzzy random characteristics of sandstone pore sizes which are more in line with the actual engineering conditions. According to the improved niche genetic algorithm, MATLAB is used for programming. Initialize , , , , , and ; the distance parameter between niches is 0.65, the coding adopts real number coding, and the length is 13 bits; the fuzzy random parameter *C* is the population individual, the penalty coefficient is set to 10^{−20}, and the termination algebra is 1000.

Based on the NMR test data and after loop iterations according to the improved niche genetic algorithm, the global optimal solution is the fuzzy random inversion value of the conversion coefficient. Taking into account the fuzzy random characteristics of the pore size distribution, the classification method of [1, 22–25] is used to distinguish the pore type, that is, the transverse relaxation time *T*_{2} is less than 5.8 ms for small apertures, 5.8∼33 ms for medium apertures, and greater than 33 ms for large apertures, respectively. The results of comparing the transformation coefficient inversion with the least square method and the niche genetic method under different aperture conditions are shown in Table 1.

As shown in Table 1, the conversion coefficient inverted by the improved niche genetic algorithm effectively reflects the fuzzy random characteristics of the pore distribution, pore shape, and pore size of the underground rock and soil with interval values, which is more reasonable than the fixed conversion coefficient fitted by the traditional least square method.

Considering that the conversion coefficients after fuzzy random inversion in Table 1 are fuzzy interval values, in order not to lose generality, equation (21) can express the fuzzy random state of different apertures:where is the aperture fuzzy random state function and is the constraint level (). According to the fuzzy interval algorithm, the fuzzy random conversion coefficient can be calculated.

Taking the sandstone GG5-1 sample in [9] as an example, according to the conversion coefficient of *T*_{2} spectrum and pore radius obtained, the least square method and improved niche genetic algorithm are used to convert the *T*_{2} spectrum, respectively. The result comparison for conversion curves and mercury injection testing curve is shown in Figure 3.

By comparing the curves, it is found that the improved niche genetic algorithm can effectively invert the conversion coefficients. This new algorithm makes the *T*_{2} spectrum conversion curve better match the mercury intrusion test in the case of small aperture, medium aperture, and large aperture. Compared with the previous least squares fitting method, the curve can more accurately reflect the actual characteristics of the pore structure of rock and soil.

##### 4.2. Algorithm Efficiency Comparison

The RedHat 9.0 system is configured on the LINUX host, and the least square method, traditional genetic algorithm, and improved niche genetic algorithm are used to simulate the inversion process of the conversion coefficient. The comparison effect of the inversion efficiency of various algorithms is shown in Figure 4.

As can be seen from the algorithm comparison figure, with the increase of the problem scale, the improved niche genetic algorithm has the characteristics of smaller error, higher efficiency, and obvious robustness compared with other algorithms.

#### 5. Fuzzy Random Analysis of Pore Structure of Frozen Sandstone

##### 5.1. *T*_{2} Spectrum Test during Freezing

Applying the fuzzy random analysis method in this paper and taking the coarse sandstone of Jurassic Anding Formation as the object, the low-field NMR test system (MesoMR23-060V-I, Niumai Company, Suzhou, China) is used to conduct the *T*_{2} spectrum test in the freezing process [26, 27]. Select a sample of quartz sandstone, which has a saturated water content of 8.02% and a dry density of 2.13 g/cm^{3}, see Figure 5.

In the early stage, through the results of the *T*_{2} spectrum measured every hour under the same temperature condition, it is known that the *T*_{2} signal can be stabilized after a single temperature point is maintained for 1.5 to 2.3 hours. Therefore, in order to ensure that the sample temperature reaches a stable state at each temperature point, each temperature point should be maintained for 3 hours. The cooling path adopted is shown in Figure 6. During the freezing process, the *T*_{2} spectrum test procedure is as follows: (1) make sandstone into a cylindrical sample with a diameter of 25 mm and a height of 60 mm. (2) Pressurize and saturate the sample in a vacuum saturation device for 24 hours, and set the pressure to 0.1 MPa. (3) After the saturation, the CPMG sequence is used to sequentially perform the *T*_{2} spectrum test on the saturated sample during the cooling process.

The *T*_{2} spectra at different temperature points obtained from the test are shown in Figure 7.

##### 5.2. Fuzzy Random Conversion and Analysis of *T*_{2} Spectrum

According to the fuzzy random interval values of the *T*_{2} spectrum and aperture conversion coefficient retrieved by the improved niche genetic algorithm in Table 1 and combined with the fuzzy random distribution of different apertures, as shown in equation (21), the fuzzy random conversion coefficient is obtained by using the fuzzy interval operation. Thus, the *T*_{2} spectra of frozen sandstone are converted to interpret pore distribution curves, as shown in Figure 8.

Comparing the aperture distribution and the *T*_{2} spectrum, it can be found that, with the decrease of temperature in the *T*_{2} spectrum, the pores distributed in the small pore size range have shifted to the direction of short relaxation time. In many references, it is believed that it is caused by the influence of diffusion coupling [28, 29]. However, the result of Figure 8 shows that this phenomenon does not exist in the aperture distribution after fuzzy random conversion. The reason is that the improved niche genetic algorithm is used to carry out fuzzy random inversion of pore parameters in this paper, and the conversion coefficient obtained indirectly takes into account the different surface relaxation rates of different pore sizes, thus effectively reducing the characterization of the diffusion coupling phenomenon.

From the inverted pore size distribution diagram, it can be seen that when the freezing temperature decreases from positive temperature to −2°C, the frozen pores are only distributed in the range of large aperture and medium aperture. However, according to *T*_{2} spectra, some pores distributed in the range of small aperture are frozen. The classification range of the pore size obtained by the inversion of the improved niche genetic algorithm is shown in Table 2. As shown in the table, the upper limit of the small aperture of this rock is 0.089 *μ*m and the upper limit of the medium aperture is 1.015 *μ*m.

It is found that the pore size is inversely proportional to the degree of water confinement. Therefore, the larger the pore size in the freezing process, the higher the freezing temperature is required. In other words, the pore size range of the multipeak distribution should be greatly different after the sudden drop in water content. In conclusion, for the frozen rock in this experiment, the pore structure characterization obtained according to the fuzzy random method is more consistent with the actual engineering situation.

#### 6. Conclusion

In this paper, the fuzzy random characteristics of the NMR *T*_{2} spectrum and pore structure are deeply analyzed in accordance with the complex and uncertain distribution characteristics of the underground frozen rock and soil structures. By studying the fuzzy random characteristics of the NMR *T*_{2} spectrum, the fuzzy random conversion method of *T*_{2} spectrum and pore size distribution is generated, and the following conclusions can be drawn:(1)The traditional genetic algorithm is updated by the fuzzy random method in terms of the niche principle, and the improved niche genetic algorithm is proposed. The improved algorithm effectively overcomes the shortcomings of the traditional genetic algorithm, such as low effectiveness, slow convergence, and weak controllability, which provides an effective way for parameter inversion in the section of frozen geotechnical engineering.(2)The fuzzy random inversion of the conversion coefficient is carried out by using the improved niche genetic algorithm. It in turn makes the conversion curve of *T*_{2} spectrum and pore size distribution align with the mercury injection test curve in diverse pore apertures. Compared with thre previous least square fitting method, it provides a more accurate approach in characterizing complicated pore structures in frozen rock and soil masses.(3)Based on the *T*_{2} spectrum test of frozen sandstone, the fuzzy random transformation method is used to characterize the frozen sandstone pore distribution. The results show that the conversion coefficient obtained by the improved niche genetic algorithm indirectly considers the different surface relaxation rates of different pore sizes and effectively reduces the diffusion coupling phenomenon, and the pore characteristics obtained are more consistent with the engineering practice than the previous methods.

#### Data Availability

The data used to support the findings of this study are included within the article.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

The authors express their sincere appreciation to Chief Engineers Xing-Zhong Yi and Xia Zhou and to Dr. Yan Zhu and Hua Shen for their enthusiastic support in providing related information. This work was supported by the National Natural Science Foundation of China (Grant no. 51874005), Jiangsu Construction System Science and Technology Plan Project of China (Grant no. 2017ZD062), Natural Science Foundation in Anhui Province of China (Grant no. 2008085ME165), Nantong Municipal Science and Technology Program of China (Grant no. MS12018054), and “Qinglan Project” for Training of University Teachers in Jiangsu Province of China.