Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to do test time augmentation to improve prediction robustness #98

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

tayden
Copy link
Collaborator

@tayden tayden commented Jan 23, 2024

This PR adds a boolean flag to the CLI and lib functions which enables test-time augmentation in the find-kelp and find-mussels functions.

For each image chip, it is classified in it's normal orientation, then repeatedly rotated 90 degrees and reclassified. The chips are then flipped horizontally, reclassified, and finally flipped vertically and reclassified. In total, each chip is classified 6 times in different orientations. The predictions are then un-flipped and rotated such that each chip has 6 predictions in the correct orientation. Finally, individual pixels are classified using a combination of all these predictions such that the most confident prediction over all the possible orientations is used as the final output.

The result of this is that processing an image takes about 6 times as long as in the normal, non-tta, mode to process. However, the outputs are generally expected to be of higher quality.

Accumulate logits, with maximum confidence output being the one used to predict the output
@tayden tayden self-assigned this Jan 23, 2024
@tayden tayden enabled auto-merge (squash) January 23, 2024 20:59
@tayden tayden merged commit 5120cf2 into main Jan 23, 2024
21 checks passed
@tayden tayden deleted the tta branch January 23, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant