Git Product home page Git Product logo

android-csi-labelling-app's Introduction

Android CSI Labelling App

Channel State Information (CSI) is often used to perform "Wi-Fi Sensing" and "Localization" prediction tasks. Most often, prediction is performed through some supervised machine learning algorithms. Supervised machine learning model require each sample to have a specific label (or classification) for training. To facilitate training such a model with CSI data collected from the ESP32 CSI Toolkit, this Android app allows the user a number of methods to label CSI samples in real-time while also recording the CSI data.

Features

  • Collect and Parse CSI from an ESP32 running the ESP32 CSI Toolkit (this feature uses the Android ESP32 CSI Library)
  • Accurately keep track of timestamps for samples
  • Real-time sample labelling (important for supervised machine learning algorithms)

Labelling Methods

  • Timer (Action changes every t seconds)
  • Press and Hold (Action is only recorded when the user presses a button on screen)
  • Toggle (Action switches to the next state after each press-and-release)
  • Manual Input (Manually type the current action into the text-input box)

Usage

git clone --recurse-submodules https://github.com/StevenMHernandez/Android-CSI-Labelling-App.git

Select Labelling Method

In ./app/src/main/AndroidManifest.xml, uncomment the desired labelling method.

For example the below sample would select the "PressAndHold" labelling method:

<!-- <activity android:name=".Experiments.TimerMainActivity"> -->
<activity android:name=".Experiments.PressAndHoldMainActivity">
<!-- <activity android:name=".Experiments.ToggleMainActivity"> -->
<!-- <activity android:name=".Experiments.ManualInputMainActivity"> -->

Set Labelling Parameters

In the MainActivity selected in the previous step, edit the ./app/src/main/java/com/stevenmhernandez/csi_labelling_app/.java file

Install App on Phone

Plug in your android device into computer, then press run in Android Studio. After installation, unplug smartphone and plug ESP32 into smartphone with a USB OTG cable.

android-csi-labelling-app's People

Contributors

stevenmhernandez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

android-csi-labelling-app's Issues

I continue to get next build error : "could not resolve project : ESP32CSISerial"

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve project :ESP32CSISerial.
     Required by:
         project :app
      > Unable to find a matching configuration of project :ESP32CSISerial:
          - None of the consumable configurations have attributes.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

This error occurred when I tried to get a git and build it into an Android studio.

I don't know what I did wrong.... T_T
(I just turned on the git without changing the code)


Oops..!! i'm sorry,
I checked and found that the ESP32CSISERIAL folder was empty,
so I received the library from the git "https://github.com/StevenMHernandez/Android-ESP32-CSI"
and it worked well... I was a fool.

can't find data on my phone

Dear Steven, thank you for your work!
I want to know where data is stored in the phone,I can't find data on my phone。

Update Configuration from the UI

From the app's UI, we should be able to update experiment parameters like

  • Baud Rate
  • Experiment Activity Type
  • List of Actions
  • Other Miscellaneous Activity-specific parameters

It would be nice to have the following options too:

  • Parameters should be stored so that restarting the application does not require the user to input all of the same experiment again.
  • There should be some list of old experiment parameters so that we can redo old experiments without having to manually type in each class name and other experiment specific parameters.

Any other ideas are welcome. I cannot promise that I will work on these tasks, but if anyone is interested in working on this, I am open to pull requests. Thanks!

There is no CSI data in the CSV file saved by the App

Dear Steven, thank you for your work!

We can now get the CSI data from ESP32 and save them to the my-experiment-file.csv file of the computer, for example:

CSI_DATA,STA,74:05:A5:92:11:E1,-52,11,1,7,1,1,1,1,1,0,0,-89,1,6,1,6341572,0,114,0,0,6.71627,612,[114   -96 6 0 0 0 0 0 0 0 0 0 -5 -3 -8 2 -12 6 -16 9 -20 12 -23 12 -27 12 -28 10   -29 8 -28 6 -26 4 -23 2 -19 1 -15 1 -10 2 -6 3 -2 5 2 7 5 10 8 13 10 15 11 18   11 21 10 21 9 22 8 22 0 0 4 17 4 14 3 10 4 6 4 1 6 -3 8 -6 10 -9 13 -12 15   -13 17 -14 17 -14 18 -14 18 -12 17 -11 15 -10 12 -9 9 -9 5 -8 1 -8 -3 -9 -6   -10 -9 -11 -12 -13 -13 -14 -14 -15 0 0 0 0 0 0 0 0 0 0 ]

