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 NN 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 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 (and also just for funsies).

The area graph visualizes my productivity score as calculated by RescueTime, and is included to contextualize Affectiva's attention scores.

Keylogger Sentiments

As an attempt to automatically measure mood, I created a sentiment analysis keylogger for my computer. Written in python, the keylogger collects any coherent phrase I type, and sends the log every hour to IBM's Tone Analyzer. The API provides several sentiment categoriesโ€”joy, confidence, analysis, tentativeness, sadness, fear, and angerโ€” as well as scores of their perceived dominance (featured in the y axis). The actual logs have been redacted for publication, but the length of the analyzed sentence is encoded in each circle's diameter.

I have recently added keystroke dynamics and simple text analysis to the keylogger, and hope to visualize these metrics soon.

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 especially overwhelmed, scatterbrained, or lethargic, I'm likely to open tabs without even consuming their content, thus leaving them open indefinitely. The growing number of tabs in the browser graveyard further contributes to the feeling that I've lost control of my life, effectively creating a positive feedback loop of mounting existential dread.

Metrics Key

To get a sense of emerging correlations, we can look at 1) scatterplots, the shape of which suggests strength of correlation, 2) linear regression, the slope of which expresses the magnitude of how positive or negative a correlation is, and 3) Pearson coefficients, which measure the linear correlation between two variables within a range of -1 to 1.

A pearson correlation coefficient matrixโ€”based on two months of dataโ€”can be generated by comparing "All" with "All" via the dropdown menus, below. Comparing a metric with another metric, or "All", will generate scatterplots and trendlines. Tabcounter data to come.

METRICS KEY