Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Using Convolutional Neural Networks to Explore The Effect of Impaired

Subitizing in Dyscalculia

Rohan Jay
Princeton International School of Mathematics and Science

Abstract
Dyscalculia is a learning disability that impairs a person’s ability to solve mathematics problems.
One of the issues many people with dyscalculia face is an impaired ability to subitize, which refers
to the ability to look at a group of objects and recognize the number of objects without counting
directly. In this article, we explore the ability of a convolutional neural network (CNN) to mimic
the subitizing ability of both dyscalculic and non-dyscalculic persons. We look at first whether the
model follows the same pattern in accuracy for both small and larger number of objects. Since
people generally subitize smaller numbers of objects (e.g., two books, three dots, etc.) better than
they subitize larger ones, the CNN should follow the same pattern. To model dyscalculia, we also
simulate damaged neural connections (using dropout) and compare the behavior of the damaged
network to behavioral data from dyscalculic children reported in [6]. Our methodology involved
the creation of custom datasets and the introduction of dropout in the CNN to simulate potential
neural deficits associated with dyscalculia. This research not only underscores the potential of
CNNs in cognitive modeling but also paves the way for a deeper understanding of dyscalculia and
its neural underpinnings.

Introduction
The aim of this article is to use the power of Convolutional Neural Networks (CNNs) to
understand the nature of subitizing and how it might be impaired in those with dyscalculia. By
virtue of their ability to handle image data and recognize patterns, CNNs offer a unique opportunity
to emulate how the human brain executes the subitizing function. By training the CNN network to
subitize shapes of varying numerosity, we aim to discover the network’s performance pattern and
compare it to human behavior. An accurate CNN model would demonstrate the same pattern as
human behavior, which is better performance (i.e., higher accuracy) for smaller quantities and a
decline in accuracy as the number of objects increases.

Additionally, we examine the model’s performance after the application of dropout, which
we use to simulate missing neural connections in persons with dyscalculia. By the end of the paper,
readers will have a clear understanding of how a machine learning model such as CNN processes
subitizing tasks and the potential similarities and dissimilarities it has with human cognition,
especially in the context of dyscalculia.
Prior Work
Previous research has been carried out using neural networks to study subitizing. We build
upon this work by comparing the subitizing abilities of standard and damaged networks to that of
healthy and dyscalculic children. First, Guan and Loew’s research [1] used deep neural networks
for subitizing connected shapes, i.e., shapes which touch each other at the corners. Their focus was
primarily on counting the connected components in images. Zhang et al. [2] looked at how to apply
CNN to real-world images in the Salient Object Subitizing (SOS) dataset. [3] is similar in that it
contains images of varying sizes in its dataset. However, despite the heterogeneity in the sizes,
they did not draw any conclusions with regard to the performance between different sized images,
thus leaving a gap in the understanding of the effect of the size on subitizing. Wever and Runia [4]
brought in a new and interesting perspective by exploring the use of unsupervised training and
noted that it does not perform as well as models trained on supervised data. Cleveland Clinic [5]
also looks at the sizes of objects in the SOS.

In summary, previous work has successfully demonstrated that neural networks can
develop subitizing behavior. [1], [3], and [4] go over using simple polygons in the training data,
which we build upon in this work. We chose to use simple shapes to focus on isolating the effect
of the number of objects on subitizing without adding complexity in terms of real-world imagery,
which is the case of [2] and [5], which use the Salient Object Subitizing (SOS) dataset.

Methods
In this article, we build upon previous work to explore how human-like subitizing ability
works. As can be noted above, while neural networks have been used in the past to study subitizing,
certain gaps still exist in terms of the influence of shape size and type, and previous work has not
simulated subitizing in dyscalculics. Our research serves to bridge that gap by studying how shape
size and type influence subitizing in both standard and damaged neural networks. The code we
used for both healthy and impaired subitizing is available at a GitHub repository, whose link is in
the Appendix.

Model
We use a CNN with the following model architectural nuances. We employ a model with a
single hidden layer. Pooling: To further distill the features and to reduce the spatial dimensions of
the output, we applied 2D max pooling twice in our network. CNN works by taking sections of the
image, applying deep learning for each section, and combining the outputs into a new image with
a lower resolution. Max pooling is the term used for calculating the maximum value from a
particular section (such as a pixel) of the image, effectively reducing the resolution. This technique
helps to focus on the most salient features while discarding the redundant and less important
information. For the non-linearity in our network, except for the last layer, we have chosen the
Leaky ReLU (Rectified Linear Unit) activation function. A normal ReLU function ReLU(x) is
defined as x for x > 0 and 0 for x = 0. For the Leaky ReLU variant, for the condition of x = 0, the
function is a line of an almost negligible slope – close to the constant slope in the normal ReLU.
Data
We developed a custom generation procedure to create the training dataset for the network.
Our generator created two types of images: those that contain circles, and those that contain
squares. The numerosity for each image was from 1 to 10, inclusive on both ends.

Testing Accuracy For Each Number Data


