An Adaptive Threshold for the Canny Edge with Weak Label
Abstract
1. Introduction
2. Related Works
2.1. Filter-Based Algorithms
2.2. Deep Learning-Based Algorithms
3. Proposed Method
3.1. Actor and Critic Network
3.2. Computing Reward Using Weak Labels
4. Experimental Results
4.1. Weak Label Creation Result
4.2. Result of the Proposed Method
4.3. Result on Unseen Images
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Arbelaez, P.; Pont-Tuset, J.; Barron, J.; Marques, F.; Malik, J. Multi-scale combinatorial grouping. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Columbus, OH, USA, 24–27 June 2014; pp. 328–335. [Google Scholar]
- Chen, L.C.; Barron, J.T.; Papandreou, G.; Murphy, K.; Yuille, A.L. Semantic image segmentation with task-specific edge detection using CNNs and a discriminatively trained domain transform. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 4545–4554. [Google Scholar]
- Modava, M.; Akbarizadeh, G. Coastline extraction from SAR images using spatial fuzzy clustering and the active contour method. Int. J. Remote Sens. 2017, 38, 355–370. [Google Scholar] [CrossRef]
- Hermosilla, T.; Palomar-Vazquez, J.; Balaguer-Beser, A.; Balsa-Barreiro, J. Using street based metrics to characterize urban topologies. Comput. Environ. Urban Syst. 2014, 44, 68–79. [Google Scholar] [CrossRef]
- Canny, J.F. A computational approach to edge detection. IEEE Trans. Pattern Anal. Mach. Intell. 1986, 8, 34–43. [Google Scholar] [CrossRef]
- Konishi, S.; Yuille, A.L.; Coughlan, J.M.; Zhu, S.C. Statistical edge detection: Learning and evaluating edge cues. IEEE Trans. Pattern Anal. Mach. Intell. 2003, 25, 57–74. [Google Scholar] [CrossRef]
- Shen, W.; Wang, X.; Wang, Y.; Bai, X.; Zhang, Z. Deepcontour: A deep convolutional feature learned by positive sharing loss for contour detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 3982–3991. [Google Scholar]
- Bertasius, G.; Shi, J.; Torresani, L. Deepedge: A multi-scale bifurcated deep network for top-down contour detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 4380–4389. [Google Scholar]
- Xie, S.; Tu, Z. Holistically-nested edge detection. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Santiago, Chile, 7–13 December 2015; pp. 1395–1403. [Google Scholar]
- Choi, K.H.; Ha, J.E. An adaptive threshold for the Canny algorithm with deep reinforcement learning. IEEE Access 2021, 9, 156846. [Google Scholar] [CrossRef]
- Choi, K.H.; Ha, J.E. An adaptive threshold for the Canny edge with actor-critic algorithm. IEEE Access 2023, 11, 67058–67069. [Google Scholar] [CrossRef]
- Mnih, V.; Kavukcuoglu, K.; Silver, D.; Rusu, A.A.; Veness, J.; Bellemare, M.G.; Graves, A.; Riedmiller, M.; Fidjeland, A.K.; Ostrovski, G.; et al. Human-level control through deep reinforcement learning. Nature 2015, 518, 529–533. [Google Scholar] [CrossRef]
- Mnih, V.; Kavukcuoglu, K.; Silver, D.; Graves, A.; Antonoglou, I.; Wierstra, D.; Riedmiller, M. Playing atari with deep reinforcement learning. arXiv 2013, arXiv:1312.5602. [Google Scholar] [CrossRef]
- Williams, R.J. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Mach. Learn. 1992, 8, 229–256. [Google Scholar] [CrossRef]
- Degris, T.; Pilarski, P.M.; Sutton, R.S. Model-free reinforcement learning with continuous action in practice. In Proceedings of the American Control Conference (ACC), Montreal, QC, Canada, 27–29 June 2012; pp. 2177–2182. [Google Scholar]
- Mnih, V.; Badia, A.P.; Mirza, M.; Graves, A.; Harley, T.; Lillicrap, T.P.; Silver, D.; Kavukcuoglu, K. Asynchronous method for deep reinforcement learning. In Proceedings of the International Conference on Machine Learning (ICML), New York City, NY, USA, 19–24 June 2016. [Google Scholar]
- Martin, D.R.; Fowlkes, C.C.; Malik, J. Learning to detect natural image boundaries using local brightness, color and texture cues. IEEE Trans. Pattern Anal. Mach. Intell. 2004, 26, 530–549. [Google Scholar] [CrossRef]
- Arbelaez, P.; Maire, M.; Fowlkes, C.; Malik, J. Contour detection and hierarchical image segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 2011, 33, 898–916. [Google Scholar] [CrossRef]
- Dollar, P.; Tu, Z.; Belongie, S. Supervised learning of edges and object boundaries. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, New York City, NY, USA, 17–22 June 2006; pp. 1964–1971. [Google Scholar]
- Ren, X. Multi-scale improves boundary detection in natural images. In Proceedings of the European Conference on Computer Vision, Marseille, France, 12–18 October 2008; pp. 533–545. [Google Scholar]
- Lim, J.J.; Zitnick, C.L.; Doll´ar, P. Sketch tokens: A learned mid-level representation for contour and object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Portland, OR, USA, 23–28 June 2013; pp. 3158–3165. [Google Scholar]
- Doll´ar, P.; Zitnick, C.L. Fast edge detection using structured forests. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1558–1570. [Google Scholar] [CrossRef] [PubMed]
- Xu, D.; Ouyang, W.; Alameda-Pineda, X.; Ricci, E.; Wang, X.; Sebe, N. Learning deep structured multi-scale features using attention-gated crfs for contour prediction. In Proceedings of the Conference on Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017; pp. 3964–3973. [Google Scholar]
- He, J.; Zhang, S.; Yang, M.; Shan, Y.; Huang, T. Bi-directional cascade network for perceptual edge detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 3828–3837. [Google Scholar]
- Lu, J.W.; Ren, J.C.; Lu, Y. A modified Canny algorithm for detecting sky-sea line in infrared images. Isda J. 2006, 2, 16–18. [Google Scholar]
- Fang, M.; Yue, G.X.; Yu, Q.C. The study on an application of Otsu method in Canny operator. In Proceedings of the ISIP ‘09, Geneva, Switzerland, 10–12 June 2009; pp. 109–112. [Google Scholar]
- Ostu, N. Threshold selection method from gray-level histograms. IEEE Trans. Syst. Man Cybern. 1979, 9, 62–66. [Google Scholar]
- Huo, Y.K.; Wei, G.; Zhang, Y.D.; Wu, L.N. An adaptive threshold for the Canny operator of edge detection. In Proceedings of the International Conference on Image Analysis and Signal Processing, Trois-Rivières, QC, Canada, 30 June–2 July 2010; pp. 371–374. [Google Scholar]
- Lu, X.; Yao, J.; Li, K.; Li, L. Cannylines: A parameter-free line segment detector. In Proceedings of the IEEE International Conference on Image Processing, Québec City, QC, Canada, 27–30 September 2015; pp. 507–511. [Google Scholar]
- Yitzhaky, Y.; Peli, E. A method for objective edge detection evaluation and detector parameter selection. IEEE Trans. Pattern Anal. Mach. Intell. 2003, 25, 1027–1033. [Google Scholar] [CrossRef]
- Medina-Carnicer, R.; Carmona-Poyato, A.; Munoz-Salinas, R.; Madrid-Cuevas, F.J. Determining hysteresis thresholds for edge detection by combining the advantages and disadvantages of threshold methods. IEEE Trans. Image Process. 2010, 19, 165–173. [Google Scholar] [CrossRef]
- Medina-Carnicer, R.; Munoz-Salinas, R.; Yeguas-Bolivar, E.; Diaz-Mas, L. A novel method to look for the hysteresis thresholds for the Canny edge detector. Pattern Recognit. 2011, 44, 1201–1211. [Google Scholar] [CrossRef]
- Sutton, R.S.; Barto, A.G. Introduction to Reinforcement Learning, 2nd ed.; MIT Press: Cambridge, MA, USA, 2018. [Google Scholar]
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
- Silver, D.; Huang, A.; Maddison, C.J.; Guez, A.; Sifre, L.; Van Den Driessche, G.; Schrittwieser, J.; Antonoglou, I.; Panneershelvam, V.; Lanctot, M.; et al. Mastering the game of go with deep neural networks and tree search. Nature 2016, 529, 484–489. [Google Scholar] [CrossRef]
- Silver, D.; Schrittwieser, J.; Simonyan, K.; Antonoglou, I.; Huang, A.; Guez, A.; Hubert, T.; Baker, L.; Lai, M.; Bolton, A.; et al. Mastering the game of go without human knowledge. Nature 2017, 550, 354–359. [Google Scholar] [CrossRef]
- Silver, D.; Hubert, T.; Schrittwieser, J.; Antonoglou, J.I.; Lai, M.; Guez, A.; Lanctot, M.; Sifre, L.; Kumaran, D.; Graepel, T.; et al. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science 2018, 362, 1140–1144. [Google Scholar] [CrossRef]
- Caicedo, J.C.; Lazebnik, S. Active object localization with deep reinforcement learning. In Proceedings of the International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 2488–2496. [Google Scholar]
- Jie, Z.; Liang, X.; Feng, J.; Jin, X.; Lu, W.; Yan, S. Tree-structured reinforcement learning for sequential object localization. Adv. Neural Inf. Process. Syst. 2016, 29, 127–135. [Google Scholar]
- Yun, S.; Choi, J.; Yoo, Y.; Yun, K.; Young Choi, J. Action-decision networks for visual tracking with deep reinforcement learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 2711–2720. [Google Scholar]
- Baddeley, A.J. An error metric for binary images. In Robust Computer Vision: Quality of Vision Algorithms; Wichmann Verlag: Karlsruhe, Germany, 1992; pp. 59–78. [Google Scholar]
- Xu, N.; Yang, L.; Fan, Y.; Yang, J.; Yue, D.; Liang, Y.; Price, B.; Cohen, S.; Huang, T. YouTube-VOS: Sequence-to-sequence video object segmentation. In Proceedings of the European Conference on Computer Vision, Munich, Germany, 8–14 September 2018; pp. 585–601. [Google Scholar]
- Yu, F.; Chen, H.; Wang, X.; Xian, W.; Chen, Y.; Liu, F.; Madhavan, V.; Darrel, T. BDD100K: A diverse driving database for heterogeneous multitask learning. arXiv 2018, arXiv:1805.04687. [Google Scholar]









