# Contrast-Invariant Edge Detection: A Methodological Advance in Medical Image Analysis
## 4 Experimental Results and Analysis
### Comparison
As the F1-score is an evaluation metric integrating both precision and recall, it gives a more balanced reflection of the performance of edge detection results. Figure 9 shows the result of the detected edge images using different methods in terms of F1-score. According to the result, CIED performs the best and most stably among these methods. Some methods can hardly detect any edges under low contrast, resulting in an F1-score close to zero, whereas CIED can still robustly extract effective edge information. At low image contrast, the effect of the edges extracted by the edge detection methods is significantly weakened, and in extreme cases, it is not even possible to extract any effective edges. However, unlike other methods, the CIED can extract clear and effective edges under different image contrasts. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Methods** & **Accuracy** & **Precision** & **Recall** & **F1-Score** \\ \hline Prewitt & 0.894 & 0.173 & 0.591 & 0.180 \\ Sobel & 0.894 & 0.171 & 0.582 & 0.176 \\ Canny & 0.967 & 0.163 & 0.266 & 0.190 \\ Canny–Median & 0.977 & 0.224 & 0.212 & 0.200 \\ WL & 0.813 & 0.158 & 0.806 & 0.218 \\ CIED & _0.978_ & _0.408_ & _0.917_ & _0.550_ \\ \hline \hline \end{tabular} The average evaluation metric results of the CIED are highlighted in italics, while the optimal average values of all methods are highlighted in bold.  
\end{table} 
Table 2: The results of detected edge images using different methods in terms of accuracy, precision, recall, and F1-score. Data are presented as average values. Figure 8: The demonstration of detected edge images using different methods. The green boxes highlight the edge detection results of CIED, while the red boxes indicate the results of other methods. To more intuitively observe the performance of methods under different contrasts, we select an image, scale its original contrast in equal proportions, and then observe the edge images under different contrasts. Figure 10 shows the edge detection effect of Sobel, Canny, and the CIED under different contrasts on the same image. We demonstrate edge images for linear contrasts of 10, 60, 90, and 120%. In the case of the original image having low contrast, even if the contrast is increased to 120%, the visual effect of Sobel and Canny edge detection is still ineffective. The edge detection effect of the Sobel decreases with the decrease in the contrast, making it difficult to observe the edge information intuitively. It is not until the contrast is increased to 120% that the edge information is only visible in bits and pieces. The edge detection performance of the Canny also decreases with the decrease in contrast, and the edge information becomes clearer when the contrast is increased to 120%. However, the CIED can extract complete and clear edge information at all contrast levels, which demonstrates that the CIED is robust to contrast-invariant. To comprehensively compare the performance at different contrast levels, we record in detail the accuracy, precision, recall, and F1-score values of the three methods, Sobel, Canny, and the CIED, for contrasts ranging from 50% to 140%. Table 3 presents the specific evaluation metrics results for Sobel, Canny, and the CIED at different contrast levels, the outcomes of the CIED are indicated in italics, while the optimal values are highlighted in bold. From the result of Table 3, the precision and recall of Sobel and Canny gradually increase when the contrast is gradually enhanced, which indicates that there is an improvement in the edge detection ability when the contrast is enhanced. While the CIED is more stable in precision and recall in any contrast. Compared to Sobel and Canny, the precision, recall, and F1-score of the CIED are better than the other two methods and reach the highest precision of 0.246, recall of 0.793, and an F1-score of 0.371. Some edge detection techniques based on gradients, such as Sobel and Canny, are not effective in low-contrast situations.