Detection of Threat Objects in X-ray Inspections
This playbook demonstrates how to detect hammers, scissors, guns, and knives in pseudo-coloured X-ray baggage images for airport security. A detector identifies and localizes each object in the image, assigning it to the appropriate class. A single AI model handles all four classes within one inspection pipeline.
The dataset
The dataset contains 406 X-ray images with 1,045 target objects of four types: scissors, hammers, guns and knives. All target objects are annotated in LabelMe format; sample annotated images are shown below.
.jpg)
Load the annotated dataset
- Request access to ReliVision Learning Center and download the X-ray image set and its LabelMe annotation files.
- In ReliUI, import the image set with Import Data.
- Import the annotation file for each image folder with Import Annotated Dataset, choosing the LabelMe annotation format.
- Your annotated dataset is now available in the Gallery.
.jpg)
Train the object detection model
In ReliTrainer, train an AI block for X-ray object detection. The main steps are:
- Select Object Detection as the model type.
- Select your annotated X-ray dataset.
- Split the data into train and test sets, automatically or manually, to hold back some data for validation.
- Set the hyperparameters and start training.
Hyperparameters used in this use case
- Epochs: 40 (default)
- X-Y resolution: 704 (default)
- Learning rate: 0.0001 (default)
- Momentum: 0.937 (default)
- Weight decay: 0.0001 (default)
.jpg)
Build and run the pipeline
Use the pipeline editor to build the pipeline by dragging and dropping AI and basic blocks. For this use case you need an input data source and a detection AI block connected in series.
- Open the pipeline editor.
- Add an input data source and point it at your raw X-ray image set.
- Add the object detection AI block you trained and connect it after the input.
- Run the pipeline with the execute button at the top.
.jpg)
Review the results
Review the results in the ReliUI data annotation interface. The pipeline saves its outputs as a separate set of annotations for each image it runs on, so you can compare predictions against your labels image by image.
Gun and scissors
.jpg)
Knife and hammer
.jpg)
Related User Guide sections
- Import a raw dataset
- Import annotated data
- ROI annotation
- Training an AI block
- Create and edit a pipeline
Try it yourself
Download ReliVision to run this playbook on your own X-ray images, or browse the other use cases.
Download ReliVision