Skip to content
Seong-guk Kim edited this page Jun 14, 2023 · 12 revisions

Smombie

Introduction

The Smombie Android App is designed to help users detect and track their walking patterns using Convolutional Neural Networks (CNN). This wiki page provides documentation and information about the app's functionality, architecture, and usage.

Table of Contents

App Overview

overview

Installation

To install the Smombie Android App, follow the steps below:

  1. Step 1: Download the APK file from the GitHub repository.
  2. Step 2: Enable installation from unknown sources on your Android device. To do this, navigate to Settings > Security and enable the "Unknown Sources" option.
  3. Step 3: Connect your Android device to your computer using a USB cable.
  4. Step 4: Transfer the downloaded APK file to your Android device.
  5. Step 5: On your Android device, locate the transferred APK file using a file manager app.
  6. Step 6: Tap on the APK file to start the installation process.
  7. Step 7: Follow the on-screen instructions to complete the installation.
  8. Step 8: Once the installation is complete, you will find the Smombie app icon in your app drawer.

Note: Make sure that your Android device meets the minimum system requirements which is over 7.0.

If you encounter any issues during the installation process or have questions about compatibility, please refer to the Issue section or reach out to our support team.

Feel free to modify these installation steps based on the specific requirements of your Smombie Android App and any additional instructions or considerations that need to be mentioned.

Usage

Press Start Just Walk!
Image Image

Note: Provided app is only available in Gachon University. You must train your own data.

CNN Model

EfficientNetb0

The code for training the model that goes into our app is train.py in the model folder. If you want to improve this app for your local region, we recommend fine-tuning the model with your own data. Exporting and validating to ONNX is also included, so it's just a matter of collecting data and tweaking a few variables.

This code was written in python 3.7, torch 1.13.1, and cuda 11.6

How to train?

During the train process, a visualization will be output to help you learn.

Prepare your data

Create a folder in the rootpath to hold the data. Create three folders with subfolders: tests, train, and vaild,

and inside each folder create five folders: crosswalk, door, road, sidework, and stair, and put the data in them.

*There is an example in sampleDataset.zip.

We also recommend a ratio of train:tests:vaild of 7:2:2.

The rootpath is defined as "./data/project/", which can be changed if desired.

In this code, the train dataset is agumentaioned by applying RandomResizedCrop, RandomHorizontalFlip, and Normalize. Add or modify more if you like

Train/Hyperparameter tuning

Modify your train.py and run it.

You don't need to modify much. You just need to modify the list of hyperparameters for hyperparameter tuning.

This is a list of the three hyperparameters supported by our code.

#example
list_lr = [0.01, 0.005, 0.001]                     #list of learning late
list_mo = [0.99, 0.95, 0.9]                        #list of momentum 
list_op = ["sgd","adam","adamw","nadam","radam"]   #list of operators

freeze_layer = False #Freeze all layers except FC when set to true

num_epochs = 300

We only support five: SGD, Adam, AdamW, NAdam, and RAdam. If you enter a different optimizer, it will be ignored and trained with SGD.

freeze_layer is a variable that determines whether to freeze layers other than FC to prevent them from being trained. It defaults to false and trains all layers.

When you run the code after modifying list_lr, list_mo, and list_op, it will learn all the hyperparameter combinations in the list above for a given num_of_epochs and display them in order of accuracy.

We recommend trying multiple combinations at low epochs, getting the best combination, and then proceeding with high epoch training with that combination alone.

You don't have to think about the overfitting problem because early cutting is already applied to that code

Test model

#example
test_and_visualize_model("example.pt")

Call the test_and_visualize_model function with the name of the weight file to be tested as a parameter. (It is normally commented out)

It shows you the test results of that model and visualizes what's right and what's wrong.

ONNX export

#example
export_onnx("example.pt")

Call the export_onnx function with the name of the weight file to be converted to ONNX as a parameter. (It is normally commented out)

It will convert that model to ONNX form and test that it has been converted correctly.

Contributors

This wiki page is open to contributions. If you have any suggestions, improvements, or would like to add more information, feel free to edit this page on GitHub.