Author: Shiwei Liu, College of Artificial Intelligence, Nankai University
E-mail: [email protected]
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.
- You need a conda enviroment with a suitable Python version:
conda create -n YOUR_ENV_NAME python==3.9 conda activate YOUR_ENV_NAME
- 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
- 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.
- To train this model, run:
To test the result, run:
python Building.py -- run_mode train --train_epochs YOUR_TRAIN_EPOCHS
python Building.py -- run_mode test
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 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: