Magnetostatic Active Contour Model with Classification Method of Sparse Representation

-e active contour model is widely used to segment images. For the classical magnetostatic active contour (MAC) model, the magnetic field is computed based on the detected points by using an edge detector. However, noise and nontarget points are always detected. -us, MAC is nonrobust to noise and the extracted objects may be deviant from the real objects. In this paper, a magnetostatic active contour model with a classification method of sparse representation is proposed. First, rough edge information is obtained with some edge detectors. Second, the extracted edge contours are divided into two parts by sparse classification, that is, the target object part and the redundant part. Based on the classified target points, a new magnetic field is generated, and contours evolve with MAC to extract the target objects. Experimental results show that the proposed model could decrease the influence of noise and robust segmentation results could be obtained.


Introduction
Image segmentation aims to separate the "target" area and the "background" area of the input image and to extract the interesting part for in-depth understanding and analysis [1,2]. Segmented images are the advanced expression of the original pixels to semantic objects. erefore, efficient image segmentation is a key step from image processing to image analysis and also a basic problem in computer vision. e active contour model (ACM) is one of the main ways to realize image segmentation. In recent years, many scholars have conducted in-depth studies on this area, and some models are widely used in computer vision, pattern recognition, target tracking, and other fields. Recently, with the development of the neural network, some methods that combined deep learning with the level set are exerted to resolve complex segmentation and recognition problem. In [3], a new methodology combines deep learning with the level set for the automated segmentation of the left ventricle of the heart from cardiac cine magnetic resonance (MR) data. is combination is relevant for segmentation problems, where the visual object of interest presents large shape and appearance variations, but the annotated training set is small, which is the case for various medical image analysis applications.
ACM can be usually divided into two types: the ACM based on region information [4][5][6][7][8][9][10]11] and the ACM based on edge information [12][13][14][15][16]. e region-based ACM has been cited and studied by many scholars, because it does not rely on the edge information of the image and can better deal with the weak edge, even the image without edge. e classic region-based ACM is the CV model [17,18] proposed by Chan and Vese. However, it is sensitive to inhomogeneous intensity. Some methods on the basis of the CV model are proposed to solve the shortcomings. For example, the local binary fitting (LBF) model is proposed by Li [19], and the locally statistical active contour model (LSACM) model is proposed by Zhang [20]. To a certain extent, the ability of these models to segment inhomogeneous images is improved. However, the segmentation of some images with serious inhomogeneous intensity is still difficult, and the high computational complexity is usually required. In [21], the region-based ACM that embeds the image local information is proposed. By defining a local image fitting (LIF) energy [21], local image information is extracted and able to segment images with intensity inhomogeneities. e edge-based ACM mainly uses the gradient information of the image and pushes the contour to the target boundary under the action of the defined forces of the curve. It is usually robust to inhomogeneous intensity. e geodesic active contour (GAC) model [22] comes from the snake model [23], which makes the contour smoothly converge to objects. However, the evolution of the contour curve in the GAC model is slow, and it is sensitive to initialization. In order to speed the contour evolution, a distance regularized level set evolution method (DRLSE) [24] by integrating a regional speeding term is proposed by Li. On the other hand, some models by defining a new external force field on the basis of the GAC model are proposed to improve the robustness of initialization. For example, the gradient vector flow (GVF) model [25] and vector field convolution (VFC) model [26] are integrated into the GAC model. However, there are some saddle points, stationary points, and other equilibrium points [27,28] in the vector fields; thus, the contour is hard to converge to the concave area.
In [29], a variational approach for simultaneous estimation of bias field and segmentation of images with intensity inhomogeneity is presented, where the model intensity of inhomogeneous objects is Gaussian distributed with different means and variances. en, a sliding window to map the original image intensity onto another domain is introduced, where the intensity distribution of each object is still Gaussian but can be better separated. In [30], a novel ACM driven by regularized gradient flux flows is presented for image segmentation, which achieves an accurate result since the zero crossings of the image Laplacian are reached at the object boundary when minimizing the gradient flux flows. Meanwhile, the Laplacian of the image is regularized with an anisotropic diffusion term, which can not only reduce noise but also preserve edge information. In [31], the method named selective binary and Gaussian filtering regularized level set (SBGFRLS) is proposed, which selectively penalizes the level set function to be binary and then uses a Gaussian smoothing kernel to regularize it. Zhi and Shen [32] proposed a saliency driven region-edge-based top-down level set (SDREL) by using both saliency map and color intensity as region external energy to motivate an initial evolution of level set function (LSF). is saliency map term improves the performance of extracting objects from a complicated background and also enhances the asynchronous evolution of single LSF results. e magnetostatic active contour (MAC) model [33] is proposed by Xie, and it utilizes the edge information to realize the segmentation of objects. Different from the ACMs based on traditional vector fields, the problem of equilibrium points does not exist in MAC, and it can effectively extract objects with a concave region. By combining the level set method, the change of topology structure is permitted to extract multiple objects. But there are two main problems with MAC: (1) robustness to noise should be improved; (2) the detected edge is sometimes deviant from the real target edge, which leads to the inaccuracy of the segmented result. In order to solve these two problems, an improved MAC model with a classification method of sparse representation is proposed.

