MSTAR dataset. Unoffical python implementation of Paper: Bag-of-Visual-Words Based Feature Extraction for SAR Target Classification
MSTAR数据集的分类, 复现论文Bag-of-Visual-Words Based Feature Extraction for SAR Target Classification
trian dataset acc: 90.45%
test dataset acc: 85.37%
The train steps are as follow:
- gamma transform and extract HOG features
- use K-means cluster to build a codebook(Bag of word, that is some feature vectors can represent origin train data.) and save it
- use the Eculid distance between HOG feature and codebooks to encoder a new feature
- train a Linear SVM model and save it
- calculate the acc
The test steps are as follow:
- gamma transform and extract HOG features
- use the Eculid distance between HOG feature and codebooks to encoder a new feature
- SVM prediction
- calculate the acc
Download the dataset:
Link:https://pan.baidu.com/s/1Sa0AC9aERD36fpXGGYuI-w Code:u4zg
unzip the JPEG-e.7z
, and it should look something like this:
The first two folders are for the mixed type targets, the third and fourth folders are for the data of the T72 variant targets, and the last folder contains the T-72, BMP-2, BTR-70, SLICY targets. This repo focuses on the targets in the first two folders. According to the official recommendation, the images from the 17-degree imaging side view are used as the training set, and the images from the 15-degree imaging side view are used as the test set. It consists of 8 kinds of objectives, namely BTR_60, 2S1, BRDM_2, D7, SLICY, T62, ZIL131, ZSU_23_4.
For convenience, all targets of 17-degree imaging are stored in the train folder, and all targets of 15-degree imaging are stored in the test folder:
this repo relies on sklearn, opencv and numpy. you can run
pip install -r requirements.txt
to install.
then run train.py
directly or with some arguments:
python train.py
or
python train.py --data_root "D:/data/MSTAR" --cluster_num 64 --ratio 0.75
Same as train: just run
python test.py
or
python test.py --data_root "D:/data/MSTAR" --cluster_num 64 --ratio 0.75