Hailo 8: YOLOv8n HEF export succeeds, but accuracy drops significantly after conversion. Looking for help debugging the conversion pipeline.
Hello everyone,
I am working on an ANPR project using a Raspberry Pi 5 with a Hailo 8 accelerator. One part of the pipeline involves detecting vehicles using a custom trained YOLOv8n model.
I have been able to successfully export the model to HEF using the Ultralytics and Hailo conversion workflow. The compilation completes successfully, but I am facing a significant and inconsistent drop in detection accuracy after conversion.
In our recent Hailo export and validation experiments, mAP@0.50 has been around 0.29, with mAP@0.50:0.95 around 0.19. This is substantially lower than expected.
I have tried full calibration, changed export confidence thresholds, and repeated the export with the same model weights, but have not been able to resolve the issue.
I would appreciate guidance from anyone who has worked with custom YOLO models and Hailo 8.
1. Model details
Model: Ultralytics YOLOv8n
Task: Object detection
Classes:
-
Car
-
Bus
-
Bike
-
Truck
-
Auto
The original PyTorch model reported approximately 0.85 mAP@0.50 on its native validation setup.
The checkpoint used for the conversion was best.pt.
We also verified that the checkpoint copied for the first full calibration export was byte identical to best.pt using SHA256.
SHA256:
03a4f6909b48df812587d750954a7fbe2d022a9a0304f67e86f50b9496cd981d
2. Hailo conversion environment
Hailo Dataflow Compiler: 3.33.0
Target architecture: Hailo 8
Conversion framework: Ultralytics YOLO export workflow with Hailo support
Input resolution: 640 × 640
Number of classes: 5
The HEF files were generated on the IIT Delhi HPC environment. The resulting HEFs are intended to run on a Raspberry Pi 5 with a Hailo 8 accelerator.
3. Calibration dataset
We prepared a dedicated calibration dataset containing 3,963 images.
The calibration images are stored in:
/scratch/design/phd/ddz248303/hailo_conversion/mix_calib_png
The calibration YAML specifies the following class mapping:
names:
0: car
1: bus
2: bike
3: truck
4: auto
We used:
-
Image size: 640 × 640
-
Calibration fraction: 1.0
-
Calibration images: 3,963
-
Full calibration dataset
The calibration dataset was successfully loaded during the export process.
4. Conversion experiments
We have performed two recent full calibration exports using the same underlying trained model checkpoint.
Experiment 1: Full calibration export v1
Export settings:
model.export(
format="hailo",
imgsz=640,
conf=0.2,
iou=0.7,
data="hailo_calib.yaml",
fraction=1.0,
device="cpu"
)
The export completed successfully.
Generated HEF:
hpc_export_4sep_ultralytics_fullcal_v1.hef
HEF size: 4,501,744 bytes
The log reported successful mapping and successful compilation.
Experiment 2: Full calibration export v2
We repeated the export with a lower confidence threshold to investigate whether the confidence setting was affecting the resulting detections.
Changed settings:
conf=0.001
iou=0.7
imgsz=640
fraction=1.0
The rest of the model and calibration setup remained the same.
Generated HEF:
hpc_export_4sep_ultralytics_conf001_v2.hef
HEF size: 4,500,762 bytes
The export log reported:
Successful Mapping
Successful Compilation
FULL CALIBRATION EXPORT PASSED
Export complete
Both exports generated their corresponding metadata.yaml and nms_config.json files.
However, successful compilation has not translated into the accuracy we expect.
5. Evaluation results from earlier HEF experiments
We also have an earlier evaluation workbook containing results for four HEF models.
Evaluation information recorded in that workbook:
-
Images evaluated: 5,000
-
Ground truth objects: 59,311
-
Input resolution: 640 × 640
-
Confidence threshold: 0.2
-
Classes: Car, Bus, Bike, Truck, Auto
The results are as follows:
| HEF | Precision | Recall | F1 | mAP50 | mAP50:95 | FPS |
|---|---|---|---|---|---|---|
| hpc.hef | 0.7602 | 0.7037 | 0.7309 | 0.6792 | 0.4987 | 192.64 |
| undefined | ---- | ---- | ---- | ---- | ---- | ---- |
| bes.hef | 0.8089 | 0.6469 | 0.7189 | 0.6288 | 0.4556 | 118.15 |
| undefined | ---- | ---- | ---- | ---- | ---- | ---- |
| best_2.hef | 0.7472 | 0.7032 | 0.7246 | 0.6774 | 0.4935 | 118.22 |
| undefined | ---- | ---- | ---- | ---- | ---- | ---- |
| net_7july_v1.hef | 0.7628 | 0.6988 | 0.7294 | 0.6759 | 0.4985 | 192.05 |
| undefined | ---- | ---- | ---- | ---- | ---- | ---- |
The older hpc.hef achieved an mAP@0.50 of approximately 0.679.
The latest Ultralytics based conversion and validation experiments, however, have produced results around 0.29 mAP@0.50.
This is a major discrepancy.
One important caveat: these results may come from different evaluation scripts, preprocessing implementations, or export configurations. We have not yet established that all these figures are directly comparable. We want to understand and eliminate those differences before drawing conclusions.
6. What we have tried so far
-
Repeated the conversion using the same trained PyTorch checkpoint.
-
Used the complete calibration dataset rather than a subset.
-
Verified that the first export checkpoint was identical to the original
best.pt. -
Changed the export confidence threshold from 0.2 to 0.001.
-
Kept the input resolution at 640 × 640.
-
Kept the IoU threshold at 0.7.
-
Verified that Hailo mapping and compilation complete successfully.
-
Generated and retained the HEF metadata and NMS configuration files for both exports.
At this stage, the problem does not appear to be a straightforward compilation failure. The main concern is the accuracy of the generated model and whether the conversion or postprocessing pipeline is behaving as expected.
7. What we need help with
I would particularly appreciate guidance on the following:
A. Recommended conversion workflow
For a custom trained Ultralytics YOLOv8n model, what is the currently recommended conversion workflow for Hailo 8 with DFC 3.33.0?
Would you recommend the integrated Ultralytics Hailo export workflow, or manually converting through ONNX, HAR parsing, optimization, and HEF compilation?
B. Calibration
Are 3,963 representative calibration images sufficient for this model?
Are there specific requirements for image normalization, RGB versus BGR ordering, letterboxing, and calibration image preprocessing that are particularly important for YOLOv8?
How can we verify that the calibration images are being interpreted in exactly the same way as the original training pipeline?
C. NMS and confidence thresholds
Can changing the conf argument during export affect the actual NMS configuration embedded in the HEF?
What is the recommended way to verify that the NMS configuration and the postprocessing implementation used during evaluation are consistent with the model’s expected outputs?
D. Debugging accuracy degradation
What is the recommended procedure to compare:
-
Original PyTorch model
-
Exported ONNX model
-
Parsed HAR
-
Optimized HAR
-
Final HEF
We would like to identify exactly at which stage the accuracy drops.
Are there recommended Hailo tools or diagnostics for examining quantization errors, activation distributions, and layerwise accuracy degradation?
E. Evaluation methodology
Are there any known differences between Ultralytics validation and Hailo HEF evaluation that could explain a significant difference in mAP?
What is the recommended way to perform a fair comparison using identical input images, preprocessing, confidence thresholds, IoU thresholds, and matching criteria?
8. What would help us most
Our immediate objective is to identify why a model that performs reasonably well in PyTorch produces significantly lower accuracy after conversion to HEF.
We are happy to share relevant export logs, calibration configuration, metadata, NMS configuration, and evaluation results for further investigation.
Any suggestions regarding the recommended conversion procedure, calibration configuration, or debugging methodology would be greatly appreciated.
Thank you!