To test the subitizing accuracy for each number, we use a confusion matrix and plot each
value on the diagonal. This helps us to gain insights into the model’s true positive predictions. A
confusion matrix represents, for each true value, how many times the model predicted each
possible predicted number. It helps us to understand how often the model accurately subitized a
given number of objects and how often it is misjudged.

Learning Subitizing
We then analyzed healthy subitizing accuracy over time for each number.
Figure 1a: Healthy subitizing over time, divided by the number of objects in each display Figure
1b: Confusion matrix for the last epoch, healthy subitizing

We can see that each number has a distinct learning trajectory, which would suggest that
the model learns to subitize certain numbers more efficiently than others. This is especially true
for numbers smaller than 3. For numbers greater than 3, we see steeper slopes in their accuracy
over time, indicating that the model quickly adapts and improves its predictions for those specific
numbers. The accuracy for numbers less than 3 follows similar trajectories, which suggest that the
model's subitizing capability is consistent across these quantities.

Dropout Simulations and Its Implications


After successfully modeling the healthy subitizing ability, we used dropout on the whole
CNN to simulate possible missing neural connections in dyscalculia (dropout rate = 0.56). Our
results for accuracy over time for each digit is below.
Figure 2a: Impaired subitizing over time, divided by the number of objects in each display — 32
epochs
Figure 2b: Confusion matrix for the last(32nd) epoch, impaired subitizing

To determine whether the damaged network could develop subitizing capabilities over an extended
developmental time frame, we next trained the network for a total of 100 epochs.
Figure 3a: Impaired subitizing over time, divided by the number of objects in each display — 100
epochs
Figure 3b: Confusion matrix for the last(100th) epoch, impaired subitizing

We notice that with dropout, the model is learning at a slower pace and with more
variability, as is reflected by the more fluctuating accuracy graph. The accuracy is also not settling
as quickly or effectively as the healthy simulation. We also notice that accuracy, in addition to
showing more fluctuations, is also taking longer to stabilize (although it eventually does),
reflecting the inconsistencies introduced by the dropout. It might suggest that individuals with
dyscalculia have a more erratic or inconsistent cognitive process when it comes to rapid number
recognition. Their brain might be making frequent adjustments, trying to find the best way to
interpret numerical information, leading to instability in learning. We also notice that it is taking
longer to converge, reflecting the challenges faced by individuals with dyscalculia. We observe
that the model is taking longer to reach its best performance level. However, we also see that the
dyscalculia model eventually stabilizes after a prolonged period, which might suggest the presence
of compensatory mechanisms. Even though dyscalculic people may face initial challenges, they
may be developing alternative approaches to understand numbers, leading to eventual stabilization.

In order to compare the healthy model to the dyscalculia model, we reference Figure 2 in
[6]. The data depicts the response time for identifying the number of objects for dyscalculic and
non-dyscalculic participants in grades 2, 3, and 4. The data shows an initial divergence in response
time between the two groups as the number of objects increases; however, past the normal
subitizing range, the gap decreases. We see that in general, as the digit increases, the gap between
the two groups increases.

Conclusion
In summary, the graph visually confirms the earlier observation that simulating potential
neural deficits using dropout provides a model that resonates more closely with natural subitizing
patterns. This offers exciting insights into the neural dynamics of dyscalculia and how artificial
neural networks can be fine-tuned to emulate human cognitive processes more closely.
We found dropout to be a powerful tool to simulate cognitive deficiencies like dyscalculia
in neural networks. Simulations such as these can be used in preliminary studies where the financial
and time costs of collecting data from real people is too great. We would also like to interpret these
results in the context of the broader cognitive framework. The differences in learning dynamics,
stability, convergence, peak performance, and generalization between the two models offers us
profound insights into the neural underpinnings of dyscalculia and its impact on subitizing tasks.

Acknowledgements
The author thanks Tyler Giallanza (Princeton University) for providing guidance and mentorship
for this research project.
References
[1] Guan, S. & Loew, M. (2021). Understanding the Ability of Deep Neural Networks to Count
Connected Components in Images, ArXiv, doi: 10.48550/arXiv.2101.01386
[2] Zhang, J. & Ma, S. & Sameki, M. & Sclaroff, S. & Betke, M. & Lin, Z. & Shen, X. & Price,
B. & Mech, R., Salient Object Subitizing, ArXiv, Salient Object Subitizing. ArXiv,
doi.org/10.48550/arXiv.1607.07525
[3] Wu, X. & Zhang, X. & Shu, X. Cognitive Deficit of Deep Learning in Numerosity, ACM
Digital Library, https://dl.acm.org/doi/pdf/10.1609/aaai.v33i01.33011303
[4] Wever, R., & Runia, T. Subitizing with Variational Autoencoders, ArXiv, doi:
10.48550/arXiv.1808.00257
[5] “Dyscalculia: What It Is, Causes, Symptoms & Treatment”, Cleveland Clinic (2022),
clevelandclinic.org
[6] Schleifer, P. & Landerl, K (2011). Subitizing and Counting in Typical and Atypical
Development, Developmental Science, Volume 14, Issue 2,
https://doi.org/10.1111/j.14677687.2010.00976.x

Appendix
1. https://github.com/roha913/CNN-Based-Analysis-of-Dyscalculia.git

You might also like