<p>You can either do 1) Object Detection 2) Semantic Segmentation. I would suggest segmentation because boundary extraction is crucial for your application.</p>

<p>I'm assuming you have the pages of the documents as images.</p>

<p>The following are the steps involved in projects involving segmentation. </p>

<h3>Dataset</h3>

<ol>
<li>Collect the images of the pages required to solve you problem and do
preprocessing steps such as image resizing to bring all images in
your dataset to a common shape and to reduce the number of computations performed. Be sure to maintain variability in your samples.</li>
<li>Now you have to annotate the regions of the images that you are interested and mark them with a name. Here assigning a class (like classification) to certain regions of the image. You can use the following tools for this.</li>
</ol>

<p><a href="https://github.com/wkentaro/labelme" rel="nofollow noreferrer">Labelme</a> -- (my recommendation) </p>

<p><a href="http://www.robots.ox.ac.uk/~vgg/software/via/" rel="nofollow noreferrer">Vgg Annotation tool</a> -- (highly portable tool written in html but has less features than labelme)</p>

<h3>Model</h3>

<p>You can use U-Net Model for your task. <a href="https://arxiv.org/pdf/1505.04597.pdf" rel="nofollow noreferrer">Unet Paper</a>. It is very easy to implement but performs very robustly on most real-world tasks such as yours.</p>

<p>We have done something similar at work. This is the <a href="https://labs.imaginea.com/post/measuring-feet-using-deep-learning/." rel="nofollow noreferrer">blog post</a>. We have explained in detail the steps involved in the pipe line from the data collection stage to the results.</p>

<h3>Literature on Document Layout Analysis.</h3>

<ol>
<li><a href="https://arxiv.org/pdf/1804.10371.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1804.10371.pdf</a> -- They have used U-Net with ResNet-50 as encoder. They have achieved very good results compared to previous approaches</li>
<li><a href="https://github.com/leonlulu/DeepLayout--" rel="nofollow noreferrer">https://github.com/leonlulu/DeepLayout--</a>  This is a Python implementation of page layout analysis tool using a Deep Lab v2 model which does semantic segmentation.</li>
</ol>

<h3>Conclusion</h3>

<p>The approach presented here might seem tedious and time consuming but it is robust to variability in the documents when you are testing. Comment below if you have any questions.</p>
Block scheme detection in text document
<p>I have image of text document. It includes text and block-schemes. The main problem is to detect block-schemes. I think there are two approaches to solve this task: 1) detect geometric primitive that make up the scheme; 2) detect the whole scheme.</p>

<p>How can I solve this task, please, give me some aproaches.</p>

<p><strong><em>UPDATE 1</em></strong>
I try to detect where in document block-scheme is placed. Example is shown on the picture below. I didn't try to detect text in block-scheme.</p>

<p><strong><em>UPDATE 2</em></strong> The main problem is that i should find block-schemes in different varieties. Even part of the block-scheme.</p>

<p><a href="https://i.stack.imgur.com/4jXAm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4jXAm.png" alt="Example image"></a></p>