Automatic security inspection relying on computer vision technology is a challenging task in real-world scenarios due to many factors, such as:
- intra-class variance,
- class imbalance,
- occlusion.
Most previous methods rarely touch the cases where the prohibited items are deliberately hidden in messy objects because of the scarcity of large-scale datasets, hindering their applications.
To address this issue and facilitate related research, was presented a large-scale dataset, named PIDray, which covers various cases in real-world scenarios for prohibited item detection.
This dataset has three degrees of difficulty: easy, hard, hidden.
Also, the authors of the article presented their approach for the detection and segmentation of these items.
You can find it in original repo.
According to the article, the author proposes the selective dense attention network (SDANet), formed by the dense attention module and the dependency refinement module.
This method has the following metrics:
For these case I`ve trained two detectors from ultralytics: new YoloV8 and pretty old YoloV5.
Both of them was trained on RTX 3090 for 300 epochs and batch size = 32.
To make the inference fast, I took a Small version of Yolo.
The detectors were compared after training.
YoloV8s inference
As we can see, YoloV8s shows the mAP result better than YoloV5s by 11%. That`s very cool.
Method | Easy mAP | Hard mAP | Hidden mAP | Overall mAP | Inference / ms (RTX 3090) |
---|---|---|---|---|---|
YoloV5s | 0.738 | 0.715 | 0.493 | 0.648 | ~6 ms/image |
YoloV8s | 0.818 | 0.78 | 0.589 | 0.729 | ~6 ms/image |
Moreover, light YoloV8s better than huge SDANet more than 15% (72.9 mAP vs 61.6 mAP)...
mAP difference between YoloV8s and YoloV5s by each class in hidden subset:
In my repository you can find everything you need to run YoloV8 on PIDray data.
The only thing you need is downloaded and converted from Coco-format to Yolo-format PIDray dataset. You can download it from original repo
Also, before start you need to install ultralytics:
pip install ultralytics
Now you can use pretrained YoloV8s weights from weights folder to predict or validate on PIDray data.
Check demo.ipynb for simple inference example using high-level ultralytics lib.
If you want more, check ultralytics YoloV8 docs.