Custom Segmentation Loss Design

Job ID: 40397962

Budget: $30 – $250 USD

I am building a vision pipeline around a transformer-based architecture trained on a large set of general object images. The next milestone is to craft bespoke loss functions focused on pixel-accurate segmentation, going beyond the typical Dice or Cross-Entropy formulations to capture fine-grained boundaries and class imbalance issues present in my data.

Here is what I need from you:

• One or more well-documented PyTorch (or JAX if you prefer) loss modules tailored for segmentation with transformers.
• A short test script that plugs the loss into a dummy forward pass so I can confirm gradients flow and the function is numerically stable.
• Guidance on hyper-parameters and any recommended preprocessing tweaks that let the loss shine.

If you have ideas for optionally extending the same design to classification in the future, feel free to outline them, but the immediate deliverable is the segmentation-centric loss and its validation code.

Clean, readable code, inline comments, and a brief markdown explaining the math behind your approach will be the acceptance criteria.