Representation Based Regression for Object Distance Estimation
=============================
This repository includes the implentation of the methods in [Representation Based Regression for Object Distance Estimation](https://www.sciencedirect.com/science/article/pii/S089360802200452X).
![Example Results](/images/samples.png)
Software environment:
```
conda create -n distance
conda activate distance
conda install anaconda::tensorflow-gpu
pip install opencv-contrib-python
pip install pandas==1.0.4
pip install tqdm==4.46.1
pip install scikit-learn==0.24.1
```
```
1. Python with the following version and libraries.
python == 3.7.7
tensorflow == 2.1.0
Numpy == 1.18.5
Matplotlib == 3.2.2
SciPy == 1.5.0
scikit-learn == 0.24.1
argparse == 1.1
OpenCV == 4.2.0
pandas == 1.0.4
tqdm == 4.46.1
```
```
2. MATLAB -> MATLAB R2019a.
```
## Demo** (New)
We have now included a demo using pretrained weights of ```CL-CSEN``` and ```CL-CSEN-1D``` methods. First, you need to download KITTI Dataset, refer to [Getting started with the KITTI Dataset](#Getting-started-with-the-KITTI-Dataset), then the demo can be run as follows,
```
cd demo/
python demo.py --method CL-CSEN
```
Press any key to proceed with the next object in the opened window or press ```q``` to exit. You can also change the method to ```--method CL-CSEN-1D```. Additionally, the feature extraction method can be changed by setting ```--feature_type``` to ```DenseNet121```, ```VGG19```, or ```ResNet50``` (DenseNet-121 [1], VGG19 [2], ResNet-50 [3]). For example,
```
python demo.py --method CL-CSEN --feature_type ResNet50
```
## Content:
- [Citation](#Citation)
- [Getting started with the KITTI Dataset](#Getting-started-with-the-KITTI-Dataset)
- [Feature Extraction](#Feature-Extraction)
- [Distance Estimation via Representation-based Classification](#Distance-Estimation-via-Representation-based-Classification)
- [Sparse Representation-based Classification (SRC)](#Sparse-Representation-based-Classification-SRC)
- [Collaborative Representation-based Classification (CRC)](#Collaborative-Representation-based-Classification-CRC)
- [Distance Estimation using Representation-based Regression (RbR)](#Distance-Estimation-using-Representation-based-Regression-RbR)
- [Convolutional Support Estimator Network (CSEN)](#Convolutional-Support-Estimator-Network-CSEN)
- [Compressive Learning CSEN (CL-CSEN)](#Compressive-Learning-CSEN-CL-CSEN)
- [Distance Estimation using Support Vector Regressor (SVR)](#Distance-Estimation-using-Support-Vector-Regressor-SVR)
- [References](#References)
## Citation
If you use method(s) provided in this repository, please cite the following paper:
```
@article{Ahishali,
title = {Representation based regression for object distance estimation},
journal = {Neural Networks},
volume = {158},
pages = {15-29},
year = {2023},
issn = {0893-6080},
doi = {https://doi.org/10.1016/j.neunet.2022.11.011},
author = {Mete Ahishali and Mehmet Yamac and Serkan Kiranyaz and Moncef Gabbouj}
}
```
## Getting started with the KITTI Dataset
The left color images of object dataset and the corresponding training labels can be obtained from [3D Object Detection Evaluation 2017](http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark=3d).
```
unzip data_object_image_2.zip
unzip data_object_label_2.zip
```
After unzipping, move them under ```kitti-data/``` folder and using ```generate-csv.py``` script generate a csv file for the KITTI annotations:
```
python kitti-data/generate-csv.py \
--input=kitti-data/training/label_2/ \
--output=kitti-data/annotations.csv
```
## Feature Extraction
Features are extracted using ```feature_extraction.py``` script. The supported models are ```DenseNet121```, ```VGG19```, and ```ResNet50``` (DenseNet-121 [1], VGG19 [2], ResNet-50 [3]):
```
python feature_extraction.py --model VGG19
```
Next, the features are further processed and ordered using ```processFeatures.m```. In the script, please also set the proper model name ```param.modelName``` to either ```DenseNet121```, ```VGG19```, or ```ResNet50``` and ```param.DicDesign``` to ```2D``` or ```1D``` corresponding to the dictionary designs used in CSEN and CL-CSEN approaches. This procedure is only needed for the CSEN, CL-CSEN, and SVR approaches. If you are only interested in running SRC and CRC methods, you may proceed to the related sections: [SRC](#Sparse-Representation-based-Classification-SRC) and [CRC](#Collaborative-Representation-based-Classification-CRC). Note that the script of ```processFeatures.m``` produces the predicted distances using the CRC-light model that is discussed in the paper.
## Distance Estimation via Representation-based Classification
We formulate the distance estimation task as a representation-based classification problem by estimating the quantized distance values. For example, for the objects between [0.5, 60.5] meters away from the camera, we estimate a quantized distance level from 60 different distance levels ranging between [1, 60] with 1-meter senstivity.
### Sparse Representation-based Classification (SRC)
There are implemented 8 different SRC algorithms for the distance estimation task including ADMM [4], Dalm [5], OMP [5], Homotopy [6], GPSR [7], L1LS [8], ℓ1-magic [9], and Palm [5]. You may run all of them in once as follows:
```
cd src/
run main.m
```
Alternatively or preferably (e.g., you may choose a specific SRC method since the required run-time is huge for running all SRC methods in once), the selected ones can be defined in the script:
```
l1method={'solve_ADMM','solve_dalm','solve_OMP','solve_homotopy','solveGPSR_BCm', 'solve_L1LS','solve_l1magic','solve_PALM'}; %'solve_PALM' is very slow
```
Similarly, please also set the proper model name ```param.modelName``` to either ```DenseNet121```, ```VGG19```, or ```ResNet50```.
### Collaborative Representation-based Classification (CRC)
Distance estimation using the CRC method [10] can be run as follows:
```
cd crc\
run main.m
```
The CRC-light model can be run by setting ```CRC_light = 1``` in the script. Please change the model name ```param.modelName``` to ```DenseNet121```, ```VGG19```, or ```ResNet50``` to try different features.
## Distance Estimation using Representation-based Regression (RbR)
![CSEN](/images/csen_updated.png)
Contrary to previous methos, it is possible to directly estimate the object distance information without the quantization step using CSEN and CL-CSEN approaches. As CSEN and CL-CSEN approaches still utilize the representative dictionary, we introduce the term <em>Representation-based Regression (RbR)</em> for the proposed framework.
### Convolutional Support Estimator Network (CSEN)
The CSEN implementation is run as follows:
```
python regressor_main.py --method CSEN --feature_type DenseNet121
```
Note that similarly, the feature type can be set to ```DenseNet121```, ```VGG19```, or ```ResNet50```. If you like, only testing can be performed using the provided weights:
```
python regressor_main.py --method CSEN --feature_type DenseNet121 --weights True
```
### Compressive Learning CSEN (CL-CSEN)
The CL-CSEN implementation is run as follows:
```
python regressor_main.py --method CL-CSEN --feature_type DenseNet121
```
The parameter ```--feature_type``` can be set to ```DenseNet121```, ```VGG19```, or ```ResNet50```.
Testing of CL-CSEN with the provided weights:
```
python regressor_main.py --method CL-CSEN --feature_type DenseNet121 --weights True
```
## Distance Estimation using Support Vector Regressor (SVR)
The SVR method is implemented as a competing regressor. We use the Nystroem method for the kernel approximation since it is unfeasible to compute exact kernel mapping with the given high-dimensional dataset. Hyperparameter search is applied with grid search and then the performance is computed with the found optimal SVR parameters:
```
python regressor_main.py --method SVR --feature_type DenseNet121
```
The parameter ```--feature_type``` can be set
没有合适的资源?快使用搜索试试~ 我知道了~
基于表示的回归算法在目标距离估计中的应用matlab代码.zip
共28个文件
py:13个
pkl:6个
m:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 19 浏览量
2024-02-19
00:25:15
上传
评论
收藏 3.98MB ZIP 举报
温馨提示
1.版本:matlab2014/2019a/2021a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
资源推荐
资源详情
资源评论
收起资源包目录
基于表示的回归算法在目标距离估计中的应用matlab代码.zip (28个子文件)
基于表示的回归算法在目标距离估计中的应用matlab代码
CSENDistance-master
demo
ResNet50_1D_scaler.pkl 25KB
DenseNet121_1D_scaler.pkl 13KB
ResNet50_scaler.pkl 25KB
model.py 2KB
VGG19_scaler.pkl 7KB
DenseNet121_scaler.pkl 13KB
phi_1D_DenseNet121.mat 3.86MB
__pycache__
model.cpython-311.pyc 2KB
model.cpython-37.pyc 1KB
demo.py 5KB
VGG19_1D_scaler.pkl 7KB
cl_csen_1d_regressor
model.py 3KB
csen_regressor
utils.py 2KB
model.py 3KB
crc
Eigen_f.m 1KB
main.m 6KB
CRC_RLS.m 408B
prepareCSEN.m 2KB
split_data.m 3KB
competing_regressor
utils.py 1KB
svr.py 7KB
csen_1d_regressor
utils.py 2KB
model.py 3KB
cl_csen_regressor
utils.py 1KB
model.py 3KB
README.md 10KB
cl_csen_1d_regressor
utils.py 1KB
model.py 3KB
共 28 条
- 1
资源评论
matlab科研助手
- 粉丝: 1w+
- 资源: 2054
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功