MAC Model.
e edge information of the image is used in the MAC model. It takes the force of the magnetic field to the current as the original force to move the contour to the edge of the target.
In the MAC model, the direction of current for the object boundary can be computed using boundary orientation estimation. And the boundary orientation O(x) can be obtained by (1) at is a 90 ∘ rotation of the normalized gradient vector (I x (x), I y (x)).I x (x) and I y (x) are the partial derivatives in x and y of image I: Next, the magnetic flux density B(x) at each pixel position x due to the electric current applied to the object boundary is computed. Given a current I f(s) , B(x) is defined as μ 0 and π are constants, S is a set of some pixels, and s denotes a boundary pixel. Γ(s) is an electric current vector at s and proportional to the edge strength, and is the unit vector from x to s, and R xs is the distance between them. en, given the current I C applied to the active contour C, its magnetic field F(c) is computed as Υ(c) represents the current vector at each point. F(c) is replaced by F(x), and the evolution equation of the MAC model is defined as follows: α is a real constant, κ denotes the curvature, and N is the unit normal of the evolving contour. g(x) is a stopping function, which is defined as en, the evolution equation of the MAC model with respect to level set function Φ is as follows:

Classification Method of Sparse Representation.
e two main tasks of signal sparse representation are the generation of dictionaries and the sparse decomposition of signals.

2
Journal of Electrical and Computer Engineering e sparse decomposition algorithm is proposed by Mallat [34], which is a very famous matching tracking (MP) algorithm. e basis function used to represent the signal can be selected flexibly according to the characteristics of the signal itself [35]. e algorithm is easy to implement, so there are a lot of applications in many different fields, such as image and signal processing [36]. Sparse representation model is represented as follows: where Y is a signal, D is a dictionary, and L is the coefficient matrix.
en, Y can be divided into two parts, and the formula is where Y is the object part and Y is regarded as the redundant part. e formula for extracting Y is In order to clearly explain the proposed method, a typical example is shown in Figure 1. An image with noise is shown in Figure 1(a). First, some contour points are obtained by using an edge detection operator (the Sobel detector is used), which is shown in Figure 1(b). Second, the dictionary is obtained by labeling for the detected contour points. It is assumed that the number of labeled connect contours is N, and the basis function in the dictionary is written as D i (i � 1, . . . , N). erefore, the contour points Y are decomposed into several components. It is shown as follows: Because some basis functions are redundant in equation (11), the sparse coefficients are finally to be determined by solving the similar equation (8) with OMP algorithm. e main principle behind the OMP is simple and intuitive: in each iteration, the coefficients maximally correlated with the residual are chosen. In OMP, the contour length of basis function or prior information can be used as the measure of maximum correlation.
rough OMP algorithm, the corresponding basis functions are obtained, which are shown in Figure 1. When extracting a single object, with contour length correlation of OMP, the obtained result is shown in Figure 1(d). With prior information of triangle area of OMP, the result is shown in Figure 1(d). By setting M � 4 of OMP, the first four maximum correlation basis functions are obtained, and Y is obtained, which is shown in Figure 1(e). e redundant part Y � Y − Y is shown in Figure 1(f ), which always includes noise and nontarget objects. e detected points Y are classed into two parts Y and Y.

Problem Analysis.
e MAC is a segmentation model based on the edge information. In this model, there are two major problems when extracting the target object. e segmentation result of Figure 2(a) shows that the MAC model extracts some nontarget regions (including some noises) and the final extracted contour is inaccurate. e reasons for these problems lie in the MAC model itself. e magnetic field is used to extract the target object, while the magnetic field depends on the edge information which is obtained by some detection operators.
e detection result is shown in Figure 2(b). Some noise points and other nontarget objects are obtained in the process of detection. erefore, the segmentation results with MAC will be influenced.

