Project Development Studio W1 HW: Dream, Vision, Goal, Plan

Dream: My dream is quantify depression, and use those numbers to establish a centralized and comprehensive system that empowers both the inflicted and their medical professionals to be better able to understand, manage, and treat the cyclical nature of the disorder. I imagine a tool that will put an ever-on-call psychologist, neurologist, psychiatrist, and personal assistant in the pocket of patients who lack the energy and concern to care for themselves. 

Vision: I would like to build a system of wearables that monitor the tracked biometrics and self-reported markers of depression. With the user’s baseline state as reference, the system would employ machine learning and the user’s self-reported corroborations to label biometric deviations. Once the system learns to read the user’s mood, it will provide recommendations on self-care and subsequently learn which methods work best for the user, and when. The system will also retain an archive of visualized data for medical professional to assess during appointments.

Goal: My goal for this course is to create an EEG wearable that I can use on a daily basis. The headset will be 3d-printed and use a bluetooth arduino to send data to my computer or phone, but if this proves unreliable I will just save the data on a SD card to upload at the end of each day. The EEG will record my brainwaves, which will hopefully reveal when I blink (an indicator of mind-wandering) and whether I’m focused (theta dominance in the prefrontal ACC).

In addition, I will be using some ready-made and beta trackers for my Quant Humanists class, and hope to export all the tracked data into one system that visualizes them together. This endeavor will also be supported by the course API of You, which will start at the second half of the semester.

Plan – What is your game plan to achieve the goal in 10 weeks, what is the research required, what are the milestones. Try to come up with about 5 milestone dates towards a completion beginning of May.

deep learning in medicine

Task T:

  • Classification: output is a category
  • Regression: continuous vs discreet
  • anomaly detection: EEG data
  • synthesis and sampling
  • density estimation or probability mass function estimation
    • ie clusters of distribution

Performance Measure, P:

  • Accuracy of predicted labels compared to true labels
  • mean squared error between target and predictions
  • likelihood: probability of predicting the true outcome label for samples
    • classification
    • function of the model parameters
    • conditional probability
    • i.i.d. = identically and independently drawn

Machine learning formulation:

  • input: X
  • output: Y
  • task: fθ(x)
  • evaluation: loss

Supervised Learning- Classification

  • input X: continuous or categorical vector or Matrix or Tensor
  • output Y: categorical label
  • task fθ(x): some function f that computes probability of the each for each sample
  • evaluation loss

Supervised Learning- Regression

  • input X: continuous or categorical vector or Matrix or Tensor
  • output Y: continuous target
  • task fθ(x): some function f that computes target for each sample
  • evaluation loss: mean squared error loss, or adversarial loss, etc

Supervised Learning- Structured Output

  • input X: continuous or categorical vector or Matrix or Tensor
  • output Y: continuous or categorical vector or Matrix or Tensor
  • task fθ(x): some function f that computes  a vector/matrix/tensor for each sample
  • evaluation loss: combination

Unsupervised Learning- Density Estimation

  • input X: continuous or categorical vector or Matrix or Tensor
  • output Y: P(X)
  • task fθ(x):
  • evaluation loss: log likelihood of observing Xs are they are

Unsupervised Learning- Denoising

  • input X (noisy): continuous or categorical vector or Matrix or Tensor
  • output X: denoised continuous or categorical vector or Matrix or Tensor
  • task fθ(x): some function that returns an output identical in size but with nice constraints
  • evaluation loss

Gradient descent: used to find the local minimum

Solution to under/overfitting:

  • randomly sample and set aside a test set; the rest of the data becomes the training set
  • optimize the loss function on the training set only
  • have 3 sets: training set, validation set, and test set

Quant Humanists: w2 Class Notes

  • I documented the entire experience with a plodding sequence of 3,214 photographs, beginning with the taxi ride to Newark airport, and ending with the butchering of the second whale, seven days later. The photographs were taken at five-minute intervals, even while sleeping (using a chronometer), establishing a constant “photographic heartbeat”. In moments of high adrenaline, this photographic heartbeat would quicken (to a maximum rate of 37 pictures in five minutes while the first whale was being cut up), mimicking the changing pace of my own heartbeat.

Quant Humanists W1 HW: Reflection

29 JAN 2018

Write a short reflection about what your current relationship with self-tracking (e.g. hopes, dreams, perceptions), questions you have about self-tracking and how it could help or harm you, and how you hope the course will help facilitate your interests. Write about which questions you’ve identified to track, how you plan to track those variables of interest, and what challenges you expect to encounter as well as what you hope to learn.

