# The Classification of Inertinite Macerals in Coal Based on the Multifractal Spectrum Method
## 3 Methods  
### Multifractal Spectrum Based on MF-DFA  
The method of MF-DFA is widely applied in scaling analysis due to its high accuracy and easy implementation. For grayscale images, it is not appropriate to calculate the multifractal spectrum with a gray series by the approach of one-dimensional MF-DFA. Generalizing the one-dimensional method to two-dimensional one can better express the information of the surface with self-similar properties [29]. Specifically, the process of calculating the multifractal spectrum of the grayscale image by using the two-dimensional MF-DFA method is determined as follows.  
Step 1. Regard a microscopic image as a self-similar surface with a size of \(M\times N\), which is represented by a matrix \(X(i,j),i=1,2,...,M\) and \(j=1,2,...,N\). Partition the surface into \(M_{s}\times N_{s}\) (\(M_{s}\equiv[M/s]\), \(N_{s}\equiv[N/s]\)) none-overlapping square subdomains of equal length \(s\). Each subdomain is denoted by \(X_{m,n}=X_{m,n}(i,j)\) with \(X_{m,n}(i,j)=X(r+i,t+j)\) for \(1\leq i,j\leq s\) where \(r=(m-1)s\), \(t=(n-1)s\).  
Step 2. For each subdomain \(X_{m,n}\), the cumulative sum is constructed as follows  
\[G_{m,n}(i,j)=\sum_{k_{1}=1}^{i}\sum_{k_{2}=1}^{j}X_{m,n}(k_{1},k_{2}), \tag{1}\]  
where \(1\leq i,j\leq s\), \(m=1,2,...,M_{s}\), \(n=1,2,...,N_{s}\). Note that \(G_{m,n}=G_{m,n}(i,j)(i,j=1,2,..,s)\) is a surface.  
Step 3. The local trend \(\tilde{G}_{m,n}\) for each surface \(G_{m,n}\) can be obtained by fitting it with a pre-chosen bivariate polynomial function. In this paper, we adopt the trending function as  
Figure 1: Typical microscopic images of inertinite in coal. (**a**) Pyrotisnite; (**b**) oxyfusinite; (**c**) semifusinit; (**d**) secretinite; (**e**) funginite; (**f**) maximize; (**g**) inertodetrinite; (**h**) micirinite.  
\[\tilde{G}_{m,n}(i,j)=ai+bj+c \tag{2}\]  
where \(a\), \(b\), and \(c\) are free parameters to be estimated by the least-squares method. We can determine the residual matrix \(y_{m,n}(i,j)\) with  
\[y_{m,n}(i,j)=G_{m,n}(i,j)-\tilde{G}_{m,n}(i,j). \tag{3}\]  
Step 4. The detrended fluctuation \(F(m,n,s)\) for each subdomain \(X_{m,n}\) can be defined via the variance of \(y_{m,n}(i,j)\) as follows  
\[F^{2}(m,n,s)=\frac{1}{s^{2}}\sum_{i=1}^{s}\sum_{j=1}^{s}y^{2}_{m,n}(i,j). \tag{4}\]  
Step 5. The \(q-th\) order fluctuation is obtained by averaging over all the subdomain  
\[F_{q}(s)=\exp\left\{\frac{1}{M_{s}N_{s}}\sum_{m=1}^{M_{s}}\sum_{n=1}^{N_{k}} \ln[F(m,n,s)]\right\},q=0 \tag{5}\]  
\[F_{q}(s)=[\frac{1}{M_{s}N_{s}}\sum_{m=1}^{M_{s}}\sum_{n=1}^{N_{k}}{[F(m,n,s)] ^{q}]^{1/q}},q\
eq 0. \tag{6}\]  
Step 6. The scaling relation of the fluctuation can be determined by analyzing the log-log \(F_{q}(s)\) versus the \(s\) for different values of \(s\) ranging from 6 to \(\left(M,N\right)/4\), which reads  
\[F_{q}(s)\propto s^{h(q)}. \tag{7}\]  
The scaling exponent \(h(q)\) can be obtained by the linear regression of \(\ln F_{q}(s)\) to \(\ln s\), which is also called the generalized Hurst index. For each \(q\), the corresponding traditional scaling exponent as \(\tau(q)\)  
\[\tau(q)=qh(q)-D_{f}. \tag{8}\]  
Note that, \(D_{f}\) represents the fractal dimension of the geometric support. For the two-dimensional microscopic image of this paper, we take the value of \(D_{f}=2\).  
Step 7. The multifractal surface can be characterized by _Holder_ exponent \(\alpha(q)\) and singularity spectrum \(f(\alpha)\), which are given by the Legendre transform [30].  
\[\alpha(q)=\tau^{\prime}(q)=h(q)+qh^{\prime}(q) \tag{9}\]  
\[f(\alpha)=q\alpha(q)-\tau(q)=q[\alpha-h(q)]+2. \tag{10}\]  
Here, the multifractal singularity spectrum \(f(\alpha)\) is a continuous exponential spectrum used to characterize multiple fractal sets, which provides a complete statistical description of the internal inconsistencies of fractals.