Research on Improved Image Segmentation Algorithm Based on GrabCut
Abstract
:1. Introduction
2. GrabCut Segmentation Algorithm
2.1. Algorithm Introduction
- (1)
- Assign Gaussian components in the GMM to each pixel. For each in , .
- (2)
- For the given image data Z, iteratively optimize the parameters of GMM: .
- (3)
- Estimated segmentation (based on the Gibbs energy term analyzed in (1), establish a graph and calculate the weights t-link and n-link, and then use the max flow/min cut algorithm for segmentation).
- (4)
- Repeat the above process until convergence occurs.
- (5)
- Use border cutout. Use border matching to smooth and perform post-processing on the segmented boundaries.
2.2. Description of the Problem
3. Algorithm Improvement
3.1. Appearance Overlap in Minimum Cutting
3.2. Energy Optimization Based on Appearance Overlap
3.3. Significant Object Segmentation
4. Experimental Analysis
4.1. Algorithm Comparison Experiments
4.2. Qualitative and Quantitative Comparison
4.2.1. Qualitative Comparison
4.2.2. Quantitative Comparison
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Han, S.; Wang, L. Overview of Threshold Methods for Image Segmentation. Syst. Eng. Electron. Technol. 2022, 102, 91–94. [Google Scholar]
- Jiang, F.; Gu, Q.; Hao, H. Overview of Content based Image Segmentation Methods. J. Softw. 2017, 28, 160–183. [Google Scholar]
- Hao, Q.; Zheng, W.; Wang, C.; Xiao, Y.; Zhang, L. MLRN: A multi-view local reconstruction network for single image restoration. Inf. Process. Manag. 2024, 61, 103700. [Google Scholar] [CrossRef]
- Yue, G.; Li, Y.; Jiang, W.; Zhou, W.; Zhou, T. Boundary Refinement Network for Colorectal Polyp Segmentation in Colonoscopy Images. IEEE Signal Process. Lett. 2024, 31, 954–958. [Google Scholar] [CrossRef]
- Kalb, T.; Beyerer, J. Principles of Forgetting in Domain-Incremental Semantic Segmentation in Adverse Weather Conditions. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 19508–19518. [Google Scholar]
- Khan, K.; Khan, R.U.; Ahmad, F.; Ali, F.; Kwak, K.-S. Face Segmentation: A Journey From Classical to Deep Learning Paradigm, Approaches, Trends, and Directions. IEEE Access 2020, 8, 58683–58699. [Google Scholar] [CrossRef]
- Li, C.; Sun, C.; Wang, J. Leaf vein extraction method based on improved Sobel operator and color tone information. J. Agric. Eng. 2011, 27, 196–199. [Google Scholar]
- Hu, M.; Li, M.; Wang, R. Application of an improved Otsu. J. Electron. Meas. Instrum. 2010, 24, 443–449. [Google Scholar] [CrossRef]
- Zhao, Y.; Liu, J.; Li, J. Medical image segmentation. Comput. Eng. Appl. 2007, 238–240. [Google Scholar]
- Boykov, Y.Y.; Jolly, M.P. Interactive graph cuts for optimal boundary & region segmentation of objects in ND images. In Proceedings of the Eighth IEEE International Conference on Computer Vision, ICCV 2001, Vancouver, BC, Canada, 7–14 July 2001; Volume 1, pp. 105–112. [Google Scholar]
- Boykov, Y.; Kolmogorov, V. An experimental comparison of min—Cut/max—Flow algorithms for energy minimization in vision. Tissue Eng. 2005, 26, 1631–1639. [Google Scholar]
- Rothe, C.; Kolmogorov, V.; Blake, A. “GrabCut”—Interactive foreground extraction using iterated graph cuts. ACM Trans. Graph. 2004, 23, 309–314. [Google Scholar] [CrossRef]
- Liang, Y.; Li, S.; Liu, X.; Li, F. GrabCut algorithm for automatic segmentation of target leaves in complex backgrounds. J. S. China Norm. Univ. Nat. Sci. Ed. 2018, 50, 112–118. [Google Scholar]
- Ruzon, M.; Tomasi, C. Alpha estimation in natural images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2000 (Cat. No. PR00662), Hilton Head Island, SC, USA, 13–15 June 2000; Volume 1, pp. 18–25. [Google Scholar]
- Kohli, P.; Torr, P.H. Robust higher order potentials for enforcing label consistency. Int. J. Comput. Vis. 2009, 82, 302–324. [Google Scholar] [CrossRef]
- Vicente, S.; Kolmogorov, V.; Rother, C. Joint optimization of segmentation and appearance models. In Proceedings of the 2009 IEEE 12th International Conference on Computer Vision, Kyoto, Japan, 29 September–2 October 2009; pp. 755–762. [Google Scholar]
- Achanta, R.; Hemami, S.; Estrada, F.; Susstrunk, S. Frequency-tuned salient region detection. In Proceedings of the 2009 IEEE Conference on Computer Vision and Pattern Recognition, Miami, FL, USA, 20–25 June 2009; pp. 1597–1604. [Google Scholar]
- Cheng, M.M.; Mitra, N.J.; Huang, X.; Torr, P.H.S.; Hu, S.-M. Global contrast based salient region detection. IEEE Trans. Pattern Anal. Mach. Intell. 2014, 37, 569–582. [Google Scholar] [CrossRef] [PubMed]
- Perazzi, F.; Krähenbühl, P.; Pritch, Y. Saliency filters: Contrast based filtering for salient region detection. In Proceedings of the 2012 IEEE Conference on Computer Vision and Pattern Recognition, Providence, RI, USA, 16–21 June 2012; pp. 733–740. [Google Scholar]
- Gould, S.; Fulton, R.; Koller, D. Decomposing a scene into geometric and semantically consistent regions. In Proceedings of the 2009 IEEE 12th International Conference on Computer Vision, Kyoto, Japan, 29 September–2 October 2009; pp. 1–8. [Google Scholar]
Segmentation Cost | |
---|---|
Images | AO-GrabCut Time t (s) | (s) | (s) | (s) | (s) |
---|---|---|---|---|---|
(1) | 0.083 | 3.571 | 3.488 | 4.832 | 4.749 |
(2) | 0.178 | 3.872 | 3.694 | 5.074 | 4.896 |
(3) | 0.191 | 3.725 | 3.534 | 5.011 | 4.820 |
(4) | 0.695 | 4.268 | 3.573 | 5.343 | 4.648 |
(5) | 0.129 | 3.852 | 3.723 | 4.956 | 4.827 |
Images | AO-GrabCut Time t (s) | (s) | (s) | (s) | (s) |
---|---|---|---|---|---|
(6) | 0.103 | 3.885 | 3.782 | 5.068 | 4.965 |
(7) | 0.113 | 3.513 | 3.400 | 4.985 | 4.872 |
(8) | 0.129 | 3.244 | 3.115 | 5.132 | 5.003 |
(9) | 0.231 | 3.695 | 3.464 | 5.349 | 5.118 |
(10) | 0.132 | 3.871 | 3.739 | 5.096 | 4.964 |
Dice coefficient (DSC) | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Image | (1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) | |
Algorithm | |||||||||||
min_cut | 0.79281 | 0.88009 | 0.77543 | 0.44489 | 0.62575 | 0.7123 | 0.71556 | 0.03253 | 0.38767 | 0.43389 | |
GrabCut | 0.93775 | 0.85767 | 0.87592 | 0.8871 | 0.92091 | 0.90481 | 0.83378 | 0.53358 | 0.96401 | 0.90147 | |
ours | 0.93491 | 0.96528 | 0.96613 | 0.91594 | 0.97036 | 0.94313 | 0.92257 | 0.93965 | 0.97889 | 0.97356 | |
Intersection over Union (IoU) | |||||||||||
Image | (1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) | |
Algorithm | |||||||||||
min_cut | 0.6567 | 0.7859 | 0.6332 | 0.4581 | 0.4553 | 0.5532 | 0.5571 | 0.0214 | 0.2404 | 0.5085 | |
GrabCut | 0.8828 | 0.7508 | 0.7792 | 0.8004 | 0.8534 | 0.8262 | 0.7149 | 0.3687 | 0.9305 | 0.8374 | |
ours | 0.8778 | 0.9329 | 0.9345 | 0.8035 | 0.9424 | 0.8924 | 0.8563 | 0.7324 | 0.9586 | 0.918 | |
Pixel accuracy | |||||||||||
Image | (1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) | |
Algorithm | |||||||||||
min_cut | 95.99% | 93.36% | 93.05% | 77.85% | 83.35% | 90.46% | 93.09% | 63.78% | 60.84% | 54.22% | |
GrabCut | 98.90% | 90.17% | 94.99% | 93.68% | 94.93% | 96.78% | 96.05% | 64.06% | 96.28% | 87.42% | |
ours | 98.87% | 97.92% | 98.76% | 95.15% | 98.23% | 98.20% | 97.99% | 97.12% | 97.82% | 96.74% | |
Precision | |||||||||||
Image | (1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) | |
Algorithm | |||||||||||
min_cut | 0.60158 | 0.89948 | 0.7635 | 0.68327 | 0.91608 | 0.51004 | 0.53335 | 0.05237 | 0.94129 | 0.89657 | |
GrabCut | 0.97094 | 0.78685 | 0.82487 | 0.94651 | 0.8834 | 0.85439 | 0.92598 | 0.3896 | 0.96058 | 0.89309 | |
ours | 0.85757 | 0.8777 | 0.87098 | 0.85248 | 0.91738 | 0.84165 | 0.89108 | 0.74469 | 0.92082 | 0.93614 | |
Recall | |||||||||||
Image | (1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) | |
Algorithm | |||||||||||
min_cut | 0.83401 | 0.7876 | 0.6436 | 0.29716 | 0.45728 | 0.73112 | 0.67728 | 0.23157 | 0.24206 | 0.28511 | |
GrabCut | 0.89984 | 0.95748 | 0.9491 | 0.83075 | 0.97047 | 0.94863 | 0.77151 | 0.87205 | 0.97413 | 0.93553 | |
ours | 0.88125 | 0.93675 | 0.95126 | 0.88403 | 0.95351 | 0.92187 | 0.93384 | 0.95147 | 0.98695 | 0.97511 |
Parameters | DSC | IoU | Pixel Accuracy | Precision | Recall | |
---|---|---|---|---|---|---|
Algorithm | ||||||
min_cut | 0.579625 | 0.496363 | 81.37% | 0.665735 | 0.532614 | |
GrabCut | 0.499326 | 0.764325 | 90.15% | 0.842516 | 0.908573 | |
ours | 0.943528 | 0.864392 | 95.62% | 0.864852 | 0.926397 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Pang, S.; Thio, T.H.G.; Siaw, F.L.; Chen, M.; Xia, Y. Research on Improved Image Segmentation Algorithm Based on GrabCut. Electronics 2024, 13, 4068. https://doi.org/10.3390/electronics13204068
Pang S, Thio THG, Siaw FL, Chen M, Xia Y. Research on Improved Image Segmentation Algorithm Based on GrabCut. Electronics. 2024; 13(20):4068. https://doi.org/10.3390/electronics13204068
Chicago/Turabian StylePang, Shangzhen, Tzer Hwai Gilbert Thio, Fei Lu Siaw, Mingju Chen, and Yule Xia. 2024. "Research on Improved Image Segmentation Algorithm Based on GrabCut" Electronics 13, no. 20: 4068. https://doi.org/10.3390/electronics13204068
APA StylePang, S., Thio, T. H. G., Siaw, F. L., Chen, M., & Xia, Y. (2024). Research on Improved Image Segmentation Algorithm Based on GrabCut. Electronics, 13(20), 4068. https://doi.org/10.3390/electronics13204068