r/computervision • u/SnappySkillz • 1h ago
Help: Theory CNN Generalisability Problems
Hi everyone!
So, I'm having a bit of difficulty with CNN generalisability.
My problem is that, given a camera image, we need to predict object pose e.g., rotation
A week ago, I was using a synthetic dataset. Using (unforseen) synthetic data, I get very low error. Using real data, however, it is a disaster. I though this might be a domain gap from sim-to-real.
So, I did some more data retrieval and now I have 2 distinct video feeds, so 2 real datasets. However, if I train on one, inference on the other is terrible. So, it is not sim-to-real, but a generalisation problem in general.
I do have a pre-processing, which I won't detail, but if you look at the image above what the CNN sees is quite similar to my scenario (just imagine they sre 64x64x3 images). Imagine really low errors on the left lamp (same training environment) and high on the right lamp (different camera/perspective etc).
Basically, one camera has a different FOV/lens/resolution, and the images might also have varying sizes (e.g. a lamp in one camera might be "chunkier" due to lens characteristics).
In teems of solutions, I have read that it is very healthy to augment your training data, especially for computer vision. This could be blur/brightness/contrast etc., that you can do natively in PyTorch.
Would this be a profitable direction? What are good steps to take to try to debug this? What are the standard practices in these situations? What are the features my CNN is learning that are so specific to one dataset?
I should mention, my CNN is almost certainly not the problem. I have another pipeline that uses a VAE, inspired from a paper that achieves very high accuracy not only for generalisability, but even for sim-to-real. This current architecture fails for my data.
Thanks for any response!