Giter VIP home page Giter VIP logo

traffic-sign-detection-with-retinanet's Introduction

Traffic-Sign-Detection-with-RetinaNet

Introduction

在这个项目里,我们实现了基于RetinaNet 的交通标志检测算法。该项目主要代码参考自:Simultaneous-Traffic-Sign-Detection-and-Classification-with-RetinaNet。我们对数据集和代码进行了部分更改,使其能够在pytorch1.0版本下正常运行,并实现了一个五类的交通标志检测任务。

Dataset

CVTS数据集

Computer Vision Traffic Sign,CVTS是计算机视觉课程上所有人手工标注得到的交通标志数据集。一共有警告、禁令、指示、道路、交通灯五大类别,每个大类别又包含若干个小类别,共77个小类别。其部分类别示例如下图所示:

数据清理:

CVTS数据集共包含2620张图片,但由于标注质量参差不齐,存在漏标、误标、检测框未对齐等多种情况,原始数据无法直接用以网络训练。因此,我们对CVTS数据集进行了清理,去除掉图片质量和标注质量较差的数据。经过清理之后,得到的数据集共有1250张,分别包含了754个红绿灯标志、623个禁令标志、345个指路标志以及244个警告标志。显然,清理后的数据集存在着不同类别上的数据量不平衡的问题。

数据增强:

为了确保网络在每个类别上的表现均衡,我们对清理后的数据集进行了数据增强,确保每个类别的图片量都在1000张以上。经过数据增强后,得到的数据集包含6333张图片,数据量大致确保了在小型网络上能够得到相对较好的结果。

Tsinghua_Tencent_100K数据集

Tsinghua_Tencent_100K是清华大学在2016年发布的交通标志数据集。该数据集是从1,000,000张腾讯街景图片中选取的300,000张交通标志图片构成。在去除掉出现次数少于100次的交通标志数据后,得到的数据集共有37212张图片,共包含指示标志、禁令标志、警告标志3个大类,其中又细分为42个小类。其交通标志示例下图所示。

类别转换:

为了将Tsinghua_Tencent_100K数据集应用到我们的五类交通标志检测任务中,我们对该数据集的类别进行了转换,将以i开头的类别转换为s(指示标志),以p开头的类别转换为z(禁令标志),以w开头的类别转换为j(警告标志)。

数据合并:

Tsinghua_Tencent_100K的交通标志数据具有很好的标注质量,能够有效得提高算法的检测准确度,因此我们从该数据集的三大类中随机采样1000张图片,和CVTS数据集合并起来,从而构成了我们最后实验中所使用的数据集:CVTS-TT100K

CVTS-TT100K数据集共包含9333张图片,包含了警告标志、禁令标志、指示标志、道路标志和交通灯五个类别。我们从CVTS-TT100K中随机采样1000张图片作为测试集,剩下的8333张图片作为训练集。

Model

Usage

利用预训练模型对 /samples 文件夹下的图片进行检测,并将检测结果输出在 /result 文件夹下:

python test.py -m demo

利用预训练模型测试在验证集上的表现,并在预测结果(json文件)输出到 /data 文件夹下:

python test.py -m valid

训练网络:

python train.py -exp model

evaluate 文件下有着许多实用代码:

  • crop_image:对数据集进行resize和增强操作;
  • eval_check.ipynb:测试模型在多个指标上的表现;
  • anno_process.ipynb:用于处理annotations各种函数;
  • data_process.ipynb:用于处理数据集的各种函数。

Performance

不同类别和不同边框大小下的accuracy和recall:

不同检测框范围下的 acc-recall 曲线:

ground truth 和预测的检测框大小分布直方图:

Demo

CVTS-TT100K的部分检测结果示例:

References

  • Zhu, Zhe, et al. "Traffic-sign detection and classification in the wild." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2016.
  • Li, Yuming, et al. "TAD16K: An enhanced benchmark for autonomous driving." Image Processing (ICIP), 2017 IEEE International Conference on. IEEE, 2017.
  • Lin, Tsung-Yi, et al. "Focal loss for dense object detection." IEEE transactions on pattern analysis and machine intelligence (2018).
  • Lin, Tsung-Yi, et al. "Feature Pyramid Networks for Object Detection." CVPR. Vol. 1. No. 2. 2017.
  • Long, Jonathan, Evan Shelhamer, and Trevor Darrell. "Fully convolutional networks for semantic segmentation." Proceedings of the IEEE conference on computer vision and pattern recognition. 2015.

traffic-sign-detection-with-retinanet's People

Contributors

chenshen03 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.