Summary

Syringe exchange programs, such as Kentucky Outreach Service Kiosk (KyOSK) at the University of Kentucky’s College of Public Health, aim to reduce the spread of disease among people who use intravenous drugs by facilitating one-for-one syringe exchanges through a vending machine interface. The original system relied solely on weight measurements, which could be manipulated by adding foreign objects. Additionally, the recommended practice of placing used syringes in containers (e.g., plastic bottles) often distorted weight-based readings.

To address these limitations, we are developing a computer vision–based system using downstream analysis on DINOv2 embeddings to detect and classify foreign objects and accurately count syringes. First, the system classifies the contents, identifying deposits containing only syringes, those with foreign objects, or those in an approved container. Second, whenever foreign objects are detected, it performs a direct visual count of the syringes, providing an accurate total that is independent of weight. This dual approach ensures the system remains accurate even when containers or extraneous materials are present.

Datasets/Models

Our initial dataset contains 114 images of materials deposited into the kiosk. Each image is annotated with metadata, including the precise syringe count, the type of container used (if any), and the presence of foreign objects. The dataset was partitioned into a 70% training set and a 30% testing set. To expand the training data, we applied data augmentation techniques—specifically rotation and random cropping—to generate three additional variations of each training image.

The first step of our method involves extracting features from each image using a pre-trained DINOv2-base. The resulting embeddings are then processed with Principal Component Analysis (PCA) to reduce their dimensionality, improving performance for training the downstream models:

  • Support Vector Machine (SVM): An SVM was trained for content classification. Its objective is to categorize each deposit into one of three primary classes: syringes only, syringes within a container, or foreign objects present.
  • Multilayer Perceptron (MLP): A simple MLP, acting as a regression head, was trained on the reduced embeddings to estimate the number of syringes in a deposit.

Preliminary results, while based on a limited dataset, are promising. The SVM classifier achieved 93% accuracy in distinguishing between the primary content classes. The MLP regression model achieved a Mean Absolute Error (MAE) of 1.3 when counting syringes, a strong result considering some deposits contain as many as 17 syringes. Further data collection is necessary to fully validate our approach and to implement classification of specific container types.

Access

This dataset is currently protected.

Ownership

This project is currently ongoing with plans to submit as a poster to the 2026 AMIA Symposium.

Resources Utilized

Developers Evan Damron and Sam Armstrong have worked on this project.

20% of Sam’s FTE for the life of the Supplement (1 year)

20% of Evan’s FTE for the life of the Supplement (1 year)

Categories:

Tags: