abstract: It is ten years since neural networks made their spectacular comeback. Prompted by this anniversary, we take a holistic perspective on Artificial Intelligence (AI). Supervised Learning for cognitive tasks is effectively solved — provided we have enough high-quality labeled data. However, deep neural network models are not easily interpretable, and thus the debate between blackbox and whitebox modeling has come to the fore. The rise of attention networks, self-supervised learning, generative modeling, and graph neural networks has widened the application space of AI. Deep Learning has also propelled the return of reinforcement learning as a core building block of autonomous decision making systems. The possible harms made possible by new AI technologies have raised socio-technical issues such as transparency, fairness, and accountability. The dominance of AI by Big-Tech who control talent, computing resources, and most importantly, data may lead to an extreme AI divide. Failure to meet high expectations in high profile, and much heralded flagship projects like self-driving vehicles could trigger another AI winter.
author: Sanjay Chawla$^1$ Preslav Nakov$^2$ Ahmed Ali$^1$ Wendy Hall$^3$
Issa Khalil$^1$ Xiaosong Ma$^1$ Husrev Taha Sencar$^1$
Ingmar Weber$^5$ Michael Woolridge$^4$ Ting Yu$^1$
bibliography: refs.bib
date:  $^1$Qatar Computing Research Institute
  $^2$ Mohamed Bin Zayed University of AI
  $^3$University of Southampton
  $^4$ Oxford University
  $^5$ Saarland University
  2024-10-02
title: Ten Years after ImageNet:
  A $360^{\circ}$ Perspective on AI

# Introduction

The ImageNet challenge for automatically recognizing and labeling objects in images was launched in 2010 . However, it was in 2012 when AlexNet, an eight-layer (hence deep) convolutional neural network (CNN) emerged as the winner by a large margin, and ushered in the new era of AI . CNNs were not new and had been proposed as far back as the 1990s, but had been sidelined in favor of more theoretically rigorous ML approaches such as support vector machines (SVMs) and boosting methods . So, why did CNNs outperform other models? Two reasons are usually given. First was the provision of substantial high-quality training data. The ImageNet database was a one-of-a-kind benchmark and consisted of over fourteen million hand-annotated images from more than twenty thousand diverse categories. The multilayer CNN had the *capacity* to effectively memorize the training subset of ImageNet and, at the same time, generalize to unseen examples — a characteristic that is not fully understood even today . Second, Graphics Processing Units (GPUs), which were originally designed for parallelizing image processing tasks, proved to be ideally suited for the computational problems associated with training CNNs, making it practicable to train deep CNNs on large data sets in a reasonable amount of time. The combination of Big Data, Big Models, and relatively cheap parallel computation became the mantra that swept through AI research, in disciplines spanning from astronomy to zoology, and all applications that have elements of data and prediction.

Our perspective has two parts.

We begin with a high-level, partly technical, overview of the current state of AI. We will begin by reviewing supervised learning, a machine learning task that has been most impacted by deep learning (DL). We follow with a discussion on deep content generation models, on the resurrection of reinforcement learning, on the emergence of specialized software libraries for deep learning, and on the role of GPUs. We will conclude the first part by highlighting how adversarial samples can be designed to *fool* deep models and whether it is possible to make models robust.

In part two of the perspective, we consider the many socio-technical issues surrounding AI. Of particular interest is the dominance of Big Tech on AI. Effectively, only big corporations have the resources (expertise, computation, and data) to scale AI to a level where it can be meaningfully and accurately applied.

# Digression: What is AI?

The term Artificial Intelligence was first introduced in 1956 in a workshop proposal submitted by John McCarthy to the Rockefeller foundation, which proposed that "every aspect of learning or any other feature of intelligence can in principle be so precisely described that a machine can be made to simulate it ." Before that, Alan Turing in 1947, in an unpublished report titled "Intelligent Machinery", speculated that "What we want is a machine that can learn from experience" and suggested that the "possibility of letting the machine alter its own instructions provides the mechanism for this[^1]." Much of the recent success in AI is under the distinct subfield of AI known as Machine Learning and since the role of data is central, there is a broader term, Data Science, that is often used to subsume related disciplines including Statistics.

# Is Supervised Learning Solved?

Supervised Learning (SL) is the poster child of success of machine learning. Depending upon the context, SL is known as classification, regression, or prediction. Since the modern advent of deep learning, both the accuracy and the reach of SL have increased manifold. Many diverse problems across disciplines now use SL as a powerful oracle to tackle problems that hitherto seemed intractable. The task of Supervised learning can be formalized as follows:

> Given a set of samples $\mathcal{D} =\{(\mathbf{x},y)\}$ from a fixed but unknown probability distribution $P(\mathbf{x},y)$, learn a function mapping $f(\mathbf{x},\mathbf{w}) \approx y$ that generalizes to unseen samples from $P(\mathbf{x},y)$.

