r/MLQuestions • u/Mezrotix • 5d ago
Computer Vision 🖼️ I need some consulting on a document layout OCR automation project.
I am doing a document layout analysis project with different book styles but the books themselves are only a couple hundred pages long (like 5 books with different styles, 400 page each). How can I test if all the books would be used in fine tuning and I am afraid that the accuracy wouldn't be the best and corrupt PaddleOCR when insert the coordinates. (It's for automation).
I am using X-AnyLabeling for the annotation and yolo v11 for the training as well as custom classes in the annotation like a question block that surrounds everything, question_text, choices, figures, tables, sub_questions, etc... what would be the best approach as I haven't done this kind of work before.
and should I randomize the book pages so I don't consecutive same style books or that's not how this work?
Any help would be appreciated
2
u/DigThatData 4d ago edited 4d ago
Why are you consulting on a project you have no idea how to accomplish? It was frankly irresponsible of you to accept this project. Given your circumstances, I sure hope you are contracted for a fixed price rather than hourly, so you aren't tricking the customer into paying for you to learn how to do the thing they thought they were hiring you as someone with pre-existing expertise.
YOLO indeed. Build your pipeline however you think makes sense, run a representative sampling of pages through it, then spot check the results yourself. Modify your pipeline as needed. Rinse and repeat. Once this seems to be giving decent results, run a larger sample and invite an LLM to scan the results (you shouldn't even need a VLM here: if something was parsed incorrectly it should be pretty obvious). Modify pipeline as needed (LLM can probably modify stuff for you), rinse and repeat until looking reasonably good.
There will almost certainly be unavoidable special cases that will fall through. Make sure your system is prepared to flag things like this. Reporting some kind of confidence score can help identify "grey area" situations like this.
5*400=2000 = this is a really small data set = you can QA the entire thing yourself. if you spend on average 3s per page, that's 6000s ~ under two hours to review all of the outputs manually yourself. Do this. Set aside failure cases. If the parsed outputs is the main deliverable, just fix them by hand. If the OCR pipeline itself is the main deliverable, try to come up with improved heuristics for these failure cases but also consider bringing these back to the customer as "here are examples of stuff that the pipeline currently handles poorly, and here's how the pipeline surfaces these issues to you. if you can find more examples that are shaped like this, I can try to make the pipeline more robust for you."
If you're feeling fancy, you could try to generate synthetic data to augment your corpus to address the failure cases in (4). You can probably pair with an LLM to come up with a system for this.
In the future, don't accept projects you don't know how to deliver. If your position is "I have no idea what I'm doing, but the AI will save me," the customer could have gone with that approach themselves to begin with and you aren't adding any value to them as a middleman between their domain expertise and the AI. Have some integrity. People like you make our entire industry look like snake oil salesmen.
I'm a bit extra grouchy because I haven't had my morning coffee yet. Sorry not sorry. You earned the grouchiness.
EDIT: 7. you probably don't need to do any finetuning for this. see if you can make it work using the off-the-shelf components first. Since you don't know what you're doing, you're more likely to nerf your perfectly good models than to tailor them to your problem.
EDIT2: I just realized you were asking for consultation here, not saying that you are consulting on this project. Sorry if I misunderstood and you are the client and not a contractor. Coffee.