Classification problem with many images per instance I am working in the following kind of classification problem: I have to classify every instance as class A or class B using many images of the instance. That is, every training example has not one image (which is the usual thing in image classification), but many images, and the number of images for every training instance is not fixed. That is, instance 1 can have 3 images, and according to these images we have to classify it as A or B, and instance 2 can have instead 5 images.

As any machine learning problem, I am provided with many labelled images and I have to build a classifier.

Although ideas are also welcome, I am looking for a documented way to attack this kind of problem (Kaggles, papers or books, mainly).

My main idea was the following: train a model $f$ that given one image gives a probability of that image being of class A. Then, for every training instance, evaluate $f$ in every image of the instance and compute statistics (aggregate) of the distribution of these probabilities, as the mean, median, maximum and minimum. Then, train a model $g$ that has as inputs these aggregates and use the composition of $f$, aggregates and $g$ as the final model. This idea is a bit simple so I am looking for something better.
This might be a hack, but, have you considered repeating some images to make every instance contain a fix number of images? Let's say you have images A, B, C, D, E, F, G, H, and I. Your dataset might look like this:


A , B
C
D, E, F
G
H, I


Make a function that will randomly select one of the image in an instance and then use that as placeholder. From our example, we now modify our dataset into:


A, B, A
C, C, C
D, E, F
G, G, G
H, I, I


Then, from here, you can use a convolutional neural network with 3 inputs. Here is an example of a CNN with multiple inputs: Multi-Input Convolutional Neural Network for Flower Grading - images of same flowers taken at different angles.

Also, you can shuffle the images in each instance to produce more training samples.