# Direct Estimation of Pupil Parameters Using Deep Learning for Visible Light
Pupillometry

Abhijeet Phatak  1,† Aditya Chandra Mandal  2,† Janarthanam Jothi Balaji3 and
Vasudevan Lakshminarayanan4  1245 W California Ave #6, Sunnyvale, California
94085, USA
2Department of Mining Engineering, Indian Institute of Technology (BHU),
Varanasi - 221005, India
3Department of Optometry, Medical Research Foundation, Chennai - 600 006,
India
4Theoretical and Experimental Epistemology Lab, School of Optometry and Vision
Science, University of Waterloo, Waterloo, Ontario N2L 3G1, Canada
*Corresponding author<EMAIL_ADDRESS>
†First two authors contributed equally to the study.

###### Abstract

Pupil reflex to variations in illumination and associated dynamics are of
importance in neurology and ophthalmology. This is typically measured using a
near Infrared (IR) pupillometer to avoid Purkinje reflections that appear when
strong Visible Light (VL) illumination is present. Previously we demonstrated
the use of deep learning techniques to accurately detect the pupil pixels
(segmentation mask) in case of VL images for performing VL pupillometry. Here,
we present a method to obtain the parameters of the elliptical pupil boundary
along with the segmentation mask is presented. This eliminates the need for an
additional, computationally expensive post-processing step of ellipse fitting
and also improves segmentation accuracy. Using the time-varying ellipse
parameters of pupil, we can compute the dynamics of the Pupillary Light Reflex
(PLR). We also present preliminary evaluations of our deep-learning algorithms
on clinical data. This work is a significant push in our goal to develop and
validate a VL pupillometer based on a smartphone that can be used in the
field.

††journal: osajournal††articletype: Research Article

##  1 INTRODUCTION

Pupillometry is an important non-invasive, diagnostic tool that can be used to
study the measurement of pupil size fluctuations over time in response to
light, which is also referred to as Pupillary Light Reflex (PLR) in clinical
settings. This method is particularly useful in examining various neurological
and ophthalmological disorders, optic nerve injury, head trauma resulting from
vehicular accidents, oculomotor nerve damage, brain stem lesions including
tumors, as well as the use of central nervous system depressants like
barbiturates [1, 2, 3]. Although non-light-related fluctuations in pupil size,
which are often considered a sign of arousal via Locus Coeruleus (LC)
activity, can be utilized to assess brain state in different species, pupil
size is mainly determined by light intensity [4, 5, 6]. Because of its utility
pupillometry is a very important tool for measuring retinal function in
individuals with acquired [7, 8, 9, 10, 11, 12, 13]and hereditary[14, 15, 16]
ocular dysfunction. Clinicians, typically, use a penlight to perform
qualitative pupil examination. Automated infrared (IR) pupillometers have
become available that provide quantitative measures of pupil size and
reactivity, allowing assessment in both bright and dark-environments, as well
as monitoring pupil dynamics over time, however they are often expensive, not
portable, and require trained operators. Visible Light (VL) pupillometry has
advantages over the conventional near-IR based pupillometry as it does not
require specialized equipment and can provide a better representation of the
pupil response in a realistic setting as compared to near-IR illumination.
However, in VL, images of the eye exhibit more corneal Fresnel reflections at
the air-cornea interface (Purkinje image) [17]. Several studies have been
conducted recently[18, 19, 20, 21, 22] where conventional image processing
algorithms were applied to VL pupillometry. Using images captured in VL,
Morita et al. [18] developed a pupil detection algorithm that first identifies
iris edges and uses the Hough transform to find the pupil boundary. However,
their method relies on a specific image acquistion technique which avoids
corneal reflections. Kitazumi and Nakazawa[23] presented a Convolutional
Neural Network (CNN) based on U-net[24] to carry out pupil segmentation and
localization of the pupillary center in VL images for gaze tracking and other
applications. Previously, we demonstrated the use of CNN architecture in
segmenting pixels representing the pupil in VL images of human eyes for
performing VL pupillometry[17]. Pupillography has shown to be useful in many
clinical applications[25]. To study the PLR, extraction of ellipse parameters
of the best elliptical contour of the identified pupil pixels must be carried
out. An additional post-processing step of using a least squares algorithm or
other computationally intensive algorithm is carried out to extract the
ellipse parameters from the pupil mask[26].
In this paper, we further extend our prior work to obtain the segmentation
mask[17] (pixels representing the pupil) and extract the necessary ellipse
parameters, and also fit an ellipse that represents the pupil boundary. This
obviates the additional step of ellipse fitting and also results in training a
better performing neural network model in terms of accuracy. This is a
milestone in our effort to build a smartphone based VL pupillometer that uses
CNN, utilizing on-device computation, without requiring a processing server or
internet access. This is critical in areas with poor access to healthcare or
in the field where conventional pupillometers cannot be utilized.

##  2 THEORY

###  2.1 Dataset and Data Preprocessing

We followed the approach demonstrated in our prior work[17] which was inspired
by Kitazumi et.al.[23] to compile the initial dataset. The first step in VL
pupillometry is identifying the pixels of the pupil in a VL image. For
supervised machine learning, we need ground truth output, i.e. segmentation
mask of the pupil, corresponding to each input image of the human eye. We used
the UBIRISv2 datase [27] for input images of human eyes in VL. The ground
truth binary segmentation masks were obtained from the dataset prepared by
Hofbauer et.al.[28, 29] which contained 2250 annotations for a subset of
UBIRISv2 (11,102 RGB eye images). The RGB eye images and annotated
segmentation masks both had width and height of 400 pixels and 300 pixels
respectively. Fig. 1 illustrates some examples from the dataset.

---
(a)

---
(b)

---
(c)

---
(d)

---
(e)

Figure 1:  Examples of (a) RGB Images from UBIRISv2 (b) Annotated Masks by
Hofbauer et.al (c) Extracted Pupil Mask (d) Extracted Iris Mask (e) Ellipse
(green) fitted on Pupil in the RGB Image.

The most crucial step in VL pupillometry is approximating the pupil contour
with an ellipse[30] as we want to observe the variation in the average pupil
diameter. An ellipse can be defined by a quintuple -
$\varepsilon:(x_{c},y_{c},2a,2b,\theta)$ where $(x_{c},y_{c})$ are the
coordinates of the center of the pupil. $(a,b)$ are the lengths of the semi-
major and semi-minor axis respectively and $\theta$ is the angle of the
ellipse measured counterclockwise from the horizontal axis as illustrated in
Fig. 2.

---
Figure 2:  Definition of an elliptical pupil boundary in terms of the co-
ordinates of the center $(x_{c},y_{c})$, semi-major and semi-minor axis
lengths $(a,b)$ and the angle of rotation ($\theta$).

The ellipse parameters for the pupil masks were obtained using a least
squares[26] algorithm available in OpenCV. Outliers were removed by ignoring
images that had an elliptical pupil contour having a solidity or aspect ratio
less than 0.5. The detailed description of data preprocessing step is given in
reference[17].

###  2.2 Data Augmentation

---
(a)

---
(b)

---
(c)

---
(d)

Figure 3:  Examples of data augmentations performed (a) Original RGB Image
from UBIRISv2 (b) Color Augmentation (c) Corneal Reflection Augmentation (d)
Flip, Rotate Augmentation

