Image segmentation is still a challenging work at present; it has great significance for the understanding and analysis of images. Active contour model is a very successful image segmentation method, which is divided into parametric active contour model     and geometric active contour model  - . The difference between the two lies in whether the curve is constructed by using the parametric equation of display or the implicit equation of level set method.
Currently, the Piecewise Constant (PC) model  based on global information (often referred to as C-V model), Region-Scalable Fitting (RSF) model  and Local Image Fitting (LIF) model  based on local information are the three types of models most widely used. In C-V model, the gray level of the target and background is assumed to be constant. Due to over-reliance on the global average, this assumption will lead to the wrong segmentation of the evolution curve in the segmentation of the image with uneven gray level. The variable intensity fitting RSF model based on the local area of the image overcomes the deficiency of the global model in the segmentation of non-uniform gray scale images. However, it can be seen from the segmentation results that the over-dependence on the local information of the image makes it more sensitive to the initialization and noise. The Local Image Fitting (LIF) model proposed by Zhang et al.  is also a model using local information for curve evolution. Compared with RSF model, the convolution calculation efficiency of LIF model is higher, but it also has the disadvantage of being sensitive to initialization.
On the basis of the above models, the researchers put forward many improved models. Liu et al.  proposed a ternary variational level set model including gradient regularization and function regularization based on C-V, and designed an alternate minimization algorithm to solve the model effectively. Based on the RSF model, the fitting center is defined in the Local Pre-Fitting (LPF) energy model of Ding et al. , which greatly improves the curve evolution rate. Han et al.  proposed a new Global Weighted Function (GWSPF) and a new Locally Weighted SPF (LWSPF) active contour model. Gao et al.  proposed a robust convex active contour model for texture segmentation, which has good robustness to complex textures.
Based on LIF model, an improved active contour model is proposed in this paper. First, we replace the mean value of the LIF model with the median intensity of the local area as the fitting center to enhance the robustness to noise. Secondly, the energy equation about the LOG operator is established to minimize it, which can enhance the edge information while smoothing the uniform region. Finally, the minimized Log energy term is combined with the LIF term to drive the curve to the boundary. The experimental results show that the segmentation accuracy and speed of the proposed model are significantly improved and the segmentation effect is good.
2.1. RSF Model
Let , for a given image , The closed contour C is constructed by the level set function ,
In order to make full use of local image information, Li et al.  constructed the following energy function:
In Equation (1), is the Gaussian kernel function, controls the size of the kernel function.
is the mean intensity inside and outside the locally approximated curve, and the expression is as follows:
is the smooth approximation function of Heaviside function , is Dirac function, is a constant.
In general, , the curve evolution equation obtained through curve evolution theory is as follows:
Since the kernel function , , is the weighted average of the intensity of the image in the Gaussian window inside and outside the curve, the high-precision segmentation of the image with uneven intensity can be achieved. However, if the initial contour is not set properly, the evolution rate of the curve may drop sharply and eventually fall into the local minimum. This means that different positions of the initial contour may lead to different segmentation results, and inappropriate initial contour may lead to segmentation failure.
2.2. Local Image Fitting (LIF) Model
Zhang et al.  also used the local information of the image to propose a LIF model, and the energy functional is defined as follows:
is defined as follows：
where , is calculated as follows:
Finally, its evolution equation is as follows:
In LIF model, and can be viewed as the average of the image strength in the window. Thus, and are the same as and in the RSF model. By introducing local image information, LIF model can segment images with uneven intensity, calculating only two reels at a time, which is half of that of RSF model, so the calculation cost is lower. However, with the introduction of localization information, the model becomes more sensitive to the location of the initial contour and is prone to fall into the local minimum.
2.3. LOGF Model
Ding et al.  proposed an optimized Laplacian of gaussian (Log) energy for the sensitivity of the local information active contour model to the initial contour. Its model is as follows:
where C is a constant, is Laplacian of gaussian, defined as Equation (11).
is the energy function of the Log of image, when declines, will drive L to 0, which helps to smooth the regions. When approaching the target edge, will drive L to close to , when C > 1, it can enhance the target edges.
Its evolution equation is as follows:
3. The Proposed Model
In the LIF model, the fitting center is represented by the gray mean of images inside and outside the evolution curve. This method has poor robustness to noise points, and when there are many noise points in the image, the gray mean cannot accurately reflect the change of gray level of the image. In order to solve this problem, this paper uses the median value of grayscale of images inside and outside the evolution curve instead. When there are noise points in the image, the median value can guarantee the accuracy of the fitting center and better reflect the gray level change of the image area. The fitting center can be defined as:
In Equation (13), med() is the median operator. Because the noise point belongs to the mutation pixel point, it will have a great influence on the result when calculating with the mean value. However, the calculation of median does not need to calculate the specific values of all pixel points, so the median is more robust to noise points. Figure 1 shows the segmentation effect of the LIF model based on Equation (8) and Equation (13) on noisy images.
In Figure 1, (A) is the original image containing noise, (B) is the segmentation result based on Equation (8), and (C) is the segmentation result based on Equation (13). As can be seen from Figure 1, the segmentation results of LIF model based on Equation (8) show some small segmentation points, and the smoothness of the curve is not good, while the segmentation results based on Equation (13) are better.
Next, we propose the following model:
where are calculated in Equation (13), is calculated by Equation (16).
In order to make the curve evolve more stably and quickly, the length constraint term and distance regularization term are introduced into the model, keeps the curve smooth, and keeps the steady evolution of the level set function without the need for re-initialization.
The final evolution equation is as follows:
In this paper, the finite difference method is used to solve the differential Equation (19), the central difference method is used to approximate the partial derivatives in the spatial domain, and the forward difference method is used to approximate the partial derivatives in the time domain. The discrete form of Equation (19) is:
Figure 1. Comparison of LIF models based on Equation (8) and Equation (13).
where and are calculated as follows:
The segmentation steps of the above model can be summarized as the following steps:
Step 1: Initialize , and set parameters.
Step 2: Calculate according to Equation (16), Calculate according to Equation (13).
Step 3: Update according to Equation (20).
Step 4: Judge whether the curve evolution is stable. If so, stop iteration and update the contour to obtain segmentation results. If you are not satisfied, go to Step 2.
In addition, we used precision rate P, recall rate R and DICE Similarity Coefficient DSC  to quantitatively evaluate the performance of the model.
where represents the ground truth, and represents the area where the model solves. The closer the value of P is to 1, the better the image split. At , it is stated that the solved area is the same as the real area, and the split result is the best. The same is true for R and DSC, where only approximately close to 1 represents the better segmentation effect.
4. Experimental Results and Analysis
In order to verify the validity of this algorithm, this section gives the model mentioned in this article and the image segmentation experimental results of this model. In this model, is set to a small constant function . When calculating , , , number of iterations . When evolving the curve : ; ; ; ; , . The window size of is , and the standard deviation is . These parameters can be adjusted for different images.
The four original images in Figure 2 were segmented by different methods, and the segmentation results were shown in Figures 3-6. By Figures 3-6 shows, this method can effectively the original image is divided into different areas, image segmentation and edge smooth, verified the effectiveness of the method of image segmentation, and many mistakes occur in contrast method dividing point, lead to loss of some important information, obtained the “split” or “under segmentation results. The model obtained ideal segmentation results for all four images, followed by LOGF model, which correctly segmented three images, while LIF and RSF model had poor effect.
In order to objectively evaluate the segmentation quality of each model, we present the ground truth of four images, as shown in Figure 7.
Table 1 statistics the number of iterations, Equation (22) is used to solve the precision rate, recall rate and DSC by combining our results of the four images with the ground truth. As can be seen from Table 1, P, R and DSC of the model in this paper are all above 90%. P, R and DSC reached 99%.
Table 2 shows the segmentation time of each model for the four images. As for image (A), the RSF model took the most time, 0.9212 s, and the LIF and LOGF take very close, while the time of our model is 0.3853 s, which was less than half of the LOGF. For image (B) and (C), RSF still takes the most time, while the model in this paper takes the least time. As for image (D), the model in this paper used the least segmentation time, which is 0.5853 s, followed by LIF model, LOGF, and 0.9275 s for RSF model, and our model takes 63% of the time that the RSF model takes. Compared with the other three models, the segmentation time of the four images in this model is reduced and the segmentation speed is improved.
Figure 2. Original images.
Figure 3. Image segmentation results of RSF.
Figure 4. Image segmentation results of LIF.
Figure 5. Image segmentation results of LOGF.
Figure 6. Image segmentation results of our model.
Figure 7. Ground truth.
Table 1. The iteration times and segmentation accuracy of the model in this paper for Figure 2.
Table 2. Comparison of time consumption by each model (\s).
In conclusion, the proposed model can better balance the effect of image segmentation and the efficiency of image segmentation, and compared with the other three models, the proposed model can accurately perform image segmentation while meeting the requirements of image segmentation efficiency. According to the final segmentation result, the required running time and the number of iterations, it can be seen that the model in this paper has good segmentation effect and unique advantages in the accuracy and speed of the algorithm.
In view of the traditional active contour, model in the zone of partial information is sensitive to initial contour, segmentation and segmentation accuracy rate needs to be improved; this paper puts forward an improved local area active contouring model, which uses the median fitting center to improve the robustness of noise, at the same time, combined with the optimization of the Log function, enhances the image edge information. Compared with RSF, LIF and LOGF, the methods of segmentation accuracy, segmentation effect, calculation speed and noise resistance are better.
 Zhang, X., Wen, X., Xu, H., et al. (2016) Synthetic Aperture Radar Image Segmentation Based on Edge-Region Active Contour Model. Journal of Applied Remote Sensing, 10, Article ID: 036014. https://doi.org/10.1117/1.JRS.10.036014
 Chen, D. and Cohen, L.D. (2017) Anisotropic Edge-Based Balloon Eikonal Active Contours. International Conference on Geometric Science of Information, Paris, 7-9 November 2017, 782-790. https://doi.org/10.1007/978-3-319-68445-1_90
 Badoual, A., Unser, M. and Depeursinge, A. (2019) Texture-Driven Parametric Snakes for Semi-Automatic Image Segmentation. Computer Vision and Image Understanding, 188, Article ID: 102793. https://doi.org/10.1016/j.cviu.2019.102793
 Fang, L.L., Zhao, W.T., Li, X.Y. and Wang, X.H. (2017) A Convex Active Contour Model Driven by Local Entropy Energy with Applications to Infrared Ship Target Segmentation. Optics and Laser Technology, 96, 166-175. https://doi.org/10.1016/j.optlastec.2017.05.008
 Wang, H., Huang, T., Xu, Z. and Wang, Y. (2016) A Two-Stage Image Segmentation via Global and Local Region Active Contours. Neurocomputing, 205, 130-140.
 Zhang, W.H., Wang, X., Zhang, P.B. and Chen, J.F. (2017) Global Optimal Hybrid Geometric Active Contour for Automated Lung Segmentation on CT Images. Computers in Biology and Medicine, 91, 168-180. https://doi.org/10.1016/j.compbiomed.2017.10.005
 Zhang, K., Zhang, L., Lam, K. and Zhang, D. (2017) A Level Set Approach to Image Segmentation with Intensity in Homogeneity. IEEE Transactions on Cybernetics, 46, 546-557.
 Liu, C., Xie, C.H., Yang, J., Xiao, Y.Y. and Bao, J.L. (2018) A Method for Coastal Oil Tank Detection in Polarimetric SAR Images Based on Recognition of T-Shaped Harbor. Journal of Systems Engineering and Electronics, 29, 499-509. https://doi.org/10.21629/JSEE.2018.03.07
 Guan, S.-Y., Wang, T.-M., Meng, C. and Wang, J.-C. (2018) A Review of Point Feature Based Medical Image Registration. Chinese Journal of Mechanical Engineering, 31, 21-36.
 Li, C.M., Kao, C.Y., Gore, J.C., et al. (2007) Implicit Active Contours Driven by Local Binary Fitting Energy. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, Minneapolis, 17-22 June 2007, 1-7. https://doi.org/10.1109/CVPR.2007.383014
 Liu, Y., He, C., Wu, Y., et al. (2018) The L0-Regularized Discrete Variational Level Set Method for Image Segmentation. Image and Vision Computing, 75, 32-43.
 Ding, K.Y., Xiao, L.F. and Weng, G.R. (2018) Active Contours Driven by Local Pre-Fitting Energy for Fast Image Segmentation. Pattern Recognition Letters, 104, 29-36.
 Han, B. and Wu, Y.Q. (2019) Active Contours Driven by Global and Local Weighted Signed Pressure Force for Image Segmentation. Pattern Recognition, 88, 715-728.
 Gao, M., Chen, H., Zheng, S., et al. (2019) Feature Fusion and Non-Negative Matrix Factorization Based Active Contours for Texture Segmentation. Signal Processing, 159, 104-118. https://doi.org/10.1016/j.sigpro.2019.01.021
 Ding, K., Xiao, L. and Weng, G. (2017) Active Contours Driven by Region-Scalable Fitting and Optimized Laplacian of Gaussian Energy for Image Segmentation. Signal Processing, 134, 224-233. https://doi.org/10.1016/j.sigpro.2016.12.021
 Taha, A.A. and Hanbury, A. (2015) Metrics for Evaluating 3D Medical Image Segmentation: Analysis, Selection, and Tool. BMC Medical Imaging, 15, Article No. 29.