Status Report 3/2

Kevin

Accomplishments

  • This week I spent time on preparing for our Design Review presentation on Monday. Our presentation will server a good beginning for the content in our Design Document. I have also begun to work on the Design Document. I generated the BOM for our PCB and ordered the necessary parts. I ordered enough to make 5 complete boards. This is mitigate problems with components breaking and we will also have most of the parts on hand for our next revision.
  • I made progress on detecting and separating keystrokes. We have found the Matlab Voice Activity Detector was not sufficient in finding keystrokes, especially with background noise. Instead we looked at a few other strategies. The first we tried was using xorr, a correlation algorithm. The goal here is to find every place in the waveform that has the signature pattern of a keystroke. This was not effective and resulted in poor results. The current method is to take a window in the past and find the mean amplitude. We then compare this with the mean of a smaller window looking forward. If the difference is significant, we consider this a keystroke and take a 100ms snippet. Below is an example of a keystroke found this way.
  • While this method appears to be effective, it is subject to problems with background noise, especially voices. James has been working on a new method which focuses on power instead of amplitude and looks for the characteristic pattern of a keystroke, two humps spaced ~80ms apart.

Upcoming Work

  • For this upcoming week, I will primarily be focused on the bring-up of the PCB. We are expecting the PCBs to arrive this week and I would like to have one assembled before Spring break, which starts on Friday 3/8/2019. The plan for this was outlined in the previous weeks progress report. I will be contacting the post-doc we have been working with for some help with assembly. I will also be researching methods of reducing background noise. We may to use both mics in order to complete this task without losing too much data from the keystrokes.

Changes to schedule description

  • We are currently on track with the PCBs. It would have been nice to receive them this past week but unfortunately we were not lucky with the timing. We are slightly behind with the signal processing. Fortunately, the keystroke detection built this week is good enough to efficiently grab keystrokes from long audio clips. From here we can start extracting features and begin using real data for our machine learning side. James is helping out with the next version of the keystroke separation to help speed things up while I move onto noise reduction.

Ronit

Accomplishments

  • Last week, we were having trouble  with getting the ESP32 to sample I2S at the rate we wanted it to. This turned out to be because we were performing several small TCP transactions instead of one large TCP transaction. As a result we were getting bottlenecked in terms of RAM, we were not sending samples out fast enough and we were dropping samples and it seemed as though we were sampling data at a lower rate that we were actually.
  • To fix this, we switched to large streaming transfers and we send raw bytes to the laptop rather than sending ascii text. This required some reconfiguration of the network stack to accept bytes rather than ascii text. Now We are able to record data remotely and replay it back on the laptop in matlab.
  • We did some preliminary testing with music, there was no audible difference between the recorded track and the real track. We also compared the fft spectrums, there was a little bit of noise in the recorded version but we do not anticipate there being any issues with this.

Upcoming work

  • With this, all the embedded code has been written for now, I will now be moving on to writing the deep learning model to translate each of the clusters to letters based on a language model.

Changes to schedule description

  • There are no changes required, I am on track. I will spend some time next week to collect data using the ESP32 in order to help bring Kevin and James back on schedule.

James

Accomplishments

  • In parallel with Kevin, I implemented and researched an alternate method of keystroke identification and separation. In order to identify individual keystrokes, the entire recording of keystrokes was temporally divided into non-overlapping 10ms bins. Subsequently, the FFT coefficients of each bin was used to calculate the energy of each bin, which was then normalized between 0 and 1. A sequence of delta vectors was then calculated by subtracting each bin’s energy with the energy of the previous bin. The delta vectors were then amplitude-thresholded to determine the presence of each feature of keystrokes: two surges of energy followed by rapid falls in energy within a 40ms window signify the key-press sequence. A later surge in energy within a 100ms window then signifies the key-release.

Upcoming work

  • Next week, I will continue to refine the keystroke separation, as well as to be able to isolate the different parts of each individual keystroke, as indicated by the waveform above.
  • Now that we have also fixed the sampling rate issue on the ESP32, we can begin collecting good data from the actual sensor package. In the upcoming weeks, and over Spring Break, I will begin to apply the keystroke separation to larger portions of this data and begin to work with Kevin to extract FFT, cepstrum, and TDoA features.
  • Now that the risk of not being able to obtain good data from the ESP32 over wifi has been eliminated, the biggest risk to the project has shifted to

Changes to schedule description

  • I have fallen behind schedule on extracting features from keystrokes. However, now that we have the sensor package up and running, we can begin collecting large amounts of data to work with. I will make use of the data we collect to work on the feature extraction over Spring Break, in order to catch up to schedule.

Team Status

