## 2 Methodology
### Proposed Method  
Following the MRF-based image classification algorithm, the CAMRF-FLI is proposed by incorporating the prior probability function and local similarity measure. We perform the regularization of classification map in the MAP-MRF framework. The framework is based on the interpixel class dependence assumption that neighboring pixels tend to belong to the same class. Based on the Bayesian approach, an optimization is formulated as the minimization of the global objective energy in the image by iterative minimization of local energies. Details of the MRF-based classification approach have been introduced previously [10]. The local energy of function for a pixel \(x_{i}\) is represented as  
\[U(x_{i})=U_{data}(x_{i})+U_{spatial}(x_{i}) \tag{9}\]  
where \(U_{data}(x_{i})\) is the data energy term, and \(U_{spatial}(x_{i})\) is the spatial energy term, in the CAMRF-FLI method, considering the class spatial dependency information, by incorporating the prior probability function describe in Equation (5), the data energy function is defined as  
\[U_{data}(x_{i})=-\ln(u_{k}(x_{i})\times P_{k}^{*}(x_{i})) \tag{10}\]  
And considering the class spatial dependency information, by introducing the local similarity measurement described in Equation (8), in the CAMRF-FLI method, the spatial energy term is defined as  
\[U_{spatial}(x_{i})=-\ln(\sum\limits_{j\in N_{i}}u_{k}(x_{j})\times w_{ij}(k)) \tag{11}\]  
To minimize the energy function Equation (9), many algorithms have been proposed, such as Simulated Annealing (SA), Maximum a Posterior Margin (MPM), ICM, etc. [4]. Considering computational simplicity, Equation (9) is solved by the ICM method, in addition, at each iteration in the ICM, the fuzzy memberships for each pixel are updated by  
\[u_{k}^{new}(x_{i})=\sum\limits_{k^{\prime}=1}^{c}\left(\frac{u_{k}(x_{i}) \times P_{k}^{*}(x_{i})+\sum\limits_{j\in N_{i}}u_{k}(x_{j})\times w_{ij}(k)}{ u_{k^{\prime}}(x_{i})\times P_{k^{\prime}}^{*}(x_{i})+\sum\limits_{j\in N_{i}}u_{k^{ \prime}}(x_{j})\times w_{ij}(k^{\prime})}\right) \tag{12}\]  
The flowchart of proposed CAMRF-FLI approach is shown in Figure 1. The implementation includes the following five steps:  
Step 1: Initialization  
The initial fuzzy memberships matrix \(U=\left\{u_{k}(x_{i})\right\}_{c\times n}\) is obtained by the pixel-wise probabilistic MLC method, set maximum iterations as _maxIteration_, loop counter \(b=0\) and window size \(N_{i}\)  
Step 2: Calculate the prior probability \(P_{k}^{*}(x_{i})\) and the local similarity measure \(w_{ij}(k)\)  
\(P_{k}^{*}(x_{i})\) and \(w_{ij}(k)\) are calculated according to Equations (5) and (8), respectively.  
* Calculate the data energy term \(U_{data}(x_{i})\) and the spatial energy term \(U_{spatial}(x_{i})\)  
Based on the calculated \(P_{k}^{*}(x_{i})\) and \(w_{ij}(k)\), \(U_{data}(x_{i})\) and \(U_{spatial}(x_{i})\) are calculated according to Equations (10) and (11), respectively.
* Solve objective energy function  
The objective energy \(U(x_{i})=U_{data}(x_{i})+U_{spatial}(x_{i})\) is minimized by the ICM algorithm.
* Termination  
The iteration will stop when \(b=b+1<maxIteration\) is met; otherwise, update the posterior probability for each pixel \(U=\left\{u_{k}^{new}(x_{i})\right\}_{c\times n}\) according to Equations (12), and go back to Step 2 and repeat.  
The main contributions of CAMRF-FLI are as follows. (1) It is free of any experimentally adjusted parameters. (2) The class spatial dependency information is considered by introducing the class adaptive MRF-based prior probability function. (3) The spectral dissimilarity is taken into account by incorporating the local similarity measurement based fuzzy local information. The identification of centered pixel is determined by the spatial dependency and spectral information of its own and neighbors' pixels simultaneously, to a certain extent the CAMRF-FLI approach can refine the classification map in homogeneous areas and reduce the boundary pixels classification errors simultaneously.