Adjust BitNetwork Message Expanding#17
Open
huayuan4396 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I met a problem where the bit error won't decrease when training on 384 * 384 cover image with 128 bits of message length.
I found the problem is aroused since the message is first expanded to [b, 1, msg_len, msg_len] and than interpolated to the feature map size [b, 128, img_size // 8, img_size // 8]. In this procedure, the expanded message tensor is downsampled and can cause information loss when msg_len is larger than img_size // 8 (in my case, msg_len = 128 and img_size // 8 = 48).
As a result, I tried some modification and found the submitted changes can solve this problem, in which I choose to directly expand the message tensor to [b, 1, img_size // 8, img_size // 8] instead of [b, 1, msg_len, msg_len]. The solution is simple and effective, by just changing one linear layer. The bit error rate is reduced quickly within 5 epoches to 0.0273:

Hope this is can help improve the model:)