The optimal solution of a Markov random field (MRF) can be solved by constructing a Markov chain that eventually goes to a balance state. However, in most situations, only an suboptimal solution can be obtained, because it is hard to choose the ideal initial state and the updating strategy. While the updating strategy has been extensively investigated, the initialization issue has been fully neglected. Though k-means-clustering has been used exclusively in initializing the label field, it suffers from the lack of account of the local constraints, which is the most essential part of the MRF model. A structural method based on selective autoencoding (SAE) is proposed for the label field initialization of MRF model in the task of sonar image segmentation. SAE is similar to the AutoEncoder, with the largest difference on the activation function, where a piece-wise sigmoid activation function with two different slop parameters is used to selectively encode image patches that resemble shadow ares or other areas. The synapse matrixes of SAE network act as information filters, preserve specific area adaptively and selectively, generating a label field that is much closer to the balance state. Experiments on sonar image segmentation demonstrate the efficiency of the SAE algorithm.