From PDF to Word: From Static Layers to a Dynamic Object Detection Engine
The role of the YOLOv10s model trained with 86k images in document layout analysis; a development journal of a custom C++ and Python ecosystem transcending traditional open-source libraries.
PDFduty's Development Journey: My Story of Transitioning from OCR to YOLOv10s
The Beginning
Although the momentum of my site, which I laid the foundation for last year, impressed me a lot, I took a major step towards creating an internal ecosystem within this environment that I enriched with research sections, blogs, and PDF tools. I dedicated a lot of time to this structure that I coded during my holidays. With the add-ons I created for the blog section, I planned to both ease my own working environment and maximize the efficiency of my site.
Open Source Libraries and My Vision
Although PDFduty is generally a tool website and its infrastructure was primarily created and developed using open-source libraries, my main goal here was to add new tools that I produced myself to this ecosystem and to improve its quality.
As a math student taking this step; even though I am only 19 years old, and studying economics and mathematics simultaneously, I aimed to blend these different disciplines with software development. In this journey that I started in 2025, I got to work by learning Python, JavaScript, and C++.
The Basics of PDF to Word Conversion
In PDF conversions, as I mentioned before, using open-source libraries was my first priority. First, I was going to get everything up and running, see that the system works, and then integrate my own libraries one by one.
My first step in the PDF to Word converter was Fitz or the pdf2word libraries that use Fitz. No matter how high-quality and open-source these libraries are, I started writing my own library to make my project, which is both my first project and has moral/material value for me, even more unique and to further develop it.
My Custom Library Development Process (17/04/2026)
After questions like "How should I do it? How should I prepare it?" that lingered in my mind for a long time, I started building my own library that translates PDF to Word. Rather than dealing with complex code blocks or building huge structures from scratch, I thought I needed to design a smart plan that would create a faster impact in an individual project.
The idea of training my own small artificial intelligence model was always in the back of my mind, but I never had the opportunity. I decided that integrating the AI directly into the core of the main functions, rather than just calling it as an external API on my site, would satisfy me more, and I started working.
Architecture and Initial Challenges
Actually, I started by writing a simple pdf2word library. First, I managed to export only as text, then to extract the pages as PNG. Over time, I attempted to detect fonts, RGB color values, identify layers, determine columns, and integrate texts into Word using "text block anchor" methods.
However, since classic OCR (Optical Character Recognition) libraries sometimes failed to transfer correctly, and the processes became very heavy and took a long time on some complex PDFs, I changed my direction. I decided to include an artificial intelligence model in the library that would provide the flexibility I truly wanted.
Why Did I Abandon Traditional OCR?
The main problems I encountered with classic methods were as follows:
-
Resource Consumption: OCR processes require high processing power and take a long time.
-
Lack of Precision: The need to capture important structural areas on the page (tables, special headers, text within images) based on coordinates without missing them, and being able to export them as PNG or formatted text.
-
Preserving the Architecture: The difficulty of reconstructing fonts, colors, the general layout, and the document architecture losslessly in Word format.
The Solution: Training My Own AI Model
One Friday, I decided on which AI architecture I would use and which datasets I would train it with. Even though I had no prior experience in training models, this uncertainty didn't scare me; rather, it excited me incredibly.
My goal was clear: to perform object detection on PDF pages and ensure flawless data extraction based on coordinates (bounding boxes). The aim was to categorize the elements on the page (text block, title, image, table) and use this data as a skeleton during the transfer to Word.
At this point, I came across a model that doesn't take up much space in terms of parameters, can work with relatively low hardware power, but is highly effective: YOLOv10s.
Why YOLOv10s?
YOLOv10s (You Only Look Once version 10 - small) is a state-of-the-art computer vision architecture developed for real-time object detection tasks.
While this model is used in security cameras, autonomous vehicles, military technologies, and many other demanding tasks, I asked myself the question: "Why shouldn't this artificial intelligence scan complex PDF pages too?"
Training Process and Initial Results
I prepared a custom dataset with exactly 86,000 PDF images (pages) and trained the model for 85 epochs. With the hardware of my own personal computer, this training took exactly 16 hours.
The results I got at the end of the training more than satisfied me. I didn't expect this "small" structure, consisting of about 7.2 million parameters (weight matrices), to be able to do such detailed and high-quality work.
Model Performance Metrics

Examples of AI Object Detection on PDF Pages





To Be Continued
Welcome
Sign in to use the AI assistant
Menu
Home
All tools
Editor
Edit text and shapes
Blog
Tips and guides
Research
Academic papers & studies
Theme
Language
Recent Actions
Lokal Geçmiş