PIG-MENT

Computer vision that turns hours of video into behavioural metrics

Hours of video analysed in minutes: a tool to automatically measure and compare the behaviour of an animal model throughout its recovery, reducing the time spent on manual viewing.

PIG-MENT: behavioural metrics by block
Objective lenses of a laboratory microscope
Status
In production
Period
- present
Client
IGTP

At the CMCiB, a strategic project of the Germans Trias i Pujol Research Institute (IGTP), part of the assessment of animals in preclinical studies is based on video recordings. With PIG-MENT, developed by Mecexis together with the IGTP, each hour of video can be processed in approximately two minutes of computing time, yielding behavioural metrics for statistical analysis.

Biomedical research and the need to obtain objective measurements

A research centre and a methodological challenge

The IGTP is a public research centre located on the Can Ruti Campus in Badalona, associated with the Germans Trias i Pujol Hospital. It is a CERCA centre and is accredited as a centre of excellence by the Carlos III Health Institute (ISCIII). Its main objective is to increase scientific knowledge and transform it into solutions that help improve health and care for patients and society. One of its strategic projects is the Centre for Comparative Medicine and Bioimaging of Catalonia (CMCiB), a preclinical research and bioimaging infrastructure aimed at facilitating translational research and the development of new healthcare solutions. Its activities include biomedical research, the development and evaluation of medical devices and specialised training, promoting responsible research aligned with the principles of the 3Rs: replacement, reduction and refinement of the use of animals in research.

There, the Cellular and Molecular Neurobiology Research Group (CMN), led by Teresa Gasull, studies new approaches to stroke using porcine preclinical models: how the animals progress after an intervention and whether the treatments studied change that progression compared with the control group. Cameras were already recording each enclosure in the morning, afternoon and night. What was missing was a way to obtain objective, comparable measurements from those hours of video for statistical analysis.

PIG-MENT: recordings and occupancy maps

A manual observation process that is difficult to scale

Assessment was done by watching the recordings, and every animal, session and day of follow-up added more material to review

  • Each hour of recording required an equivalent amount of viewing time from a researcher.
  • Different observers could score the same recording differently.
  • Video detection usually relies on models trained on many hand-labelled videos and on graphics cards (GPUs).
  • Methods based solely on detecting the animal's movement had an important limitation: when it stays still, precisely when you need to measure how much it rests.
  • The recordings also posed various technical challenges: lenses that distort the image, objects passing in front of the animal and videos with no date information.

Computer vision to automate the processing of recordings while keeping the research team's scientific judgement

PIG-MENT combines computer vision, which extracts metrics from each video automatically, with a web application where the research team manages, reviews and compares the results.

  • Three metrics from each video

    How many turns the animal makes in each direction, where it spends its time within its enclosure, measured in real centimetres, and how long it stays at rest.

  • Reproducible, comparable metrics

    Automated processing reduces the variability of manual observation. Each video includes quality indicators and control figures for reviewing the results.

  • No graphics cards

    The algorithm runs on a standard CPU, with no GPU, and there was no need to train a model on large sets of hand-labelled videos. It also makes it easier to detect the animal during periods of immobility.

  • Each video is processed only once

    Reading the video, the most costly part, is done once. Recalculating a metric or correcting the scale afterwards takes seconds, and the data obtained make it possible to reproduce the analyses.

  • Comparing groups

    The web application shows how each animal evolves from the intervention and calculates indicators of change between groups, to support the analysis of the treatment effect. Interpretation is up to the research team.

  • Data ready for statistics

    Each export includes all the tables, in Excel, CSV or Parquet, with a document defining every column and every metric. The platform can also hide the treatment group during certain phases of the analysis, when the study design requires it.

First prove that it was possible, then build the tool

A prototype to decide, a platform to work with

The project began with a question: can part of this analysis be automated? The first phase was a prototype built on the IGTP's real recordings, to decide with data whether the project was viable. The results were checked against observation of the recordings, for example the count of turns or the difference between periods of higher and lower activity.

With viability confirmed, the second phase turned the prototype into a working tool that the team began using in beta. The third built on the experience of that period of use, added comparison between groups and took the platform into production. Each phase was delivered and validated before the next began, so development adapted to the needs identified together with the research team.

PIG-MENT: configuring zones in the enclosure

Less time spent on manual viewing and standardised collection of metrics

More of the research team's time for analysing and interpreting the results

  • 1 h → 2 min

    Of processing per hour of video, with no GPU

  • 3

    Behavioural metrics per video, obtained automatically

  • 100%

    Of analysed frames with the animal located, in the sample used to validate the system

Ready to measure more

New metrics without rewriting the existing ones

Each metric is an independent component, so new ones can be added without necessarily modifying the existing ones. Possible lines of future development include greater automation of how recordings are captured and managed and adapting the system to other facilities or experimental set-ups. Camera-specific calibrations make it easier to explore its possible use in other environments.

PIG-MENT: comparison between treatment groups

How PIG-MENT works

What the platform measures, what equipment it needs and what role the research team plays.

Computer vision in the service of research

A computer vision platform, developed with the IGTP, that analyses videos from preclinical studies and automatically extracts metrics on the animals' behaviour, reducing the time spent on manual viewing.

The turns the animal makes in each direction, where it spends its time within its enclosure, in real centimetres, and how long it stays at rest.

No. The algorithm runs on a standard CPU, with no graphics cards (GPUs).

No. The platform automates the repetitive processing and presents the data, but decisions that require scientific judgement, such as validating each camera's geometry or interpreting the results, remain in the team's hands.

Yes. If your team spends hours reviewing recordings, we start with a prototype built on your own videos to see what can be measured automatically.