Measuring pupil size and light response through closed eyelids

: Monitoring pupillary size and light-reactivity is a key component of the neurologic assessment in comatose patients after stroke or brain trauma. Currently, pupillary evaluation is performed manually at a frequency often too low to ensure timely alert for irreversible brain damage. We present a novel method for monitoring pupillary size and reactivity through closed eyelids. Our method is based on side illuminating in near-IR through the temple and imaging through the closed eyelid. Successfully tested in a clinical trial, this technology can be implemented as an automated device for continuous pupillary monitoring, which may save staff resources and provide earlier alert to potential brain damage in comatose patients.


Introduction
Monitoring pupillary size and light-response is a key component of the neurologic examination in comatose patients with brain injury from multiple etiologies. Changes in these pupillary parameters can provide important clues to neurologic deterioration, elevated intracranial pressure and herniation [1]. The prognostic and clinical value of pupillary examinations have been well established for traumatic and non-traumatic injuries [2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17] and have been featured in benchmark studies as far back as the early 1980s [3,8]. For example, during transtentorial herniation, pupil size and reactivity are the most sensitive and easily identifiable findings [2]. In a study of functional recovery in patients with traumatic transtentorial herniation, only 3.5% of patients with bilaterally fixed (unresponsive to light) and dilated pupils at admission had a functional recovery [18]. The combination of the pupillary examination and Glasgow Coma Scale (GCS) score provides more accurate prognostic information, and patients with a GCS of 3 with reactive pupils have a 33% survival rate, as opposed to patients with a GCS of 3 and fixed dilated pupils who have no reasonable chance of recovery [9]. Therefore, early and accurate detection of pupillary abnormality can both reduce the time to appropriate interventions, which are frequently life-saving, and avoid frequent computed tomographic scans. Additionally, accurate pupillary examination can help detect transtentorial herniation in some head injury patients with low speed trauma who undergo early herniation [18].
When performing a pupillary examination in patients with traumatic brain injury, the medical staff is looking for abnormalities, such as an asymmetric pupil size (anisocoria), irregular pupil shape, or a sluggish or absent pupillary light response. According to standard care protocols, upon detection of such an abnormality, a physician should be notified immediately and often head CT-scan and continuous intracranial pressure monitoring are subsequently used to aid in definitively identifying the cause of the abnormal pupil. Pupillary evaluation in comatose patients is often performed in a subjective manner by manually opening the patient eyelids, measuring the size of each pupil with a pupil-gauge ruler, and using a flashlight to illuminate the open eye in a darkened room to assess pupil reactivity. The manual method provides diameter evaluation with spatial resolution of ∼1mm and its output regarding the pupil reactivity is binary. This method suffers from large variability both across the nursing staff and within the same examiner [19][20][21][22]. Alternatively, pupil size and reactivity can be evaluated using a pupilometer, which is a handheld imaging device that provides measurement standardization and accuracy of ∼0.1mm in the measured pupil diameter [23]. Importantly, evaluation using either of these two manual methods is carried out variably, intermittently every 4-6 hours based on local protocols and on the availability of medical and nursing personnel. However, this frequency of pupillary assessment might be too low to obtain timely alert and prevent irreversible brain damage [5,17]. For example, Cohen et. al have shown [17] that in patients with acute traumatic epidural hematoma a delay of 90 minutes or more between the detection of pupil size asymmetry (anisocoria) and a craniotomy procedure was associated with greater mortality. Further, a delay of 70 minutes or less resulted in no mortality and a good or reasonable outcome.
Here we present a novel method for monitoring pupillary size and reactivity in close eyelid condition, specifically designed to meet the needs of unconscious patients. Our method is based on applying near-IR light through the temple, which penetrates the eye, emitted through the pupil and the closed eyelid, and then imaged by a camera placed in front of the eye. To assess pupil reactivity, we apply short pulses of visible white light that induce pupil contraction through the closed eyelid. Pupil diameter was evaluated using a generative image-analysis model that accounts for the light scattering through the eyelid. The quantitative measurement of pupil diameter before and after the white-light pulse, can lead to a continuous, rather than binary, scale for pupil reactivity. This method, validated in a clinical trial, may lead to automated, accurate and continuous pupillary monitoring that will alert on pupillary changes in real time and thus save delays that postpone neurologic lifesaving procedures.

