Creating an affordable, portable fundus camera
Good afternoon. My name is Alexander Timokhin. I study at the National Research University Higher School of Economics and work as a physicist. In this article I will tell you what I did during my internship at Sberbank in laboratory medicine center AI, which attempted to develop a low-cost and portable fundus camera for personal use.
Introduction
The fundus of the eye is the only part of the body in which the human nervous tissue (retina) and blood vessels are not covered by skin and other opaque tissues and can be examined visually. The doctor can see and evaluate the condition of these structures in real time, with his eyes, and observe their functioning.
Fundus photography is indispensable for the clinical detection and treatment of eye diseases. Traditional fundus photography evaluates the quality of the visual media, optic nerve, retinal vasculature, and choroid and is widely used in clinical practice to diagnose and monitor eye diseases. Typically, obtaining high-resolution images depends on a high-quality fundus camera, a special device used by doctors to photograph the retina, optic nerve and blood vessels. This is typically an expensive, fixed tabletop system that requires an experienced photographer who is familiar with both the imaging system and retinal anatomy. Recently, with the advancement of technology, handheld fundus cameras are gaining popularity as they are cost-effective, portable and easy to handle, and the quality of retinal photographs is improving. However, even for such models, prices start at 600,000 rubles. The goal of this work is to create a cheap fundus camera. In this article, I have attempted to describe the optical principles and utility of an inexpensive, portable, non-contact fundus camera assembled from available means for obtaining fundus photographs. The idea was to develop a device that a patient without specialized skills could use independently to diagnose eye diseases.
Methodology
The main task in creating a budget fundus camera was to ensure the ability to obtain high-quality images of the fundus using available components. At the same time, it was necessary to take into account the complexity of working with the pupil.
The main problem with creating a fundus camera is that through a small hole in the human pupil, you need to both illuminate the retina and photograph it. To solve this problem, mydriatic agents are often used – eye drops that dilate the patient's pupil for a while. However, the effect of this drug lasts several hours, during which the patient loses the ability to see clearly.
We found an alternative approach: we photograph the eye in the dark using a short flash that fires faster than the pupil can react.
It is known that the human eye does not respond to infrared radiation, so it can be used to focus a camera in the dark on the desired area of the eye.
Let's summarize. Suppose we have a certain lens system (lens), a camera and a pair of LEDs emitting light in the visible and infrared parts of the spectrum. First of all, we block all the light entering the eye, wait about 30 seconds until the pupil dilates, you can observe this process through the camera by illuminating the eye with IR light, then you need to aim at the retina of the eye (using the same IR LED), after which you need to simultaneously make a flash of duration no more than 250 milliseconds (this is the average response time of the pupillary reflex) and photograph the eye. Technical solutions of this plan will be discussed in this article.
Description of the experimental setup
First of all, we decided to repeat the optical design from the article “Design, simulation and experimental analysis of an anti-stray-light illumination system of fundus camera, November 2014”
The figure shows a diagram of the first prototype of the camera. Here, the beam from the ring source passes through the illumination system and the edge of the pupil and reaches the tissues of the fundus. And the light reflected by the fundus of the eye is collected by the imaging system. Below (Figure 3) are photographs of the first prototype.
The proposed fundus camera consists of a lighting system and an imaging system. The imaging system includes an eyepiece, a relay lens, an objective lens, and a CCD sensor. The illumination system includes a ring light source, a condensing lens and an eyepiece. The light source is connected to the cornea. To improve the efficiency of light energy use, the illumination system and the imaging system have a common eyepiece and are connected by a beam splitter. As shown in Figure 2, the beam from the ring source first travels along the illumination path and forms a real image on the cornea, where the dark image hole covers the center of the cornea and only the edge of the pupil is illuminated. The illumination beam then passes through the intraocular medium and reaches the tissues of the fundus. And the light reflected by the fundus of the eye is collected along the imaging path.
The images obtained with this camera are presented in Figure 4. If you try, you can see the outline of the vessels.
I assume that it was not possible to obtain images due to the design being too exposed and the lens being incorrectly selected. Subsequently, I realized that in order to focus on the retina of the eye, the front lens (eyepiece) should have as small a radius of surface curvature as possible in order to avoid strong aberration and generally be able to focus light on the retina.
Next we decided to change the approach, namely to completely rebuild the optical design. We decided to take the design of a portable fundus camera from oDocs Eye Care as a basis. A shot of the internal structure of their camera is shown in Figure 5.
In this solution, the digital matrix of the camera and the lighting part are located next to each other near the optical axis. To test this hypothesis, a simple installation was assembled (its diagram and photograph are presented in Figure 6).
In this case, light sources are located in front of the lens and illuminate the eye area through the pupil, the light is reflected from the retina and directed into the space between the LEDs, behind which there is a lens that focuses the image on the camera. The camera itself is located at a distance of approximately 180 mm from the pupil. In this configuration, some kind of image of the retina was obtained.
Based on this design and after conducting several experiments, we came to the conclusion that it is best to place the LEDs next to the camera being used, behind the lens system. A three-dimensional model of the following optical design is shown in Figure 7.
The front lens plays a key role in this design; it focuses the light from the LED through the pupil hole onto the iris. The second lens, located in the center of the structure, focuses the image onto the camera. Behind these lenses there are two light sources: one operates in the infrared range, the other emits white light. The human pupil dilates in the dark, so a near-infrared source with a wavelength of 800 nm is used to continuously illuminate, observe and focus on the retina.
However, all cameras available for purchase have an infrared filter installed. It usually looks like a small red piece of glass. It is placed so that when shooting in daylight, infrared radiation does not illuminate the image. For our project we need to remove this filter.
Let me remind you that initially it was planned to make a device that could be used by one person, but in this case the structure would be attached to one eye, and the other would need to somehow monitor the image settings, but if light hits one eye, then the second one also reacts to it and reduces the size of the pupil, so another person is required to use this device – the operator.
In this fundus camera design, after the operator has focused on the retina, he must use a toggle switch to switch the LEDs. However, in practice, this action led to vibration of the entire structure, which caused focusing to be lost. In addition, a sharp flash illuminated the camera matrix, and during autoexposure the pupil managed to close. The second disadvantage of this design is the small area of the resulting image, which subsequently leads to poor picture quality.
The following design uses a number of technical modifications. First, another lens was added in front of the camera. Its function is to enlarge the resulting image and focus it on the camera. As a result, the image turned out to be clearer and took up more space on the camera sensor. Secondly, hardware was added to the camera design, namely 2 white LEDs and one infrared were connected to the Arduino Uno microcontroller, and a physical button was also connected to it. An application was written in Python that read an image from a web camera connected to a computer (this is the same camera that photographs the retina). In addition, this application reads information from the COM port to which the board is connected. When you press the button, the infrared LED turns off, after which 2 short consecutive flashes are made with 2 visible light LEDs with a length of 150 milliseconds, at which time a program written in Python takes photographs from the web camera. As a result, we get 2 images of the retina. You may be asking, “Why do we need to take 2 pictures?” The fact is that LEDs give glare on all 3 lenses and on the pupil, to get an image without glare we use a system of 2 LEDs to produce glare in different parts of the image, then using a specially created software 2 images are merged into one in such a way as to exclude illuminated areas. A three-dimensional model of the final fundus chamber design is shown in Figure 8.
Camera body printing:
Testing and results
One of the key stages in the development of a low-cost fundus camera was testing the system both in laboratory conditions and on real patients. The tests were carried out in several stages to verify the accuracy of the optics, image quality and software performance.
1. Tests with artificial eye
The first part of the testing was carried out in laboratory conditions using an artificial eye. The optical system was adjusted experimentally. The lenses, using an optical bench, were positioned on the same optical axis, and the distance between the optical components (lenses, LEDs and camera) was manually adjusted to achieve the optimal focal length. The main lens included a lens with a diameter of 40 mm with a focal length of 20 mm, the characteristics of subsequent lenses depended on the camera used.
This phase first tested the system against the iPhone 14 camera to obtain baseline images. This was done to ensure that the lens system was set up correctly, as the phone's camera has much better image quality compared to a budget webcam. After the image quality on the iPhone met the requirements, a webcam was installed in the system, and the optics were adjusted to its characteristics. This approach made it possible to significantly simplify the process of setting up lenses for working with a cheap camera. The images obtained on the iPhone14 and on the webcam are presented in Figures 9 and 10, respectively.
2. Tests in real conditions
After laboratory tests, the camera was tested on real patients. Two volunteers from Sber's AI laboratory took part in this experiment. The main goal was to ensure that the device functions on a living eye. However, there were some difficulties in obtaining images due to eye movement and lack of pupil dilation in patients. Despite this, it was possible to obtain images of the retina with a small area, which confirmed the functionality of the system (Fig. 11).
Problems and their solutions
One of the main difficulties was to achieve precise alignment of the optical axis of the camera and the patient's eye, since natural eye movements made focusing difficult. In the future, it may be possible to install visual cues inside the camera body so that the patient can fixate the gaze, thereby improving the quality of the resulting images.
Another problem was the camera shutter. It worked too early – before the LEDs turned on, which led to overexposed pictures. To resolve this issue, adjustments were made to the Arduino software and Python script to adjust the shutter time delay and synchronize it with the moment of the flash.
Conclusion
During the development of a budget fundus camera, the possibility of creating an effective device for diagnosing eye diseases using available components was demonstrated. Experiments have shown that a combination of simple optical elements and software can provide high-quality fundus images. However, when working with a living eye (without the use of drugs to dilate the pupil), a number of problems arose, such as the difficulty of focusing and the influence of the pupillary reflex, which require further refinement. To improve the functionality of the camera in the future, it is planned to improve the optical system, improve focusing and introduce automatic synchronization with the shutter. You should also use a higher quality camera; articles usually use a 27 MP matrix, but in this project there was only 2 MP. Such steps will make the device more reliable, compact and convenient for use both in laboratory conditions and in the field.
The resulting images collected by the fundus camera were demonstrated to qualified ophthalmologists. We asked them: “Can we diagnose eye diseases from these photos?” Below are their reviews:
Review 1:
“Hello) it’s better from the phone, you can make a diagnosis. But the camera does not photograph the entire retina, but rather the center; if the problem is in the center, then yes.”
Review 2:
“The diagnosis can be made”
Review 3:
“Yeahhh great. I didn’t even expect that it could turn out so well)))). Especially on the phone. There are distortions, but even with cool fundus cameras there are highlights that look like pathology – like drusen, for example.”
Review 4:
“Hello! Yes, I also believe that a diagnosis can be made.”
The experimental results confirm that even with limited resources it is possible to create a fundus camera capable of diagnosing eye diseases. The development process was not easy and required experimentation with many solutions and approaches. Despite the challenges, this work has opened up new possibilities for further improvements to the device, making it even more affordable and effective. This experience not only deepened our understanding of the principles of ophthalmic optics, but also inspired new ideas that will help make diagnostics more convenient and accessible to everyone.