smarsland / pots

1 stars 1 forks source link

is the registration working? #3

Open Armand1 opened 5 years ago

Armand1 commented 5 years ago

These are my plots of the registered pots, by shape class. So what's completely clear here is that the registration is destroying any information about the differences between the shape classes. If you compare them to my plots of the unregistered pots --- which have been messed about with a bit, but should largely preserve their original shapes, you can see the difference. Even bowls and cups have become elongate things.

So, clearly some other approach to registration is needed.

registered pots

LittleAri commented 5 years ago

That's really interesting to see. Of course the 'stretching' is inevitable in this type of registration but I can definitely see what you mean by the lack of obvious shape variability. My initial thought was that part of the reason for this could be because of the contours themselves. These are all rough contours, none of which are perfect. So I wonder whether we'll have more obvious shape variability once the contour extraction code has been improved.

Following your plots, I was curious to see whether pot classes would be more easily distinguished by their registered representations (registered square root velocity (SRV) functions) so I made some plots showing the SRVFs of subsets of a few classes from the sample.
srvf_classes_1 srvf_classes_2

Similar to yours, though there is some variation, not much can be seen by the naked eye.

I then did a rough "match test" where I picked 4 pots that were not in the sample and computed their square root velocity function. And then I found the pot in the sample, which gave me the smallest distance (i.e. the L2 distance between the SRVF of the test pot and the registered SRVFs from before). This was quite interesting: matched_pots

[The 4 pots on the left were matched to the 4 on the right]

The pots that were matched to the bell kraters are very odd. The results from the cups were also rather weird since the test Siana matched one of the Little Master Cups, and the test Little Master Cup matched a Siana. Though it does bring some hope that at least the cups were matched to cups - so there must at least be a slight amount of shape variability preserved here in the SRVFs.

Of course a better test would be to see if we can find clusters between all registered pots (unlike my previous test which tested non registered pots with the registered ones). I'll work on this next week.

All in all, I agree that we must look into other ways of registration here. The plan was always to start with the usual registration algorithm that we had, and to then go from here. But it's definitely worth checking this one thoroughly first.

There are two questions here: "Is the registration right for us?" and "Is the registration correct"? The first one we have talked about but the latter still needs tackling. At this point in time, though the registered pots might look odd, I'm not sure if that's necessarily a strong indicator that the registration is incorrect. A bigger indicator might be the fact that the code for the registration had played up a bit for me in early July. Still hoping to examine the actual code more finely but it's not that easy since C++ is not my forte.

So in the next few days / week I will take a look at the optimal reparamtrizations (aka optimal warping functions) found since these are arguably the most important result from the registration. And I will test how a basic clustering of the registered contours might pan out. Hopefully I'll have a chance to properly examine the C++ registration code too. Work in progress! 👍

Armand1 commented 5 years ago

Great. Thanks.

smarsland commented 5 years ago

HI Armand, I think that there is some confusion here. The idea of the registration is to make them all look the same. Then the amount of bending and stretching that was required tells you which class it was in before you messed with it. Does that make sense? Having said that, some of the registrations do look a bit crap, so there is a bit more work to do. We have many methods of registration, and will be trying some others. Stephen

Armand1 commented 5 years ago

Hi Stephen, Yes. I am --- was --- confused. I thought the objective of registration was to make the things look the same while preserving shape information. In other words, align them straight, scale them appropriately etc.

Ok -- so the important information lies in the amount of bending and stretching. That's given by the SRVF plots? Or the Optimal Warping Function plots?

What would be useful for presentational purposes is a kind of "registration" in which the pot contours were aligned, flipped the right way, and scaled, but in which shape information is preserved, so that vases of a given class could be overlain. In other words to do kinda what I did here [https://github.com/smarsland/pots/issues/2#issue-477556799] but better. My idea is that you could, for example, average the contours so "registered" and instantly see the variation within and among classes of pots in an visually direct way. Is that possible /desirable?

LittleAri commented 5 years ago

Hi! I wonder if you've tried recreating those graphs with the updated contours? It would be interesting to see if they still look like that.

And yes, the registration algorithm aligns the contours, and still gives us information about the contours' shapes. And you're right about the neat information being within the optimal warping functions. Since it's the optimal warping function that when composed with the reparametrisation of our contour, gives us the registered contour. I've made a few plots here so we can see how they look for some of the classes in our sample:

updated_reparams_classes

It does seem to look like the Amphora Neck and the Olpe plots are closer to the straight diagonal y=x, suggesting that if we look at an average of all the shapes, they might resemble these two a bit.

The thing to note here is that we are aligning all our contours in the sample together. We're not registering by class. If we were registering all the classes separately (i.e. register all the amphoras together, register the cups together etc), then, we can definitely re-create the kind of plots you showed in Issue 2, by plotting the average registered contour per pot class. I could definitely run that if you're interested? What I was interested in seeing is if we register all of these pots together, will we then see some classes forming? I'm currently trying to do this by looking at L2 distances between the SRVFs of the contours.

As for instantly seeing the variation, the optimal warping functions definitely show that more than the registered contour plots and SRVFs plots. But looking at other kinds of registration is still on the table! 😄