Cookie Consent by PrivacyPolicies.com
Quality Automation with AI and Relimetrics

Knowledge Hub

Explore & Learn ReliVision with Proven Use Cases

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.

Sample annotated X-ray baggage images with threat objects outlined.
Sample annotated X-ray baggage images.
Step 1 of 4 · Data curation

Load the annotated dataset

  1. Request access to ReliVision Learning Center and download the X-ray image set and its LabelMe annotation files.
  2. In ReliUI, import the image set with Import Data.
  3. Import the annotation file for each image folder with Import Annotated Dataset, choosing the LabelMe annotation format.
  4. Your annotated dataset is now available in the Gallery.
An X-ray image annotated with a gun (red contour) and scissors (pink contour).
A sample annotation: a gun (red contour) and scissors (pink contour).
Step 2 of 4 · Training

Train the object detection model

In ReliTrainer, train an AI block for X-ray object detection. The main steps are:

  1. Select Object Detection as the model type.
  2. Select your annotated X-ray dataset.
  3. Split the data into train and test sets, automatically or manually, to hold back some data for validation.
  4. 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)
Training and validation loss and IoU curves for the X-ray object detection model.
Training and validation loss and IoU curves as a function of epochs.
Step 3 of 4 · Pipeline

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.

  1. Open the pipeline editor.
  2. Add an input data source and point it at your raw X-ray image set.
  3. Add the object detection AI block you trained and connect it after the input.
  4. Run the pipeline with the execute button at the top.
Pipeline editor with an image input source connected to a detection AI block.
An input source connected in series to the detection AI block.
Step 4 of 4 · Results

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

Detection output on an X-ray image containing a gun and scissors.
Sample detection output: gun and scissors.

Knife and hammer

Detection output on an X-ray image containing a knife and a hammer.
Sample detection output: knife and hammer.

Related User Guide sections

Try it yourself

Download ReliVision to run this playbook on your own X-ray images, or browse the other use cases.

Download ReliVision
← All use cases