DDMAL / Rodan

:dragon_face: A web-based workflow engine.
https://rodan2.simssa.ca/
46 stars 13 forks source link

After training, odd regularly sized repeating square outlines leave artifacts on images #1209

Open kyrieb-ekat opened 1 week ago

kyrieb-ekat commented 1 week ago

After training images will have, to varying degrees, odd repeating square outlines on images. I've now managed to replicate this consistently with a model on a variety of simple black and white text images. I have attached the models and images below. The artifacted lines- which may have a better term than what I'm using, so I apologize in advance for any confusion- appear to frequently remove a strip from one layer and place it into another. The squares show up most clearly and consistently on larger images.

The text images I used only had two layers: annotated layer (Layer 1) and background. The gaps from the 'squares' disappear in layer 1 and show up in background. They show poorly here, so I've copied one of the sample images into a text file with a white background to give a clear demonstrations of what's happening- the others replicate this to varying degrees.

Abecedarian bold on white bg

Image names and their sizes produced by Rodan (original files at end):

AB - 571x521 BC - 543x364 CD - 571x347 DE - 551x379 Alphabet Clear BG - 7810x5176 Alphabet White BG - 611x786 Lorem Ipsum - 513x672 Abecedarian Bold - 587x777

Note: the lines are very hard to see on a black background, so they can also be viewed here, along with the model files (https://drive.google.com/drive/folders/1PI1uvjzxI775Lcc6a7FGODhueopdDGAQ?usp=sharing) if you don't want to change the GitHub black background to see them.

L1 DE - Letter test 4 - DE L0 DE - Letter test 4 - DE L1 CD - Letter test 3 - CD L0 CD - Letter test 3 - CD L1 BC - Letter test 2 - BC L0 BC - Letter test 2 - BC L1 AB - RODAN letter test L0 AB - RODAN letter test L1 Alphabet Clear BG - Fast Pixelwise Analysis of Music Document, Classifying - Layer 1 L0 Alphabet Clear BG - Fast Pixelwise Analysis of Music Document, Classifying - Background Layer L1 Alphabet - Fast Pixelwise Analysis of Music Document, Classifying - Layer 1 L0 Alphabet - Fast Pixelwise Analysis of Music Document, Classifying - Background Layer L1 Lorum Ipsum - Fast Pixelwise Analysis of Music Document, Classifying - Layer 1 L0 Lorem Ipsum - Fast Pixelwise Analysis of Music Document, Classifying - Background Layer L1 Abecedarian Bold - Fast Pixelwise Analysis of Music Document, Classifying - Layer 1 L0 Abecedarian Bold - Fast Pixelwise Analysis of Music Document, Classifying - Background Layer

Original Images uploaded to classifying job:

RODAN letter test Screenshot 2024-09-16 at 9 29 51 AM Screenshot 2024-09-16 at 9 30 04 AM Screenshot 2024-09-16 at 9 30 14 AM Screenshot 2024-09-16 at 10 33 26 AM Screenshot 2024-09-16 at 11 06 32 AM Screenshot 2024-09-16 at 11 14 37 AM Screenshot 2024-09-16 at 10 59 47 AM Alphabet-Letters-Black-Clip-Art

Workflow is below. All images are separated using the Fast Pixelwise Classifier. Images/line artifact gaps might be easier to see if downloaded and opened over a white background. Background removal job not utilised Screenshot 2024-09-16 at 11 26 18 AM Screenshot 2024-09-16 at 11 26 07 AM

@JoyfulGen if you have any other models which consistently produce the squares, please feel free to drop them- or if you run into.think of any other circumstances which provoke them.

kyrieb-ekat commented 1 week ago

For a larger demonstration of this squares phenomena, and perhaps also the layer combining/separating issue (#1207), see the below image. Note that the white dots appearing on the manuscript cover above the parchment aren't present in the manuscript image, and appear to be bleed through from the squares present on layer 3.

Screenshot 2024-09-17 at 12 48 59 PM Screenshot 2024-09-17 at 12 48 54 PM

fjcastellanos commented 2 days ago

Hello, I have located the bug in the code, and it should be fixed now. The problem is in inference (not in training). I have updated the repository with the correction. After several tests, I haven’t encountered the problem again. I hope this fix has definitively resolved the issue. Thank you very much for reporting the error.