Imaging device
To measure pupil size and light-reactivity, we developed an imaging device consisting of a near-IR sensitive camera, a near-IR LED (810nm wavelength), and a white LED, all mounted on a chin-rest ( Fig. 1(a) and Appendix). The camera and both LEDs were synchronized using a dedicated controller as illustrated in Fig. 1(b). The pupil was imaged by illuminating the eye through the temple with the near-IR LED and imaging the eye from the front with either an open or a closed eyelid. This method relies on the observation that near-IR light penetrates through the temple into the eyeball and is partially emitted from the eyeball through the pupil and across the eyelid. To facilitate imaging, the selected IR wavelength should be both absorbed by the iris and transmitted by the other components of the eye: the crystalline lens, the cornea, and the eyelid. These conditions, which allow the light to emanate from the eye through the eyelid, are satisfied by near-IR in the range of 750-900nm [24]. Additionally, using near-IR light does not influence the size of the pupil because the retina is insensitive to light at this spectral range. To induce the light pupillary reflex, we illuminated the eye from the front using a pulse of white LED light. This light can be seen even through a closed eyelid, which acts as a red-pass filter with ∼5% transmission [25]. To quantify the light pupillary reflex, we imaged the pupil in IR before and after the visible light pulse and compared the pupil diameters in both IR measurements. Measuring the light pupillary reflex is an important medical assay on its own right and provides a controlled environment for testing our method. In particular, it tests the capacity of our device to detect changes in pupil diameter as well as expands the range of measured diameters.

Measurement protocol
We performed a clinical trial on 39 healthy volunteers in accordance with the Institutional Review Board of the Hadassah Medical Center (S/N HMO-0555-17) and radiation safety requirements (IEC 62471 international standard), and under an ophthalmologist supervision (see Appendix). Each volunteer provided an informed written consent for participating in the trial. For each volunteer we measured both eyes, one eye at a time. The trials were conducted in a dark room, to reduce background illumination and the camera was acquiring an image during the entire IR pulse. The IR-LED was housed in an opaque sleeve contacting the temple, which placed the IR-LED 2cm from the skin.
First, to find the optimal position of the IR-LED on the temple, we recorded a series of IR images of the pupil with an open eyelid, scanning the position of the IR-LED on the temple until the pupil was clearly seen ( Fig. 1(d), open eyelid). Second, using the same IR-LED position, we recorded several IR images of the pupil with a closed eyelid, verifying the pupil was indeed visible through the eyelid. Finally, we applied the following three-step protocol ( Fig. 1(c),(d)): (1) Took an image in IR using a 0.1s illumination pulse to measure pupil size; (2) waited for 0.2s and then illuminated the eye from the front with a 1s pulse of the white LED to induce the pupillary light reflex; (3) waited for 1ms and took a second image in IR using another 0.1s pulse to measure the pupil size after it had contracted. During this sequence, the volunteers were asked to fix their gaze to minimize pupillary motion. The short delay between the white light pulse and the second IR imaging was set to minimize pupillary motion and to avoid imaging the expansion of the pupil expected after the white light turns off. Figure 1(d) demonstrates that both the pupil and its contraction following white light exposure are clearly seen through the closed eyelid. Comparing the images with open and closed eyelids, we see that the eyelid both absorbs and scatters the IR light emanating from the pupil. We noticed that both these effects are reduced when the eyelid was stretched downwards by the volunteer (Fig. 1(d), bottom). Hence, for some of the volunteers the experimental protocol was performed both with a relaxed closed eyelid and with a stretched closed eyelid. Overall, we managed to image pupils through closed eyelids in 38 of the 39 volunteers. For 34 volunteers we managed to obtain at least one image pair taken before and after a white light pulse, in which the pupil was clearly seen. Our analysis includes 242 such image pairs.

