Speak, (Random Access) Memory


Speak, (Random Access) Memory

This semester, I began work on a system of trackers for a whole host of potential/evidenced metrics of depression, in hopes of monitoring its cyclical nature and identifying correlations with my activity and environment. I was motivated to do this for three main reasons: 1) I have a terrible memory, which makes it difficult to accurately report necessary information in weekly therapy sessions, 2) I have a terrible memory, and therefore tend to be totally unaware of my long-term behavior, and 3) I'm slightly impulsive, and therefore tend to be totally unconcerned with the repercussions of my long-term behavior.

Ultimately, I hope to predict the onset of depression by feeding this data into a neural network, and perhaps even preempt it by teaching the neural net to recommend/enforce interventions. As a preliminary exercise, I've trained a couple ML models to predict mood with only a month of data; see the documentation here.

Below are visualizations of a week's worth of data collected by my homemade python trackers. The brush at the bottom of the page controls the time domain of all the charts.

To begin, filter the data by date:

Mood Reporter

Because affect is difficult to measure, psychiatry traditionally employs self-administered questionnaires as diagnostic tools for mood disorders; these usually attempt to quantify the severity of DSM-IV criteria. The module for depression is called the PHQ-9, and I've adapted several of its questions into my own questionnaire, which python deploys every hour via the command line. The visualization to the left includes ratings from 1-5 for mood, morale, stress, and fatigue . Hovering over the fuchsia points on the mood line will display qualitative explanations for its respective score. The x's denote the occurence of compulsions.

Facial Analysis

This tracker utilizes the Affectiva API, an emotion and facial recognition model. Via my laptop's webcam, it analyses my face for a minute every hour; a python script grabs the min and max attention and valence values, as well as the expressions made (plotted with emoji) and the amount of times I blinked (calculated by dividing the number of times the eyeClosure variable hit 99.9%, divided by 2).

I choose these variables as an attempt to measure mindwandering, a marker strongly correlated with depression. The emojis were included to illustrate the concept of valence (also just for funsies).

Keylogger Sentiments

The idea for this is simply to discern the sentiment of everything I type. I wrote a keylogger in python, which collects any coherent phrase to be sent to IBM Watson's Tone Analyzer every hour. The API provides several sentiment categories: joy, confidence, analysis, tentativeness, sadness, fear, and anger. The actual logs have been redacted for publication.

Browser Activity

This tracker is a Chrome Extension that counts the number of tabs as they're created and activated, as well as the final hourly count. I wanted to track my browser activity because I've noticed a relationship between all of these variables and my motivation and stress levels. I'm a tab hoarder in general, but if I'm feeling either especially overwhelmed or lethargic, I'm even more likely to open tabs but not actually consume their content, thus leaving them open indefinitely. The number of tabs in the browser graveyard then contributes to this underlying stress/anxiety, effectively creating a positive feedback loop of mounting existential dread.