Abstract
The 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. Thus, 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.
1. 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. Therefore, efficient image segmentation is a key step from image processing to image analysis and also a basic problem in computer vision.
The 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. This 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–10, 11] and the ACM based on edge information [12–16]. The 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.
The 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.
The 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. The 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. Then, 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). This saliency map term improves the performance of extracting objects from a complicated background and also enhances the asynchronous evolution of single LSF results.
The 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.
2. Background
2.1. MAC Model
The 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 can be obtained by
That is a rotation of the normalized gradient vector . and are the partial derivatives in and of image :
Next, the magnetic flux density at each pixel position x due to the electric current applied to the object boundary is computed. Given a current , is defined as
and are constants, is a set of some pixels, and denotes a boundary pixel. is an electric current vector at and proportional to the edge strength, and . is the gradient magnitude of image . is the unit vector from to , and is the distance between them. Then, given the current applied to the active contour , its magnetic field is computed as
represents the current vector at each point. is replaced by , and the evolution equation of the MAC model is defined as follows:
is a real constant, denotes the curvature, and is the unit normal of the evolving contour. is a stopping function, which is defined as
Then, the evolution equation of the MAC model with respect to level set function is as follows:
2.2. Classification Method of Sparse Representation
The two main tasks of signal sparse representation are the generation of dictionaries and the sparse decomposition of signals.
The sparse decomposition algorithm is proposed by Mallat [34], which is a very famous matching tracking (MP) algorithm. The basis function used to represent the signal can be selected flexibly according to the characteristics of the signal itself [35]. The 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 is a signal, is a dictionary, and is the coefficient matrix. Then, can be divided into two parts, and the formula iswhere is the object part and is regarded as the redundant part. The formula for extracting 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 , and the basis function in the dictionary is written as . Therefore, the contour points are decomposed into several components. It is shown as follows:

(a)

(b)

(c)

(d)

(e)

(f)
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. The 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. Through 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 is obtained, which is shown in Figure 1(e). The redundant part is shown in Figure 1(f), which always includes noise and nontarget objects. The detected points are classed into two parts and .
3. Proposed Method
3.1. Problem Analysis
The MAC is a segmentation model based on the edge information. In this model, there are two major problems when extracting the target object. The 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.

(a)

(b)
The reasons for these problems lie in the MAC model itself. The 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. The detection result is shown in Figure 2(b). Some noise points and other nontarget objects are obtained in the process of detection. Therefore, the segmentation results with MAC will be influenced.
3.2. 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. The force field is computed with the classified edge points. Two images in Figure 3 are taken as examples. The implementation process of the improved model is as follows.

(a)

(b)

(c)

(d)
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. Thus, it directly leads to a result that the model cannot accurately extract the edge information of the target object. The segmentation results are not ideal. In this paper, the extracted result is denoted by , which can be expressed as follows:where 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. The precondition is that the edge contours 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 . The other edge contours are represented as , 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). The 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. Then, the OMP algorithm is used to select the coefficient that is most correlated with the residual in 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. The result after classification is shown in Figures 3(c) and 3(d). The red contour curves represent the target part.
For an image with multiple objects of Figure 3(b), we determine the 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 of the target object extracted from the classification.
4. Experiment and Analysis
These experiments are simulated mainly in the MATLAB R2010a, with Intel Core 3.20GHZ and 4 GB of memory environment. The proposed model is compared with some advanced models. The 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].
4.1. Segmentation of Images with a Single Target
The 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. The 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.

(a)

(b)

(c)

(d)

(e)

(f)
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. Thus, the segmentation results are not ideal. The 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(e). The segmentation results of the LIF model and the SDREL model are shown in Figures 4(c) and 4(d), respectively. The 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.
The 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.
4.2. 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.

(a)

(b)

(c)

(d)

(e)

(f)
The ACMs based on local information are always sensitive to noise, such as LIF and MAC models. The corresponding segmentation results shown Figures 5(c) and 5(e) are greatly affected by the noise.
The SDREL model has the disadvantage of easily crossing weak boundaries, as shown in the first image of Figure 5(d). The 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.
4.3. Quantitative Assessment
4.3.1. 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. That 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] iswhere 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. The JS values of each model are shown 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. They 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. The 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 proposed method for quantitative analysis are compared. The F-score algorithm [38] is used as a standard. The 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. The 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. The 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 overall precision is better. Compared with the original MAC model, the segmentation precision is improved with the proposed model. When the segmentation effect is relatively satisfied, the segmentation effect with the proposed model is more accurate. Some more comparisons with MAC are shown in Figure 7. The object region is prior, and the proposed method converges to the objects. But MAC extracts some noise and nonobjects. The typical result is shown in the second result of Figure 7(a).

(a)

(b)
5. 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. The 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. This 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]. These prior studies are cited at relevant places within the text as [1, 2].
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Acknowledgments
This work was jointly supported by the National Natural Science Foundation of China (nos. U1404603 and 61901160).