Data analysis
Due to IR scattering through the eyelid, the pupil image has no distinct boundaries, as shown by the intensity profiles in Figs. 2(a)-(e). Hence, the main challenge in extracting the pupil diameter from the acquired images is formulating a consistent and meaningful definition of this diameter. To this end, we formulated a generative model that approximates the process of diffusive light scattering from the unscattered pupillary disk ( Fig. 1(d)) through the eyelid, as illustrated in Figs. 2(f)-(g). This approach is consistent with the diffusive nature of light propagation in tissue and particularly in skin [26][27][28], as well as with the fact that the typical eyelid thickness of 4-5mm [29,30] is larger than the diffusive length of light in skin. Additionally, light emanating from the pupil towards the inner side of the eyelid is already diffused due to its passage through tissues. Therefore, light diffusion through the eyelid can be modeled as a convolution of the pupillary disk with a two-dimensional Gaussian scattering kernel.  Each IR image acquisition consisted of a 0.1s pulse of the IR-LED, synchronized with a 0.1s exposure of the camera (red line). To find the optimal IR-LED position and camera parameters, we first took several images with an open eyelid, until the pupil was clearly seen (left image in d). Subsequently, we imaged the eye in closed eyelid using a three-step automatic acquisition sequence: A first image was taken in IR (d, middle column); the eye was illuminated from the front by a 1s pulse of white light (blue line); A second image was taken in IR (d, right column). In some cases, the volunteer was asked to stretch down the eyelid, which reduced both eyelid scattering and absorption (d, bottom row). (d) The pupil is clearly seen as a bright spot on the closed or stretched eyelid. Implementing this approach at the single-image level requires three fit parameters: The pupil diameter D, the intensity of the unscattered pupillary disk, A, as would have been measured without scattering, and the scattering parameter of the eyelid σ, which represents the standard deviation of the Gaussian scattering kernel. These three parameters would be used to generate a model-image by starting with an image of a disk with diameter D and uniform intensity A and convolving this image with the Gaussian kernel. However, using these three parameters, (D, A, σ), to fit the model image to a single data image is under-constrained due to parameter coupling. For example, decreasing D might be compensated by increasing σ, resulting in an equivalently good fit. To circumvent this issue, we used the fact that thanks to the short delay between the acquisitions of consecutive IR images, pupillary motion between the two images is small. Hence, we assume that for such pairs the disk intensity A and scattering σ are identical. Therefore, rather than modeling a single image using three parameters, we modeled a pair of consecutive images using four parameters: one diameter per image (D 1 , D 2 ), and common A and σ. The constraints added by the four-parameter formulation of the fitting problem reduced the parameter coupling compared with the three-parameter case. For each pair of images, we used this generative model to fit the four parameters via gradient descent optimization ( Fig. 2 and Appendix). Briefly, we fitted the intensity profiles of the generated images to the profiles of the measured images after performing background subtraction. The confidence intervals of the fitted values were evaluated using bootstrapping.

Validation of the pupillary reflex in closed eyelids using ultrasound
To verify that white light illumination in closed eyelids induces the light pupillary reflex, we performed ultrasound measurements on five of the volunteers using a designated ocular ultrasound device (Ellex ultrasound system), operating with a 20MHz probe in B-scan mode. The volunteers were tested in closed eyelids and in a dark room. Their pupil was measured before and during white light illumination, equivalent to the illumination used in the IR-based device. The volunteers were asked to fix their gaze during the scan. The pupil was identified and the probe was positioned such that the scan plane was aligned with the pupil diameter.

