cogsys-tuebingen / deephs_fruit

Measuring the ripeness of fruit with Hyperspectral Imaging and Deep Learning
40 stars 11 forks source link

overfitting the model #10

Closed fragkrag closed 8 months ago

fragkrag commented 9 months ago

Hi,

Running the code on avocado/mango datasets, and I've gotten the code to run and train. However, I've been running into some issues that I believe are overfitting. I've tried both the deephs_fruit and hyve flags, training a minimum of 50 and 100 epochs with multiple seeds, and while I'm getting a relatively high training/validation accuracy ( ~ 80-90%), the test accuracy is also quite low (~25%).

I believe the only change that I have made is using "gloo" instead of "nccl" as ddps strategy. The line I've inserted is:

`ddps = DDPStrategy(process_group_backend="gloo")

trainer = lightning.Trainer(max_epochs=opt.num_epochs, ... `

around line 388 or so in train.py

Is there a pretrained model that can be shared?

leonvarga commented 9 months ago

Hi,

sorry for the late reply. I am no longer employed by the chair, so I do not have access to the data anymore.

In my last work, we pretrained a couple of models and also shared the weights: https://github.com/cogsys-tuebingen/hsi_benchmark

For the avocados, you should also get a test accuracy of over 80%. For the mangos, it is more unstable.

Depending on how the backend is handling the different weights, this can affect the training procedure and the impact of parameters like batch_size and co.

Sorry, for this not really helpful response :-D.

Best regards, Leon