Data Augmentation generates additional data and is important for training
neural network models that are robust to noise. The goal is to obtain a model
that generalizes well on test (unseen) datasets and does not overfit on the
training (seen) dataset. In our prior work[17], we applied three types of
augmentations to the dataset, which are Color Augmentation (CA), Corneal
Reflection Augmentation (CRA), and Flip/Rotate Augmentation (FR). Below is a
brief description of the augmentations as illustrated in Fig. 3.
CA was necessary to create darker iris and skin tones as compared to the
distribution in the dataset (UBIRISv2). CA was applied to the input RGB image
(Fig. 3(a)) and no changes were needed for the pupil mask. First the image was
converted to Lab color space and noise was added as
$[L^{\prime},a^{\prime},b^{\prime}]=[L+rand(L_{d}),a_{i}+rand(a_{d}),b_{i}+rand(b_{d})]$
where $-50<L_{d}<10,-20<a_{d}<20,-20<b_{d}<20$ and
$[L,a_{i},b_{i}]=RGB2Lab([r,g,b])$. Then
$CA([r,g,b])=[r^{\prime},g^{\prime},b^{\prime}]$ is performed using
$[r^{\prime},g^{\prime},b^{\prime}]=LAB2RGB([L^{\prime},a^{\prime},b^{\prime}])$.
This helps in dealing with chromatic sensitivity variations and white balance
parameters of the camera. An example of CA is shown in Fig. 3(b).
CRA was performed to address the corneal reflections in the eye images as VL
images show greater corneal (Fresnel) reflections at the air cornea interface
when compared to near-IR illumination. This results in eye images with
Purkinje images. In VL pupillometry it is expected that the subjects will be
looking at intense sources of illumination such as a flashlight or a lamp
leading to reflections and saturation. We captured five such images (detailed
description is given in reference[17]) referred to as scene images $(I_{sc})$
taken from the subject’s perspective. CRA was thus performed using
$CRA(I)=\alpha I+(1-\alpha)I_{iris}I_{sc}$ where $0.98<\alpha<1$.
$I_{sc},I_{iris}$ stand for a scene image and the iris mask respectively. An
example of CRA is shown in Fig. 3(c). Finally, FR was used to improve the
rotation invariance of the model by flipping and rotating the images and
adjusting the pupil masks accordingly. This was done using standard image
processing techniques, and an example of flip augmentation is shown in Fig.
3(d).

###  2.3 Deep Learning

We chose U-net style architecture as the backbone architecture for our
approach. U-net has proven highly successful for biomedical image segmentation
tasks. It consists of an encoder-decoder architecture that uses multi-stage
downsampling with non-linear activations to constrict the representation of
the input image, to a latent representation called bottleneck, that is
subsequently upsampled by the multi-stage decoder which is expected to output
the desired segmentation mask. There are shortcut connections between encoder
blocks and the corresponding decoder blocks that pass information. After
applying augmentation techniques, we had a total of total 23431 input images
as well as the ground truth pupil masks. Next, we split this dataset into
training and validation sets in a 9:1 ratio. The input image originally of
size (400, 300, 3) was resized to (224, 224, 3) and the pupil mask and ellipse
parameters were adjusted accordingly. To prepare the input data from the
UBIRISv2 dataset, we performed normalization of both the input images and the
ellipse parameters. Specifically, we scaled the pixel values of the images to
a range of [0, 1] by dividing each pixel value by 255. Additionally, the
ellipse parameters were normalized by dividing the center coordinates
$(x_{c},y_{c})$ and the major, minor axis $(2a,2b)$ by 224, the dimension of
the input images. This resulted in these parameters being scaled to the range
of [0, 1]. Finally, the orientation angle $\theta$ was divided by 180, which
scaled it to the range of [-1, 1]. We considered the backbone U-net tasked
only to perform image segmentation as is. In our case, it means correctly
identifying the pixels in the image representing the pupil. We used Dice Score
Coefficient (DSC) as the evaluation criteria. DSC between binary sets X, Y is
defined in Equation (1)

$DSC(X,Y)=2\frac{|X\cap Y|}{|X|+|Y|}=\frac{2TP}{2TP+FP+FN}\,,$ (1)

where TP, FP, FN stand for True Positives, False Positives and False Negatives
respectively.
Since the goal was to maximize the Dice Score Coefficient, we defined the Dice
Loss, to be minimized by the optimizer during training as shown in Equation
(2)

$Loss(M_{gt},M_{pred})=1-DSC(M_{gt},M_{pred})\,,$ (2)

where $M_{gt}$, $M_{pred}$ is the ground truth target mask and predicted mask
respectively.

####  2.3.1 U-Net with Ellipse Regression