MAC Model with the Classification Method of Sparse
Representation. In view of the shortcomings of the MAC model, the evolution equation (5) is improved in this paper. e force field is computed with the classified edge points. Two images in Figure 3 are taken as examples. e implementation process of the improved model is as follows.
First, the rough edge points are obtained by using the original edge detection operator, and the detected results are easily affected by noise and nontarget objects. us, it directly leads to a result that the model cannot accurately extract the edge information of the target object. e segmentation results are not ideal. In this paper, the extracted result is denoted by e, which can be expressed as follows: e � e 1 + e 2 + · · · + e N , where e represents the detected result, and it contains some noise points and edges of nontarget objects, and the results are shown in Figures 3(a) and 3(b). Second, the edge points obtained by using the edge detection operator form the contour curve. e precondition is that the edge contours e are divided into two types by sparse classification; that is, the formula is expressed as Some edge contours for describing the target objects are represented as e � e 1 + e 2 + · · · + e M , M ≤ N. e other edge contours are represented as e, and they are viewed as redundant. In general, for an image with a single target as shown in Figure 3(a), the target object can be determined according to edge feature (such as edge length). e longest edge contour is extracted by using the edge length, and the edge contour of the obtained target object is shown by the red line in Figure 3(c), the green contour curves represent the part that is considered redundant. On the other hand, for an image with multiple targets in Figure 3(b), target objects can be determined according to the following steps. Firstly, the contours in the detected result are marked as basis functions. en, the OMP algorithm is used to select the coefficient that is most correlated with the residual in Journal of Electrical and Computer Engineering 3 each iteration. Because the target contour occupies a large proportion in the foreground, the contour length is usually used as the maximum correlation measure without other prior information. In the end, the target objects are extracted, and the target objects are distinguished from the redundancy. e result after classification is shown in Figures 3(c) and 3(d). e red contour curves represent the target part.
For an image with multiple objects of Figure 3(b), we determine the M � 2 through the OMP algorithm, and the formula can be written as Finally, a new magnetic field is generated for the evolution of the contour according to the edge information e of the target object extracted from the classification.

Experiment and Analysis
ese experiments are simulated mainly in the MATLAB R2010a, with Intel Core 3.20GHZ and 4 GB of memory environment. e proposed model is compared with some advanced models. e compared models include the classical CV model, the SBGFRLS model, the LIF model, the SDREL model, and the MAC model. Not only the real images but also the medical images are tested, and the segmentation performance of the proposed model is evaluated objectively by calculating the Jaccard similarity coefficient [37] and F-score [38].

Segmentation of Images with a Single Target.
e images in this section are the real images published in the Weizmann database [39] for testing, for example, the six images in Figure 4. Label images for quantitative evaluation are also provided in this database. e remaining images are medical images and other images, and these images are also used for testing. Among them, the segmentation results of images with a single target are shown in Figure 4.
From these images, the region-based CV model and the SBGFRLS model are easily affected by the complex background when extracting the target objects. As shown in the segmentation results of Figures 4(a) and 4(b), these models not only extract noise points but also extract some other unnecessary objects. us, the segmentation results are not ideal. e MAC model based on the edge information has the same disadvantages as the two models mentioned above, and the segmentation results are shown in Figure 4 respectively. e LIF model is easy to be affected by the noise and inhomogeneous intensity regions, the extracted contour curves are disordered which are sensitive to initialization, and the segmentation results are inaccurate. As shown in the segmentation result of the fourth image of the SDREL model, the saliency feature is utilized to acquire an object. However, some nontargets are not detected as saliency areas so that some oversegmentation regions appear.
e segmentation results of the proposed model are shown in Figure 4(f ). Since the edge contour is classified by the classification method based on sparse representation, and only the edge contour of the target object is utilized to generate a new magnetic field; therefore, the proposed model can robustly extract the object contour, and the segmentation results are better.