Accomplishments

  • The major accomplishments this week we were to fix the issues with obtaining data using the ESP32. We were also able to implement a fairly reliable keystroke separator.
  • The largest task completed this week was the preparation for the Design Review presentation and the writing of the Design Report.

Upcoming work

  • In the next few weeks, we will be moving forward with the signal processing and machine learning portions of the project, as the initial PCB design is mostly complete.

Changes to schedule description

  • We have fallen slightly behind schedule due to challenges in obtaining data from the ESP32 over wifi as well as the time spend on composing the Design Report. We will make use of the extra time over Spring Break to catch back up to schedule.

High-level Project Changes

  • No major changes have been made to the project as of now. We are, however, exploring modifications to the noise reduction and keystroke separation methods.

Status Report 2/23

Kevin

Accomplishments

  • This week I finished the PCB design for revision 0. I completed the routing for power, trying to use wide traces and keep them short to reduce noise. These design features were suggested in datasheets for parts we will be using as well as many online tutorials. I routed the data lines and bus lines for our two microphones.  I added a few resistors and capacitors on the I2S bus to improve signal reliability. I did my best to avoid sharp turns with the analog signal from the Vesper mic to avoid filtering the data in ways that are undesirable.
  • I also fixed some small issues with part footprints in Eagle. I double checked the footprints for other parts as well, especially the charging circuit ICs since they are small QFN packages. Lastly, I standardized all of the capacitors and resistors, of the type, to have the same package and library in Eagle.
  • By the end of the week, the PCB was ordered. We ordered 5 for 1$ each, plus shipping, approximately $17. In the best case scenario, we may be able to get them before the end of next week. If not they should arrive during the following week.
  • I also helped out Ronit and James with collecting audio signals from the ESP32. We were able to collect recognizable voice clips, but are not able to set the correct sampling frequency.

Upcoming Work

  • Once the PCB arrives, we can begin testing. We will test the board itself first, making sure the traces are connected properly. After this is complete we can begin assembly. If the boards arrive next week, I should be able to test them before the end of the week.
  • We also need to order the parts for the PCB. We currently have the LM1117 and the ESP32, but are lacking the power management circuits and microphones. I will be purchasing those early next week.
  • The largest risk with the PCB is that they do not work once assembled. I expect debugging to be challenging. Finding the issues as quickly as possible will be critical so we can get another revision of boards ordered. If problems do arise, we will look for help in debugging, likely from the post-doc we spoke with last week.
  • Considering it is very likely we will not have the PCBs back next week, I will also be working on signal processing. Keystroke detection has already begun, but by the end of this week I am aiming to have the system automated.

Ronit

Accomplishments

  • Getting I2S working on the ESP32 was particularly challenging. Even though the mems microphone is a 24bit device, the clock has to be driven for 32 clock ticks.
  • The I2S bus also expects two I2S devices, so instead I set it up to double sample the one device.
  • Set up the I2S device to use DMA to increase sample throughput.
  • Set up port forwarding within the cmu network to connect the ESP32 to the laptop over CMU’s wireless network.
  • Transferred the I2S data from the MEMS microphone to the laptop over TCP
  • Although we were getting data on the laptop, it was extremely noisy, to overcome this we first lowered the sample rate until we could debug the sounds more easily. By listening carefully to the sound, I realised that the sounds were being scrambled. I.e- the samples were not playing in the correct order. I was querying only single values from the DMA buffers instead of the whole buffer and under the covers the ESP32 was swapping the buffers and the sounds were playing out of order. I set it to read the entire buffer and increased the number of DMA buffers.

The image below is the sound of human speech that was recorded on the ESP32 and sent over wifi being plotted on Matlab.

Changes to schedule description

  • Right now we are able to play back sound on the laptop that has been sampled on the i2s device. However, we are not able to increase the sampling rate to the desired 44.1KHz. At a mere 10kHz, we will not be able to pick up any desired features. This is a problem we did not anticipate would happen and do not have time budgeted in the schedule and as such must move things around. Since we are ahead on the PCB, Kevin will be helping me with the i2s sampling as he has some slack.

Upcoming work

  • Not being able to sample at the desired frequency is currently the biggest problem we have. The strange thing is that, the device clock is set to the right rate, and we are able to observe this on the oscilloscope, but for some reason, the device simply does not give us the values we need. I anticipate that this will take no more than 4 days to fix. After which, most of the embedded software stack will be complete and I will move to signal processing.
  • Per Professor Mai’s advice, we will be using multiple microphones, this required a slight modification in the network code, but was easily manageable.

James