CSI_DATA,STA,74:05:A5:92:11:E1,-52,11,1,7,1,1,1,1,1,0,0,-89,1,6,1,7347868,0,114,0,0,7.72225,612,[114   -96 6 0 0 0 0 0 0 0 0 0 -31 0 -31 -2 -31 -4 -28 -6 -24 -6 -19 -4 -13 -3 -8 0   -3 4 0 8 3 12 5 16 6 18 7 21 6 23 6 24 5 24 4 24 3 23 2 20 2 16 1 12 2 7 3 3   5 -1 6 -6 0 0 11 -12 13 -14 14 -16 16 -16 16 -15 17 -15 16 -13 14 -12 12 -10   9 -8 5 -7 1 -6 -3 -5 -7 -5 -12 -5 -15 -6 -17 -6 -19 -7 -20 -7 -20 -7 -19 -7   -18 -7 -17 -6 -15 -4 -13 -2 -10 0 0 0 0 0 0 0 0 0 0 0 ]

However, when the ESP32 is connected to the mobile phone, there is no CSI data in the backup_xxx.csv file in the mobile phone. There are only four types of data: type, smartphone_id, timestamp, and current_action. For example:

type smartphone_id timestamp current_action
'CURRENT_ACTION' '4b5bb365bd3e491f' 1.63825E+12 'sit'
'CURRENT_ACTION' '4b5bb365bd3e491f' 1.63825E+12 'transition'
'CURRENT_ACTION' '4b5bb365bd3e491f' 1.63825E+12 'stand'
'CURRENT_ACTION' '4b5bb365bd3e491f' 1.63825E+12 'transition'
'CURRENT_ACTION' '4b5bb365bd3e491f' 1.63825E+12 'sit'
'CURRENT_ACTION' '4b5bb365bd3e491f' 1.63825E+12 'transition'
'CURRENT_ACTION' '4b5bb365bd3e491f' 1.63825E+12 'stand'
'CURRENT_ACTION' '4b5bb365bd3e491f' 1.63825E+12 'transition'
'CURRENT_ACTION' '4b5bb365bd3e491f' 1.63825E+12 'sit'

Now, I need to save the CSI data in the backup_xxx.csv file of the phone. What do I need to do?

The ESP32 CSI Tool Settings are as follows:

PROJECT_NAME: ACTIVE_STA
CONFIG_ESPTOOLPY_MONITOR_BAUD: 115200
CONFIG_ESP_CONSOLE_UART_BAUDRATE: 115200
IDF_VER: v4.3.1-dirty

WIFI_CHANNEL: 6
ESP_WIFI_SSID: WiFi110
ESP_WIFI_PASSWORD: WiFi666666
PACKET_RATE: 100
SHOULD_COLLECT_CSI: 1
SHOULD_COLLECT_ONLY_LLTF: 1
SEND_CSI_TO_SERIAL: 1
SEND_CSI_TO_SD: 0

The APP labeling method we select to TimerMainActivity in ./app/src/main/AndroidManifest.xml

        <activity android:name=".Experiments.TimerMainActivity">
<!--        <activity android:name=".Experiments.PressAndHoldMainActivity">-->
<!--        <activity android:name=".Experiments.ToggleMainActivity">-->
<!--        <activity android:name=".Experiments.ManualInputMainActivity">-->

Thanks again!

How to prepare the data for training

Hi there!

This is a super cool app, thanks a lot for putting it together!

I am looking to take the CSI and train it using TensorFlow. The ability to do this has been mentioned, but would love to better understand how to implement this and so have a few questions please.

  1. It looks like the default state is that CSI is exported in one file (via the ESP32CSISerial library) and a separate file is created which records the training labels. Is this done purposefully? It seems like the better approach would perhaps be to first convert the CSI to amplitude via the currently unused parseCsi function, and then export that data whilst also appending the current label.
  2. My understanding is that most training is done on just the amplitude, but if phase is also recommended, I'd love to know.
  3. When training data via this method before, has any attempt been made to use CSIKit to de-noise the data or has this been done within the Android app?

Thank you so much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.