road-anomaly-detection

Software for registering anomaly situations on roads

https://github.com/lddl/road-anomaly-detection

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary

Keywords

anomaly-detection computer-vision multi-object-tracking object-detection opencv road-accidents yolov7 yolov8
Last synced: 6 months ago · JSON representation ·

Repository

Software for registering anomaly situations on roads

Basic Info
  • Host: GitHub
  • Owner: LdDl
  • License: mit
  • Language: Rust
  • Default Branch: master
  • Homepage:
  • Size: 882 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
anomaly-detection computer-vision multi-object-tracking object-detection opencv road-accidents yolov7 yolov8
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Yet another toy utility for registering anomaly situations on roads

In W.I.P. stage

Table of Contents

Video showcase

@w.i.p.

About

This project is aimed to register road traffic accidents, foreign object and other anomaly situations on roads. It is pretty simple and uses just YOLO (both traditional and Ultralytics version could be used). Some advanced techniques like 3D-CNN, LSTM's and others could be used, but I do not have that much time so PR's are very welcome.

I do have also utility for monitoring road traffic flow parameters here

How does it work?

Diagram could speak more than a thousand words. I'm not digging into the Background Subtraction / Object Detection or MOT (Multi-object tracking) topic since it is not a main target of this project.

Diagram is prepared via https://app.diagrams.net/. Source is here.

Screenshots

imshow() output:

Subscribe channel on the server:

Wait until event has come:

Installation and usage

Important notice: it has been tested on Ubuntu 22.04.3 LTS only!

It is needed to compile it via Rust programming language compiler (here is docs: https://www.rust-lang.org/learn/get-started) currently. If further I'll make a Dockerfile for CPU atleast and may be for GPU/CUDA.

Compilation from source code: shell git clone https://github.com/LdDl/road-anomaly-detection cd road-anomaly-detection cargo build --release

Prepare neural network for detecting anomaly events.

Prepare configuration file. Example could be found here - data/conf.toml. In my example I use YOLOv8 trained on just two classes: "moderateaccident", "severeaccident".

Run: export ROAD_ANOMALY_CONFIG=$(pwd)/data/conf.toml ./target/release/road-anomaly-detector $ROAD_ANOMALY_CONFIG

When events published into to the reciever server than you can expect following JSON structure: json { "id": "Event identifier represented as UUID v4", "event_registered_at": UTC UnixTimestamp when event has been registered, "event_image": "base64 representation of an image", "object_id": "Detection identifier. Most of time would be represented as UUID v4", "object_registered_at": UTC UnixTimestamp when detection has been registered, "object_lifetime": Number of second while the detection was considered "relevant", "object_bbox": { "x": X-coordinate of the left top of the detection, "y": Y-coordinate of the left top of the detection, "width": Width of the corresponding detection bounding box, "height": Height of the corresponding detection bounding box }, "object_poi": { "x": X-coordinate of the center of the detection bounding box, "y": Y-coordinate of the center of the detection bounding box }, "object_classname": "Label for the class", "object_confidence": Confidence that detection is classified as corresponding class label, "zone_id": "Unique identifier for zone of interests", "equipment_id": "Optional application name (could be considered as equipment identifier for embedded devices)" }

Future works

  • Make REST API to extract and to mutate configuration;
  • Make MJPEG export;
  • Make publishing to custom REST API via POST request;
  • Prepare some pre-trained neural networks;

References

  • MOG2 - https://docs.opencv.org/4.x/d1/dc5/tutorialbackgroundsubtraction.html
  • MOT (Multi-object tracking) in Rust programming language - https://github.com/LdDl/mot-rs
  • OpenCV's bindings - https://github.com/twistedfall/opencv-rust
  • Object detection in Rust programming language via YOLO - https://github.com/LdDl/object-detection-opencv-rust
  • YOLO v3 paper - https://arxiv.org/abs/1804.02767, Joseph Redmon, Ali Farhadi
  • YOLO v4 paper - https://arxiv.org/abs/2004.10934, Alexey Bochkovskiy, Chien-Yao Wang, Hong-Yuan Mark Liao
  • YOLO v7 paper - https://arxiv.org/abs/2207.02696, Chien-Yao Wang, Alexey Bochkovskiy, Hong-Yuan Mark Liao
  • Original Darknet YOLO repository - https://github.com/pjreddie/darknet
  • Most popular fork of Darknet YOLO - https://github.com/AlexeyAB/darknet
  • Developers of YOLOv8 - https://github.com/ultralytics/ultralytics. If you are aware of some original papers for YOLOv8 architecture, please contact me to mention it in this README.

Video example has been taken from here

Please cite this repository if you are using it

Support

If you have troubles or questions please open an issue.

Owner

  • Name: Dimitrii Lopanov
  • Login: LdDl
  • Kind: user
  • Location: New Zealand

Golang dev (computer vision / telemetry) Mail: sexykdi@gmail.com Telegram: https://t.me/sexyk

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Lopanov
    given-names: Dmitrii
    orcid: https://orcid.org/my-orcid?orcid=0009-0007-9734-6970
title: "Road anomaly detection via computer vision and neural networks"
version: 2.0.4
identifiers:
  - description: "This is the collection of archived snapshots of all versions of Road anomaly detection via computer vision and neural networks"
    type: doi
    value: 10.5281/zenodo.123456
date-released: 2024-06-24

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

Cargo.lock cargo
  • 108 dependencies
Cargo.toml cargo