Results
The measured pupil diameters, D 1 and D 2 , before and after the white light pulse, respectively ( Fig. 3(a)), are within the normal pupil diameter range of 2 − 7mm. In 98.7% of the cases, pupil diameter decreased after the white light pulse (D 2 <D 1 ), consistent with the diameter reduction expected due to the light response reflex. The histogram of the diameter ratio D 2 /D 1 is plotted in Fig. 3(b), where the mean ratio over all measurements was 0.63 ± 0.13 (mean ± standard deviation). We see no statistically significant effect of the eyelid condition (normal vs. stretched) on the measured diameters or diameter ratio. The distribution of the scattering parameter σ is plotted in Fig. 3(c), with a mean over all measurements of 1.19 ± 0.28mm. Additionally, there is a slight, though statistically significant, decrease in σ in the stretched (1.15 ± 0.32mm) vs. normal (1.22 ± 0.6mm) eyelid condition (KS p val = 0.0024 and KS distance of 0.25). A decrease in σ is consistent with the fact that the stretched eyelid is thinner and, hence, expected to scatter the IR light less.
To compare the variability of the scattering parameter σ within individual volunteers and its variability across all the volunteers, we considered the 19 volunteers for which we had more than 5 measurements. The average standard deviation of σ across these volunteers was 0.19mm, lower than the standard deviation of σ across the entire data set, which was 0.28mm. This observation is consistent with the notion that σ is a person-specific feature. The accuracy of the measurement was evaluated by calculating the confidence intervals (CI) of D 1 and D 2 using bootstrapping (Appendix). The CI distribution (Fig. 3(d)) shows that 97% of the measurements showing D 2 , the diameter after the white light illumination vs. the D 1 diameter before white light illumination. Each point represents an image pair taken for one eye either with a normally closed eyelid (N = 165, blue circles) or stretched closed eyelid (N = 77, yellow squares). Whiskers represent 95% confidence intervals for each measurement. In 98.7% of the measurements the pupil contracted upon white light exposure, D 2 <D 1 . (b) Pupil diameter ratio D 2 /D 1 for the data in (a). The mean ratio for the images with normally closed eyelid was 0.62 ± 0.13 (mean ± standard deviation), the the mean ratio with stretched closed eyelid was 0.65 ± 0.13, with no statistically significant difference between the ratios in both conditions (using both t-test and KS-test). (c) The distributions of the scattering parameter σ for both eyelid conditions, with a mean of 1.19 ± 0.28mm (mean ± standard deviation), across all 242 measurements The value of σ in stretched closed eyelids was 1.15 ± 0.32mm, compared with 1.22 ± 0.6mm in normally closed eyelid. Despite its small magnitude, this difference was statistically significant (KS p val = 0.0024 and KS distance of 0.25). (d) The distributions of the single-sided confidence intervals (CI) of all 484 images (242 pairs), plotted for both closed eyelid conditions. There was no statistically significant difference between the two distributions (KS p val = 0.26). The overall mean CI value was 0.15 ± 0.11mm (mean ± standard deviation), and 97% of all measurements had CI<0.4 mm. have CI<0.4mm, with no statistically significant difference between the two eyelid conditions (KS p val = 0.27 and KS distance of 0.096). Figure 4 shows representative ultrasound scans before and during white light illumination, indicating the pupillary reflex is induced when the eyelid is closed. The mean diameter ratio, equivalent to D 2 /D 1 in the IR measurement, was 0.7 ± 0.06 (mean ± standard deviation, for N = 5), consistent with the IR measurements.

Discussion
We presented a device capable of measuring pupil diameter and light reactivity through closed eyelids. This technology is based on frontal imaging of near-IR light that was transmitted through the temple, and on inducing the pupillary response through the closed eyelid using visible light. The resulting IR image pairs, taken before and after the visible light pulse, were analyzed using a generative, Gaussian-scattering model, with typical confidence intervals of 0.4mm. Hence, the spatial resolution of the pupil diameter measurement is estimated to be 0.4 mm and its temporal resolution is limited by the overall duration of the IR and visible light pulses, which is <1.5s overall.
This technology can be implemented as an automated bedside and wearable device for continuous, accurate and standardized monitoring of pupillary parameters. It combines pupil diameter and pupillary reactivity measurements, and improves upon both the temporal (4-6 hours) and spatial (∼1 mm) resolution of the currently common manual procedure. We estimate that using such a device for pupil evaluation every 5-15 minutes is expected to provide sufficient alert for medical intervention and may provide new insight on the dynamics of brain injury. Moreover, the pupil diameter ratio D 2 /D 1 constitutes a graded, rather than a binary scale for pupil reactivity. Such a scale may be used for further study of the dynamics of the pupillary parameters, for example, by taking a series of diameter measurement and by establishing their relation with other medical parameters. Moreover, a bedside device that can modulate the intensity of wavelength of the visible light pulse and simultaneously measure both eyes, could provide further clinically relevant information on the consensual pupillary response. In conclusion, this technology may aid in saving medical staff resources and in providing earlier alert for neurologic deterioration and potential brain damage in comatose patients.