Segmentation of Images with Multiple Targets.
In this section, several advanced models are used to test the segmentation performance of images with multiple targets, and the segmentation results of various models are shown in Figure 5. It can be seen that the segmentation results of the proposed model are significantly better than other models participating in the comparison. During the segmentation of these images, the parameters in each model are set to default values without any changes. Both CV and SBGFRLS models utilize the region information to evolve the contour, and they are robust to noise compared with the ACMs based on edge information. As shown in Figures 5(a) and 5(b), the results are less affected by noise, but they are affected by nontarget objects. For example, the first row segmentation results of Figures 5(a) and 5(b) show that the segmentation results of these models include some nonobjects.
e ACMs based on local information are always sensitive to noise, such as LIF and MAC models. e corresponding segmentation results shown Figures 5(c) and 5(e) are greatly affected by the noise.
e SDREL model has the disadvantage of easily crossing weak boundaries, as shown in the first image of Figure 5(d).
e proposed model utilizes the classification method of sparse representation. In the proposed model, M � 2 is set in the simulations, and noise and nontarget objects are viewed as redundancy; thus, it improves the segmentation accuracy.

Jaccard Similarity Coefficient.
In order to objectively reflect the good segmentation performance of the proposed model, the Jaccard similarity coefficient (JS) is used for quantitative evaluation in this section.
at is, the label images published in [39] are compared with the segmentation results of several advanced models mentioned in Figures 4 and 5. Jaccard similarity coefficient formula [37] is where A is the segmentation result and B is the ground truth of the original image. When the JS value is larger, indicating higher similarity, the segmentation results are relatively accurate. e JS values of each model are shown Journal of Electrical and Computer Engineering 5 in Tables 1 and 2. More segmentation results with our model are shown in Figure 6 and the assessment results are shown in Table 3. Because the edge contours are classified in the proposed method, the edge contour of the desired target is extracted, and the new magnetic field is generated.
Consequently, compared with the other models, the segmentation results of the proposed model are the best. For example, it can be seen from Table 1 that the LIF model is greatly influenced by the noise, and the segmentation effect is always not ideal. Compare the JS values of the first column and the sixth column in Table 1. CV model and SBGFRLS model are having better segmentation results in Figure 5 compared with the models based on local information, such as LIF. Table 2 shows the segmentation performance of the models. ey represent the Jaccard similarity coefficients of the four images with multiple targets in Figure 5. Because of the influence of nonobjects, the accuracy with the models based on region information is not ideal, as shown in Figure 2(a), and the Jaccard similarity coefficient of the proposed model is higher than that of the other models. It verifies again that the segmentation results of the proposed model are ideal. e averaged JS is shown in Table 3. From Table 3, the proposed method obtains the averaged JS in tested images, which show the robustness of the proposed method. More results with the proposed method are shown in Figure 6, and the corresponding JS is shown in Table 4, which verifies the robust performances of the proposed method.
Since the proposed method is integrated into the MAC model, in order to evaluate the upgrade rate with the proposed method, the results in Figure 4 with MAC and the  Journal of Electrical and Computer Engineering proposed method for quantitative analysis are compared. e F-score algorithm [38] is used as a standard. e formula of the algorithm is as follows: .
Among them, TP is the correct segmentation sample of the target foreground; FP is a sample that divides the target background error into the foreground; FN is a sample that divides the target foreground error into the background. P is the precision rate, representing the proportion of the correct segmentation foreground to the total segmentation foreground; R is the recall rate, representing the proportion of the correct segmentation foreground to the standard sample of the target foreground. F is the accuracy rate, and it is the overall evaluation index to judge whether the segmentation result is accurate. e results obtained by the F-score algorithm are shown in Table 5.
It can be seen from Table 4 that the segmentation results of the proposed model are more ideal and more suitable for the desired target. e specific performance is that the precision rate, recall rate, and accuracy rate of segmentation results of the proposed model are relatively high, there is no larger oversegmentation or leakage segmentation, and the    Figure 7. e object region is prior, and the    Figure 7(a).

Conclusion
In this paper, a magnetostatic active contour model with a classification method of sparse representation is proposed, in order to solve the problem that the magnetostatic active contour model is often affected by the nonobject background and noise in the image segmentation. In this model, the idea of sparse representation is introduced. e edge contours are divided into two categories: targets and redundancies. Only the edge contours of the target objects are extracted by edge feature or OMP algorithm, and they are recalculated to generate a new magnetic field.
is method could robustly extract the edge contour of the target object. It is simple and easy to implement. And it can effectively avoid the influence of noise points and unnecessary objects.

Data Availability
Weizmann database is used to support this study which is shown in [39]. ese prior studies are cited at relevant places within the text as [1,2].

Conflicts of Interest
e authors declare that they have no conflicts of interest. A-D represent the four original images with multiple targets in Figure 4.