Accomplishments

  • Began work on the TDoA algorithm for multiple microphones. Because we plan on having 2 microphones per board, one high quality and one low power for waking the processor up, we can apply TDoA to a single board as well as to multiple devices. I was able to achieve accuracy on the order of centimeters by using recorded samples of gunshots. The output time difference will simply be used as an additional variable toward the feature-to-cluster algorithm.
  • Attempted to build TensorFlow from source in order to enable AVX instructions. Unfortunately, I was not able to get TensorFlow with AVX up and running. I will continue to work on installing the missing dependencies in the following weeks. In the meantime, I will continue to refine the machine learning algorithms using the pre-built PIP TensorFlow package. Although this will result in slower training, we can still proceed with the rest of the project unhindered.
  • Helped Ronit get recorded sound transmitted over wifi from the ESP32. This past week, we were struggling to get recorded data transmitted correctly from the ESP32. Because the rest of the signal processing depends on this data, I helped Ronit get back on schedule. We ultimately fixed the issues regarding the clock and data protocols between the ESP32 and I2S microphone, and reading from buffers in the wrong order. We will still need to debug the sampling rate of the microphone, as we are finding that it seems to be stuck at around 8kHz, despite a correct frequency on the I2S clock line.

Upcoming work

  • Currently, we are still working on collecting good data from the ESP32 module with the I2S microphone. Once this is complete, Kevin and I can make further headway into extracting features from recorded keystrokes (FFT, cepstral, and TDoA).
  • Again, I plan to continue working on getting TensorFlow built from source in the upcoming weeks.
  • Next week, I will work with Kevin to refine the keystroke separation algorithm.
  • Currently, one of the biggest challenges and risks we face is the fact that we are still unable to obtain good data from the ESP32 over wifi. As a contingency plan, we will move forward with cell-phone data if necessary, until we explore more microphone and data transmission options.

Changes to schedule description

  • I am currently a little behind schedule in terms of getting building TensorFlow from source. Fortunately, this is not critical for the other components of the project, so I will work on this in parallel with other work in the upcoming weeks.

Team Status

Accomplishments

  • The PCB design was finalized and vetted by Sam.
  • We made some last minute changes like adding additional debug headers just to make the debugging process a little easier. Currently the PCB has lots of jumpers and debug gpio ports that will be removed in future iterations, but as this is our first foray into PCB design we deemed it necessary to build in as much fail safe into the PCB as possible.
  • Even if the processor on the PCB does not work, we have set it up so that it can still act as a breakout board for all our components.
  • A little bit of work was needed to get the network connectivity working exactly how we wanted it to. From our previous blogpost you would know that we were having some trouble sending data from the ESP32 to the laptop but that issue has been resolved.
  • We are able to obtain I2S data from the microphone, however there are still some issues in that area.
  • We are in the process of creating a means of using time of delay arrival as another data point. Since we already have two microphones, a low power wakeup mic and a good quality MEMs mic, we are attempting to use them to determine the delay in the sound arrival to the two mics. The are spaced 2 inches apart and therefore, the time delay in arrival between the two of them is in the order of tens of milliseconds ,which we will be able to discern once we reach our desired sampling frequency. If we find that using two mics on the same board do not give us the desired results, we will move to using two sensor packages on two PCBs. The network stack has been written so that additional devices can be trivially added.

Upcoming work

  • Next week, Ronit will be working on fixing the I2S sampling frequency.
  • Kevin and James will be working on separating keystrokes.

Changes to schedule description

  • Not being able to sample i2s data and have real data is a setback, however, we are have reordered the schedule so that things dependent on real data have been pushed back.

High-level Project Changes

  • The only update to the project at a high level is the inclusion of a second microphone. We have seen some literature (https://www.sigmobile.org/mobicom/2015/papers/p142-liuA.pdf?fbclid=IwAR2ZJi4b4LWak6W2l5iZk5fF9sDwKGeZHDAlDtUJiNDDYE62bAhzhfUjmZE) regarding using two microphones positioned at known locations relative to a keyboard to obtain millimeter-level localization accuracy using TDoA. Because our project’s aim is to create a practical device that an adversary can quickly and discreetly place, we will be able to determine and utilize the exact locations of the microphones in relation to the keyboard, as was done in the research. However, we will incorporate TDoA into our project as an extra data point in the feature-to-cluster machine learning algorithm.

Project LAKE

This project seeks to exploit the unique acoustic properties of individual keypresses to log keystrokes of a computer user without physical or digital access to the keyboard itself. Past research has been conducted in this area, showing that this type of attack is possible. However the focus of many of these studies were to show that this attack was feasible, as such, unrealistic scenarios were considered where a studio quality microphone was used and the sound was recorded in a noise-free recording studio. The focus of this project is to show that this side channel attack is practical. We will construct our own small, low-power, wireless sensor package capable of accurately logging keystrokes via an acoustic side-channel attack.