To obtain the ellipse parameters as well as the segmentation mask of pupil, we
used the method described by Kothari et.al. [31] to modify the network
architecture as shown in Fig. 5. The key idea here is to use a combined loss
function for solving two learning tasks simultaneously: accurately identifying
pixels representing the pupil ($M$) and regressing parameters ($\varepsilon$)
of the elliptical contour that fits the pixels identified as the pupil. We
introduce a regression module $R$ as shown in Fig. 4 which is able to learn
the ellipse parameters from the bottleneck representation $z$. For ellipse
regression, we used the $L_{1}$ loss as it minimizes the absolute deviation
between the predicted parameters and the ground truth. The joint loss function
is defined in Equation (3)

$\begin{array}[]{c}Loss(M_{gt},M_{pred},\varepsilon_{gt},\varepsilon_{pred})=DiceLoss(M_{gt},M_{pred})+L_{1}(\varepsilon_{gt},\varepsilon_{pred})\\\
=1-DSC(M_{gt},M_{pred})+\sum|\varepsilon_{gt}-\varepsilon_{pred}|\end{array}$
(3)

where $\varepsilon_{gt}$, $\varepsilon_{pred}$ are the ground truth and
predicted ellipse parameters respectively. The ellipse regression module we
used is shown in Fig. 4

---
Figure 4:  Architecture used for performing ellipse regression ($R$) using
bottleneck (latent) representation $z$.

---
(a)

---
(b)

Figure 5:  $I$ is the input RGB image. $M$ is the output predicted
segmentation mask for the pupil. $E$ represents the encoder (downsampling),
$D$ represents the decoder (upsampling), $z$ is the latent representation also
referred to as bottleneck. Dotted lines from $E$ to $D$ are skip connections.
$g$ is a non-linear activation function used to obtain $M$ and $\varepsilon$.
(a) Example architecture for pupil segmentation only. (b) Example architecture
for segmentation & ellipse regression. $R$ is the ellipse regression module
that can predict ellipse parameters $\varepsilon$ from the bottleneck.

###  2.4 Training

We used Pytorch[32] to program the neural network architecture, training, and
prediction pipeline in a GPU workstation with an NVIDIA A100 SXM graphics
card. The dataset was split into a train (90%) and validation (10%) sets. A
data generator was created to send mini-batches of data comprising of model
specific inputs and outputs required by the model. Batch-size was set to 64.
Models were trained for 100 epochs using the RMSprop optimizer[33] with a
learning rate of $1e^{-4}$, and weight_decay, momentum $=1e^{-8},0.9$. A
cyclic learning rate scheduler was also used during training to adjust the
learning rate of the optimizer. The CyclicLR scheduler from PyTorch was used
with a minimum learning rate of $1e^{-4}$ and a maximum learning rate of
$1e^{-3}$. We used the Sigmoid function $g(z)=\frac{1}{1+e^{-z}}$ as the
activation function $(g)$ after the decoder $(D)$ and ellipse regression
module $(R)$ to obtain the pupil mask $M$ as well as ellipse parameters
$\varepsilon$. After obtaining $\varepsilon$, we can rescale its original
values by simple constant multiplication.

###  2.5 Evaluation

In our study, we evaluated two different approaches for obtaining ellipse
parameters in the context of pupil segmentation. The first approach involved
using a U-Net model for segmentation, followed by an additional step of
ellipse fitting to obtain the ellipse parameters. The second approach used a
combined U-Net with Ellipse Regression module, where the ellipse parameters
were directly obtained as an output of the network. To compare the two
approaches, we measured the prediction times and evaluated the performance of
the two models on UBIRISv2 test set and clinically acquired images that were
not used for training. We performed ellipse fitting on the pupil mask output
from the U-Net with Ellipse Regression module, and compared the results in
terms of DSC and accuracy metrics with segmentation only U-Net model. We also
evaluated the performance of the U-Net with Ellipse Regression module when
predicting ellipse parameters and pupil mask output directly. Overall, our
evaluation aimed to compare the performance and efficiency of the two
approaches for obtaining ellipse parameters in the context of pupil
segmentation. Accuracy is defined in Equation (4)