The function $f(.,\mathbf{w})$ is known as the *model*, and $\mathbf{w}$ are the weights or the parameters of the model that are inferred from $\mathcal{D}$ converting the SL task into an optimization problem. A loss function $\ell$ (e.g., square loss), is defined and the weights $w$ are obtained by minimizing the empirical average $$\mathcal{R}_{emp}(f,\mathcal{D}) = \frac{1}{|\mathcal{D}|}\sum_{i \in \mathcal{D}}\ell(f(\mathbf{x}_i,\mathbf{w}),y_i)$$ Note that the ideal objective would have been to minimize the expectation $\displaystyle\mathbb{E}_{(\mathbf{x},y) \sim P(\mathbf{x},y)}(\ell(f(\mathbf{x},\mathbf{w}),y)$, which is not actionable because $P(\mathbf{x},y)$ is not known. In deep learning, $f$ is a composition of $N$ layered functions given by $$\begin{aligned}
f_{1} & =   \sigma(\mathbf{W}_{1}\mathbf{x}) \\
f_{n+1} & =  \sigma(\mathbf{W}_{n}f_{n}) \; n = 1, \ldots, N-1 \\
y & =   \sigma(\mathbf{w}_{N}f_{N})
\end{aligned}$$ Here $\mathbf{W}_n$ are the weight matrices, $\mathbf{w}_N$ is a vector, and $\sigma$ is a pointwise activation nonlinear function loosely analogous to the biological activation in a brain neural cell. The total number of weights to be learned in the model is $\sum_{n}\mbox{size}(\mathbf{W}_{n})$. It is not uncommon these days for the number of parameters to be in the order of one hundred billion.

## Success Stories

It is remarkable that many scientific and technical questions can be reduced to a supervised learning task and then effectively solved using deep learning. The key to the success of deep learning seems to be that the input ($x$) should have a large amount of redundancy to predict the output ($y$). For example, even if a significant amount of pixels from an image of a cat are removed, there is enough context to make the correct prediction. Below are a few diverse examples, spanning different areas, where deep learning has made extraordinary progress.
**Object Recognition:** Identifying and classifying the correct object in an image is a fundamental task in computer vision, and this is where deep learning has arguably had the most impact. The most successful deep learning model for object recognition are the Convolutional Neural Networks (CNNs) . A convolution layer is designed to capture the observation that in vision what matters is the *locality* and the differences (and not absolute values) between the pixels in local neighborhoods. CNN is also the deep learning model most inspired by how the visual cortex of an animal brain works. The ImageNet database was designed primarily for object recognition tasks .
**Machine Translation (MT)** One of the most visible impact of deep learning is the widespread adoption of machine translation tools on mobile devices . Recurrent Neural Networks (RNNs) and successors like Long Short-Term Memory (LSTMs) were primarily designed for sequence-to-sequence modeling and MT is their primary application . RNN's are specified using a state transition model $$\mathbf{h}^{t+1} = f(\mathbf{h}^{t},\mathbf{x}^{t},W)$$ Here $\mathbf{x}_t$ is a dense vector word embedding, $\mathbf{h}^{t}$ is its latent or hidden representation and $W$ is the matrix of model parameters. Note that the function $f$ does not change between consecutive words. In natural language processing, it is customary to use a language model to create *word embeddings* for individual words. Word embeddings are effectively created by decomposing the co-occurrence matrix of words. A famous model for training word embeddings is `word2vec`, which surprised experts because it exhibited interesting algebraic properties . For example, it was observed that the difference between the embedding vectors of the words `king` and `queen` was aligned with the difference between the embedding vectors of `man` and `woman`. RNNs are now being replaced by Transformer Neural Networks (TNNs) as the latter are better at capturing long range dependencies (see Section ).
**Speech Recognition:** For automatic speech recognition (ASR) the task is to map a sequence of acoustic signals (continuous data) into a sequence of words (discrete symbols): $$\underbrace{[x_1,x_2,\ldots,x_n]}_{\text{acoustic signal}} \rightarrow \underbrace{[y_1,y_2,\ldots, y_m]}_{\text{text}}$$ Before the advent of deep learning, the state of the art was based on a combination of Gaussian Mixture Models and Hidden Markov Models (GMM-HMM). However, these models did not significantly improve with larger training data set. Traditional ASR systems employ a modular design, with different modules for acoustic modeling, pronunciation lexicon, and language modeling, which are trained separately. Now, almost all ASR models are based on deep learning with end-to-end (E2E) systems that are trained to convert acoustic features to text transcriptions directly, potentially optimizing all parts for the network for word error rate (WER).
**Protein 3D structure prediction:** A core idea in biology is that structure determines function. For example, the "spike" structure of the SARS-COV-2 protein is responsible for enabling the virus invade human cells. Deep learning has been effectively used to predict the 3D structure of a protein from its primary amino acid sequence, more specifically, the pairwise distance between the residues of the sequence . $$\underbrace{\mbox{primary amino acid sequence}}_{x} \rightarrow
\underbrace{\mbox{contact map}}_{y}$$ **Satellite Imagery Analysis:** The OpenStreetMap (OSM) initiative is known as the Wikipedia of maps . OSM is a collaborative effort in which volunteers build and annotate road maps worldwide. Deep Learning has been successfully used to automate the extraction of road maps from satellite imagery . Here again, a satellite image is treated as a raster input ($x$) and the model outputs a vector OSM road network ($y$). Deep Learning is effectively able to bridge the raster and vector dual representation in Geographical Information Systems (GIS).
**Material Science:** Graph Neural Networks (GNNs) adapt deep learning to make predictions about inter-connected entities, which are naturally represented as a graph. In fact, GNNs generalize both CNNs and RNNs. One of the most successful applications of GNNs is in the prediction of the electronic and thermodynamic properties of molecules. GNNs equal or surpass methods based on first-principles techniques such as Density Functional Theory (DFT) . Deep Learning will hasten the design of new materials for longer lasting batteries, solar cells, and hydrogen storage.

## Double Descent Phenomenon

While DL models exhibit excellent empirical performance, we have only a very limited understanding of why they actually work. This is especially true in overparameterized regimes, i.e., when the number of parameters in the model is larger than the number of data points.

The predictive performance of statistical models is grounded in the *bias-variance* trade-off. Models which make strong apriori assumptions about the relationship between the input ($x$) and output ($y$) (e.g., linearity) are defined to have a high bias. On the flip side, high bias models tend to have low variance - i.e., they mostly remain unaffected if trained using a different sample from the same underlying distribution. The complexity of neural networks increases with the number of layers, and they exhibit low bias but higher variance. In theory (and in practice) as the model complexity increases, the training error should go down, but the test error should start increasing beyond a point as the variance increases. However, models tend to exhibit a double descent behavior as shown in Figure . Indeed, the training error goes down (to almost zero) and the test error starts to increase, but beyond a point the test error starts going down again. There is no good explanation for this phenomenon. A side-effect is that there is a race to collect large datasets and to train very large models. The double descent phenomenon provides an empirical justification for such large models.

# Cognitive Content Generation

A distinctive attribute of intelligence is the ability to create meaningful informative content. Deep Learning solutions have emerged in the last ten years towards designing content generation models. There are two distinct flavors of content generation: continuous data like images (an image is an array of numbers) and discrete data (language). Generative Adversarial Networks (GANs)  and Variational Autoencoders (VAEs)  are used for image and speech generation, while language models, such as Generative Pre-trained Transformers (GPTs), for generating synthetic natural language content .

## Generating Synthetic Images

An early breakthrough in generating synthetic content was proposed using the generative adversarial networks (GANs) framework . Suppose we have access to a data set $\mathcal{D}$ consisting of images of cats and our goal is to design a neural network-based sampling function $\mathbb{G_\theta}$ that takes a random vector (e.g., from a Normal distribution) as input and outputs an image of a cat, which may never have existed before. How can such a function be trained? Note that $\mathcal{D}$ consists of only images of cats and thus we are in the *unsupervised* learning mode. The key idea underpinning GANs is to create another neural network $\mathcal{D_\eta}$ which is optimized to distinguish between "fake" output of $\mathbb{G_\theta}$ and the real input from $\mathcal{D}$. The network $\mathbb{G_\theta}$ in turn is optimized to *fool* $\mathcal{D_\eta}$, i.e., to create output that $\mathcal{D_\eta}$ is unable to distinguish whether it is from the generator or from the real data set. The two networks are trained in an iterative and adversarial manner until their parameters ($\theta$ and $\eta$) stabilize. The trained network $\mathbb{G_\theta}$ is now a sample generator for cats[^2].

A statistical perspective on content generation is to use what might be called the fundamental inequality of variational inference (FIVI), but is better known as the Evidence Lower Bound (ELBO) :

$$\log p(\mathbf{x}) \geq \mathbf{E}_{q_{\theta}(\mathbf{z|x})}\left[\log p_{\eta}(\mathbf{x|z})\right] - D_{KL}(q_{\theta}(\mathbf{z|x})||p(\mathbf{z}))$$ The intuition is to approximate a complex probability distribution with a product of two simpler distributions. Technically ELBO can be interpreted as follows. Again suppose we have a data set $\cal{D}$ of cat images which is generated by an unknown probability distribution, $p(\mathbf{x})$. Directly using maximum likelihood estimation to infer $p(\mathbf{x})$ is not tractable without knowing a specific form of the distribution. However, we can lower bound $\log p(\mathbf{x})$ by specifying two function approximators (e.g., neural networks) $q_{\theta}(\mathbf{z|x})$ and and $p_{\eta}(\mathbf{x|z})$ known as the *encoder* and *decoder* respectively and $\mathbf{z}$ is a data-driven latent variable to extract abstract features of the data. For example, for an image of a cat, $\mathbf{z}$ could capture concepts like the shape of a typical cat, color, and texture. The RHS of the inequality is widely known as the Evidence Lower Bound (ELBO). Note that the LHS of the inequality is independent of parameters $\theta$ and $\eta$ and therefore the RHS can be maximized and pushed closer to $\log p(\mathbf{x})$ by optimizing these two parameter sets using samples from $\cal{D}$. During optimization, $q_{\theta}(\mathbf{z|x})$ is forced to be close to a prior $p(\mathbf{z})$ by minimizing the Kullback-Liebler (KL) divergence. Once optimized, samples from $p(\mathbf{x})$ (cat images) can be efficiently generated as follows. Sample from a prior distribution (e.g., Normal), $p(\mathbf{z})$ and pass the sample through the decoder $p_{\eta}(\mathbf{x|z})$. Variational AutoEncoders  were the first example of generating complex image samples using this framework. However GANs tend to produce sharper and more realistic images compared to VAEs but they are notoriously prone to instability during training. More recently, Diffusion models based on using FIVI to infer a decoder using a sequence of latent variables have reportedly outclassed GANs . Furthermore Diffusion models can more easily be extended to incorporate context to control the generation of content. For example, systems like DALL.E-2  can be given prompts like "show me a blue cat in a brown bag" and produce synthetic images which closely match the prompt.

## Generating Natural Language

While CNNs were designed for object recognition, where the context is dependent on spatial proximity, language has a sequential structure. Recurrent Neural Networks (RNNs), were specifically designed to bring in sequential context and are used for Language Modeling (LM) — the task of predicting the next word in a sequence. However, a new architecture, known as Transformers have emerged, which has become the de facto choice . Consider a sequence of words $$x_1:\mbox{julia, } x_2:\mbox{is, }
x_3:\mbox{a, } x_4:\mbox{better, }
 x_5:\mbox{\underline{language}, } x_6:\mbox{than, } x_7:\mbox{python }$$ Assume that associated with each of the $x_i$'s is a `word2vec` vector embedding. For example, on its own, the word embedding of $x_7:\mbox{python}$ might indicate that it is a reptile rather than a computer language. The role of the Transformer Neural Network (TNN) is to transform the word embeddings so that they are more contextualized. The key idea in TNN (or just Transformers) is that of self-attention: each word will "attend" to each other word and will then update its own embedding. The architecture of self-attention is defined as follows: $$\begin{aligned}
 \mbox{query: } & q_t  = x_tW_q  \\
\mbox{key: } & k_{\tau}  = x_{\tau}W_k  \\
 \mbox{value: } & v_{\tau}  = x_{\tau}W_{v} \\
\mbox{Transform: } & y_{t} = \sum_{\tau}(q_t \cdot k_{\tau})v_{\tau}
\end{aligned}$$

The architecture of transformers is loosely modeled on the concept of a database query or information retrieval: treat every word $x_t$ as a *query* $q_t$ and compute its similarity with every other word *key*, $k_{\tau}$, and use it (the similarity) to re-weight every *value*, $v_{\tau}$ and form a transformed context-dependent word embedding $y_t$ by taking the weighted sum.

Transformers can be trained (to learn $W_q,W_k,W_v$) by using the concept of self-supervision. For example, assume we remove $x_5:$`language` from the above sequence of words and force the model to predict the masked word. The error between the predicted and the masked word will be back-propagated to learn the model parameters. The prediction of masked words is an example of self-supervision and it obviates the need for the expensive and time-consuming task of human label generation.

Transformers have brought huge improvements over the state of the art for a variety of tasks ranging from question answering, to machine translation, and automatic text summarization and are now being applied outside natural language applications including computer vision and control. Transformers have effectively made information retrieval *differentiable* - and that maybe one of the biggest innovations in the last ten years.

While GANs and Diffusion models are the basis of synthetic image generation, TNNs are playing an analogous role for text. The Generative Pre-Trained Transformer (GPT-X) models are now being widely used for symbolic data generation. For example, many email editors now have an auto-completion feature, which is often based on TNNs. Even by Big Model standards, these models are huge with reports that the next generation purportedly having over one trillion parameters. GPT-3 has been shown to be quite good at learning from a very small number of examples (few-shot learning) for a variety of tasks ranging from automatic essay writing to program code completion and generation. It is also capable of generating very realistic text: Figure  shows a fake news article[^3] generated by GPT-3 given as a start a title that establishes a false link between North Korea and the GameStop's share price short squeeze.

# Autonomous Decision-Making

Prediction on its own is not sufficient. Intelligence is also about decision-making. Deep Learning breathed new life into Reinforcement Learning (RL) with the success of DeepMind's AlphaGO system which beat the world Go champion in 2016 .

RL provides a framework for learning and decision-making by trial and error . In a RL setting, an agent observes a state $s$ of the environment and based on that takes an action $a$, which results in a reward $r$, and the environment transitions to a new state $s'$. The interaction goes on until a terminal state is reached. The aim of the agent is to learn a policy $\pi$ which is a mapping from states to actions that maximizes the expected cumulative reward. For example, self-autonomous driving can be framed as an RL problem: a vehicle uses its perception system to observe the environment (the state $s$) and based on the observation takes an action (moving the steering wheel, accelerate, brake) and transitions into a new state. The reward is the number of time steps or distance that the vehicle can drive without human intervention in which case the episode terminates.

In Deep RL, the policy $\pi(a|s,w)$ is modeled as a deep network that takes the state as an input and outputs an action, parameterized by $w$. In RL, as opposed to optimal control, the state transition dynamics are not given and the only information available is the reward value ($r$) from interacting with the environment. How can the cumulative reward be optimized when its functional form is not available? We briefly describe the "REINFORCE trick," which can be used to directly optimize a blackbox function .

Let $\bar{s} = \left((s_1,a_1),\ldots,(s_T,a_T)\right)$ be a sequence of state action pairs in an episode. Each pair $(s_i,a_i)$ is associated with a reward $r_i$. Let $R(\bar{s}) =\sum \gamma^{t}r_t$ be the cumulative reward function. The REINFORCE algorithm moves the gradient from $R(\bar{s})$ (obtained from the blackbox environment) to the logarithm of the differential policy function $\pi(a|s,w)$ which can then be optimized using gradient ascent:

While the REINFORCE algorithm was introduced in the RL community it has broader implications. For example, it has been used to bridge symbolic AI and machine learning and also as a heuristic for solving combinatorial optimization problems . Another important trend in RL is to infer policies directly from data (called offline or batch RL) without interacting with a real or simulated environment which may not be possible in sensitive application areas like healthcare .

# AI Computation: Software and Hardware

Deep Learning has a surprisingly simple computation pattern. Almost all forms of training rely on formulating an optimization problem which is solved using variations of the gradient descent method: $$\mathbf{w}_{t+1} \leftarrow \mathbf{w}_{t}
 - \alpha_{t}\nabla_{\mathbf{w}_{t}}\left[\sum_{(\mathbf{x},y) \in D}\ell(f(\mathbf{w}_{t},\mathbf{x}),y)\right]$$

Here, $f(\mathbf{w}_{t},\mathbf{x})$ is the neural network parameterized by $\mathbf{w}$ and applied to a data vector $\mathbf{x}$, and $\ell$ is the loss function. Specialized software libraries like TensorFlow and PyTorch have become popular, which makes it easier to specify the gradient descent computation. For a fixed $\mathbf{w}$, the application of $f(\mathbf{w},.)$ to a data vector $\mathbf{x}$ is called the *forward pass*. Similarly, for a fixed data set, the update of parameters $\mathbf{w}$ by first computing the gradients, using the backpropagation algorithm, is called the *backward pass*.

An often underappreciated reason for the widespread usage of deep learning is that *gradients* can be now computed using automatic differentiation (AD) libraries. In AD, complex functions can be expressed as a composition of elementary functions, such as trigonometric and polynomial functions, and then the gradients can be computed using the chain-rule of differentiation. Surprisingly, the computational cost of a forward pass $f(\mathbf{x})$ and of computing the gradient $\nabla_{\mathbf{w}}f(\mathbf{x},\mathbf{w})$ is the same using AD. Note that AD is different both from symbolic differentiation and also from numerical methods and is accurate up to machine precision .

At the hardware level, GPUs, which were initially designed for image processing, are ideally suitable for deep learning computation because (*i*) the set of computation patterns is small and highly parallel and thus compatible with GPUs and the Single Instruction Multiple Data (SIMD) architecture, and (*ii*) the GPUs are bandwidth-optimized (as opposed to CPUs, which are latency-optimized), and thus can be applied on large chunks of tensor data, which is the norm for deep learning nowadays.

More recently, the growth of AI workloads has led to specialized hardware specifically targeting deep neural network training jobs. The most prominent example is Google's TPU, an application-specific AI accelerator designed to efficiently perform matrix multiplication and addition operations that compose the bulk of deep learning model training computation . To this end, TPUs follow a Complex Instruction Set Computer (CISC) style and possess matrix processing units, high-bandwidth on-chip memory, and high-speed interconnect to construct massively parallel model training infrastructure. Meanwhile, recognizing the relatively low requirement in neural network weight calculation, it adopts low-precision arithmetic to enable the utilization of faster, cheaper integer units (as opposed to the powerful floating-point arithmetic units adopted in GPUs), which also significantly trims the energy consumption of AI training jobs.

# Deep Learning (In)Security

Early on in the deep learning revolution, it became apparent that deep models can be manipulated with malicious intent. There are three broad categories of manipulation: creating adversarial examples that are misclassified by the model; poisoning attacks that add training examples that result in low performance or biased model; and inference attacks to extract information about the training set or model parameters.

## Adversarial Attack

One simple example of creating adversarial examples is known as the Fast Gradient Sign Method (FGSM) . We can understand FGSM using a linear model $y =\mathbf{w}.\mathbf{x}$. Suppose we make a small perturbation $\bm{\eta}$ on $\mathbf{x}$ where the norm[^4] of $\bm{\eta}$ is bounded by $\epsilon$, i.e, $\mathbf{w}(\mathbf{x} + \bm{\eta}).$ Then it can be shown that maximal change will occur when $\mathbf{w}.\bm{\eta} = \epsilon[\mathbf{w}.\mathop{\mathrm{sgn}}(\mathbf{w})] = \epsilon m d$, where $m$ is the average of the absolute value of the weights and $d$ is the dimensionality of the input space. Thus in high-dimensional space, models are extremely vulnerable to carefully chosen small perturbations.

Since in a linear model, $\mathbf{w}$ is the gradient with respect to $\mathbf{x}$, this can be generalized to a non-linear model by taking the gradient of the loss function with respect to the input $\mathbf{x}$. Thus, a good candidate for an adversarial example is $$\mathbf{x}^{adv} = \mathbf{x} + \epsilon.\mathop{\mathrm{sgn}}\left(\nabla_{\mathbf{x}}\left[\sum_{(\mathbf{x},y) \in D}\ell(f(\mathbf{w}_{t},\mathbf{x}),y)\right]\right)$$ This one-step perturbation of the input towards the gradient ascent direction increases the value of the loss function. Alternative optimization formulations have also been introduced to create adversarial examples that utilize the perturbation budget more effectively.

Note that in order to create an adversarial example, the adversary has to have full information about the model and in particular about the loss function. This is known as a *white-box* attack. However, even when no information about the target model's architecture and parameters is exposed, adversarial examples can still be generated through so called *black-box* attacks. It has been observed that by repeatedly querying the model and collecting a sufficient number of samples, an adversary can create a standalone proxy model, which can be used to create adversarial samples. Moreover, it is also known that adversarial examples created against one model can be transferred to attack other, unseen models. Several defenses have been proposed to improve the robustness of models against adversarial attacks. These include measures such as purification of inputs to filter out small perturbations potentially introduced by an attack, incorporation of adversarial training procedures by including adversarial examples in the training data, and identification of adversarial examples through additional anomaly detection mechanisms. In practice, however, these defenses come at the cost of reduced accuracy or only provide robustness against a subset of the potential adversarial examples.

## Poisoning and Inference Attacks

An increasingly more important concern is the poisoning or backdooring of deep learning models . In most learning settings, this class of attacks is not considered practical as it requires access to the training data used by developers and designers. In the case of deep learning, however, the need for large-scale, diverse data sets is typically satisfied by scraping data from the Web. The reliance on public data sources, in the absence of any screening procedures, essentially allows attackers to inject data into the training process. The underlying idea of this attack is to manipulate the training data to implant a backdoor to the model which can be selectively triggered with specific inputs during the inference. This is realized by either augmenting input samples with some pattern called the trigger or utilizing semantic triggers (i.e., patterns that are part of the original input) to bias the model in favor of a target response. For example, consider a face recognition system based on deep learning. The system can be poisoned to respond in a pre-defined way when an adversary is carrying a certain physical accessory — e.g., a specific style of eyeglasses. Backdoor attacks could become even more stealthy in model supply chains where pre-trained full-precision models are quantized for downstream applications. Backdoors could be injected in such a way that they are only triggered in quantized models but remain inactive otherwise .

Different from the aforementioned attacks which aim to fool the neural network models, Inference Attacks aims at stealing valuable information from the target models. Usually, such information is sensitive or contains intellectual property. One category of such attacks is the membership inference attack, where the attacker's goal is to infer data samples used in training the model. The foundation of membership inference attacks is that the model usually overfits its training data. Based on the model's prediction, the attacker tries to distinguish the examples that the model have seen during the training .

# AI Socio-Technical Ecosystem

There is no better example of the success and adoption of AI than language translation services accessible through mobile phones being used by travelers in remote corners of the world. Besides initial data pre-processing, AI language translation systems are completely language agnostic! However, there are many issues surrounding AI technology that has triggered a vigorous debate among experts that has spilled into the public domain.

## (Un)Interpretable AI

The Achilles heel of deep learning models is that they are largely uninterpretable. Lack of interpretability means that for a given input $x$ it is not clear why the model produced an output $y$. In shallow models like linear regression and decision trees, the relationship between the input and the output is easier to interpret. For example, in a decision tree an input will follow a series of interpretable *if-then* rules from the root to the leaf node of the tree. However in the case of deep learning models it is difficult to "read off" the decision structure from the model. For example, in an object recognition task that uses deep learning, it is entirely possible that two very similar images of cats are labeled differently and it maybe very difficult to determine how the system arrived at two different decisions. A concrete example of a stop-sign being predicted as flower-pot was already discussed in Section 7. Similarly, when the AlphaGo system defeated the world champion in 2016, the "37th move" was the game changer, but it continues to remain a source of puzzle for Go experts . In his 2019 Turing Award lecture, Yoshua Bengio compared the current state of deep learning to Kahneman's System 1 thinking — the instinctive and unconscious response made due to experience and without much thinking . In contrast System 2 thinking is slow, conscious, logical and requiring significant effort in planning and reasoning. Until deep learning is aligned with System 2 thinking then care must be taken in deciding the application space where deep learning systems are deployed.

## Sentient AI or Stochastic Parrot?

In June 2022, a Google test engineer claimed that the AI program LaMDA (Language Model for Dialog Application) is sentient, i.e., is aware of itself and has feelings. Here is an example exchange between the engineer and LaMDA that was released[^5]:
 * Lemoine: What is the nature of your consciousness/sentience
LaMDA: The nature of my consciousness/sentience is that I am aware of my existence. I desire to learn more about the world and I feel happy or sad at times.
*

The first sentence from LaMDA seems like a standard System 1 response where the definition of sentience is being regurgitated. Since LaMDA is trained by crawling massive amount data from the Web, it is entirely possible that meaning of sentience is either part of the training set or can be easily inferred. However, the second sentence might be taken to indicate elements of System 2 thinking being present in LaMDA though there is a human tendency to ascribe agency and deliberation to processes. A deeper analysis will be required to determine if deep language models *understand* relational information. However, more recent studies have shown that DALL.E-2, a text-guided image generation model struggles to distinguish between System 2 attributes of understanding relationships including *on, under* and *occluded-by* .

For Language Models (LMs) a strong case for a more careful and principled approach for designing and building large models was made by Bender et. al. , who coined the phrase "stochastic parrots" to describe large LMs. The paper makes several important observations including (i) the environmental and financial cost of training large LMs, (ii) questions whether the text generated by large LMs is based on understanding of the language or just linguistic manipulation and (iii) urges the designers of LMs to be more careful about documenting the large amount of data that is required to create such models.

## Causality

To get a better handle on interpretability it behooves to look at how other disciplines use the regression method. For example, for an econometrician, linear regression is not a tool for prediction but for testing a hypothesis that a hand-crafted feature is relevant for the problem being examined . A typical question of interest might be: *Does private elementary schooling lead to better performance in national competitive exams?* Here, private schooling is a feature ($x$) and its significance towards the national exam ($y$) can be tested. Note that this is not a prediction task and that is one reason that an econometrician will not split their data into training and test sets. For a machine learner, the correlation between the feature and the output becomes predictive. For an econometrician, the correlation is indicative of a possible causal relationship and she will look for "natural experiments" where selection-bias can be eliminated and conclude that correlation does indeed imply causation.

## Ownership of AI

The most cutting-edge AI technology is being developed by large private sector companies who have the resources to hire the best AI talent, and in addition have access to big data and unprecedented computing resources. The triad of talent, data, and computing is driving both the technological advancement and the "basic science" associated with AI. A recent study from the Fletcher School at Tufts University highlights the concentration of AI talent in US companies: the top five AI employers have a median AI headcount of about eighteen thousand, from six to twenty four the median is twenty four hundred and then the count rapidly falls off .

Companies aim to maximize shareholders value and their selection of AI problems to work on is necessarily driven by a financial profit objective. Governments, which were earlier mute spectators, have now realized that AI is potentially a game-changer and are thus now investing heavily in developing home-grown technology to achieve or to retain a "superpower" status. An arms-race in AI is underway, threatening to overturn the long-established nature of collaborative science across national boundaries. It is improbable to imagine a "Ramanujan" emerging from a remote corner of the world with a completely fresh perspective on the discipline — the stakes are just too high.

## Equitability

Setting aside larger geo-political and corporate issues, ethical aspects of AI are now studied under a broad umbrella of topics: fairness, accountability, and transparency. There have been several attempts to formalize fairness. For example, group fairness is about designing AI algorithms that do not deliberately or inadvertently harm select communities in a disproportionate manner. A widely highlighted example is that of recidivism, or judicial sentencing, where an AI-based scoring method was used to decide on the length of a jail sentence . It turned out that the AI system was indirectly using racial information as part of its decision-making process, even though that information was redacted from the input. Like in many other situations, there is a latent correlation between the attributes that an AI algorithm is able to exploit as they are designed to optimize accuracy. A criticism of this form of work is that there is a tendency to *abstract* the problem depriving it of all contextual information. Fairness may not be a computational problem.

## No Data, No AI

The original AI thesis proposed by John McCarthy, who coined the term *Artificial Intelligence*, was deductive and based on logical reasoning. However, that endeavor has not been as successful as the data-driven inductive approach. For example, linguistic rule-based language translation systems are not able to capture the vagaries of language — there are just too many exceptions to handle.

A side-effect of taking a data-driven approach is that if data is not available, no progress can be made. For example, there are many social issues, e.g., racial abuse, gender violence, or online pornography addiction, which need to be studied, but no organization may be willing to share datasets about these topics. Thus, while data liberated AI from the clutches of expert rule-based systems, it has now become a golden hand-cuff.

## AI and Education

AI is considered as a game changer and as the digitalization of data has spread across disciplines and sectors there is a huge demand for AI talent. Lucrative offers from Big Tech for AI talent has skewed the interest of both undergraduate and graduate students towards AI. In universities, new data science and AI programs are being created to churn out new talent in AI and allied disciplines. Market forces will mostly balance the supply and the demand for AI talent, but a larger question is doing the rounds: Should the whole education curriculum be revamped to make AI and data science the core of all educational activity? Given that educational resources are finite, an expansion of AI will necessarily lead to trimming of other disciplines. For example, some universities are abandoning research in "pure maths" to focus their dwindling resources on data science .

# AI Winter: Back to the Future

The term *AI Winter* refers to periods of disillusionment and scarce research funding for AI. The original AI winter, which started in the mid-1970s, followed the initial period of optimism in AI, when the founders of the field predicted rapid progress along a range of different fronts. Their optimism proved unfounded. Historically, AI winters have typically been followed by a period of intense hype and high expectations surrounding AI. After nearly ten years of hype, are we looking at a new AI Winter?

AI in its current manifestation is very different from what its founders had envisioned. In fact, even the term *Artificial Intelligence* was coined by John McCarthy as a tactical move to distinguish his research proposal from cybernetics. It is now indisputable that deep learning is a powerful tool to solve *static* prediction tasks. Whether it is predicting the 3D structure of a protein or predicting the property of a molecule, the results of deep learning are very impressive. However, in dynamic and temporal settings, the jury is still out. For example, AI has largely failed to predict how the COVID-19 pandemic would evolve . Differential equation-based models proved to be more robust than complex data-driven models. Similarly, despite near unprecedented investment, full self-autonomy in vehicles remains frustratingly elusive . Optimizing healthcare is another example where, despite the abundance of data, AI has not had the expected impact. Deep Learning seems to *generalize* in complex but static situations, but data-driven generalization in a dynamic setting may well require a new scientific paradigm for AI.

At a conceptual level can deep learning be the basis of Artificial General Intelligence (AGI) - the ability to learn *any* intelligent task that humans can ? The founders of Reinforcement Learning (RL) have proposed the "reward-is-enough" hypothesis where they argue that agents who have the ability to *learn* by interacting with an environment to maximize a suitably defined reward function is sufficient for AGI . However, the jury on RL itself, outside closed-world gaming environments, is still out. Another direction is neuromorphic computing, where the objective is to design new types of hardware to support analog neural networks to precisely model the workings of a brain . Finally, and less science fiction than before, is enhancing the natural ability of organisms with deep learning. Imagine a person with enhanced sight which is enabled by a computer vision system implanted in the visual cortex and trained on a successor of ImageNet.

[^1]: https://www.britannica.com/technology/artificial-intelligence/Alan-Turing-and-the-beginning-of-AI

[^2]: Image of cat generated from `https://thiscatdoesnotexist.com`

[^3]: <a href="www.oreilly.com/radar/ai-powered-misinformation-and-manipulation-at-scale-gpt-3/" class="uri">www.oreilly.com/radar/ai-powered-misinformation-and-manipulation-at-scale-gpt-3/</a>

[^4]: technically the $\|.\|_{\infty}$ norm

[^5]: https://cajundiscordian.medium.com/is-lamda-sentient-an-interview-ea64d916d917


abstract: Obesity is a serious public health concern worldwide, which increases the risk of many diseases, including hypertension, stroke, and type 2 diabetes. To tackle this problem, researchers across the health ecosystem are collecting diverse types of data, which includes biomedical, behavioral and activity, and utilizing machine learning techniques to mine hidden patterns for obesity status improvement prediction. While existing machine learning methods such as Recurrent Neural Networks (RNNs) can provide exceptional results, it is challenging to discover hidden patterns of the sequential data due to the irregular observation time instances. Meanwhile, the lack of understanding of why those learning models are effective also limits further improvements on their architectures. Thus, in this work, we develop a RNN based time-aware architecture to tackle the challenging problem of handling irregular observation times and relevant feature extractions from longitudinal patient records for obesity status improvement prediction. To improve the prediction performance, we train our model using two data sources: (i) electronic medical records containing information regarding lab tests, diagnoses, and demographics; (ii) continuous activity data collected from popular wearables. Evaluations of real-world data demonstrate that our proposed method can capture the underlying structures in users' time sequences with irregularities, and achieve an accuracy of 77-86% in predicting the obesity status improvement.
author:

bibliography: ../bib/reference.bib
title: Recurrent Neural Networks based Obesity Status Prediction Using Activity Data
  [^1]

# Introduction

In recent years, the advent and rapid adoption of mobile health (mHealth) enabled by wearable technologies have made continuous monitoring of environment and lifestyle a concrete possibility. For example, tiny low cost sensors such as smart watches and wristbands track a variety of parameters that range from steps taken and hours slept, to heart rate variability, which enable intelligent healthcare applications to provide estimates of steps, calories, fitness assessment, rehabilitation, activity duration, and may even offer disease pre-diagnosis .

Fig  shows an example of a system where data streams are collected using various sensors/mobile devices and analyzed to understand users' physical activity levels, and possible disease forecasting. A particular disease of interest is obesity since it is a critical worldwide problem. Early detection and status monitoring of such patients allow better care.

While studies have shown that machine learning methods can provide good performance in various healthcare applications for personalized disease diagnosis, medication, and treatments, it is still challenging to learn efficient patterns from heterogeneous healthcare data. To overcome this, recently, deep learning techniques (e.g., RNN) have been adopted in medical patterns and patient representation learning. In , the authors develop a deep neural network composed of a stack of denoising autoencoders to extract relevant patterns from Electronic Health Records (EHRs). Meanwhile, to handle vanishing exploding gradient problems, different variants of RNN have been proposed. For example, Long-Short Term Memory (LSTM) , one of such popular variants which can handle long-term event dependencies by utilizing a gated architecture, has recently been applied to health informatics with promising results.

Despite such successes, discovering hidden patterns of the sequential data is still an open challenge since it requires intelligent segmentation and clustering of the time series data. For example, the time lapse between successive elements in patient records can vary from days to months, which may lead to suboptimal performance for the traditional LSTM models. In addition, it is also difficult to interpret their impressive performance, especially when the data is high-dimensional, which in turn limits the ability to design better architectures. To address these challenges, three research questions have been raised as follows:

-   \(1\) RQ1: "Can we predict diseases status based on individual records?"

-   \(2\) RQ2: "How to build an appropriate learning model that can deal with the irregular data collection times, and learn hidden patterns from time series features?"

-   \(3\) RQ3: "How does one interpret such a predictive model?"

In order to tackle those research questions, in this paper, we take the obesity disease as a use case and solve an obesity status improvement prediction task using activity data collected via a mobile phone application named FeatForward. We recruit 275 participants and collect activity data using this phone application for 6 months. The application collect useful information such as previous diagnoses, blood test results, and activity levels (e.g., step counts).

Then, based on these collected data, we develop a Recurrent Neural Network (RNN) based time-aware learning model that performs obesity status improvement prediction. In our model, we introduce a day-week-month variable to deal with irregular data collection times, and a person's current and past obesity status are used to predict his/her obesity status in future. In addition, we interpret the behavior of our learning model by analyzing the expected responses of the hidden state units given certain inputs. Finally, we evaluate the performance of our proposed model using a real-world dataset. The experimental results show that our proposed method can capture the underlying patterns in users' time series with irregular data collection time instances, and achieve an accuracy of 77-86% for the obesity status improvement prediction.

Our major contributions are:

-   In order to conduct a general study, we use a mobile application named FeatForward that developed by our team to collect data from 275 participants within a 6 months period and build a RNN based time-aware predictive model to forecast individuals' obesity status.

-   In order to solve the irregularity in data collection time instances, we also directly incorporate the day-week-month effect to improve the prediction performance.

-   We design and implement an analytical framework to understand how the features contribute to our obesity status improvement predictive model.

-   We provide extensive experimental results using real-world data to show that our mechanism is accurate and widely applicable.

The rest of the paper is organized as follows. Section II discusses related work. Section III provides brief descriptions of our data collection program. Section IV describes the proposed method in detail. Section V presents the evaluation results of our approach with real-world data. Section VI concludes the paper and highlights our future directions.

# Related Work

In this section, we briefly review existing works in healthcare, which are closely related to our proposed method in this paper from two areas. The first one is recent works on clinical data mining and exploiting deep learning methods in the healthcare domain. The other is the existing explainable deep learning approaches that have utilized visualization to help understand machine learning models.

## Clinical Data Mining

### Conventional Machine Learning on Health Data

 Clinical Data Mining (CDM) is the application of data mining techniques using clinical data , to extract relevant knowledge and make clinical decisions . In Carreiro et al. considered the database as a social network, and try to extract relevant information from related communities. Marwa et al. in have also presented an algorithm to generate prediction models based on the information gathered on patient's first physician visit. In addition, previous studies () have used individual physical details including behavioral, sleeping, voice acoustic, and social patterns to estimate a person's mood. While their mechanisms are beneficial, they ignore the long-term dependencies among collected data records, which can be learnt using deep learning, a more robust learning tool.

### Deep Learning on Health Data

 As deep learning has achieved great success recently, researchers have begun attempting to apply neural network based methods to clinical temporal health data . For example, the authors in proposed an adjustable temporal fusion scheme using CNN-extracted features to process EHR for risk predictions. Meanwhile, Recurrent Neural Networks (RNNs) also can be used for disease prediction with times series data in healthcare domain. For example, RETAIN and GRAM in are two state-of-the-art models utilizing RNNs for future disease predictions. In , Pham et al. introduced an end-to-end deep network called "Deep-Care", which have used LSTM for predicting future admission of a patient, and also addressed the time irregularities between consecutive entries. In addition. Suhara et al. in developed a deep learning based approach that forecasts severely depressive mood based on individual's historical moods, behavioral type, and medication records. While those models achieve good prediction performance, they do not exploit mobility or activity patterns for diseases monitoring and lack model interpretations.

## Models Interpretation

In the field of visualization, most of the existing explainable deep learning approaches mainly focus on understanding and analyzing model predictions or the training process offline after the model training is completed. Recent work () has exhibited the effectiveness of visual analytics in understanding, diagnosing and presenting neural networks. In , Liu et al. treated deep CNN as a directed acyclic graph and built an interactive visual analytics system to analyze CNN models. Rauber et al. in applied dimensionality reduction to visualize learned representations, as well as the relationships among artificial neurons and provided insightful visual feedback of artificial neural networks. Meanwhile, in Greff et al. conducted a comprehensive study of LSTM components and Chung et al. in have evaluated GRU compared to LSTMs. While visualizations have achieved considerable success on deep learning models, they only provide an overall analysis without exploring hidden states in detail and are not scalable when hidden state dimensions have increased.

# Data Collection

In our work, we use a smartphone application called FeatForward that was developed by our team to collect data from 275 participants for 6 months. 49.8% of the participants are over 50 years old and 50.2% are below 50. Such data allows us to infer three highly prevalent but often undiagnosed conditions including diabetes, hypertension, and obesity that participants may have. The application provides an intuitive interface (Fig ) for users to record their data including gender, age, weight, blood pressure, etc. at three milestones (enrollment, midpoint, closeout). It also allows participants to voluntarily record their activity information (step counts) at different time slots (e.g., every 20 minutes or hourly) every day. The data can be divided into two 3-months periods, the $1^{st}$ one is from enrollment to midpoint while the $2^{nd}$ one is from midpoint to the end of the study. The application was designed such that participants will be shown the trends of their health status at the end of that 3 months and be encouraged to increase their activity levels if they cannot achieve the health related goals (expressed in terms of clinically relevant threshold (CRT) which is a measure of the percentage reduction in their BMI values).

```latex
\begin{table*}
\centering
\caption{\small Collected Data Features}
\vspace{-0.1in}
\begin{tabular}{|p{2.4cm}|p{5.5cm}|p{3.5cm}|p{5.0cm}|}
\hline\hline
\footnotesize \centering Classification & \footnotesize \centering Detailed & \footnotesize \centering Collection & \footnotesize Notes \\ [0.1ex]
\hline
\footnotesize \centering Personal Data & \footnotesize \centering gender, age, height, disease & \footnotesize \centering manual input & \footnotesize occurs at registration  \\
\hline
\footnotesize \centering Biometric & \footnotesize \centering step count & \footnotesize \centering once per hour & \footnotesize obtained through S-Health \\
\cline{2-4}
\footnotesize \centering Data & \footnotesize \centering blood pressure, blood sugar, weight, heart rate & \footnotesize \centering manual input & \footnotesize through the S-Health GUI input window \\
\hline
\footnotesize \centering Messaging & \footnotesize \centering activity/education & \footnotesize \centering whenever event occurs & \footnotesize automatic program transmission \\
\cline{2-4}
\footnotesize \centering History & \footnotesize \centering communication & \footnotesize \centering whenever event occurs & \footnotesize foctor-patient messaging  \\
\hline
\footnotesize \centering Environment & \footnotesize \centering weather information & \footnotesize \centering & \footnotesize weather forecast \\
\hline
\end{tabular}
\label{tab:collectfeatures}
\vspace{-0.2in}
\end{table*}
```

In our pilot study, we required all participants to wear the provided smartwatch during all hours except while they sleep for accurate and comprehensive data collection. The recorded information is shown in Table , and can be visualized in an aggregated manner so that participants can observe the general trends of their health status. Thus, through FeatForward, participants will be able to assess the effects of physical activities on changes in their health status which may in turn encourage them to be more physically active.

# Methodology

In this section, we consider the obesity disease as a use case and utilize the collected data from the FeatForwad pilot study (described in section III) to generate clinical learning models to predict obesity status improvement and demonstrate the usefulness of using activity data collected via wearables for predicting health status.

## Preliminaries

Different from other application domains (e.g., image and speech analysis), the problems in healthcare are more complicated. For example, the diseases are highly heterogeneous which make it hard for physicians to understand their causes and how they progress completely. Thus, in this sub-section, we first discuss the three research questions we raised in section I that helps to define our design requirements.

### RQ1: Can we forecast obesity disease status based on individual records?

The question includes identifying specific measurements which can contribute towards improving prediction performance. In , Tryon has noted that step count information is a preferred metric for quantifying physical activity. Additional risk factors which impact prediction results that need to be considered include users' demographics and health histories e.g., his/her height, age, and fitness level.

### RQ2: How to generate an appropriate model that can deal with irregular observation times?

In the pilot study, participants record their activity information at different time slots each day, and how their BMIs vary at the 3 milestones. Such raw data collected via the FeatForward application can be broken down into segments of time series data and mined for predicting obesity status improvement. For example, the obesity status prediction can be described as a $(m, n)$ task, where a feature vector $x^P_d$ can be extracted from data recorded in day $d$ of a participant $P$. $x^P_d=\{x^P_{d_1}, x^P_{d_2}, \dots, x^P_{d_m}\}$, where $x^P_{d_m}$ is a sequence of feature vectors of a participant $P$ collected at time slot $m$ of day $d$. The change of a participant's BMI value (a measure of obesity status improvement) will be predicted based on his/her histories in the previous $n$ days $\{x^P_1, x^P_2, \dots, x^P_n\}$. In this work, we proposed a RNN based time-aware model to learn long-term dependencies among time series features to perform such a prediction.

### RQ3: How to interpret such a learning model?

While recent developments in the health informatics community have seen widespread adoption of modern machine learning methods, relatively little attention has been paid to understand the properties of its representations and predictions. Thus, in our work we try to interpret the changes of individual hidden states based on different inputs.

## Methodology Overview

Before participants' records are input into various models for analysis, data needs to go through several steps of processing, as shown in Fig . First, data cleaning and transformation need to be performed since participants may not record measurements in all time slots and measurements may be either discrete or continuous values. Next, feature selection and extraction are highly desirable to produce learning models with high prediction accuracy. Finally, the learnt model need to be interpreted to uncover the impact of the hidden units on the prediction results.

## Detailed Design

In this sub-section, several key steps for processing data, namely, data cleaning, data transformation, feature extraction and data analytics/modeling are described in detail respectively.

### Data Cleaning & Normalization

Once the data has been collected, it needs to be imputed and normalized. These processes are expected to improve the data quality which helps to improve the accuracy of the learning models. Typically, missing data may be caused by either participants forgetting to wear the sensor devices or fail to record their data through the mobile application. In our work, we replace any missing value with the average value obtained from non-missing entry values of that feature.

### Data Transformation

Since participants record their activity information (step counts) at different time slots in each day, it is challenging to perform data analytics with such irregular observation times. To tackle this problem, in our work, we introduce a day-week-month variable to organize participants' data into different non-overlapping time "windows" with each window being $k$ days. While transforming variable data into fixed-length time series allows us to employ some efficient methods directly, we need to be aware of the side effects associated with such segmentation. For instance, unwise segmentation may result in the sparsity and missing data problems since there could be no observations for some features in some time windows. In addition, by dividing longitudinal data into "windows", the model may be less sensitive to capturing long-term feature patterns.

### Feature Selection & Extraction

Since no one knows precisely which features (participants' characteristics or activity information) are more critical for obesity status prediction, we conduct feature selection operations to assess their usefulness in constructing the learning models. Cross-sectional studies have shown that the daily step count is inversely related to body mass index (BMI), hypertension, and diabetes and hence will be considered.

While daily average step feature plays an essential role in referring to obesity risk, this metric does not tell us the frequency, intensity, or duration of a person's physical activity. Thus, we also include additional related features: (i) intensity: maximum or minimum steps per day/week; (ii) frequency: number of days where the daily step counts exceed a threshold (set to twice the average lowest daily step counts); (iii) duration of physical activity: a number of days that the participants will walk more steps than the average step count when compared with other participants. In addition, we also consider a patient's demographics since the steps that a person takes vary based on his/her height, age, and fitness level. For example, frail, elderly individuals tend to take slower and fewer steps while younger individuals often take more steps.

| Features | Type | Description |
|:---|:---|:---|
|  | Time Slot | step count at every time slot |
| 2-3 |  | day: average steps, maximum/minimum steps |
| 3-3 |  | week: maximum/minimum steps |
| 3-3 Step |  | total steps |
| 3-3 Information | Extracted | how frequently does the participant walk |
| 3-3 | Features | \# of days that has larger steps than the average steps (per day/week) of a specific participant |
| 3-3 |  | \# of days that has larger steps than the average steps (per day/week) of all participants |
| Demographic |  | gender, age, marital, adult in household, highest degree, hispanic or latino, race, occupation |

Extracted Features

Finally, all the features extracted from collected data and used in our work are shown in Table .

### Model Construction & Interpretation

After data cleaning, transformation, and feature extraction, we then build learning models for obesity status improvement prediction, where we pose our predictive problem as a sequence classification task.

To quantify the effectiveness of the neural network models, we first develop a set of baseline classifiers using traditional machine learning approaches such as Logistic Regression (LR) and Random Forest (RF) so that we can later compare them with those obtained using neural network models.

**(1) Baseline Classifiers**

The reason why we select LR and RF as our baseline classifiers is because: (i) the L2-regularizer in LR classifier is more robust to limited training examples; (ii) the RF classifier is a robust and ensemble-based machine learning method, which is a commonly used approach in the healthcare domain. However, those commonly used classification approaches assume all features are independent and do not consider the impact of their time correlations.

**(2) Deep Learning Models**

In order to use individual histories as time series data, we need a technique that is capable of incorporating dependencies from previous states. In our work, we consider a Long Short-term Memory (LSTM) network, which captures correlations across different behavioral sequences over time.

First, we segment the collected time series data into different segments, each of which lasts for $k$ days and generate corresponding features from the collected records in each segment, as shown in Table II. For instance, $k=7$ means the data collected every week is used to generate useful features, e.g., the average step counts per time slot per week, the average daily step counts, the maximum weekly step counts, etc.

Because we have different type of features with distinct semantics, we also introduce an embedding layer to convert those raw data into a dense vectorial representation. The outputs of the embedding layer will be fed into a 2-layer LSTM model, where the first layer is used to extract features from the vectorial representation and the $2^{nd}$ layer is used to learn high level abstraction representations. The output of the $2^{nd}$ layer is fed to a fully connected layer to perform prediction.

The network architecture of our method is illustrated in Fig , where all inputs grouped every $k$ days are fed into the model and prediction results are generated as the output $Y_{\lfloor n/k \rfloor}$ at the final time step $\lfloor n/k \rfloor$.

**(3) Learning Models Interpretation**

Inspired by the idea of using interpretable representations to explain functions of network components, we use a similar method to interpret the learned representation of our proposed model. Our model has a sequence-to-sequence input-output scheme, as shown in Fig . This formulation takes an input sequence $X_t=\{X^1_t, X^2_t, \dots, X^{|X_t|}_t\}$ and generates an output $Y_t$ at every time step $t$, which can be further processed as the input of the next time step or directly used for classification tasks. In our work, we only use the output at the last time step $\lfloor n/k \rfloor$ of the whole sequential inputs $\{X_1, X_2, \dots, X_{\lfloor n/k \rfloor} \}$ for the prediction task.

At each time step $t$, the model takes an input $X^i_t$, and updates the hidden state using:

$$\label{eq1}
\begin{array}{lcr}
h^i_{t} = f(Wh_{t-1}+VX^i_t)
\end{array}$$

where $W$ and $V$ are weight matrices and $f$ is a nonlinear activation function. After the updates, $h^i_t$ is considered to capture the long-term memory and used to compute the intermediate or final output. Although $h^i_t$ is calculated by a non-linear transformation of the previous state $h_{t-1}$ and the input $X^i_t$, $\triangle h^i_t=h^i_t-h_{t-1}$ is deterministic with regards to the input $X^i_t$ when the previous history $h_{t-1}$ is given, and can be used to reflect the degree a hidden state in the model is influenced by the input. Thus, based on $\triangle h^i_t$ the model's response to the input $X_t$ can be computed as follows:

$$\label{eq1}
\begin{array}{lcr}
s(X_t) = E(\triangle h_t| X_t) = \frac{\sum_{i=1}^{|X_t|} \abs{\triangle h^i_t}}{\sum_{i=1}^{|X_t|} 1}
\end{array}$$

where $s(X_t)$ is the average absolute expected responses of $|X_t|$ input sequences from all participants. Note that with the $tanh$ activation function, the response can have either positive or negative value, where a larger absolute value of response indicates that the input is more salient to the corresponding hidden state.

# Performance Evaluation

In this section, we analyze the collected dataset to confirm that it contains useful information to infer participants' obesity status improvement levels as well as verify that the model we suggest can make useful predictions. We first describe our experimental settings and the data we use. Then, we provide the preliminary results in dealing with the research questions that described in section I.

## Experimental Setup

To evaluate the performance of our scheme, we conduct experimental evaluations on real-world data, which is collected by the FeatForward application described in Section III. It tracks 275 participants for a 6-month period which can be divided into two 3-months periods, namely from enrollment to midpoint ($1^{st}$ 3 months) and from midpoint to end of the study ($2^{nd}$ 3 months). The measured metrics consist of an individual's time series of daily step counts (measured using 20 minutes time windows), his/her medical records and demographics (as shown in Table II). One can use statistics from different time windows to derive learning models. For example, we can conduct training using measurements collected with different day time windows ($k=$ one day, one week, one month) and daily time slots (i.e., $m=4, 6, 12$). Since some participants dropped out after the midpoint or they do not record enough step counts information, so after data cleaning, we obtain dataset $D_1$, which contains 323 instances. Each instance contains historical measurements of a participant for 3 months. Next, we conducted 10-fold cross validation, where the cross validation splits the datasets into training (80%), validation (10%) and testing sets (10%). Our training model is used to predict whether a participant's BMI change exceeds the clinically relevant threshold (CRT) at the end of 3 months. For our training, we apply a dropout mechanism and conduct regularization to overcome any possible overfitting problem.

In addition, since in the collected datasets, participants share their BMI measurements, we can use such measurements to label each participant as positive or negative instance depending on whether their BMI change percentage exceeds the CRT. In our case, we set CRT to 5% since past studies, e.g, have shown that it is reasonable to achieve an average weight loss of 5-10% during 3-6 months. With such labeling method, we obtain 53% positive instances and 47% negative instances.

For our obesity status improvement learning model, we use 25 hidden units for our LSTM and apply a dropout of 0.5. We train our model for 150 epochs, where each epoch is defined as the process of feeding the whole training set to a model. All our experiments are conducted on Mac Pro with an Intel Core i7 processor running at 2.5GHz, 16GB memory and an external GTX 1080.

## Performance Evaluation

### Importance of Step Counts in BMI changes

First, we conducted Exp1 using the $D_1$ dataset to measure the relationship between step counts and BMI changes.

Exp1: In this experiment, we first compute the daily average step counts $DAS^P$ for every participant $P$. Then, we use an IBM SPSS 20 tool to examine the association between participants' daily average step and changes in obesity related indicators (e.g., BMI) using the linear mixed-effects models , a preferred method for evaluating the longitudinal effects over time. We also compute the daily average step counts for all participants, denoted as $DAS^{all}$ and compute the probability that a participant's BMI will drop after 3 months based on the comparison between his/her daily average step counts with $DAS^{all}$.

| Source    | Numerator (df) | Denominator (df) | F   | sig  |
|:----------|:---------------|:-----------------|:----|:-----|
| Intercept |                |                  |     | .000 |
| Step      |                |                  |     | .021 |

Linear Mixed-effect Model

The results of the linear mixed-effect model are shown in Table . From the results we can see that the individual daily average step count is highly predictive of BMI changes. From our analysis of the participants' records, we observe that any participant $P$ whose daily average step $DAS^P$ is larger than $DAS^{all}$ has a high probability (73% on the average) to have a drop in his/her BMI value after 3 months.

### RQ1: Can we forecast obesity health status improvement? How to select essential features?

In this subsection, we conduct Exp2 to evaluate the forecasting performance of traditional models. Such performance results are used as baselines for comparison with deep-learning based model in subsequent subsection.

Exp2: We first use the traditional classifiers LR and RF (described in section IV) to generate the learning models using different combinations of extracted features (Table II) so that we can compare their performances: (i) we only use daily average step feature to build the models; (ii) instead of using the daily average step count feature, we use step counts measured using $m$ different time slots; (iii) we use both time slot features and demographics to train the learning models. In this experiment, we use dataset $D_1$ with different $m$ values ($m=4, 6, 12$).

| Selected Features     | Time Slot | Feature Size | Accuracy (LR) | Accuracy (RF) |
|:----------------------|:----------|:-------------|:--------------|:--------------|
| Time Slots            |           |              | $\%$          | 53.1$\%$      |
| Time Slot+Demographic |           |              | $\%$          | 54.7$\%$      |
| All Features          |           |              | $\%$          | 63.1$\%$      |
| Time Slots            |           |              | $\%$          | 56.5$\%$      |
| Time Slot+Demographic |           |              | $\%$          | 57.8$\%$      |
| All Features          |           |              | $\%$          | 63.7$\%$      |
| Time Slots            |           |              | $\%$          | 53.2$\%$      |
| Time Slot+Demographic |           |              | $\%$          | 53.8$\%$      |
| All Features          |           |              | $\%$          | 60.2$\%$      |

Impact of Different Selected Features

The results are shown in Table . From the results, we can observe that each of the two classifiers (LR or RF) achieves significantly higher accuracy than random guessing (e.g., 0.5). It is better to use all features to generate learning models since the obesity status improvement depends not only on the number of step counts but also on the frequent, intensity, duration of a participant's physical activity bouts as well as his/her demographics. In addition, the performance of RF is better than LR (by 3% on average) when all features are used. It is expected since RF is less likely to overfit and it also learns better the correlations among different features. Moreover, we find that the performance of all models varies when $m$ increases from 4 to 12, with the best performance being achieved when $m=6$. This can be explained as follows: more noises in the training data will be observed with a larger number of time slots (e.g., 12) since more time slots will have zero measurements. With fewer number of time slots (e.g., 4), the observed step counts for different time slots may not differ much from one another and hence affects the prediction results.

### RQ2: Which model performs best in obesity status improvement predictions?

We conduct two experiments (Exp3.1 & Exp3.2) to examine how the selection of window size $k$ affects our results. For example, $k=30$ means that the input of a predictive model is trained based on the data extracted from every month.

Exp3.1: Since those traditional classification approaches (Exp2) assume all features are independent and do not consider the time correlation of these features, we use a single layer LSTM architecture in this experiment so that we can see if such learning model can perform better than traditional methods. We also set $n=90$, $k=3, 7, 30$ and assign $\lfloor n/k \rfloor$ (i.e., 30, 12, 3) time steps for such LSTM model, where the input of each node is the related feature vector generated based on $k$ days.

Exp3.2: Instead of only using a single layer LSTM as in Exp3, we use other learning models, which include a 2-layer CNN model and multi-layer LSTMs.

| Model | Time Slot | Feature Size | Window Size | Step Nodes | Accuracy (Validation) | Accuracy (Testing) |
|:---|:---|:---|:---|:---|:---|:---|
| LSTM (1 layer) |  |  |  days |  | $\%$ | 60.9$\%$ |
| LSTM (1 layer) |  |  |  week |  | $\%$ | 68.7$\%$ |
| LSTM (1 layer) |  |  |  month |  | $\%$ | 64.3$\%$ |

Impact of Different Time Window Sizes

| Model | Time Slot | Feature Size | Window Size | Step Nodes | Accuracy (Validation) | Accuracy (Testing) |
|:---|:---|:---|:---|:---|:---|:---|
| LR |  |  |  |  | $\%$ | 60.6$\%$ |
| RF |  |  |  |  | $\%$ | 63.7$\%$ |
| CNN |  |  |  |  | $\%$ | 65.6$\%$ |
| LSTM (1 layer) |  |  |  week |  | $\%$ | 68.7$\%$ |
| LSTM (2 layers) |  |  |  week |  | $\%$ | 77.2$\%$ |
| LSTM (3 layers) |  |  |  week |  | $\%$ | 72.5$\%$ |

Impact of Different Learning Models

The results are shown in Table  and . From the results, we can discover that there is a rapid accuracy increase from $k=3$ to $k=7$, but the improvement saturates as $k$ increases beyond 7 and in fact drops when $k=30$. The results reveal that the step counts captured in a week contains sufficient information to allow us to forecast obesity status improvement at the end of the 3 months period. This finding coincides with a commonly used activity assessment method called the International Physical Activity Questionnaire (IPAQ) , where the central question it has is "The Time People Spent Being Physically Active in the Last 7 Days".

The CNN and LSTM-based deep learning models perform better than the traditional learning models with the LSTM-based model performs 15% better. However, the CNN model performs poorer than LSTM models since it lacks the capability to learn long-term correlations among time series features. In addition, the results also show that among all learning models, the 2-layer LSTM model has the highest accuracy. In this 2-layer LSTM model, the first layer acts as a feature extractor and the second layer learns the correlations among long-term dominant features. The prediction performance drops when more than 2 layers are used for the LSTM-based model since overfitting begins to appear in this complicated model.

In addition, we have also separated the participants into 2 age-group (above/below 50 years old) and trained a 2-layer LSTM model for each age group. We obtain an accuracy of 80.7% for those above 50 years old and an accuracy of 74.6% for those below. This can be explained as follows: the weight loss of younger adults is also greatly influenced by their diets which is not captured in the application. Older adults typically have better diets and hence their weight loss can be more easily predicted using step counts.

### RQ3: How to interpret the learning model

In order to better understand our learning scheme, we conduct Exp4 to explain the inner working of our 2-layer LSTM model and rationale behind its predictions.

Exp4: Inspired by the idea of using interpretable representations to explain functions of network components, we propose a method to interpret the hidden state units using different inputs. Since our model typically has many-to-many relationships between hidden state units and inputs, we perform the following steps to study how different variables affect the various hidden state units: (i) we first choose four features (shown in Fig ), (ii) for each selected feature, we compute $S(X_t)$ values with all input features as well as with modified features where that selected feature is zeroed out and record the differences in these two $S(X_t)$ values, (iii) based on the computed difference values, we determine which time steps has the largest impact on the prediction results. In this experiment, we set $m=6$ (each time slot equals 4 hours).

| Top5 Active Time Slots | Total Steps | Top5 Inactive Time Slots | Total Steps |
|:-----------------------|:------------|:-------------------------|:------------|
| :00:00 - 13:00:00      |             | :00:00 - 04:00:00        | 224         |
| :00:00 - 14:00:00      |             | :00:00 - 03:00:00        | 240         |
| :00:00 - 15:00:00      |             | :00:00 - 02:00:00        | 384         |
| :00:00 - 12:00:00      |             | :00:00 - 05:00:00        | 472         |
| :00:00 - 16:00:00      |             | :00:00 - 01:00:00        | 834         |

Step Counts at Different Time Slots

After checking the prediction accuracy of each time step, we found two crucial time steps ( e.g., $10^{th}$ & $12^{th}$) and further analyze their hidden units' responses. The hidden units' responses of these two time steps are shown in Fig  (a)(b). From the results, we can see that the hidden state units in the left and right ends are more responsive/sensitive to the important feature "daily average step" than the less important feature "adult in household". We also find that different time slot features yield different impacts on the expected responses of hidden units, with the "fourth time slot" having the most effect. This coincides with the information we see from the five highest hourly step counts reported by participants as shown in Table . From the results, we can see that the most negative exercise time is the "first time slot" (since few people will walk during 00:00:00 - 4:00:00) and the "fourth time slot" (12:00:00 - 16:00:00) is the most active period. These results confirm that our model learns relevant information and allow us to infer the most relevant variables that can be used to help participants improve their BMI losses e.g., be more active during the "fourth time slot".

### Impact of Data Augmentation

Since any deep learning model typically has excellent performance on a large dataset, we conduct Exp5 to check if our model will perform better when we use a larger dataset.

Exp5: Based on the results of the previous experiments, we first set $n=90$, $k=7$ and $m=6$, which provided the best performance. Then, we apply an augmentation method to generate $D_2$, where instead of using the data from total 12 weeks, we only select $M$ ($M<12$) weeks' data to train our model. In this experiment, (i) we select data from the $1^{st}$ and the $12^{th}$ weeks; (ii) we also select ($M-2$) weeks' data from ($2^{nd}$- $11^{th}$) weeks' data; (iii) we feed the selected data into our 2-layer LSTM learning model.

| Model | \# of Time Steps | Data Size | Accuracy (Validation) | Accuracy (Testing) |
|:---|:---|:---|:---|:---|
| LSTM (2 layers) |  |  | % | 83.4% |
| LSTM (2 layers) |  |  | % | 86.1% |

Impact of Different Data Sizes

The results in Table  show that the performance of our model improves by 8% on average when we use a larger high-quality dataset. It is reasonable since modern nonlinear machine learning techniques get better performance with more higher quality data, especially for deep learning architecture. However, if we choose a small $M$ value (e.g., $M=3$), the accuracy drops since the gap between different time steps increases and there are fewer time steps which prevent our model from learning well the appropriate time correlations .

# Conclusions and Future Works

In recent years, new healthcare applications utilizing emerging smart devices with embedded sensors for improving users' health have become popular. In this paper, we have proposed a RNN based time-aware architecture to predict obesity status improvement using participants' data collected via wearables, e.g., blood pressures, step counts and their demographics. Our experimental results confirm that our framework can decently forecast obesity status improvement using users' activity and health measurement data. Furthermore, we have also provided some interpretations on how different variables affect our model. Thus, we believe that our effort is a good step in understanding how collected activity data and physical health measurements can be utilized to predict users' health status improvement. As for the future work, we intend to apply our predictive model to infer improvements in hypertension or diabetes health statuses. In addition, further prediction accuracy improvement can be made if we can integrate additional information such as participants' diets.

[^1]: