How do I decide on the final model when using cross validation?

I’m trying to build a multi classification model which is selecting an one out of 20 categories. But the problem is that I have very few data. So I am going to use the Cross Validation method and I made 5 models by dividing whole data as below picture.

As you know, in this case I can get 5 models with the .pth extension and I don’t know what results I will return when new data is entered into my neural network. The methods I personally thought of are as follows.

  1. When a new data enter into the five models, select the category with the highest frequency among the results. For example, when the results are calculated as follows, the answer is “dog”

model1 : “dog”
model2 : “dog”
model3 : “cat”
model4 : “sparrow”
model5 : “dog”

  1. Among the five models, the model with the highest accuracy is selected and used for the service.

  2. Instead of newly defining the model for each fold, use only one model and training the model

There are many difficult to develop a practical model. I’d like to hear advice from those who have developed models and services using neural network. Thanks

You can look into ensembling as a first step: Model ensembling — PyTorch Tutorials 2.4.0+cu124 documentation

Nice intro theory to it: https://machinelearningmastery.com/tour-of-ensemble-learning-algorithms/

But, if you have a very scarce dataset, make sure your splits have a representation of each class in each fold.