$Accuracy=\frac{TP+TN}{P+N}\,,$ (4)

where TP, TN, P, N stand for True Positives, True Negatives, Positives, and
Negatives respectively. As our future objective is to apply our approach to a
video and plot the pupillogram [25], we calculated the errors in estimating
pupil diameter. This is important as the pupillogram represents changes in
pupil diameter over time, and accurate estimation of pupil diameter is
necessary for meaningful analysis. Therefore, we aimed to ensure that our
approach provides reliable estimates of pupil diameter, which can be used to
generate accurate pupillograms from video data. We defined pupil radius as the
average length of the semi-axes $(\frac{a+b}{2})$, thus the pupil diameter is
$PD=(a+b)$ and pupil diameter error as $|PD_{gt}-PD_{pred}|$.

###  2.6 Clinically acquired images

Pupillary images from 5 self-reported healthy volunteers were collected.
Participants were seated facing a slit-lamp and a diffuse illumination setting
was used to illuminate the eye. Images were sequentially captured with a
commercially available Android smartphone (Xiaomi Redmi Note 10, Model no:
M2101K7AI) using the inbuilt camera application. The camera was positioned at
a distance of 15-18 cm from the eye, and adjusted so that the eye is roughly
centered in the image. Ground truth pupil masks were created manually by a
clinically experienced author (JJB) using ImageJ software [34] (version 1.51w)
and ellipse parameters were extracted using the least squares algorithm.

##  3 RESULTS AND DISCUSSION

Table 1 shows a comparison of the two models in terms of computational
performances. We saw that obviating the additional ellipse fitting step is
useful. It is also important to note that since these models will eventually
be deployed on a smartphone device, saving computational time is valuable.

Table 1: Comparison in terms of computational performance | U-net | U-net with
---|---|---
|  | Ellipse Regression
Approx. number of trainable model parameters (in million) | 7.8 | 8.1
Model memory (MB) | 30 | 31
Time for neural network prediction (ms/frame) | 15 | 17
Time for ellipse fitting (ms/frame) | 8 | 0
Total Time (ms) | 23 | 17
Table 2: Evaluation on UBIRISv2 and clinically acquired images | UBIRISV2 | Clinically acquired images
---|---|---
Parameters |  U-net |  U-net with Ellipse Regression |  U-net |  U-net with Ellipse Regression
Avg. DSC |  0.752 |  0.753 |  0.59 |  0.626
SD DSC |  0.06 |  0.06 |  0.274 |  0.242
Avg. Accuracy |  0.993 |  0.992 |  0.994 |  0.995
SD Accuracy |  0.005 |  0.005 |  0.003 |  0.002
Avg. Pupil Diameter Error |  0.223 |  0.197 |  6.336 |  4.881
SD Pupil Diameter Error |  0.214 |  0.144 |  4.599 |  1.671
Avg. Pupil Position (X-Axis) Error |  0.049 |  0.037 |  8.803 |  0.327
SD Pupil Position (X-Axis) Error |  0.048 |  0.036 |  31.550 |  0.515
Avg. Pupil Position (Y-Axis) Error |  0.069 |  0.068 |  7.260 |  0.847
SD Pupil Position (Y-Axis) Error |  0.051 |  0.060 |  25.204 |  2.187
Table 3: Evaluation on UBIRISv2 and clinically acquired images | UBIRISV2 | Clinically acquired images
---|---|---
Parameters | U-net with Ellipse Regression | U-net with Ellipse Regression
Avg. Pupil Diameter Error | 3.928 | 6.007
SD Pupil Diameter Error | 0.706 | 3.973
Avg. Pupil Position (X-Axis) Error | 0.271 | 4.123
SD Pupil Position (X-Axis) Error | 0.185 | 1.996
Avg. Pupil Position (Y-Axis) Error | 0.430 | 1.925
SD Pupil Position (Y-Axis) Error | 0.373 | 2.144