| Method | Threshold | Section 1 | Section 2 | Section 3 | Section 4 |
|---|---|---|---|---|---|
| Absolute | Evaluation value | ||||
| Threshold reversal | no | no | no | yes | |
| Relative | Evaluation value | ||||
| Threshold reversal | no | no | no | yes |
| Case 1 | Case 2 | Case 3 | Case 4 | |
|---|---|---|---|---|
| Section 1 | 1.0 | 1.0 | 1.0 | 1.0 |
| Section 2 | 0.5 | 0.5 | 0.5 | 0.5 |
| Section 3 | −0.5 | −0.5 | −0.5 | −0.5 |
| Section 4 | −1.0 | −5.0 | −10.0 | −50.0 |
| Actor, Critic Network | |
|---|---|
| Input image | 256(H) × 256(W) × 3(C) |
| Pre-processing | Weakly label, image resize and norm ([0, 255] → [0., 1.] |
| optimizer | AdamW optim |
| Learning rate | 0.001 |
| Learning scheduler | No |
| Batch size (each GPU) | 32 |
| 0.99 |
| Action Size | Train Type | Reward Method | Reward Style (Table 2) | Reward Average | (Equation (2)) | Threshold Reversal |
|---|---|---|---|---|---|---|
| High threshold: [0, 500] Low threshold: [0, 500] Filters size: [3, 9] | Continuous A2C [11] | evaluation CNN model | Case 1 | 0.815 | 0.919 | 17,430/20,000 (87.1%) |
| Case 2 | 0.832 | 0.916 | 18,981/20,000 (94.9%) | |||
| Case 3 | 0.837 | 0.921 | 19,342/20,000 (96.7%) | |||
| Case 4 | 0.794 | 0.917 | 19,485/20,000 (97.4%) | |||
| Weakly A2C | weakly label absolute evaluation | Case 1 | 0.819 | 0.954 | 19,241/20,000 (96.2%) | |
| Case 2 | 0.850 | 0.979 | 19,767/20,000 (98.8%) | |||
| Case 3 | 0.842 | 0.931 | 19,808/20,000 (99.0%) | |||
| Case 4 | 0.782 | 0.935 | 19,143/20,000 (95.7%) | |||
| weakly label relative evaluation | Case 1 | 0.823 | 0.933 | 19,066/20,000 (95.3%) | ||
| Case 2 | 0.835 | 0.948 | 19,549/20,000 (97.7%) | |||
| Case 3 | 0.826 | 0.924 | 19,482/20,000 (97.4%) | |||
| Case 4 | 0.788 | 0.937 | 18,424/20,000 (92.1%) |
| Action Size | Train Type | Additional Train | Reward Style (Table 1) | Reward Average | Magnitude Average (×5) | No Threshold Reversal Ratio (%) |
|---|---|---|---|---|---|---|
| High threshold: [0, 500] Low threshold: [0, 500] Filters size: [3, 9] | Continuous A2C [11] | No | Case 1 | 0.715 | 0.818 | 927/1070 (86.6%) |
| Case 2 | 0.723 | 0.822 | 1013/1070 (94.7%) | |||
| Case 3 | 0.746 | 0.834 | 1025/1070 (95.8%) | |||
| Case 4 | 0.698 | 0.804 | 948/1070 (88.6%) | |||
| Weakly label absolute evaluation | Case 1 | 0.729 | 0.836 | 1055/1070 (98.6%) | ||
| Case 2 | 0.733 | 0.841 | 1067/1070 (99.7%) | |||
| Case 3 | 0.730 | 0.832 | 1031/1070 (96.4%) | |||
| Case 4 | 0.701 | 0.824 | 1004/1070 (93.8%) | |||
| Yes (epoch = 50, half then pre-train) | Case 1 | 0.824 | 0.871 | 1061/1070 (99.2%) | ||
| Case 2 | 0.831 | 0.878 | 1065/1070 (99.5%) | |||
| Case 3 | 0.836 | 0.883 | 1068/1070 (99.8%) | |||
| Case 4 | 0.830 | 0.879 | 1062/1070 (99.2%) |
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. |
© 2025 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
Choi, K.-H.; Ha, J.-E. An Adaptive Threshold for the Canny Edge with Weak Label. Appl. Sci. 2025, 15, 12158. https://doi.org/10.3390/app152212158
Choi K-H, Ha J-E. An Adaptive Threshold for the Canny Edge with Weak Label. Applied Sciences. 2025; 15(22):12158. https://doi.org/10.3390/app152212158
Chicago/Turabian StyleChoi, Keong-Hun, and Jong-Eun Ha. 2025. "An Adaptive Threshold for the Canny Edge with Weak Label" Applied Sciences 15, no. 22: 12158. https://doi.org/10.3390/app152212158
APA StyleChoi, K.-H., & Ha, J.-E. (2025). An Adaptive Threshold for the Canny Edge with Weak Label. Applied Sciences, 15(22), 12158. https://doi.org/10.3390/app152212158

