An automated method is presented to aid in the analysis and detection of retinal layers, using a combination of gradient filters and optimized modelling.
Sample images are taken by the Optical Coherence Tomography (OCT) method.
The combined techniques will be discussed and presented separately. The steps for combining them will then be quickly briefed over. The aid in analysis is accomplished by outlining the layers within the retina. Once outlined, statistal data can be computed, such as measuring the distances between the layers and determining their uniformity. Below are the sample images used in the experiment:
The first technique implemented was an algorithm for generating lines and using them to model the retina layers within the image. Lines would first be drawn over the input image as follows:
A genetic method would then be used to randomly swap pixels between the different lines. At each swap, the lines affected would alter in
shape, and would cover a slightly different area of the image.
Several different data structures were used keep track of these areas covered, tracking the statistical information of each; such as the average intensity; and variance of the pixel values within the bounded region. The data structures were updated correspondingly upon each pixel swap, and if the swap was valid and in bounds, they would send their statistical information to an optimization function. The optimization function would then use a carefully adjusted equation, on the statistical data sent, to determine if the current pixel swap between the two lines affected resulted in an overall set of lines that more closely resembled retinal layers.
After two hundrend million iterations, computed in a time between five and seven seconds (running a JVM on a Macbook Air), the results were as follows for both images:
Different variations of the optimization function had been attempted. However the overall results were never perfected, in terms
of detecting individual retina layers, and yielded to be similar in terms of the overall shape of the retina layers they outlined.
Even with very large jittering used by the genetic algorithm, the characteristics of the results stayed fixed. Part of the reason why the retina layers could not be detected by this method is because of the difficulty of including gradient information when constructing the optimization function.
Use of Gradients
The next technique involved taking the gradient output for the image. The results below show the ONE-D derivative of the image, following the technique of the Canny Edge Detection algorithm:
Continuing the technique of Canny Edge Detection, a threshold was applied to the results, and the printed output looked as follows:
As can be guessed from the above results, the gradients within the image were to weak, so as to properly help detect the retina layers. To help fix this, a specially design filter was applied to the image before edge detection. Besides making other custom adjustments, the filter altered all of the gradients to point in one of two directions, of equal value, the directions being perpendicular to the overall direction of the image. The results of this filter are the binary images shown below:
The boundaries of the layers, shown in the binary images above, were then computed and layered above the original input images. The results looked as follows:
Combining Gradient with Line Modelling
The problem with the last results shown above is that the lines drawn over the image did not fall perfectly over the part were a retinal layer ended and began. In an attempt to fix, the Gradient based technique was further modified to be combined the Line Modelling technique presented at the very beginning. The first step was taking the binary images, shown in the last technique, and using them as a guide for generating an evenly divided checker board:
The next the genetic algorithm, along with the optimization function, was applied to each individual region within the checkerboard. This is a slight variation of the first technique, were the genetic algorithm began with an image of straight lines. The results of this algorithm were as follows:
The horizontal boundaries of the layers were then computed and layered above the original input images. The results looked as follows:
Further improvements were done by allow human interaction to be integrated into the results, allowing for things such as the modification and removal of the the detection lines. These improvements are included in the MagniSci software.