What are the best Deep learning models(with how many layers) to use in a regression task for a custom dataset containing around 100 images of only one object per image which is more or less centralized? The object is measured manually with a weight scale and the output of the model is the estimation of the density of an object expressed in g/mm.
In general Convolutional Neural Networks work well with images, be it a regression or a classification problem. In your case the number of images is very small, so heavy data augmentation should be used. And the network itself has to be fairly simple, to avoid overfitting. But without access to the data it is hard to recommend any actual architecture (number of layers, kernels, activations, ...).
Estimating the density is an interesting problem, it is a property of the material (assuming it isn't hollow) and is independent of the size of the object. If your objects are quite uniform in size the network might have problem with smaller and bigger objects than what you have in the training data.
If your images are high resolution, I'd consider splitting them into smaller crops (optionally with varying sizes, then resizing them into a common resolution) to get more training data.
I would also try altering the model to predict the weight and thickness as separate outputs, this way you can see which property is more difficult to predict and you can focus on that. If you feel fancy your model can have three outputs (weight, thickness, density) and optimize a weighted loss on all of them at once.
If you can publish the data I'd be interested to implement a reference solution and see how accurate it would be. By default I would not share the source code with you, just the results and give you guidance.
I sorted the images by the known density, and noticed that it correlates quite well with the object's apparent size. This is unexpected (if you weren't measuring the mass), it sounds implausible that the largest objects would be the densest. The opposite could be explained if they started at a similar size and weight, and some were compressed down into a more dense form.
Or is it that several smaller object will back denser than fewer larger ones? I had thought of this only in the context of a single object. edit 2: this is irrelevant, in the data largest objects are densest.
The change in hue is due to normalization, and I didn't convert the images to grayscale.
Looks like the grid's first image's (_DSC3479.JPG) data entry is incorrect, it may have an extra zero after the decimal comma.
Anyway, fitting a linear regression to this data will give you a good starting point. It would give a prediction of 0.099 (median of the six nearest neighbours), which is off by just 5% from the presumed correct value of 0.104.
It seems that CNNs will not help you much here, due to low amount of data and after all small size of the objects. There isn't much detail in the texture, but shading seems to give some hint of the 3D structure. If possible, I would take 10 photos of each object in a random orientation. Naturally you need to measure their density just once :) This would be much better than rotating the images after the fact. And try to place the camera closer, so that the objects would be 250 - 400 pixels in width.
The dirty background shouldn't be an issue, actually it would be a good exercise to train a pre-processing network which would do the job for you.