Table 2 presents the summary statistics for the U-net and U-net with Ellipse
Regression models, which were evaluated on both the UBIRISV2 and clinically
acquired images datasets. Here, in case of U-Net with Ellipse Regression
module, ellipse parameters were extracted by fitting ellipse on the pupil mask
output from the model. SD is referred to as standard deviation $(\sigma)$.
Pupil position is defined as the coordinates of center $(x_{c},y_{c})$ of the
fitted ellipse, and deviation of these coordinates from ground truth data is
referred to as "Pupil Position Error" and calculated with respect to $X-axis$
and $Y-axis$. To get an estimate of the performance of the trained models on
unseen data, we sampled 30 random images from the UBIRISv2 dataset and
clinically acquired data each and ran predictions. Figs. 6, 7 illustrates the
performance visually. We saw that the model with ellipse regression performs
better than the U-net.

---
(a)

---
(b)

---
(c)

---
(d)

Figure 6:  Results on UBIRISv2. (a) RGB images from UBIRISv2, (b) Ground Truth
Pupil Masks, (c) Predictions from U-net, (d) Predictions from U-net with
Ellipse Regression.

---
(a)

---
(b)

Figure 7:  Results on UBIRISv2. (a) Fitted ellipse boundary using U-net, (b)
Fitted ellipse boundary using U-net with Ellipse Regression

For the clinically acquired images, we present the results of the neural
networks on real-life images which were not used for model training as shown
in Fig. 8, 9. We observe that the model with ellipse regression performs
better than the U-net for real-world data. See columns 3 and 5 of Fig. 8 (c),
(d) for some examples. Table 3 presents the summary statistics for U-net with
Ellipse Regression models, which were evaluated on both the UBIRISV2 and
clinically acquired images datasets. Here, in this case, the obtained output
ellipse parameters directly from the model are used to evaluate the parameters
of this table. Fitted ellipse boundaries using output ellipse parameters from
this model are shown in Fig. 10.

---
(a)

---
(b)

---
(c)

---
(d)

Figure 8:  Results on Acquired Images. (a) Real-world images, (b) Ground Truth
Pupil Masks, (c) Predictions from U-net, (d) Predictions from U-net with
Ellipse Regression.

---
(a)

---
(b)

Figure 9:  Results on Acquired Images. (a) Fitted ellipse boundary using
U-net, (b) Fitted ellipse boundary using U-net with Ellipse Regression

---
(a)

---
(b)

Figure 10:  Results on UBIRISv2 and Acquired Images using predicted pupil
parameters directly from U-net with Ellipse Regression. (a) Fitted ellipse
boundary on UBIRISv2, (b) Fitted ellipse boundary using U-net with Ellipse
Regression on Acquired Images

##  4 CONCLUSION

A smartphone can potentially be used to perform VL pupillometry. We showed why
extraction of ellipse parameters of the pupil is important and how it relates
to the measurement of PLR and other important metrics. We demonstrated how
Deep Learning can be used to obtain pupil pixels and the ellipse parameters
directly in a single step with high accuracy. Training the model with the
combined loss function also improved the accuracy and robustness of the model.
This can be attributed to the model learning two tasks simultaneously as it
learns the correlation between the pupil pixels and the ellipse parameters.
Hyper-parameter optimization or the use of different encoder-decoder
architectures for performance or accuracy enhancements can be an interesting
direction for the future. The work presented here is an important step in
application of deep learning methods to an important task in clinical vision
which can be implemented on a smartphone for use under field conditions.

Disclosures The authors declare that there are no conflicts of interest
related to this article. Data Availability Statement Data underlying the
results presented in this paper are not publicly available at this time but
may be obtained from the authors upon reasonable request.

