Skip to content

This project is one of my assignments for the course "Deep Learning" during my junior year at Nankai University.It is used to train a terrain classification model in order to distinguish where the robot is running thus we can switch the controllling policy of it.

Notifications You must be signed in to change notification settings

SWL-SAMA/Terrain-classification

Repository files navigation

Terrain classification

Author: Shiwei Liu, College of Artificial Intelligence, Nankai University

E-mail: [email protected]

About this program

This project is my final assignment for the course "Deep learning" during my junior year(2022) at Nankai University.It is used to train a terrain classification model in order to distinguish where the robot is running thus we can switch the controllling policy of it. I used AlexNet for reference and built a simular net structure despite the numbers of GPU (My PC only has one GPU RTX 3060). After training for 50 epochs, it can achieve 96.575% of train accuracy and 96.125% of test accuracy.

Requirements

  1. You need a conda enviroment with a suitable Python version:
    conda create -n YOUR_ENV_NAME python==3.9
    conda activate YOUR_ENV_NAME
    
  2. Install pytorch(GPU version with your CUDA version), matplotlib, tqdm and numpy:
    pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
    pip install matplotlib
    pip install tqdm
    pip install numpy
    

Run this program

  1. I provide this terrian dataset in the project file"dixing2" which is pre-seperated by data_seperate.py. If you wants to use the source dataset in your way here it is.
  2. To train this model, run:
    python Building.py -- run_mode train --train_epochs YOUR_TRAIN_EPOCHS
    
    To test the result, run:
    python Building.py -- run_mode test
    

Result

This dataset is plenty easy for this network. I tested this model on 800 images and got a 96.125% of accuracy after only 50 training epochs.

test test

Test Figure 2 is taken while the robot is moving at high speed, and it also get a outstanding prediction.

I also show the training and evalidation loss and accuracy curve here: curve1 curve2

About

This project is one of my assignments for the course "Deep Learning" during my junior year at Nankai University.It is used to train a terrain classification model in order to distinguish where the robot is running thus we can switch the controllling policy of it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages