Erica Chen's picture

Seismologist processes earthquake waveforms recorded by smartphones on multiple platforms

MyShake users across the globe

Growing up in Anyang, in a central region of China greatly impacted by earthquakes, Qingkai Kong was inspired to do research in seismology precisely because earthquakes are serious natural hazards that affect communities worldwide. Berkeley’s proximity to the Hayward Fault influenced his decision to complete his graduate studies under Richard Allen at the UC Berkeley Seismology Lab. Qingkai was also attracted to studying seismology because of its interdisciplinary scope, which allows him to study topics from computer science to social science. Most of all, however, Qingkai notes that he was inspired to study seismology because of its capacity “to use real world data sets [to solve] real world problems.”

A New Type of Seismic Network

Qingkai aims to solve some of these real world problems through his work on the MyShake app, which was released to the public on Android in February 2016. MyShake, developed under the guidance of UC Berkeley Professor Richard Allen, aims to provide early warning of earthquakes, taking advantage of the fact that seismic waves travel much more slowly than electronic waves used to communicate information. A few seconds to minutes of warning can be issued via an electronic signal before seismic activity propagates to areas outside of the epicenter, allowing activation of automatic shutdown systems to protect infrastructure, and signaling that individuals should move away from hazards, to safer locations.

MyShake was born after the Richard Allen Lab observed that smartphones were both easily accessible and were sensitive enough to detect seismic activity. “There are millions of people actually [using] smartphones,” Qingkai explains, “So if we can set up a network using smartphones, we can set up a really dense network across the globe to help us [monitor] the earthquake.” By using the accelerometer in every smartphone, MyShake is able to detect and record a 5 minute time series of earthquake activity, confirm the quake’s location and magnitude, and then send the data to the team’s server for analysis. This is especially useful in supplementing data provided by traditional seismic stations, which can be expensive to maintain or set up and too far apart to provide fine-grained resolution.

With over 250,000 downloads and 10,000 active daily users who run the app in the background, MyShake will allow researchers to put together a high resolution shaking intensity map wherever users are clustered. MyShake has already detected more than 500 earthquakes globally, and aims to increase the density of its seismic detection network over time.

Part of Qingkai’s work was to implement an artificial neural network in MyShake that could learn to distinguish earthquakes from human activity. He did this by extracting features from past earthquake and human activity that best characterized the movement ‘signatures’ of each, and stored them into an algorithm on the app. This allows MyShake to continuously compare the phone’s current movement to these distinguishing features, and distinguish motion caused by human activity from motion due to earthquakes. Once the app recognizes seismic activity, it sends its data to a central server; if nearby phones in the network also report seismic activity, the server recognizes this event as an earthquake and can estimate its location, magnitude, and starting time.

Processing the Data on Multiple Platforms

As of now, Qingkai says, “Our current focus is still to increase the density of users and to [process] the data more accurately.” MyShake records two types of data: a very short interval processed in near-real time on a remote server, and a 5-minute interval that’s stored for more in-depth analysis. Because these analytical tasks require different computational features, the team uses both Amazon Web Services (AWS) and the Berkeley Research Computing Program's Savio computing cluster. As he was preparing to use AWS, Qingkai attended the D-Lab’s Cloud Working Group to learn about the resources available from Amazon; it was here, he says, that he heard about Savio through co-coordinator Aaron Culich, Research IT’s Cloud Architect for Berkeley Research Computing (BRC).

Having just begun using Richard Allen’s Faculty Computing Allowance (FCA) in May, Qingkai and his colleagues are still exploring the ways Savio can be used as a free or subsidized resource for their larger scale, non-real time data. Qingkai found the official documentation and supplementary materials helpful for new Savio users like himself. Currently, Qingkai uses Savio for prototyping analyses of the 5-minute long waveform intervals recorded by MyShake. Every day, MyShake records thousands of 5-minute waveform samples after the phone’s neural network decides that the activity is seismic; however, because the algorithm uses a much shorter time interval to characterize the waveform, the phone’s neural network can mistakenly record human activity instead. 

Part of the team’s current work is to distinguish these human activity waveforms from seismic activity using TensorFlow and Spark, prototype the analyses on Savio, and use the results to further calibrate their neural network. However, this is not the only way Richard Allen’s team is using Savio. Qingkai’s colleague Asaf Inbal is using a cross-correlation method on the Savio cluster to detect very small earthquakes below a magnitude of 1 on the Richter scale. His results can be used to infer characteristics of larger earthquakes in the same area and give more information about the fault’s geometry.

In contrast, AWS is suited for the future that Qingkai and the team envision for MyShake. Because it’s quickly scalable and access is not constrained by a job queue, AWS resources can process the application’s short interval, real-time data right away, and scale up to handle volatility in the volume of data. The real-time analysis is used to confirm whether signals indicate real seismic activity, or when assessing whether to send warnings through the app.

Looking Forward

A year and a half after MyShake’s release, Qingkai and his colleagues continue to develop and improve MyShake. “It’s interesting to learn a lot of things beyond seismology, like how to keep the user [using] your app, and what user behavior [is like], and so on,” Qingkai says. “This is actually something that most seismologists never thought about before.” Notably, Qingkai reports that users download the app even in locations without any earthquake hazards nearby, likely because they’re interested in tracking earthquake activity around the world. Because downloads of the app spike after an earthquake occurs, Qingkai is excited to turn the app into something that can actively help others understand and be prepared about earthquake hazards.

Eventually, the MyShake team wants to roll out earthquake early warning messages within the app that can help reduce earthquake hazards and help users prepare, but this feature requires a level of certainty about the accuracy of waveform analysis that has not yet been reached. Currently, users can stay informed about earthquake hazards by viewing a global map of earthquakes recorded by MyShake and getting notifications when earthquakes occur near the user’s current location. MyShake is currently available to be downloaded onto Android phones, and the team is working on an iOS version of the app to be released in the near future.

Through the BRC co-sponsored Cloud Working Group and collaboration with BRC Cloud Architect Aaron Culich, Qingkai was not only able to learn more about AWS, which was the reason he began attending, but he also discovered and gained access to a variety of computing resources that have the potential to fit his project’s needs, from Savio to XSEDE. Do you have questions about what resources might be right for your project? Please give BRC a chance to provide answers by contacting us at