HanlinMo / Rotation-Invariant-Coordinate-Convolutional-Neural-Network

The code of the paper "RIC-CNN: Rotation-Invariant Coordinate Convolutional Neural Network"
13 stars 4 forks source link

How to trans Q1 to Q1'? #3

Open KongCang opened 5 months ago

KongCang commented 5 months ago

Thank you very much for your research and the sharing of the code。 but I have some questions in generate_coordinates: theta = torch.round(10000. * theta) / 10000. Variable(coords, requires_grad=False) is this a fixed offset? I don't know how Q1 transforms to Q1‘, Can you help me understand? I appreciate your response.

HanlinMo commented 5 months ago

I'm glad you're interested in our work. Yes, "the offset" doesn't require learning; it is entirely determined by the rotation-invariant coordinate system we establish. It naturally ensures the rotational invariance of convolution, and this invariance doesn't come from the training data (we believe that data-driven approaches have various issues). We emphasize in section 4.1 why this approach can guarantee rotational invariance, explaining how Q transforms when the input undergoes rotation (see equations 8, 9, 10 for more details). In the code, "theta = torch.round(10000. * theta) / 10000" is a rounding operation designed to reduce computational errors, and "Variable(coords, requires_grad=False)" is used to ensure that the offset remains unchanged during the learning process.

KongCang commented 5 months ago

Thank you very much for your response, Rotation-Invariant Coodinate Convolution can realy slove any rotations around the image center, primarily using deform_conv and transform. When translating local feature to the rotated position, replacing G(y) to T(y), is it the case that φ_RCI-C≠1.04?I want to slove a problem where the input is an 13640640 image, in which I'll crop out a 133232 path feature (which will be rotated), and then I'll need to find the max similarity in the image. My Idea is to calculate the main direction of path using methods such as SIFT or SURF, and then calculate the coordinate transformations. What do you think? Any better suggestion? Thanks a lot! image

HanlinMo commented 5 months ago

Hi! You are right. Our method does not have translation invariance. It is a issue. In our new work [https://github.com/HanlinMo/Sorting-Convolution-Operation-for-Achieving-Rotational-Invariance], we proposed a new convolution operation with both rotation and translation invariance, maybe it is more suitable for your task. I am sure that you can use the dominant orientation estimation which were used in SIFT and SURF. Actually, I have tried this method before, but its performance is not very good (compared with our new work "sorting CNN").

You mentioned that "......13640640 image, in which I'll crop out a 133232 path feature......" May I ask what these numbers and "path features" mean?

KongCang commented 5 months ago

I want to use Rotation Invariance deep learning method to solve tradiational template matching problem.[1,3,640,640] is the src Image,[1,3,32,32] is the rotated template. using rotate invariance operators can reduce the rotation space search.