Brian Caffo — Biosignals, Open Education, and Publishing with Leanpub
Brian Caffo is a Professor in the Department of Biostatistics at the Bloomberg School of Public Health at Johns Hopkins University and Director of the Graduate Program at JHU Biostatistics, working in computational statistics and neuroinformatics, and co-founder of the SMART Working Group. He is the author of two Leanpub books, Statistical Inference for Data Science and Regression Models for Data Science in R, companions to the data science specialization he offers on Coursera. In this interview with Len Epp, he discusses his professional interests, his books, and his experiences using Leanpub.
Len Epp: I usually like to start these interviews by asking people for their origin story. How did you first become interested in biostatistics, and why did you decide to pursue a career in academia?
Brian Caffo: Well, the long version of this story is when I was in college, I was actually a swimmer. I wasn’t a terribly good swimmer, but I was on a big team. I was at the University of Florida, which has a great swimming program. I was an art major at the time, and I was spending so much time training that I didn’t have a ton of time to actually put into being an art major, which is a surprisingly difficult major, especially in terms of time. I had an aptitude for mathematics, so I kept taking math classes, maybe a little bit lower level than I needed to, but then just kept incrementally doing it to fill out my hours so that I could manage swimming and trying to do the art major.
Finally, after doing this for long enough, I talked to a guidance counselor and they said, “we typically don’t get too many art majors who are taking differential equations and linear algebra. You seem to be actually doing better in those than you are doing in your art classes. You can always do it in your spare time.” And so from there I switched over to become a math major, and from mathematics I’d spent some time working with the Children’s Oncology Group, which was then centered in Gainesville. From there I just really fell in love with working with data and the computing and mathematics that goes along with statistics. Staying in academics for me was in a lot of ways a no-brainer. I really loved the research that I was doing, and I was very fortunate to get a position here at Hopkins where I have such amazing access to great data, great researchers, great medical research.
Len: Could you explain some of the reasons you co-founded the SMART Working Group and what the purpose of the group is?
Brian: This was co-founded with a collaborator here, Ciprian Crainiceanu. We had a lot of similar interest in how we approach modeling and statistics, and we were getting a lot of people coming to us about some new kind of measurement that they were collecting. In my case, it was mostly brain imaging. You might think that there’s only a couple of ways that you can measure the brain, and that idea couldn’t possibly be more wrong. Even with one type of magnetic resonance imaging scanner, there are so many different ways you can tweak an MRI scanner to give you different kinds of signals in the brain that you can barely count them.
Both in terms of brain imaging but also things like sleep studies and polysomnograms, as well as other kinds of wearable computing, we were constantly getting people coming to us asking how do I analyze this kind of data. Because we’re at a school of public health, at a medical institution, people wanted to relate these measurements to disease, they wanted to create preventions and prognosis, they wanted to relate it to large populations, and they didn’t know how to do it. It involves a lot of computing, mathematics, statistics. So we noticed a common thread of some sort of biological signals or biosignals, and we founded the group out of it. Initially it was a group with air quotes around it, and then enough faculty and students joined in that we started having alumni and postdocs. It’s now become a rather large entity. When we have a full group meeting, which we don’t have that often anymore because it’s gotten so unwieldy, maybe 35 or 40 people will show up.
Len: Can you explain a little bit about what a biosignal is?
Brian: We take a biosignal to be any biological or medical signal that is used to create a diagnosis or to create a measurement that is then used for research purposes. That’s a very broad definition. An important class of biosignals that we don’t really delve into in our work is the field of computational genomics and high throughput bioinformatics. We did it that way because around Hopkins there were large developed bioinformatics groups, because there was so much excitement over the sequencing of the human genome, and a lot of these other technological revolutions were getting left behind in terms of analysis skills. So we lumped them all together. I agree that biosignals is a vague term, but now that we’ve gotten big enough we need to maybe make it more precise and define ourselves a little better.
Len: Is something people might be familiar with, like rapid eye movement, a biosignal?
Brian: There you’re talking about sleep. Sleep is typically measured, if you get a rigorous sleep study, by what’s called a polysomnogram. The collection of biosignals they would collect in that case would be electroencephalogram — they put electrodes on your head that collects brain activity. They have things like a myogram that they would put on your chest to detect breathing. They might have a motion sensor on your leg for restless leg syndrome. They might have something that measures oxygen on your finger. And they might put an EKG on, because most of the sleep studies we were looking at were very interested in cardiac outcomes associated with different kinds of sleep disorders.
REM is a specific classification of a sleep state, and that arises from subsets of these biosignals that they use to classify different kinds of sleep — deep sleep, different stages of sleep and REM. Usually they actually have to pass them through a human to get the staging like that. As an example, we have several papers on analyzing the percent of the time that you spend in REM over the course of an evening, and things they call sleep architecture. We often think about how if you’re tired for several days straight, you might catch up on sleep, and that relates to things like sleep efficiency and sleep architecture that we get out of those signals. So going from those signals to these measurements and relating them to diseases in the population is really what we try to do.
Len: And you’ve done work with signals where electrodes are implanted directly on the brain as well, is that correct?
Brian: The one kind of measurement like that that I’ve dealt with is called electrocorticography. That’s something they do for people with pretty severe epilepsy where different medications and other treatments have failed and they’re left with nothing other than brain surgery. They saw off the top of their head, and as a measure to help inform the surgery, they place this electrode sheet directly on the cortex. Usually there’s some time between the early parts of the surgery and the actual brain surgery part, and people often let some amount of experimentation go on — maybe playing sounds or having them do things and recording the brain activity while that’s going on. So in some rare cases you can actually collect measurements from otherwise healthy humans who have some severe disorder like epilepsy, where the measurements come directly from the brain.
I don’t personally do this, but there’s also a lot of people around here who study mice and monkeys where they actually implant the electrodes. There’s a fascinating field called machine brain interface where people are implanting electrodes in monkey brains and they’re getting the monkeys to feed themselves with a robotic arm, the robotic arm being controlled by the electrodes directly implanted in the brain. There’s tons of neat areas like that, but that only occurs in these more invasive things that people do on animals. I almost exclusively work on human data.
Len: I’ve read that the SMART Working Group uses brain imaging for prediction. Could you explain what brain imaging is and how it can be used to predict behaviors?
Brian: The kind of brain imaging that I work on is so-called functional magnetic resonance imaging, and in that you don’t get a static image, you get a dynamic image that represents, hopefully, localized brain activity over time. There’s a lot of different ways people might use this kind of measurement for prediction. As an example, a colleague that I’m working with right now wants to use brain activity as measured by fMRI, plus some structural measurements, in people who are in comas to try and predict when they’ll come out of it, or if they’ll come out of it. That’s an example of using brain imaging as a biomarker to predict some outcome.
A colleague of mine in the SMART Working Group, someone who we managed to successfully recruit to the university, an extremely well-known fMRI researcher, Martin Lindquist, works on actually trying to predict what’s going on in your head with the information from the scanner at that moment. In particular he works on pain. They have people in the scanner and they actually deliver pain to them by a hot plate that’s resting on the wrist that stings a little bit, and he tries to predict how hot it was on the plate just based on the brain signal. That has implications for trying to get a better measurement of pain. When people just say “oh, something hurts,” a physician doesn’t know what that means, but if they can calibrate it — so he’s working toward the idea of actual prediction of pain.
I tend to focus more on the public health type prediction things, where we try to predict whether or not a person has a disease, whether or not they’ll come out of the coma. A really big one that everyone’s working on right now is trying to predict who will get Alzheimer’s disease, the reason being that if you can detect Alzheimer’s disease early, then you have a much better chance of being able to develop an effective treatment.
Len: On the subject of gathering data, what impact do you think wearable computing is going to have on public health generally, and perhaps on your field specifically?
Brian: It’s going to be huge. The SMART group does a lot of wearable computing work. Personally I don’t do too much, but my colleague Ciprian, who co-founded the group with me, along with some others, have really dove into wearable computing in a big way. When you think of wearable computing, people tend to think of things like Fitbit. But for research purposes, there’s a million different kinds of sensors and measurements that people can take that are now small enough and portable enough. I think it’s going to revolutionize public health in terms of our ability to get accurate measurements for lots of different things.
The key bottleneck is having enough people who know how to analyze this stuff. Our ability to collect data is just so vastly outstripping our ability to analyze it. The bigger problem is not the development of the sensors, because lots of smart people are working on that and they’re developing great stuff. The real bottleneck now is people to analyze the data. So I would say to anyone who’s an aspiring young machine learner or computer scientist, statistician or biostatistician, it’s a great field to get into.
Len: Statistics seems to be enjoying a cultural moment with the popularity of sports and election statistics, most commonly associated in North America with people like Nate Silver. Do you think that’s going to inspire more people to get into things like data science?
Brian: I think this cultural revolution for sure is helping — Moneyball, the book, is a great example, and Nate Silver. But I think the bigger impetus for drawing people into the field is the demand for jobs. It’s one of the relatively few sectors where there’s an enormous amount of job growth, way more demand than supply, and there’s no apparent leveling off. New kinds of data-oriented companies seem to be popping up every day, and giant companies — all your Googles and Facebooks and Twitters — are ostensibly data companies at some level.
So I think the major draw will be the fact that it is going to be one of the principal jobs of the future, which, when I got into it as a lowly art major trying to figure out what to do, there weren’t all different kinds of options. The amount of options that our students have now is truly remarkable. Some of them go into finance, some go into technology and move off to Silicon Valley, some stay in academics, some do biostatistics, some go to mathematics.
Len: I read on your website that you have a particular interest in large-scale open access education, and I know you’ve been quite successful with the data specialization course on Coursera. What inspired your interest in open access education?
Brian: Leanpub fits really well into our vision, and I’ll get to that in a second. Initially it was really just fortuitous. I had wanted to flip my classroom, which is the process where students watch the lecture at home, but during the class period they actually get more of my time and the TA’s time doing problems. There’s a lot of work so far showing that’s a more effective way to teach people, and that the old sage on the stage lecture model is not the optimal way to do things. So when I contacted some people to do some recording in our school, they mentioned that we had just struck a deal with this open education company called Coursera, and asked whether I’d like to be one of the people in the launch. I agreed, I was really enthusiastic, and then I talked to Roger and Jeff, my two colleagues here, who were very interested in it as well. I think my class was okay; their classes were just blockbusters. From then on our interest was really piqued, for a variety of reasons, one of which being this idea of delivering low cost or free education is very appealing to people in academics.
I think Leanpub in particular has really helped us fit into that model. Our Coursera model for all of our courses is everything’s free. The lecture notes are all posted on GitHub and you can see the full development process. The videos are all free, both on Coursera and off of YouTube for most of us. It just makes sense that if there was a textbook for these classes, it should also have a free option, some new way of doing the pricing so that it conformed to this new model. And it conforms great. In Leanpub for textbooks especially, we can basically give the students edition updates, and a lot of things that people would complain about university textbooks just get all solved at once.
I would also mention that the school was a very early pioneer for open education, well before Coursera and before Khan Academy. There was MIT OpenCourseWare and our school was a participant, and I was in on some of those meetings where they were deciding to do it and I was super enthusiastic at that time as well. So I think the school has really been on the vanguard of open education, and part of that culture seeps in.
Len: I know there are some voices out there that respond relatively conservatively to the idea of open education, and in particular they’ll invoke the possibility that it might be a competitor or a threat to conventional university education. What’s your response to that criticism?
Brian: It’s possible it might be a threat to certain financial models for certain departments for certain topics, but by and large, the question is whether or not these are coming up with new markets or they’re poaching existing markets. I think the vast majority of the ways in which students take these classes are new markets. They might be university students, but a student might sign up for a machine learning class on Coursera that they may not have taken at their university otherwise. So I think the majority of the student engagement on Coursera, edX, Udemy, these other sites, is probably new users. For sure there is a certain amount of poaching that also has to occur — that student that was going to take that elective class elects to just take it on Coursera. But it’s not all that dissimilar from correspondence courses and other historic attempts to broaden access to education for people who have different circumstances.
A lot of the focus on how online education is going to disrupt universities is a laser-beam focus on 18 to 22-year-olds in undergraduate education, but the people who take these classes exist well into their work life, well beyond their university life. So I think it’s a lot more complex than that. There is a certain amount of disruption occurring, but in a lot of ways good disruption. The one place the kind of disruption you’re talking about might occur is any place that has a revenue model where they use introductory classes, with adjuncts, as a revenue generating component for other things. If they don’t have a very diverse financial model, that might get disrupted. But even that I don’t see that much. People like in-person classes. I do think most of it is new users and new content — but I am a university professor; at some level I’m dependent on brick and mortar learning.
Len: On—
Brian: —well, not on some level, on exactly every level.
Len: On the subject of generating revenue and textbooks in academia, and also journal articles, how do you see academic publishing evolving over the next few years?
Brian: I feel a little bit more confident that something like Leanpub is going to disrupt traditional book publishing than I am about what will happen with traditional universities with respect to online teaching. Our experience with Leanpub has just shown that if you have your own channels to get your book out there, then it is really an ideal circumstance. If you’re willing to publish something purely or mostly as an ebook, then you can do all sorts of interesting things with embedded videos. In my stat inference book, most of the homework problems have links to YouTube videos that actually give the solutions, with me working them out — I have a little tablet here that I handwrite out the solutions on as I record myself doing them. That kind of disruption seems pretty inevitable to me at this point.
For journal publishing, I’m less certain. I don’t know a lot about the journal publishing business. I guess I don’t really know much about the book publishing business either, but from my experience as an author, I can’t even imagine contacting a traditional publisher at this point. For journals, I still submit my best articles to what I think are the best journals that will take them. There’s a lot of discussion in academics right now about academic publishing and a lot of new models coming out. Many of them are really impressive — Frontiers is an example of one that I’ve worked with that I think is quite impressive, and PLOS is another. But I have a less clear picture in my mind of how that will shake out.
Len: In both of your books on Leanpub, you mention that people are invited to send you errata or pull requests on GitHub. Is engaging directly with people who’ve already bought your book important to you?
Brian: I like the fact that if I decide to add an extra section or a chapter or a new set of problems, Leanpub allows me to contact everyone who’s bought the book and tell them. Sometimes I’ll republish the book and I’ll just send out an email that says, “I’m republishing the book, this is minor stuff, don’t bother redownloading.” But then sometimes I’ll put a whole new section or chapter in and I’ll be like, “this is probably worth redownloading if you’re still actively engaged in the book.” And people who bought the inference book might want to get the regression one, so the ability to email them is great.
The GitHub integration — students submit pull requests on GitHub, so it’s not like they’re emailing me errata. I’ll accept the pull request, and I have one of the switches on GitHub so that whenever I check something in, it automatically recompiles on Leanpub. Then I have to republish the book, which I’ll only do every now and then when it’s a big enough set of changes. That’s actually really great, because it’s not like I’m getting a ton of emails — it’s working through GitHub, which is fantastic.
Len: Specifically with respect to emailing readers, we actually do a kind of double blind where we don’t reveal the reader’s email address to the author or the author’s to the reader. Does it bother you that you can’t see the actual email addresses unless they opt into that?
Brian: It’s sort of irrelevant to me. If I had a list of emails I wouldn’t do anything with it, so if I actually had to manage the emails that would be an annoyance. And from the consumer side it seems like a nice protection of their identity and their information. It seems like the right way to do it.
Len: Is there anything specific that you think we could improve in your workflow?
Brian: For the data science specialization, we actually wrote all the lecture notes in Markdown. The stuff I’m doing is more like lecture text — it’s sort of a standalone book but it’s mostly connected to the class — and the ability to create that kind of entity in Markdown, because the authoring is in Markdown, was very seamless, and that helped a lot.
One thing that could be improved is if you could author directly in LaTeX. I noticed that Leanpub apparently does Markdown and then probably does Pandoc to create a LaTeX file which it then compiles — I’m pretty confident I’m seeing standard LaTeX compiling in the log file. For the math, science, computer science, stat crowd, LaTeX is the lingua franca of the community, so people already know it. The other thing would be access to the log files after it gets compiled — when it comes in an email, that’s just a timing thing. Another useful thing would be an offline compiler, or something close enough — a collection of Pandoc commands that said, “take this, do this to your Markdown file, and this will approximate pretty well whether or not you’ll get an error,” so that you can write and rapidly debug. I’ve noticed the only time I ever get an error while compiling is with equations, that’s it. For inference, that part was a little hard. Fortunately I already knew the math was already typeset without errors for LaTeX to begin with. But for writing a de novo book, something that would allow you a quicker ability to debug errors in the math typesetting would be helpful.
Len: We’re actually going to be working on an author app, and hopefully a lot of that will be incorporated into it, because we want to make it easier for people to work on their own machines.
Brian: And I’ve never tried it, but another solution in my particular case would be to author it in LaTeX, Pandoc it to an EPUB file and then just submit the EPUB file, since you accept an EPUB file by itself. I’ve never tried that solution.
Len: One last question. Are you working on any other books right now that you plan on publishing?
Brian: I’ve got about seven queued up. I teach three classes as part of the specialization, so I’ve done two of them, inference and regression. Regression, I think on the slider it says maybe 70% — I’d like to get it up to 100%. After I’ve finished with regression, I teach a third class in the specialization called Developing Data Products, and I’d like to finish that one. Because it’s a computer oriented book, it will be really ideal for the Leanpub authoring setting. And then after that, I have two Coursera classes coming out that I hope to create books for. My new strategy is to write the Leanpub book, then record the videos, and then release the class — the reason being that the Leanpub book will almost serve as a script for the videos and then for the class.