Out of lack of self-discipline, I don’t currently have a relationship with self-tracking, but at ITP I ultimately hope to track the biometrics of depression and its related factors, and feed this data into a neural network that can predict my moods and help monitor the cycles of depression. I hope this course will allow me to explore my options for tracking these variables and perhaps even integrate them into an automated system of my own making. Below is my wish-list of questions/methods that I want to work on for this course:

  1. What is your current mood? (based on metrics)
        This study uses a smartphone app to calculate happiness based on psychology’s “traditional view of happiness as a parameter of two dimensions: arousal and valence”. Arousal is measured based on data coming in from a smartwatch, which tracks activity, heart rate, light level, and GPS coordinates. They also consider external factors such as weather and day of the week. By asking for self-reported mood data, they were able to input this data into a machine learning-based system (random forests) to predict mood.
        This project tracks variables like typing speed, punctuation changes, and sentiment analysis of what’s being typed to detect the user’s emotions.

  2. What makes you happy? (based on self-reporting)
      This is an ongoing doctoral research project by Matt Killingsworth at Harvard, which prompts you throughout the day to find out what factors are associated with happiness.
  3. Is your mind wandering?
  4. Do you feel lonely?

My main challenge will be to actually implement any of this! Most of these apps are from academic studies and not available to the masses, and the ones that are are only for iOS.

Quant Humanists W1 HW: Quant Self Project Review

29 Jan 2018

Perception, Data Collection and Memory – Ishac Bertran

In this profile of Ishac Bertran, there are two pieces related to personal data collection that I liked. The first, The Memory Device, is a simple recording device of a simple data form: timestamps. The user presses a physical button, which prompts a tiny line (the timestamp) to be drawn on a tiny vertical screen, the length of which represents the day. Each day is saved, so you can scroll through your history to see reminders of moments that you wanted to remember.

The technocrats have made a dazzlingly advanced and lucrative field out of data science, and nowadays you can’t go an hour without hearing about how so much data has gone through so deep a neural network to now so reliably  predict a topic once so inscrutable to stodgy old human intelligence. Given this context, I thought this project was rather poetic and refreshing for its utter lack of “intelligence” and granularity.

I also thought it was interesting because I, too, had fantasized about the use of physical mechanisms to mark common events that I might want to collect, such as compulsions, mood states, and productivity. Consider the quick press of a small button on a bracelet on your wrist, compared to the long and disruptive process of turning on your phone, tapping in the password, opening an app, finding the appropriate tracker category, and then finally being able to mark the occasion of the birth of this blog post. And since you’re on your phone already, so you might as well tend to the notifications that have accumulated while you mustered up the willpower to actually start on your homework.

Ishac also produced a series of books, each containing a year’s worth of his Google searches. That’s it! But it’s a clever little comment on internet privacy; there’s something so ironic and immense and terrifying about having all your private and passing curiosities—which one considers such anonymous, unworthy and insignificant dust in the digital ether—not only meticulously recorded by the biggest internet company ever, but enshrined in something as prestigious as print media, available for anyone to come along and flip through.

I personally thought it was interesting because I’ve been meaning to do something with my Google data for a while. Being an Android user with poor memory, I’ve always kind of delighted in having such an assiduous witness to my life. In fact, my memory is so poor that I keep forgetting this data is available to me, so I’m keeping these links here for future reference:

A similar and even more invasive project is HTTPrint, a Chrome extension that records your internet browsing activity. The data it collects includes the pages you visit, the included images and text, and the time you spent on each. You can then print the data like a newspaper.

I like the idea of this because the content you consume online almost certainly has some degree of influence on your mood, especially considering how internet browsing is such an inveterate daily habit for most of us. I would love to run sentiment analysis on both the words coming into my brain and the words coming out, to see how they influence each other and my general mood patterns.

Finally, I love this gesture by Eugenia Kuyda, who fed old chat logs with her deceased best friend into a TensorFlow neural network, to create a chat bot that spoke like him. The bot’s selected-for-publication responses are not only logical and relevant, but also very idiosyncratic. This makes it seem quite powerful as a project and experiment, but still obviously inadequate when compared to the real person.

In the end, this work may be yet another questionable application of AI in a wider, ongoing debate over ethical use cases. But ultimately I’m hopeful that machine learning can learn enough about us via our personal data to teach us about our habits, reveal opportunities for improvement, and facilitate us in our daily lives.

github basics

to create a git repo:

  1. navigate to project folder
  2. git init

to commit a change:

  1. changes on which files?
    1. specific file: git add index.html
    2. every file that was changed: git add -A
  2. commit changes to repo: git commit -m "added index.html"

to push a repo to github:

    1. create a new repo on
    2. git remote add origin
    3. git push origin master

from then on:

  1. make changes to file
  2. git add -A
  3. git commit
  4. git push origin master


To run someone else’s project: git clone

To get updates from someone else’s project (from within the local repo): git pull

To make a copy of someone else’s repo onto your own github account to push to: clone from existing repo’s github page

To prevent files from uploading to github, create a file called .gitignore with a list of files and folders (ie, file.png, *.txt, images) that you want hidden

  • password = read from config.js; .gitignore config.js
  • for list of files to ignore based on your project