diff --git a/Code/ObjectDetection/otbDescriptorsListSampleGenerator.txx b/Code/ObjectDetection/otbDescriptorsListSampleGenerator.txx
index 7291e710f9d45a2b71a8014259ac3005ace4b2a1..ad5ef24e5512e98296a458f3b40c50418e4e0735 100644
--- a/Code/ObjectDetection/otbDescriptorsListSampleGenerator.txx
+++ b/Code/ObjectDetection/otbDescriptorsListSampleGenerator.txx
@@ -318,7 +318,7 @@ PersistentDescriptorsListSampleGenerator<TInputImage,TVectorData,TFunctionType,T
         listSample->PushBack( sample );
 
         LabelMeasurementVectorType label;
-        label[0] = static_cast<LabelMeasurementType>(vectorDataIt.Get()->GetFieldAsString("Class")[0]);
+        label[0] = static_cast<LabelMeasurementType>(vectorDataIt.Get()->GetFieldAsInt("Class"));
         labelListSample->PushBack( label );
 
         samplesPosition.push_back(point);