Imaging device
The device used a near-IR cMOS camera (Grasshopper 3 NIR, PointGray) with an 8mm lens (Navitar). The lens was equipped with a 760 nm long-pass filter to attenuate shorter wavelengths and a 0.6 mm extension ring to allow close-up imaging. The camera was calibrated using a ruler placed in the same plane as the subject's eye. The IR LED used was Osram SFH-4780S with a mean wavelength of 810 nm, and 50% intensity at wavelengths of 800 nm and 830 nm. The white LED used was Osram LW-G6SP. The controller was custom made using Arduino and the gating of the LED voltages was done via standard transistors. The delay induced by the Arduino is estimated to be <1µs, which is much shorter than the duration of the IR and white light pulses (0.1s and 1s, respectively) and shorter the 1 ms time gap between the end of the white light pulse and the second IR exposure. The rise and fall time of the LEDs was <20 ns, much shorter than any time scale in the system.

Radiation safety
The device and experimental protocol were approved by a certified radiation safety officer, according to the international standard for photobiological safety of lamps and lamp systems (IEC 62471). Because no safety standards exist for a closed eyelid configuration, the device complied with the IR dose limit defined for open eyelids. Given the maximum light intensity of the near-IR LED used in the device, the duration of each near-IR illumination pulse was limited to 0.1s, and the overall number of IR pulses per eye was limited to 50.

Ophthalmologist supervision
The clinical trial was performed under ophthalmologist's supervision. Each volunteer underwent an ophthalmological examination of both eyes several days before the trial. The examination included retinal examination under pupil dilation. Volunteers with any prior ophthalmological condition or significant myopia were disqualified from the clinical trial. Immediately after the trial, each volunteer underwent a second ophthalmological examination, also under pupil dilation, to verify no eye damage was caused during the trial. A third ophthalmological examination was performed several weeks after the trial. Post-trial examinations did not reveal any eye damage due to the trial in any of the volunteers.

Image analysis and parameter optimization
For each pair of consecutive images, we used our generative model to fit the four parameters (D 1 , D 2 , A, σ) using the following procedure (Fig. 2). First, the center of the pupil in each image was located manually using a designated graphical user interface. Manual input was used due to the inherent imperfections in the data: nonuniform illumination due to the IR illumination from the temple side, eyelid blood vessels and pigmentation ( Fig. 1(d)). Second, the average intensity profile of the pupil was calculated by averaging image intensity across 10 rays that pass through the pupil center. The data along each ray was interpolated from the image in 1 pixel spacing (0.033 mm). The rays were uniformly distributed within a section of 20 • around the horizontal, to avoid the eyelashes. Due to the stronger IR illumination and scattering on the temple side, the average profile was linearly tilted (Fig. 2(b),(d)). Third, to evaluate this linearly tilted background, we manually selected two points along the average profile where the pupil signal converged towards the background. After subtracting the linear profile defined by these two points from the average profile, we obtained the profile used for model fitting by considering half of the profile from the pupil center towards the nose side. The profiles corresponding to the IR images before and after the white LED pulse are labeled ⃗ p 1 and ⃗ p 2 , respectively. Fourth, we fitted the four parameters of our generative model to the profiles ⃗ p 1 and ⃗ p 2 using gradient-descent minimization in the 4-dimensional parameter space. The cost function for this minimization was defined given a set of model parameters (D 1 , D 2 , A, σ): we generated two model images from the subsets (D 1 , A, σ) and (D 2 , A, σ), and calculated their corresponding radial pupil profiles ⃗ m 1 and ⃗ m 2 , sampled in the same spacing as the data profiles ( Fig. 2(f)). The target function for minimization was defined as the sum of squared pixel-wise differences between the data and model profiles: ||⃗ p 1 − ⃗ m 1 || 2 + ||⃗ p 2 − ⃗ m 2 ||. We validated that the target function has a single minimum by plotting it and visually examining its various two-dimensional cross sections. To verify there was no systematic coupling between the fitted parameters, we calculated their pairwise Pearson correlation coefficient: C(D, σ) = 0.16 with p val = 0.0003, C(A, σ) = −0.19 with p val = 0.0038, and C(D, A) = 0.29 with p val <10 −9 . The confidence intervals of the fitted parameters for each pair of images were evaluated using bootstrapping with 200 repeats.