Grey system theory was originally proposed by Deng Julong at Huazhong University of Science and Technology in 1980 [
14]. This theory was developed to address the issue of “few data, poor information”. In scientific research, people usually use “black” to mean that the information is completely unknown, and “white” to mean that the information is completely known. “Gray” means that part of the information is unknown, and part is known, so these information systems are called “gray systems”. Grey relational analysis is a mathematical theory that can quantitatively obtain unknown information by referring to known information. Its essence is to judge the degree of correlation between the sequences according to the similarity of the sequences. Compared with traditional methods, grey relational model has the following advantages: it does not require a large number of sample data; the specific statistical laws of the system do not need to be known; there is no need to consider the independence of each factor. In recent years, grey relational analysis has been gradually applied to image processing, and the effect is remarkable. Ma et al. [
15] successfully integrated Deng’s traditional correlation coefficient into an image edge detection algorithm, effectively merging grey relational analysis with edge detection and yielding optimal results experimentally. Zhen et al. [
16] combined grey relational analysis with genetic algorithms to effectively segment target regions, demonstrating certain noise resistance. Li et al. [
17] proposed an image edge detection algorithm based on grey simplified B-type relational analysis and realized optimal threshold selection through iteration. The algorithm exhibits strong adaptability to images with drastic grayscale changes, resulting in clear and accurate edge detection. These algorithms make reasonable use of various forms of grey relational analysis for image edge detection, effectively detecting texture edges.
In grey relational analysis, the most classic and widely used is the traditional Deng correlation degree. First of all, in order to standardize the data dimension of each sequence and enhance the comparability of data, it is generally necessary to carry out data normalization processing. Then, the system feature sequence (reference sequence) and related factor sequence (comparison sequence) are established. Then the grey correlation degree and coefficient are obtained.
Considering that the labeling samples of retinal blood vessel images are few, there are uncertain noise and other factors. In this paper, the advantages of a grey system in uncertainty and a small sample problem are used to propose a novel single-sample retinal vessel segmentation method based on grey relational analysis.
Figure 2 illustrates the flowchart of the proposed method. First of all, the noise is discrete, and the traditional grey correlation filtering algorithm cannot be used to unify all pixels; otherwise, the real pixel gray scale will be lost. In order to avoid false filtering, a novel noise-adaptive discrimination filtering algorithm based on grey relational analysis is proposed, and a good filtering effect is achieved. Secondly, a threshold segmentation model based on grey relational coefficients is proposed to improve the traditional grey correlation degree model, which avoids the pathological situation that the denominator may be zero in the Dunn correlation degree, and eliminates the normalization process in the traditional Dunn correlation degree calculation, which enhances the stability and executability of the model and achieves good operation results.
2.1. Noise-Adaptive Discrimination Filtering Algorithm Based on Grey Relational Analysis (NADF-GRA)
Since image noise typically consists of high-frequency components, the gray value of a noisy pixel tends to be at or near the extreme values within the filtering window. If the image correlation coefficient between the center pixel of the window and the median value of the domain is small, the center pixel is considered to be a pixel that deviates from the value of the neighborhood and can be identified as noise. Otherwise, it is considered a normal pixel. In the final filtering, only the normal pixels in the marker matrix are selected for grey correlation weighted mean filtering. If the flag matrix displays all noise points, the filtering window can be extended for filtering. Since the effective pixel points when the window is expanded are all points away from the center pixel, it can be changed to nonlinear filtering at this time, which can be replaced by a simple median filter, so that a good filtering effect can be achieved. The filtering algorithm commences by distinguishing noise from normal pixels. This step is critical as it lays the foundation for the subsequent application of our weighted averaging technique. By applying weights, normal pixels that are critical to vascular structure are given higher significance, thus preserving the integrity of retinal blood vessels. And the adaptive nature of our weighted scheme allows for the effective suppression of noise identified during the initial filtering stage, without compromising the vascular features. The dynamic weighting of pixels in our algorithm ensures robust performance across images with varying noise characteristics, maintaining consistent segmentation results.
The algorithm implementation process can be divided into three stages: Firstly, the discrimination stage utilizes grey relational coefficients for noise determination, which provides relevant records distinguishing normal pixels from noise pixels. Secondly, the adaptive adjustment of pixels, where weighted averaging filtering is applied based on the acquired information of normal pixels, thereby eliminating the interference of noise pixels. If there are no normal pixels within the filtering window, consideration is given to expanding the filtering window for simple median filtering. Lastly, the calibration and enhancement module.
In the 3 × 3 filtering window as the central pixel, the median pixel value in the field is selected as the reference sequence, and the 9-pixel value in the field is selected as the comparison sequence:
where
is the reference sequence,
is the comparison sequence,
is the 9-pixel value of the reference sequence,
is the median pixel in the field and
is the 9-pixel value of the comparison sequence.
To calculate the image grey relational coefficients between the median value of the filtering window and the values of each pixel in the neighborhood:
where
is the image association coefficient,
is the median value in the domain, and
is each value in the domain.
The image association coefficients calculated above are sorted in order from small to large to obtain the gray image association order.
Test whether the gray image association coefficient of the center pixel of the filtering window is ranked in the first three in the association order: If the association coefficient of the center pixel is ranked in the first three, it indicates that the gray value deviates from the median value of the domain, set
, and mark it as a noise pixel; otherwise, set
, and mark it as a normal pixel.
where
is the flag matrix,
is the gray image association coefficient of the center pixel, and
is the coefficient value of the first three sorted in the association order.
From top to bottom and from left to right, each pixel in the image is iterated in turn so that a matrix with element 0 or 1 marking the image noise information can be obtained.
The above is the noise detection stage of the image, and the next step is the noise point replacement stage of the image: starting from the upper left corner of the image, check whether the corresponding element in the flag matrix
corresponding to the center pixel
of the filtering window is equal to 1; if it is equal to 1, the current pixel is a normal pixel point, the pixel value remains unchanged, and the loop enters the next pixel for judgment; if it is equal to 0, it means that the corresponding point in the image is a noise point and should be filtered: at this time, the number of normal pixels in the 3 × 3 window field with
as the center pixel should be calculated, denoted as C; if C > 0, the C pixel is taken as the comparison sequence, where the value is the reference sequence, the image association coefficient is calculated, and the weighted mean of the grey association is filtered. At this time, there is:
where
is the central pixel,
is the number of normal pixels in the field,
is the image association coefficient, and
is the pixel in the field. If C = 0, it means that all the pixels in the 3 × 3 window are polluted by noise, which is a large noise block. At this time, the filtering window should be expanded into a 5 × 5 filtering window because the outermost non-noisy pixels in the window are already far away from the center pixel. Therefore, you can simply use the median filter to complete the assignment of the center pixel. Each pixel is processed in the traversal order from top to bottom and from left to right throughout the program loop.
Finally, it enters the adaptive correction and enhancement stage: contrast adaptive histogram equalization is used to effectively improve image contrast, and the similarity between image regions and blood vessels is evaluated on different scales to enhance the detection accuracy of blood vessel structure.
2.2. Threshold Segmentation Model Based on Grey Relational Analysis (TS-GRA)
The basic idea of grey relational analysis is to measure the similarity between reference sequence and comparison sequence by grey relational degree. The edge of the image generally has grayscale mutations to a certain extent, and the grayscale of these mutated pixels generally maintains continuity in a specific direction or texture pattern, and the gray correlation degree can just reflect the degree of such mutations. When detecting the edge of the image, set the mean value of the pixels in the field as the reference sequence. If the comparison sequence is farther away from the reference sequence, it indicates that the image has edge passing in the field, and the grey correlation degree value will be smaller. On the contrary, if no edge passes through, the value of the gray correlation degree will be greater at this time. By setting a threshold, edges can be found in the image.
Set the current center pixel in the domain window of the image as , first calculate the mean value of all pixels in the domain window, and then set the reference sequence and comparison sequence.
The difference sequence between the reference sequence and the comparison sequence can be obtained as follows:
where
is the difference sequence,
is the reference sequence, and
is the comparison sequence.
Calculate the grey image correlation coefficient:
where
is the correlation coefficient of the gray image of each pixel, and
is the difference sequence.
Calculate the gray image correlation degree of the center pixel
of the image domain window:
where
is the gray image correlation degree of the center pixel in the domain, and
is the relational coefficient of each point.
The first four steps start at the top left corner of the image, proceeding in order from left to right and top to bottom, saving the corresponding grey relational coefficients for each pixel as the center pixel of the domain window in a table until the last pixel in the bottom right corner of the image is traversed.
Find the minimum and maximum values of the grey relational coefficients corresponding to all pixels. Establish a threshold value between the minimum and maximum values as the threshold for distinguishing whether the current point is an edge point or a non-edge point, that is:
where
is the threshold to distinguish whether it is an edge point, and
is the matrix that stores whether it is an edge point.
The final segmentation results are obtained through the post-processing stage using morphological manipulation. A disc-shaped structural element was created for closure operations to fill the void in the blood vessel and connect the broken blood vessel, thereby improving vascular connectivity. Removing small, connected areas, thereby eliminating error-detected independent pixels, helps remove noise or pseudo-targets.