From a7340d378909cadbfd72dbd1f5b756f907c2a3e0 Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 13 Feb 2026 17:46:09 +0100 Subject: CNN v2 training: Add --grayscale-loss option for luminance-based loss computation Add option to compute loss on grayscale (Y = 0.299*R + 0.587*G + 0.114*B) instead of full RGBA channels. Useful for training models that prioritize luminance accuracy over color accuracy. Changes: - training/train_cnn_v2.py: Add --grayscale-loss flag and grayscale conversion in loss computation - scripts/train_cnn_v2_full.sh: Add --grayscale-loss parameter support - doc/CNN_V2.md: Document grayscale loss in training configuration and checkpoint format - doc/HOWTO.md: Add usage examples for --grayscale-loss flag Co-Authored-By: Claude Sonnet 4.5 --- doc/HOWTO.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/HOWTO.md') diff --git a/doc/HOWTO.md b/doc/HOWTO.md index 2290aa8..1e8b58b 100644 --- a/doc/HOWTO.md +++ b/doc/HOWTO.md @@ -145,6 +145,9 @@ Enhanced CNN with parametric static features (7D input: RGBD + UV + sin encoding # Custom architecture ./scripts/train_cnn_v2_full.sh --kernel-sizes 3,5,3 --num-layers 3 --mip-level 1 +# Grayscale loss (compute loss on luminance instead of RGBA) +./scripts/train_cnn_v2_full.sh --grayscale-loss + # Custom directories ./scripts/train_cnn_v2_full.sh --input training/input --target training/target_2 @@ -188,6 +191,12 @@ Enhanced CNN with parametric static features (7D input: RGBD + UV + sin encoding --input training/input/ --target training/target_2/ \ --mip-level 1 \ --epochs 100 --batch-size 16 + +# Grayscale loss (compute loss on luminance Y = 0.299*R + 0.587*G + 0.114*B) +./training/train_cnn_v2.py \ + --input training/input/ --target training/target_2/ \ + --grayscale-loss \ + --epochs 100 --batch-size 16 ``` **Export Binary Weights:** -- cgit v1.2.3