Application of an improved edge detection algorithm in fundus images
* Author to whom correspondence should be addressed.
Sigma Journal of Engineering and Natural Sciences 2025, Vol. 43, Issue 2, pp. 615-625; doi.org/10.14744/sigma.2025.00048
Abstract
Keywords: Classification; Feature Extraction; Filter; Image Processing; Medical Image Processing
Introduction
Feature extraction has attracted a great deal of attention, especially during the past few years [1]. Since it is necessary to diagnose from images in many fields such as medical treatment, a criminal investigation, military issues, feature extraction from images is one of the most important issues. Edge detection is the most important issue for feature extraction because an edge can be defined as a sudden change of intensity in an image. Up to now, some filters such as Canny, Sobel, Prewitt, Roberts operators, etc. have been used for edge detection from images. These filters use fixed filters and first or second derivative of the input image except for the Canny operator. *Corresponding author. *E-mail address: gkaplan@ogu.edu.tr This paper was recommended for publication in revised form by Editor-in-Chief Ahmet Selim Dalkilic Published by Yıldız Technical University Press, İstanbul, Turkey
In this study, we wanted to create its filter for each picture. In this context, firstly we used the eigenvalue and eigenvector matrices of the matrix forming the image. In the literature, it has been seen that there are many studies obtained in different fields using eigenvalues and eigenvectors. Using the associative memory to the image in RGB format, the filter for the image was obtained through eigenvalues, eigenvectors. While obtaining this filter, the image was filtered with the best 9 eigenvectors with min-max memory and the best results were obtained [2]. Harris and Stephens used the eigenvalues of the moment matrix to determine the corner and edge [3]. Eigenvectors were found among the best eigenvalues for vehicle detection and recognition
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 615−625, April, 2025
with a Multilayer perceptron(MLP) classifier using 1, 3, or 5 hidden nodes and over %90 success was achieved [4]. Eigenvalues and eigenvectors were used to find the corners using Bayes classifier when determining blur images [5]. Eigenvalues and eigenvectors were used to determine edges using vector-valued techniques in color images [6]. Eigenvectors were used for image defect detection method that is the non-model based [7]. To find the corners of the image in Parametric Feature Detection, the best 8 eigenvectors were selected from the image matrix [8]. Eigenvectors were used when using Edge Gradient and Graph Spectrum on the text. Compared with other algorithms, the proposed method improved the precision rate by %12 [9]. Eigenvectors were used to determine the corner by topographic analysis [10]. Eigenvectors were used to determine contour when contouring detection [11]. To determine the optic disc from the retinal images, operations were performed using principal component analysis with the help of eigenvectors [12]. A second directional derivative approach is proposed, using eigenvalues and eigenvectors for deriving a color edge detector [13]. Eigenvectors were used for the depth detection of targets in a monocular image sequence [14]. Recently, parameters obtained with differential equation systems have started to be used in this field. Some of these studies; Differential Equations with Non-Local Conditions [15], fractional integro-differential equations [16], The Mohand transform to solve fractional integro-differential equations [17]. Convolutional neural network was used to apply the filter we created in the study. There are many studies in the literature using CNN and edge detection filters. The detection of brain tumors was performed using edge detection and CNN [18]. Sobel and Prewitt edge detection filters were applied to the images with CNN for medical image segmentation [1]. CNN was used for Crowd Segmentation in traffic and %95 success was achieved [19]. CNN was used to determine edges on musculoskeletal ultrasound images [20]. Retinal vessel segmentation was performed from fundus images using edge detection filters and CNN [21]. CNN and edge detection filters were used for Traffic Sign Detection and Recognition [22]. Edge detection and CNN were used for Fingertip detection [23]. CNN and edge detection filters were used for contour detection [24]. In the same way, vessel segmentation was performed with boundary detection [25]. CNN was used for self-driving cars and Sobel, Laplacian, and Canny detectors were used for road lane detector [26]. While background subtraction using encoder-decoder, CNN and edge detection filters were used [27]. In this article, an image-specific filtering method is developed by using the eigenvalues and eigenvectors of the image to filter the image appropriately. The main idea behind the emergence of this method is that the use of fixed filters does not give good results even with the slightest blur or distortion in the image. In order to compare the filters,
fundus images were selected from radiological images with relatively lower image quality as the most suitable application area. The results obtained were compared with confusion matrices. In section 2, the 4 filters compared in the article are explained in detail with the methods they use. The method presented in section 3 is detailed. Since cnn was last applied to the method introduced in Section 4, cnn was explained and detailed.
EDGE Detection Filters
Sobel Operator The Sobel operator carry out a gradient measurement on an input image and highlights high-value regions corresponding to the edges. It is often used to obtain an approximate gradient size at each point in a grayscale image. The operator uses two 3x3 convolution kernels for figure out roughly derivatives, first for horizontal changes, and second for vertical as shown in (5). (1)
(2) It is envisaged that these kernels will respond highly to the edges working vertically and horizontally. Kernels can be applied to the image one by one to produce measurements of the gradient (Gx, Gy). They are calculated as follows [28]: (3) Direction angle of the edge causing the particular gradient is given by (4) (Gx, Gy) as shown in (5) respectively [29],
Prewitt Operator Prewitt operator works in similar to Sobel operator. This kernel produces almost similar results to the Sobel. Prewitt operator kernels (Gx, Gy) respectively as shown in (6) [30].
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 615−625, April, 2025
Roberts Operator Roberts operator is very useful for detecting diagonal of an input image. Because of the Roberts operator’s masks dimension of 2, run time is quietly diminished. (7) Roberts operator masks [31], (8) In addition to this, because of these masks work on a small array of pixels, are as a result more sensitive to noise compared with the other filters.
Canny Operator The Canny operator is the one of the best edge detection operator that uses multistage code block to determine a wide range of edges in input image. The operator use in a multistage process. First, a Gaussian filter is applied to reduce noise, soften the input image. Next, the first derivative operator is performed to find the dense gradients of the image. Next, the algorithm performs non-maximal suppression to give a thin line at the edges. After this step, a double threshold was applied to identify possible edges. Finally, edges are defined by rejecting all other edges that are not related to strong edges [32].
Overview Of The New Filter
In Section 2, 4 important filters in this field were examined. It was seen that all of these filters, except the Canny filter, used fixed filters. Therefore, the filters are sensitive to the light and color intensity of the image.
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 615−625, April, 2025
Figure 4. a) Normal image b) Canny filtered image. In digital image processing, image can be shown as a set of pixels as shown in (9)
the image. We took the eigenvector matrix closest to additive zero. When processing the filter matrix we created, we obtained 4 different filter matrices with 90° rotations to minimize image losses. In this way, we processed each image with its own 4 filters and determined the values that are above the threshold value. Part of the code block is shown in Figure 5.
CONVOLUTIONAL NEURAL NETWORKS (CNN) CNN is widely used in image processing. Inspired by bio-logical processes like the human brain, with the help of previous observations, it can distinguish different objects by just visualizing them [1]. The first CNN network is LeNet, an architecture introduced by Yann LeCun in 1988. In the LeNet network, the lower layers consist of consecutive layered convolution and maximum pooling layers. The subsequent upper layers correspond to the traditional Multi Layer Perceptron, which is fully connected [33]. A convolutional neural network composed of an input, an output layer and a large number of hidden layers. CNN architecture consists of 3 layers. These are convolutional layer, pooling layer and fully connected layer. Convolutional Layer Let’s show that ith layer to understand in detail. Let Ni indicates the number of feature maps on this layer. Each feature map is indicated as . This layer is
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 615−625, April, 2025
Figure 5. Part of the code block. parametrized by an array two-dimensional kernels ciating the mth feature map
bias bj. A nonlinear activation function ϕ(A.)is performed logically. Let * denotes the convolution operation [34]. The feature maps of the ith layer can be expressed as follows: (10)
Each resulting matrix corresponds to a property. Extracts the properties of that region from the inputs ( ) [35]. Pooling Layer In CNN architecture, it is prevalent to add a pooling layer between consecutive CNN layers. This layer is used to reduce coefficient and calculation operations on the network. it operates every step on CNN. The most commonly used form Max and Average operator which form
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 615−625, April, 2025
Figure 6. a) Normal image b) Filtered image with the new filter. of non-linear down-sampling is. Max-pooling and average-pooling partition the input image into a set of non-overlapping rectangles and, for each such subregion, outputs respectively maximum, average values. They are useful for they reduces the computational complexity for upper layers and provides a form of conversion stability. Fully Connected Layer The final output layer is a fully connected neural network layer. This layer is a necessary component of CNN that is successfully displayed in classifying images. Many functions such as softmax can be used in this layer. This layer takes the output of the previous layers, “flattens” them and turns them into a single vector that can be an input for the next stage and takes the inputs from thefeature analysis and applies the weights to predict the correct tag.
Experiments
Dataset and Design Implementation 126 AMD and normal pictures were used for the applications within the scope of this study. The pictures obtained include an equal number of AMD and normal image. 100 of them were used for training and 26 of them were used for testing. Each of the images determined for test and train operations was filtered with Sobel, Prewitt, Roberts and Canny edge detection filters using Matlab r2018a program. Similarly, the pictures were filtered with the filter we created. As a result of these operations, 5 different images were obtained which are filtered for each picture, two of them are shown in figure 8 and figure 9.
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 615−625, April, 2025
(d) (e) (f) Figure 8. (a) Normal image (b) Sobel filtered image (c) Prewitt filtered image (d) Canny filtered image (e) Roberts filtered image (f) Filtered image with the new filter.
(d) (e) (f) Figure 9. (a) Age related macular degenarationed image (b) Sobel filtered image (c) Prewitt filtered image (d) Canny filtered image (e) Roberts filtered image (f) Filtered image with the new filter.
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 615−625, April, 2025
Codes were written using Python 3.7 to apply Convolutional Neural Network to images obtained after coding in Matlab. The dimensions of the images were equalized by making 64x64 before CNN was applied. Relu was used as activation function, binary crossentropy was used as loss function and “Adam” was used for optimizer.
For CNN, epoch number 2, 5, 10, batch size 1, validation steps 2000 values were taken. Steps per epoch(Spe) were taken as 5000, 10000, 15000 for each epoch and the filters were compared according to epoch. The confusion matrixes shown in Table 1 were used to see the accuracy values used to compare the filters.
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 615−625, April, 2025
Results And Discussion
The results of the study with a limited number of data are shown in table 2, 3 and 4. When the accuracy values measured with 3 different epoch values are compared; the best result was the new filter with %69.23 at 2 epoch and 15000 spe. When we look at the average accuracy of the results of 3 epoch values, the new filter was the most successful filter with %58.97. The main motivation for this work was that the filter matrices used by most edge detection filters are fixed matrices. As a natural consequence of this, it was predicted that it would be far from being as successful as desired in images that were distorted or had low contrast for any reason. When the results were examined in detail, the positive performance of our filter against other filters was as expected. A general summary of the filters is given in table 5. One of the main reasons why our filter gives successful performance at almost every epoch value is that it selects a filter matrix from the image itself specific to the image it uses. In addition, examining the image in more detail with filter rotations around itself has a positive impact on performance. The weak point of the new filter compared to other filters is that there is a difference in time to reach the result since it filters a very detailed image. However, in computers used with today’s technology, this difference is very low. For example, it was seen that the new filter we created in the study achieved results approximately 0.1-0.2 seconds slower than other filters when measured with the tic-toc function.
Conclusion
We have presented a two-stage study. Firstly, We propose an effective edge detection filter. We used the
eigenvalue, eigenvector matrices of the image when applying this filter and applied this filter to retinal fundus images for visual comparison. Secondly, We have applied the filter to AMD and normal fundus images using CNN to compare with the new filter with other filters. The new filter successfully improves prediction performance of neural network model. In this study, although the new filter we created was working with a small amount of data, it was found to be successful by increasing the accuracy rate by approximately %10. This article was obtained from my thesis. In the next stage, the filter will be detailed using the data augmentation technique from artificial intelligence technologies. In the future, it is planned to use the filter created after this study in more socially beneficial, that is, more vital areas of medicine. One of these areas will be benign or malignant tumor detection and good or bad mole detection.
Data Availability Statement
The authors confirm that the data that support the findings of this study are available within the article. Raw data that support the finding of this study are available from the corresponding author, upon reasonable request.
Conflict Of Interest
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 615−625, April, 2025
Share and Cite
KAPLAN, G.; ODABAS, A. Application of an improved edge detection algorithm in fundus images. Sigma Journal of Engineering and Natural Sciences 2025, Vol. 43, pp. 615-625. https://doi.org/10.14744/sigma.2025.00048

