﻿# SemanticKITTI labels: decode instance bits before treating values as classes

Decode packed SemanticKITTI point labels and retain the distinction between semantic IDs, instance identity and compact training vocabulary.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-semantickitti-packed-label-instance-bits-not-class-id/
Language: en

## Inspect the stored label before allocating a classifier

A loader reads a SemanticKITTI label file and sees integer values far outside the expected semantic vocabulary. Increasing the classifier width until those values fit does not fix the interpretation. The stored point label combines semantic and instance information. Decode the representation before deriving a vocabulary or measuring class frequencies. Otherwise, distinct objects from the same category can appear to be unrelated classes merely because their packed instance fields differ.

## Preserve the point-label correspondence

The [SemanticKITTI API documentation](https://raw.githubusercontent.com/PRBonn/semantic-kitti-api/master/README.md) describes a label associated with each point of the corresponding scan. Preserve that ordering through filtering and subsampling. A correctly decoded label array can still become wrong if points are shuffled independently. Keep any selection indices and apply them consistently to geometry, remission and annotations rather than attempting to reconstruct correspondence from coordinates that may repeat or have been altered by preprocessing.

## Decode both semantic and instance fields

The [author scan loader](https://raw.githubusercontent.com/PRBonn/semantic-kitti-api/master/auxiliary/laserscan.py) separates the packed label into semantic and instance components using bit operations. Retain the original packed representation when an export or instance-aware task needs it. A cast that happens to retain only the semantic portion is not a reversible decoding method for the full annotation. Conversely, passing the entire packed value to a semantic loss changes the target space without adding a meaningful new semantic category.

## Apply the training vocabulary as a separate mapping

The [official configuration](https://raw.githubusercontent.com/PRBonn/semantic-kitti-api/master/config/semantic-kitti.yaml) defines mappings between original labels and the learning vocabulary. Treat this as a separate stage after packed-field decoding. A compact training index does not automatically equal the original category identifier, and its inverse mapping needs to match the chosen configuration. Preserve ignored-label policy alongside that mapping, especially when a pipeline combines categories or returns predictions to the benchmark’s expected representation.

## Verify semantic and instance round trips independently

Select a scan with multiple objects from a shared category and check that semantic decoding groups the category while instance decoding retains the intended distinctions. Then test the learning-map conversion and prediction export separately. [Entity-aware splitting](/journal/data-guide-entity-group-split-design/) supports sequence grouping; [software reproducibility](/journal/software-stack-reproducibility/) preserves the decoding configuration. Report the annotation representation explicitly, making class learning, instance identity and binary storage distinct contracts rather than interchangeable interpretations of the same integer array.