## References

  * [1] C. A. Hall and R. P. Chilcott, “Eyeing up the future of the pupillary light reflex in neurodiagnostics,” Diagnostics 8, 19 (2018).
  * [2] A. P. Belliveau, A. N. Somani, and R. H. Dossani, “Pupillary light reflex,” StatPearls. Treasure Island (FL) (2021).
  * [3] H. Mirjalili, A. R. Ezzabadi, Y. Yazdiyousefi, and M. A. J. Nadoshan, “The value of ultrasonography in determining pupillary light reflex in patients with traumatic ocular injuries; a letter to editor,” Archives of academic emergency medicine 7 (2019).
  * [4] J. Reimer, M. J. McGinley, Y. Liu, C. Rodenkirch, Q. Wang, D. A. McCormick, and A. S. Tolias, “Pupil fluctuations track rapid changes in adrenergic and cholinergic activity in cortex,” Nature communications 7, 1–7 (2016).
  * [5] C. R. Lee and D. J. Margolis, “Pupil dynamics reflect behavioral choice and learning in a go/nogo tactile decision-making task in mice,” Frontiers in behavioral neuroscience 10, 200 (2016).
  * [6] R. Mazziotti, F. Carrara, A. Viglione, L. Lupori, L. L. Verde, A. Benedetto, G. Ricci, G. Sagona, G. Amato, and T. Pizzorusso, “Meye: Web app for translational and real-time pupillometry,” Eneuro 8 (2021).
  * [7] B. Feigl, A. J. Zele, S. M. Fader, A. N. Howes, C. E. Hughes, K. A. Jones, and R. Jones, “The post-illumination pupil response of melanopsin-expressing intrinsically photosensitive retinal ganglion cells in diabetes,” Acta ophthalmologica 90, e230–e234 (2012).
  * [8] G. L. Ferrari, J. L. Marques, R. A. Gandhi, S. R. Heller, F. K. Schneider, S. Tesfaye, and H. R. Gamba, “Using dynamic pupillometry as a simple screening tool to detect autonomic neuropathy in patients with diabetes: a pilot study,” Biomedical engineering online 9, 1–16 (2010).
  * [9] K. Karavanaki, A. Davies, L. Hunt, M. Morgan, and J. Baum, “Pupil size in diabetes.” Archives of disease in childhood 71, 511–515 (1994).
  * [10] J. C. Park, Y.-F. Chen, N. P. Blair, F. Y. Chau, J. I. Lim, Y. I. Leiderman, M. Shahidi, and J. J. McAnany, “Pupillary responses in non-proliferative diabetic retinopathy,” Scientific reports 7, 1–10 (2017).
  * [11] J. C. Park, H. E. Moss, and J. J. McAnany, “The pupillary light reflex in idiopathic intracranial hypertension,” Investigative ophthalmology & visual science 57, 23–29 (2016).
  * [12] F. Sabeti, C. J. Nolan, A. C. James, A. Jenkins, and T. Maddess, “Multifocal pupillography identifies changes in visual sensitivity according to severity of diabetic retinopathy in type 2 diabetes,” Investigative ophthalmology & visual science 56, 4504–4513 (2015).
  * [13] S. A. Smith and R. R. Dewhirst, “A simple diagnostic test for pupillary abnormality in diabetic autonomic neuropathy,” Diabetic medicine 3, 38–41 (1986).
  * [14] F. T. Collison, J. C. Park, G. A. Fishman, J. J. McAnany, and E. M. Stone, “Full-field pupillary light responses, luminance thresholds, and light discomfort thresholds in cep290 leber congenital amaurosis patients,” Investigative ophthalmology & visual science 56, 7130–7136 (2015).
  * [15] A. Kawasaki, S. Collomb, L. Léon, and M. Münch, “Pupil responses derived from outer and inner retinal photoreception are normal in patients with hereditary optic neuropathy,” Experimental eye research 120, 161–166 (2014).
  * [16] J. C. Park, A. L. Moura, A. S. Raza, D. W. Rhee, R. H. Kardon, and D. C. Hood, “Toward a clinical protocol for assessing rod, cone, and melanopsin contributions to the human pupil response,” Investigative ophthalmology & visual science 52, 6624–6635 (2011).
  * [17] A. C. Mandal, A. Phatak, J. J. Balaji, and V. Lakshminarayanan, “A deep-learning approach to pupillometry,” in _Applications of Machine Learning 2021,_ vol. 11843 (International Society for Optics and Photonics, 2021), p. 1184312.
  * [18] Y. Morita, H. Takano, and K. Nakamura, “Pupil diameter measurement in visible-light environment using separability filter,” in _2016 IEEE International Conference on Systems, Man, and Cybernetics (SMC),_ (IEEE, 2016), pp. 000934–000939.
  * [19] M. Ricciuti and E. Gambi, “Pupil diameter estimation in visible light,” in _2020 28th European Signal Processing Conference (EUSIPCO),_ (IEEE, 2021), pp. 1244–1248.
  * [20] J. N. Sari, A. N. Hanung, E. N. Lukito, P. I. Santosa, and R. Ferdiana, “A study on algorithms of pupil diameter measurement,” in _2016 2nd International Conference on Science and Technology-Computer (ICST),_ (IEEE, 2016), pp. 188–193.
  * [21] H. Takano, K. Tachi, Y. Morita, and K. Nakamura, “Statistical evaluation of color components for pupil detection and diameter measurement under visible-light conditions,” ITE Transactions on Media Technology and Applications 7, 118–125 (2019).
  * [22] K. Tachi and H. Takano, “Effective color components for pupil diameter measurement of brown eye using a visible-light camera,” in _2018 IEEE International Conference on Systems, Man, and Cybernetics (SMC),_ (IEEE, 2018), pp. 850–855.
  * [23] K. Kitazumi and A. Nakazawa, “Robust pupil segmentation and center detection from visible light images using convolutional neural network,” in _2018 IEEE International Conference on Systems, Man, and Cybernetics (SMC),_ (IEEE, 2018), pp. 862–868.
  * [24] O. Ronneberger, P. Fischer, and T. Brox, “U-net: Convolutional networks for biomedical image segmentation,” in _International Conference on Medical image computing and computer-assisted intervention,_ (Springer, 2015), pp. 234–241.
  * [25] H. Wilhelm and B. Wilhelm, “Clinical applications of pupillography,” Journal of Neuro-ophthalmology 23, 42–49 (2003).
  * [26] A. W. Fitzgibbon, M. Pilu, and R. B. Fisher, “Direct least squares fitting of ellipses,” in _Proceedings of 13th International Conference on Pattern Recognition,_ vol. 1 (IEEE, 1996), pp. 253–257.
  * [27] H. Proença and J. C. Neves, “Irina: Iris recognition (even) in inaccurately segmented data,” in _Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition,_ (2017), pp. 538–547.
  * [28] H. Hofbauer, F. Alonso-Fernandez, P. Wild, J. Bigun, and A. Uhl, “A ground truth for iris segmentation,” in _2014 22nd international conference on pattern recognition,_ (IEEE, 2014), pp. 527–532.
  * [29] F. Alonso-Fernandez, J. Bigun, H. Hofbauer, A. Uhl, P. Wild, H. Hofbauer, and F. Alonso-Fernandez, “Evaluation of the irisseg datasets,” University of Salzburg, Department of Computer Sciences, Technical Report: IRISSEG–2013–12 (2013).
  * [30] H. J. Wyatt, “The form of the human pupil,” Vision research 35, 2021–2036 (1995).
  * [31] R. S. Kothari, A. K. Chaudhary, R. J. Bailey, J. B. Pelz, and G. J. Diaz, “Ellseg: An ellipse segmentation framework for robust gaze tracking,” IEEE Transactions on Visualization and Computer Graphics 27, 2757–2767 (2021).
  * [32] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga _et al._ , “Pytorch: An imperative style, high-performance deep learning library,” Advances in neural information processing systems 32, 8026–8037 (2019).
  * [33] T. Tieleman, G. Hinton _et al._ , “Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude,” COURSERA: Neural networks for machine learning 4, 26–31 (2012).
  * [34] C. A. Schneider, W. S. Rasband, and K. W. Eliceiri, “Nih image to imagej: 25 years of image analysis,” Nature methods 9, 671–675 (2012).