<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Python - Inero Software - Software Consulting</title>
	<atom:link href="https://inero-software.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>https://inero-software.com/tag/python/</link>
	<description>We unleash innovations using cutting-edge technologies, modern design and AI</description>
	<lastBuildDate>Fri, 08 Apr 2022 12:33:49 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://inero-software.com/wp-content/uploads/2018/11/inero-logo-favicon.png</url>
	<title>Python - Inero Software - Software Consulting</title>
	<link>https://inero-software.com/tag/python/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">153509928</site>	<item>
		<title>Digital Cloud Document Repositories &#8211; how to identify signatures in scanned PDF documents</title>
		<link>https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/</link>
		
		<dc:creator><![CDATA[Adrian Chojnacki]]></dc:creator>
		<pubDate>Tue, 09 Feb 2021 12:27:55 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Company]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[digital repository]]></category>
		<category><![CDATA[document]]></category>
		<category><![CDATA[machinelearning]]></category>
		<category><![CDATA[object detection]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[yolov5]]></category>
		<guid isPermaLink="false">https://sandbox-www.devel.inero.com.pl/?p=3306</guid>

					<description><![CDATA[<p>&#160; Computer vision and object detection are increasingly used in the automation of business processes. Along with the dynamic development of technology, especially artificial intelligence, there are many new innovative business applications for this type of algorithms. In one of our recent posts, we outlined how to build a custom&#8230;</p>
<p>Artykuł <a href="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/">Digital Cloud Document Repositories &#8211; how to identify signatures in scanned PDF documents</a> pochodzi z serwisu <a href="https://inero-software.com">Inero Software - Software Consulting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3></h3>
<p>&nbsp;</p>
<p><span style="font-weight: 400;"><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />Computer vision and object detection are increasingly used in the automation of business processes. Along with the dynamic development of technology, especially </span><a href="https://inero-software.com/machine-learning-professionals/"><span style="font-weight: 400;">artificial intelligence</span></a><span style="font-weight: 400;">, there are many new innovative business applications for this type of algorithms. In one of our recent posts, we outlined </span><a href="https://inero-software.com/few-tips-on-how-to-create-custom-class-detection-system-using-r-cnn/?preview=true"><span style="font-weight: 400;">how to build a custom R-CNN based detector</span></a><span style="font-weight: 400;">. In this article, we will walk you through how to do the same with YOLO v5, which has grown in strength in recent years. One of the important aspects over and above other solutions is the speed of inference. As part of this article, we will present the specified use case and all steps of its implementation. Enjoy your reading!</span></p>
<p><img decoding="async" data-attachment-id="2770" data-permalink="https://inero-software.com/data-the-playground-of-machine-learning/inero-glify-10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Inero Software" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-2770 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h2><span style="color: #800080;"><b>Use case</b></span></h2>
<p>&nbsp;</p>
<p><span style="font-weight: 400;"><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />Signatures are still one of the most common methods of document authentication. Especially for enterprise applications, identification of signed and unsigned copies of documents in digital repositories may be time-consuming and a challenging task. However, automation supported by <a href="https://inero-software.com/machine-learning-professionals/">machine learning</a> can make it easier. In this context, we describe the capabilities of YOLO v5 detector, and we will discuss issues of detecting invoice signatures. </span><span style="font-weight: 400;">Let’s start with an example as shown in the figure below. For the purpose of this study, we prepared a fake invoice, fake data of the seller, buyer or the product itself. Let’s investigate now, how we can focus on hand-written signatures (which is fake too :-)).</span></p>
<p><img fetchpriority="high" decoding="async" data-attachment-id="3314" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/invoice/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/invoice.png" data-orig-size="675,675" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="invoice" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/invoice-300x300.png" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/invoice.png" tabindex="0" role="button" class="aligncenter wp-image-3314 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/invoice.png" alt="invoice" width="675" height="675" srcset="https://inero-software.com/wp-content/uploads/2021/02/invoice.png 675w, https://inero-software.com/wp-content/uploads/2021/02/invoice-80x80.png 80w, https://inero-software.com/wp-content/uploads/2021/02/invoice-300x300.png 300w, https://inero-software.com/wp-content/uploads/2021/02/invoice-50x50.png 50w, https://inero-software.com/wp-content/uploads/2021/02/invoice-512x512.png 512w" sizes="(max-width: 675px) 100vw, 675px" /></p>
<p><img decoding="async" data-attachment-id="2770" data-permalink="https://inero-software.com/data-the-playground-of-machine-learning/inero-glify-10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Inero Software" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-2770 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h4><span style="color: #800080;"><b>Collecting Data</b></span></h4>
<p>&nbsp;</p>
<p><span style="font-weight: 400;"><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />One of the first steps is to collect a set of images to train your model. For our use case, we have prepared a small <strong>10 sample</strong> training set of invoices filled with different data and augmented this collection by a dedicated Python script. To make things easier, we used a</span><span style="font-weight: 400;"> </span><a href="https://roboflow.ai/"><span style="font-weight: 400;">Roboflow</span></a>, which <span style="font-weight: 400;">is a useful tool for data tagging Here you can upload your dataset and make a quick annotation process like on this GIF.</span></p>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" data-attachment-id="3310" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/annonated/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/annonated-e1646395509809.gif" data-orig-size="1716,913" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="annonated" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/annonated-e1646395509809-300x160.gif" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/annonated-e1646395509809-1030x548.gif" tabindex="0" role="button" class="aligncenter wp-image-3310 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/annonated-e1646395509809.gif" alt="Upload of the dataset" width="1716" height="913" /></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Additionally, we can generate more output images with random values ​​of rotation, saturation, exposure, noise, blur and other types of transformations. Moreover, with the help of this tool, we can determine our training, validation and test data split &#8211; the default is 70%, 10%, 10%. This is an important thing to prevent overfitting our model, you can read more about it on </span><a href="http://blog.roboflow.com/train-test-split/"><span style="font-weight: 400;">this blog</span></a><span style="font-weight: 400;">. Thanks to the described tool, we can export our dataset in the </span><i><span style="font-weight: 400;">YOLO v5 Pytorch format</span></i><span style="font-weight: 400;"> and put it in the directory of our project. The figure below shows the selection and target tree, where one of the most important files is the </span><strong>data.yml</strong><span style="font-weight: 400;"> that will be used for training.</span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="3311" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/export/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/export.png" data-orig-size="555,360" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="export" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/export-300x195.png" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/export.png" tabindex="0" role="button" class="aligncenter wp-image-3311 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/export.png" alt="Export of the files" width="555" height="360" srcset="https://inero-software.com/wp-content/uploads/2021/02/export.png 555w, https://inero-software.com/wp-content/uploads/2021/02/export-300x195.png 300w, https://inero-software.com/wp-content/uploads/2021/02/export-463x300.png 463w" sizes="(max-width: 555px) 100vw, 555px" /></p>
<p><span style="font-weight: 400;">In our case after the first step of augmentation by a Python script, we generate </span><strong>69</strong> <span style="font-weight: 400;">images. Additionally, we use a noise option in Roboflow, which allows us, in the end, export </span><strong>169</strong> <span style="font-weight: 400;">annotated examples. Our images were ultimately split as shown in the figure below. </span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="3316" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/split/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/split.png" data-orig-size="575,106" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="split" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/split-300x55.png" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/split.png" tabindex="0" role="button" class="aligncenter wp-image-3316 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/split.png" alt="Split of the images" width="575" height="106" srcset="https://inero-software.com/wp-content/uploads/2021/02/split.png 575w, https://inero-software.com/wp-content/uploads/2021/02/split-300x55.png 300w" sizes="(max-width: 575px) 100vw, 575px" /></p>
<p><span style="font-weight: 400;">And here you can see some of the train examples… </span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="4933" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/setcomp/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/setcomp.gif" data-orig-size="1206,724" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="setcomp" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/setcomp-300x180.gif" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/setcomp-1030x618.gif" tabindex="0" role="button" class="aligncenter wp-image-4933 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/setcomp.gif" alt="train examples" width="1206" height="724" /></p>
<p><img decoding="async" data-attachment-id="2770" data-permalink="https://inero-software.com/data-the-playground-of-machine-learning/inero-glify-10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Inero Software" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-2770 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<p>&nbsp;</p>
<h4><span style="color: #800080;"><b>Model configuration and architecture</b></span></h4>
<p>&nbsp;</p>
<p><span style="font-weight: 400;"><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />The next step in the whole process is to define the configuration and architecture of the YOLO model. We may build our own network structure, although in version 5 we are provided with one of the following models:</span></p>
<p>&nbsp;</p>
<ul>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">YOLOv5s,</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">YOLOv5m,</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">YOLOv5l,</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">YOLOv5x.</span></li>
</ul>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">We may use any of them but we must remember to assign appropriate target file parameter value called </span><strong>nc</strong> <span style="font-weight: 400;">&#8211; </span><i><span style="font-weight: 400;">number of classes</span></i><span style="font-weight: 400;">. In our use case, it’s 1. The models differ from each other with the number of parameters used, speed of frames per second (FPS), accuracy and others&#8230; On the figure below you can see how they cope with the same </span><a href="https://cocodataset.org/#home"><span style="font-weight: 400;">COCO dataset</span></a><span style="font-weight: 400;">. Click on the image below to learn more.</span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="3319" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/yolo/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/yolo.png" data-orig-size="2400,1200" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="yolo" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/yolo-300x150.png" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/yolo-1030x515.png" tabindex="0" role="button" class="aligncenter wp-image-3319 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/yolo.png" alt="YOLO graph" width="2400" height="1200" srcset="https://inero-software.com/wp-content/uploads/2021/02/yolo.png 2400w, https://inero-software.com/wp-content/uploads/2021/02/yolo-300x150.png 300w, https://inero-software.com/wp-content/uploads/2021/02/yolo-768x384.png 768w, https://inero-software.com/wp-content/uploads/2021/02/yolo-1030x515.png 1030w, https://inero-software.com/wp-content/uploads/2021/02/yolo-600x300.png 600w" sizes="(max-width: 2400px) 100vw, 2400px" /></p>
<p><img decoding="async" data-attachment-id="2770" data-permalink="https://inero-software.com/data-the-playground-of-machine-learning/inero-glify-10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Inero Software" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-2770 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h4><span style="color: #800080;"><b>Training</b></span></h4>
<p>&nbsp;</p>
<p><span style="font-weight: 400;"><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />What’s important, the </span><a href="https://www.ultralytics.com/"><span style="font-weight: 400;">Ultralytics</span></a><span style="font-weight: 400;"> company provides us with YOLO v5 developed in </span><a href="https://pytorch.org/"><span style="font-weight: 400;">PyTorch</span></a><span style="font-weight: 400;">, a framework specialized in machine learning. Thanks to this, we may download their repository from </span><a href="https://github.com/ultralytics/yolov5"><span style="font-weight: 400;">GitHub</span></a><span style="font-weight: 400;"> and train our own detector. Nothing simpler, but what else do we need for everything to work fine? </span></p>
<p><span style="font-weight: 400;">To run each of the scripts we must install the dependencies contained in the </span><i><span style="font-weight: 400;">requirements.txt</span></i><span style="font-weight: 400;">. If we are using </span><strong>pip</strong><span style="font-weight: 400;">, we can use the following command in the terminal. Please remember that you must be in the project directory. </span></p>
<p>&nbsp;</p>
<pre>pip install -r requirements.txt</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">In the installation process, one thing may be a problem. Namely, the </span><i><span style="font-weight: 400;">PyTorch </span></i><span style="font-weight: 400;">library…</span></p>
<p><span style="font-weight: 400;">The different operating system, package in use, programming language etc. may require a specified command. You will find everything you need in this </span><a href="https://pytorch.org/get-started/locally/"><span style="font-weight: 400;">tutorial</span></a><span style="font-weight: 400;">.</span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Let&#8217;s assume you have passed all the requirements and start our training!</span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">One line of code is enough to run this process, but we need to make sure that we have prepared two important files &#8211; </span><strong>data.yaml</strong> <span style="font-weight: 400;">and for example </span><strong>yolov5l.yaml</strong><span style="font-weight: 400;"><strong>.</strong> The first one you should have from the data collection stage and the second one can be found in the YOLO v5 repository, in the </span><i><span style="font-weight: 400;">Models </span></i><span style="font-weight: 400;">directory. </span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">That&#8217;s it! Let’s run the training by the following command: </span></p>
<p>&nbsp;</p>
<pre>python train.py --data dataset/data.yaml --cfg models/yolov5l.yaml --weights ''</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">The above command is the simplest possible, additionally, you can define the following options or parameters: </span></p>
<p>&nbsp;</p>
<ul>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">img-size,</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">batch-size,</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">epochs, </span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">name,</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">no-save,</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">cache…</span></li>
</ul>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">For the purposes of this article, </span><span style="font-weight: 400;">we conducted a relatively short training for images resized to </span><strong>416&#215;416</strong><span style="font-weight: 400;">, batch size </span><strong>32</strong><span style="font-weight: 400;"> and </span><strong>1500</strong><span style="font-weight: 400;"> epochs. When the process is complete, the result will be a weight file named </span><strong>best.pt</strong><span style="font-weight: 400;">.</span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Perhaps you may stop your learning process if your weights are optimal for you at the moment. We stopped our training after </span><strong>650</strong><span style="font-weight: 400;"> epochs, which took about </span><strong>15</strong> <strong>hours</strong><span style="font-weight: 400;"> in total. Please note that the PC used does not have a dedicated graphics card.</span></p>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" data-attachment-id="4935" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/trainingcomp/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/trainingcomp.gif" data-orig-size="1888,212" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="trainingcomp" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/trainingcomp-300x34.gif" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/trainingcomp-1030x116.gif" tabindex="0" role="button" class="aligncenter wp-image-4935 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/trainingcomp.gif" alt="training" width="1888" height="212" /></p>
<h5></h5>
<p>&nbsp;</p>
<h5><strong><span style="color: #800080;">Detailed metrics of our training:</span></strong></h5>
<p>&nbsp;</p>
<ul>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">precision &#8211; </span><strong>0.93507</strong><span style="font-weight: 400;">,</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">recall &#8211; </span><strong>0.96429</strong><span style="font-weight: 400;">,</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">mAP_0.5 &#8211; </span><strong>0.94755</strong><span style="font-weight: 400;">,</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">mAP_0.5:0.95 &#8211;</span> <strong>0.48702</strong><span style="font-weight: 400;">,<br />
</span></li>
</ul>
<p><span style="font-weight: 400;">where:</span></p>
<p><i><span style="font-weight: 400;">precision</span></i><span style="font-weight: 400;"> &#8211; measures how accurate are your predictions,</span></p>
<p><i><span style="font-weight: 400;">recall </span></i><span style="font-weight: 400;">&#8211; measures how good you find all the positives,</span></p>
<p><i><span style="font-weight: 400;">mAP_0.5</span></i><span style="font-weight: 400;"> &#8211; mean average precision for IoU* = 0.5,</span></p>
<p><i><span style="font-weight: 400;">mAP_0.5:0.95</span></i><span style="font-weight: 400;"> &#8211; mean average precision for IoU* from 0.5 to 0.95 with a step size of 0.005,</span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">* IoU (</span><i><span style="font-weight: 400;">Intersection over Union</span></i><span style="font-weight: 400;">) &#8211; measures the overlap between 2 boundaries. Find out more about these metrics </span><a href="https://jonathan-hui.medium.com/map-mean-average-precision-for-object-detection-45c121a31173"><span style="font-weight: 400;">here</span></a><span style="font-weight: 400;">.</span></p>
<p><img decoding="async" data-attachment-id="2770" data-permalink="https://inero-software.com/data-the-playground-of-machine-learning/inero-glify-10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Inero Software" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-2770 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h4><span style="color: #800080;"><b>Inference on test images</b></span></h4>
<p>&nbsp;</p>
<p><span style="font-weight: 400;"><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />Now,</span> <span style="font-weight: 400;">when we have our trained model trained after the learning stage, we may go to inference on test images. As you remember, one of the directories exported from </span><i><span style="font-weight: 400;">Roboflow </span></i><span style="font-weight: 400;">was called </span><strong>test</strong><span style="font-weight: 400;">. We can use it by putting in the terminal following line: </span></p>
<p>&nbsp;</p>
<pre>python detect.py --weights best.pt --source dataset/test --conf 0.6 --img-size 600</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">where </span><i><span style="font-weight: 400;">conf</span></i><span style="font-weight: 400;"> is model confidence &#8211; higher required makes fewer predictions. </span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Finally, we may see the result visualization. The approximate inference time on one test image </span><strong>416&#215;416</strong><span style="font-weight: 400;"> was </span><strong><span style="color: #000000;">~ 0.3 s</span></strong><span style="font-weight: 400;">, while for </span><strong>700&#215;700 ~ 0.8s</strong><b>.</b></p>
<p><img loading="lazy" decoding="async" data-attachment-id="4936" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/inferencecomp-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/inferencecomp-1.gif" data-orig-size="1138,406" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inferencecomp" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/inferencecomp-1-300x107.gif" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/inferencecomp-1-1030x367.gif" tabindex="0" role="button" class="aligncenter wp-image-4936 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/inferencecomp-1.gif" alt="inference" width="1138" height="406" /><br />
<img loading="lazy" decoding="async" data-attachment-id="3309" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/10.png" data-orig-size="675,675" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="10" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/10-300x300.png" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/10.png" tabindex="0" role="button" class="aligncenter wp-image-3309 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/10.png" alt="signatures on invoice" width="675" height="675" srcset="https://inero-software.com/wp-content/uploads/2021/02/10.png 675w, https://inero-software.com/wp-content/uploads/2021/02/10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2021/02/10-300x300.png 300w, https://inero-software.com/wp-content/uploads/2021/02/10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2021/02/10-512x512.png 512w" sizes="(max-width: 675px) 100vw, 675px" /> <img loading="lazy" decoding="async" data-attachment-id="3313" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/inv_inference/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/inv_inference.jpg" data-orig-size="1236,416" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inv_inference" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/inv_inference-300x101.jpg" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/inv_inference-1030x347.jpg" tabindex="0" role="button" class="aligncenter wp-image-3313 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/inv_inference.jpg" alt="signatures on invoice" width="1236" height="416" srcset="https://inero-software.com/wp-content/uploads/2021/02/inv_inference.jpg 1236w, https://inero-software.com/wp-content/uploads/2021/02/inv_inference-300x101.jpg 300w, https://inero-software.com/wp-content/uploads/2021/02/inv_inference-768x258.jpg 768w, https://inero-software.com/wp-content/uploads/2021/02/inv_inference-1030x347.jpg 1030w, https://inero-software.com/wp-content/uploads/2021/02/inv_inference-891x300.jpg 891w" sizes="(max-width: 1236px) 100vw, 1236px" /> <img loading="lazy" decoding="async" data-attachment-id="3317" data-permalink="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/test_batch0_pred/" data-orig-file="https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred.jpg" data-orig-size="1280,1280" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="test_batch0_pred" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred-300x300.jpg" data-large-file="https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred-1030x1030.jpg" tabindex="0" role="button" class="aligncenter wp-image-3317 size-full" src="https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred.jpg" alt="signatures on invoice" width="1280" height="1280" srcset="https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred.jpg 1280w, https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred-80x80.jpg 80w, https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred-300x300.jpg 300w, https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred-768x768.jpg 768w, https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred-1030x1030.jpg 1030w, https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred-50x50.jpg 50w, https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred-512x512.jpg 512w, https://inero-software.com/wp-content/uploads/2021/02/test_batch0_pred-1024x1024.jpg 1024w" sizes="(max-width: 1280px) 100vw, 1280px" /><br />
<img decoding="async" data-attachment-id="2770" data-permalink="https://inero-software.com/data-the-playground-of-machine-learning/inero-glify-10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Inero Software" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-2770 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h3><span style="color: #800080;"><b>Summary</b></span></h3>
<p>&nbsp;</p>
<p><span style="font-weight: 400;"><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />For the implementation of the described detector, we used only 10 images, extending the dataset by augmentation process. Thanks to the Roboflow tool, it was possible to quickly annotate and export the data to the YOLO format. The learning process allowed us to obtain a target detector that effectively recognizes signatures on invoices.</span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Please note that with such a small dataset it is only adapted to recognize similar invoices. If we wanted to expand the possibilities of our detector, we would have to equip ourselves with a better graphics card and more, and more data. Additionally, you may be tempted to add a new class, e.g. to separate the objects into the Signature of the Seller and the Buyer.</span></p>
<p>&nbsp;</p>
<p><span style="font-weight: 400;">Maybe you will see a new article in the future with more recognition classes. Stay tuned!</span></p>
<p>&nbsp;</p>
<p><strong>In Inero Software &#8211; software development agency, we are experts of digital transformation and smart automation. We provide knowledge and expertise on how to successfully use cutting edge technologies and data to shape corporate digital products of the future.</strong></p>
<p>&nbsp;</p>
<p><strong>For more information, visit us on our <a href="https://inero-software.com">website</a> or follow us on <a href="https://www.linkedin.com/company/inero-software/">LinkedIn</a>. </strong></p>
<p>Artykuł <a href="https://inero-software.com/digital-cloud-document-repositories-how-to-identify-signatures-in-scanned-pdf-documents/">Digital Cloud Document Repositories &#8211; how to identify signatures in scanned PDF documents</a> pochodzi z serwisu <a href="https://inero-software.com">Inero Software - Software Consulting</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3306</post-id>	</item>
		<item>
		<title>Few tips on how to create custom class detection system using R-CNN</title>
		<link>https://inero-software.com/few-tips-on-how-to-create-custom-class-detection-system-using-r-cnn/</link>
		
		<dc:creator><![CDATA[Adrian Chojnacki]]></dc:creator>
		<pubDate>Mon, 28 Sep 2020 12:46:24 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Company]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Deep learning]]></category>
		<category><![CDATA[Image processing]]></category>
		<category><![CDATA[Keras]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[R-CNN-based detectors]]></category>
		<category><![CDATA[Tensorflow]]></category>
		<guid isPermaLink="false">https://sandbox-www.devel.inero.com.pl/?p=2973</guid>

					<description><![CDATA[<p>Region based Convolutional Neural Network &#8211; R- CNN Thanks to the development of computing technology and artificial intelligence in recent years, applications using machine learning and systems based on neural networks have more and more business uses. Moreover, the advancement of technology has made machine learning, adapting advanced solutions based&#8230;</p>
<p>Artykuł <a href="https://inero-software.com/few-tips-on-how-to-create-custom-class-detection-system-using-r-cnn/">Few tips on how to create custom class detection system using R-CNN</a> pochodzi z serwisu <a href="https://inero-software.com">Inero Software - Software Consulting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3><span style="color: #800080;"><strong>Region based Convolutional Neural Network &#8211; R- CNN</strong></span></h3>
<p><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<p><span data-contrast="none">Thanks to the development of computing technology and artificial intelligence in recent years, applications using machine learning and systems based on neural networks have more and more business uses. Moreover, the advancement of technology has made machine learning, adapting advanced solutions based on neural networks cheaper and allows for relatively quick creation of solutions that have direct application, such as tracking objects on the camera image (tracking cars in parking lots, detecting people on construction sites) or extracting information from scans of documents (finding amounts and contractor data on an invoice).</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559731&quot;:708,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><span data-contrast="none">In the described material, we presented the methodology that we use as part of o<a href="https://sandbox-www.devel.inero.com.pl/machine-learning-professionals/">ur ML-based work using R-CNN networks</a>, which due to the universality of the structure and architecture of the model, work well in a wide range of areas. It is a type of neural network specifically designed to detect objects, </span><span data-contrast="auto">which at least one layer is a convolution layer, allowing to distinguish the features of the manipulated image. </span><span data-contrast="none">Based on the input image, R-CNN determines potential ROI&#8217;s (regions of interest) by selective search segmentation. Then each of them is analyzed by a neural network to obtain the probability of the object classification.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559731&quot;:708,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><span data-contrast="none">R-CNN detectors are widely used in:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<ul>
<li data-leveltext="" data-font="Symbol" data-listid="9" aria-setsize="-1" data-aria-posinset="1" data-aria-level="1"><span data-contrast="none">driver assistance systems in autonomous cars,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="9" aria-setsize="-1" data-aria-posinset="2" data-aria-level="1"><span data-contrast="none">face recognition,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="9" aria-setsize="-1" data-aria-posinset="3" data-aria-level="1"><span data-contrast="none">anomalies detection, </span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="9" aria-setsize="-1" data-aria-posinset="4" data-aria-level="1"><span data-contrast="none">health risk assessment and biomarkers of aging discovery</span><b><span data-contrast="none">, </span></b></li>
<li data-leveltext="" data-font="Symbol" data-listid="9" aria-setsize="-1" data-aria-posinset="4" data-aria-level="1"><span data-contrast="none">Intelligent multi-site surveillance system,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
</ul>
<p><span data-contrast="none">and many others&#8230;</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><span data-contrast="none">Building your own R-CNN detector is a simple task that does not require a lot of work. In this article you will see an example of its use and the next steps in the process.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><img decoding="async" data-attachment-id="2770" data-permalink="https://inero-software.com/data-the-playground-of-machine-learning/inero-glify-10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Inero Software" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-2770 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h3><strong><span style="color: #800080;">Use case</span></strong></h3>
<p><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<p><span class="TextRun SCXW212057878 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="none"><span class="NormalTextRun SCXW212057878 BCX0">In order to demonstrate the possibility of building Your own detector based on R-CNN, the use case in this article will be the date detection on the transport document. Your solution may have different elements or the number of classes of objects to be recognized. A sample document is shown in the illustration below. As You can see, there are many irrelevant elements on this picture. In this case, we are only interested on each date.</span></span><span class="EOP SCXW212057878 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:12,&quot;335559731&quot;:708,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="2986" data-permalink="https://inero-software.com/few-tips-on-how-to-create-custom-class-detection-system-using-r-cnn/glass-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2020/09/glass-1.jpg" data-orig-size="946,439" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="glass" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2020/09/glass-1-300x139.jpg" data-large-file="https://inero-software.com/wp-content/uploads/2020/09/glass-1.jpg" tabindex="0" role="button" class="aligncenter wp-image-2986 size-full" src="https://inero-software.com/wp-content/uploads/2020/09/glass-1.jpg" alt="set of data" width="946" height="439" srcset="https://inero-software.com/wp-content/uploads/2020/09/glass-1.jpg 946w, https://inero-software.com/wp-content/uploads/2020/09/glass-1-300x139.jpg 300w, https://inero-software.com/wp-content/uploads/2020/09/glass-1-768x356.jpg 768w, https://inero-software.com/wp-content/uploads/2020/09/glass-1-646x300.jpg 646w" sizes="(max-width: 946px) 100vw, 946px" /></p>
<p><img decoding="async" data-attachment-id="2770" data-permalink="https://inero-software.com/data-the-playground-of-machine-learning/inero-glify-10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Inero Software" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-2770 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h3><span style="color: #800080;"><strong>Software architecture</strong></span></h3>
<p><span data-contrast="none">Programming tools enabling the implementation of the system in Python are, for example:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:12,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<ul>
<li data-leveltext="" data-font="Symbol" data-listid="5" aria-setsize="-1" data-aria-posinset="1" data-aria-level="1"><i><span data-contrast="none">Tensorflow</span></i><span data-contrast="none">,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="5" aria-setsize="-1" data-aria-posinset="2" data-aria-level="1"><i><span data-contrast="none">Keras</span></i><span data-contrast="none">,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="5" aria-setsize="-1" data-aria-posinset="1" data-aria-level="1"><i><span data-contrast="none">OpenCV,</span></i><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="5" aria-setsize="-1" data-aria-posinset="2" data-aria-level="1"><i><i><span data-contrast="none">Scikit-learn. </span></i></i></li>
</ul>
<p><span data-contrast="none">Once we have configured development environment, the first step in building the system is collecting the dataset. In order to make a R-CNN based detector with a high measure of accuracy, remember that:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<ul>
<li data-leveltext="" data-font="Symbol" data-listid="4" aria-setsize="-1" data-aria-posinset="3" data-aria-level="1"><span data-contrast="none">the collection of images must be extensive and diverse,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="4" aria-setsize="-1" data-aria-posinset="4" data-aria-level="1">as input to the model must be of the same dimension,</li>
<li data-leveltext="" data-font="Symbol" data-listid="4" aria-setsize="-1" data-aria-posinset="4" data-aria-level="1"><span data-contrast="none">eliminate duplicates that can cause network over-matching</span><span data-contrast="none">.</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
</ul>
<p><span data-contrast="none">For a good start, in the described case of the article it is enough to prepare even a few photos of the elements that we want to recognize, preferably against the background of other objects. Why such preferences? In the next step of the algorithm, </span><span data-contrast="none">should be </span><span data-contrast="none">a positiv</span><span data-contrast="none">e and negative samples</span><span data-contrast="none"> generated from the prepared set.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><span data-contrast="none">In order to generate the samples, we will use selective search segmentation.  The possibility of using this algorithm is provided by the </span><i><span data-contrast="none">OpenCV</span></i><span data-contrast="none"> library.  This function uses hierarchical clustering to group pixels and then combine them into one based on color, texture or composition. The following is an implementation of the search code on the base image. The output of the process is a set of a potential ROI’s, depending on the size of the photo, even over 2.000 item’s. </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<pre>selective_search = cv2.ximgproc.segmentation.createSelectiveSearchSegmentation()
selective_search.setBaseImage(image)
selective_search.switchToSelectiveSearchFast()
rects = selective_search.process()</pre>
<p><span class="TextRun SCXW43619007 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW43619007 BCX0">To divide the generated ROI’s, for example, we can use a metric called IoU (Intersection over Union). It’s defined as the intersection area divided by area of the union of a predicted bounding box and ground-truth box. Using this factor will allow You to filter when building a sample set. However, before we proceed to this operation, You should manually prepare the ground truth.  There are many different object tagging programs available on the internet. In this article, we will use the VoTT (Visual object Tagging Tool)</span></span><span class="TextRun SCXW43619007 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW43619007 BCX0"> originally developed by the Commercial Software Engineering (CSE) group at Microsoft</span></span><span class="TextRun SCXW43619007 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW43619007 BCX0">. </span></span><span class="EOP SCXW43619007 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="2987" data-permalink="https://inero-software.com/few-tips-on-how-to-create-custom-class-detection-system-using-r-cnn/vott-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2020/09/vott-1.jpg" data-orig-size="1920,998" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="vott" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2020/09/vott-1-300x156.jpg" data-large-file="https://inero-software.com/wp-content/uploads/2020/09/vott-1-1030x535.jpg" tabindex="0" role="button" class="aligncenter wp-image-2987 size-full" src="https://inero-software.com/wp-content/uploads/2020/09/vott-1.jpg" alt="Software architecture" width="1920" height="998" srcset="https://inero-software.com/wp-content/uploads/2020/09/vott-1.jpg 1920w, https://inero-software.com/wp-content/uploads/2020/09/vott-1-300x156.jpg 300w, https://inero-software.com/wp-content/uploads/2020/09/vott-1-768x399.jpg 768w, https://inero-software.com/wp-content/uploads/2020/09/vott-1-1030x535.jpg 1030w, https://inero-software.com/wp-content/uploads/2020/09/vott-1-577x300.jpg 577w" sizes="(max-width: 1920px) 100vw, 1920px" /></p>
<p><span class="TextRun SCXW267799848 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267799848 BCX0">The above image shows the tagged date in the sample photo.  The operation should be repeated for all prepared data and exported to the appropriate format (JSON, XML, etc.). The generated files contain the exact coordinates and labels of previously marked objects. This allows us to compare our tagge</span></span><span class="TextRun SCXW267799848 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267799848 BCX0">d</span></span><span class="TextRun SCXW267799848 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267799848 BCX0"> data with those that will return a selective search segmentation. In this algorithm, we decided to set the IOU to 0.5</span></span><span class="TextRun SCXW267799848 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267799848 BCX0">, because of the good prediction result</span></span><span class="TextRun SCXW267799848 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267799848 BCX0">.</span></span><span class="TextRun SCXW267799848 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267799848 BCX0"> You can modify this ratio depending on Your preferences and check whether the resulting data set is consistent with the assumptions.</span></span><span class="TextRun SCXW267799848 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267799848 BCX0"> After executing the script, the filtered data should look like this (on the left – positives, on the right – negatives). </span></span><span class="EOP SCXW267799848 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><img loading="lazy" decoding="async" data-attachment-id="2976" data-permalink="https://inero-software.com/few-tips-on-how-to-create-custom-class-detection-system-using-r-cnn/samples/" data-orig-file="https://inero-software.com/wp-content/uploads/2020/09/samples.png" data-orig-size="1796,722" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Positi" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2020/09/samples-300x121.png" data-large-file="https://inero-software.com/wp-content/uploads/2020/09/samples-1030x414.png" tabindex="0" role="button" class="aligncenter wp-image-2976 size-full" src="https://inero-software.com/wp-content/uploads/2020/09/samples.png" alt="set of data" width="1796" height="722" srcset="https://inero-software.com/wp-content/uploads/2020/09/samples.png 1796w, https://inero-software.com/wp-content/uploads/2020/09/samples-300x121.png 300w, https://inero-software.com/wp-content/uploads/2020/09/samples-768x309.png 768w, https://inero-software.com/wp-content/uploads/2020/09/samples-1030x414.png 1030w, https://inero-software.com/wp-content/uploads/2020/09/samples-746x300.png 746w" sizes="(max-width: 1796px) 100vw, 1796px" /></p>
<p><span data-contrast="auto">As You can see, the positive samples present a variety of dates, while the negative other </span><span data-contrast="auto">image elements.  On such a data</span><span data-contrast="auto">set, we can move on to building the R-CNN neural network model. A helpful library in this aspect will be the previously mentioned </span><i><span data-contrast="auto">Tensoflow </span></i><span data-contrast="auto">with </span><i><span data-contrast="auto">Keras</span></i><span data-contrast="auto">. </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><span data-contrast="auto">After loading samples of the created model architecture You should split into test and training data. We can quickly do this with a single line of code using s</span><i><span data-contrast="auto">cikit-learn, </span></i><span data-contrast="auto">when we can define the size of the test data (</span><i><span data-contrast="auto">test_size) </span></i><span data-contrast="auto">and the shuffle value </span><i><span data-contrast="auto">(random_state).</span></i><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<pre>(self.train_x, self.test_x, self.train_y, self.test_y) = train_test_split(self.data, self.labels,
                                                                                  test_size=0.1,
                                                                                  stratify=self.labels,
                                                                                  random_state=42)</pre>
<p><span class="TextRun SCXW19720123 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW19720123 BCX0">The </span></span><span class="TextRun SCXW19720123 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW19720123 BCX0">Tensorflow</span></span><span class="TextRun SCXW19720123 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW19720123 BCX0"> library is already so extensive that it provides us with ready-made network architectures. </span></span><span class="TextRun SCXW19720123 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW19720123 BCX0">The</span></span><span class="TextRun SCXW19720123 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW19720123 BCX0"> implemented algorithm uses the </span></span><span class="TextRun SCXW19720123 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW19720123 BCX0">MobileNetV2 </span></span><span class="TextRun SCXW19720123 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW19720123 BCX0">model, containing pre-trained weights from </span></span><span class="TextRun SCXW19720123 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW19720123 BCX0">ImageNet.</span></span><span class="TextRun SCXW19720123 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW19720123 BCX0"> </span></span><span class="TextRun SCXW19720123 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW19720123 BCX0">Here we define the dimension of each tensor, i.e. in this case the image, which is the input of the model.</span></span><span class="EOP SCXW19720123 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<pre>self.model = MobileNetV2(weights="imagenet", include_top=False, input_tensor=Input(shape=(224, 224, 3)))</pre>
<p><span data-contrast="auto">To the ready model architecture, optionally we can add layers to improve the network. In this use case have been used:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<ul>
<li data-leveltext="" data-font="Symbol" data-listid="3" aria-setsize="-1" data-aria-posinset="1" data-aria-level="1"><i><span data-contrast="auto">pooling – </span></i><span data-contrast="auto">combining </span><span data-contrast="auto">the spatial data created by the convolution layer, minimizing the input data in both dimensions</span><i><span data-contrast="auto">,</span></i><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="3" aria-setsize="-1" data-aria-posinset="2" data-aria-level="1"><i><span data-contrast="auto">flatten – </span></i><span data-contrast="auto">minimazing each tensor to one dimensional,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="3" aria-setsize="-1" data-aria-posinset="3" data-aria-level="1"><i><span data-contrast="auto">dense</span></i><span data-contrast="auto"> – </span><span data-contrast="auto">enabling the connection of nodes in each subsequent layer using the activation function,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
</ul>
<ul>
<li data-leveltext="" data-font="Symbol" data-listid="3" aria-setsize="-1" data-aria-posinset="1" data-aria-level="1"><i><span data-contrast="auto">droput – </span></i><span data-contrast="auto">consisting in a random data rejection. Allows for regularization to prev</span><span data-contrast="auto">ent overfitting. It also proved</span><span data-contrast="auto"> the flexibility of the neural network and </span><span data-contrast="auto">the </span><span data-contrast="auto">margin of response to input data. </span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
</ul>
<p><span data-contrast="auto">The next step in creating Your own R-CNN based detector is to compile the model with defined optimizer, metrics and loss function. </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<pre>self.model.compile(loss="binary_crossentropy", optimizer=Adam(lr=self.lr), metrics=["accuracy"])</pre>
<p><span data-contrast="auto">This algorithm uses the Adam’s optimizer, the acurracy metric and the loss function </span><i><span data-contrast="auto">binary crossentropy.</span></i><span data-contrast="auto"> </span><span data-contrast="auto">The selected parameters are popular for similar use ca</span><span data-contrast="auto">ses, but i</span><span data-contrast="auto">n the detailed </span><i><span data-contrast="auto">Tensorflow</span></i><span data-contrast="auto"> documentation you can find something specific</span><span data-contrast="auto"> for Your </span><span data-contrast="auto">solution.</span><span data-contrast="auto"> </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><span data-contrast="auto">Now we can proceed to the training process. By properly defining the parameters of a function, we can do it with a line of code: </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559731&quot;:708,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<pre>self.model.fit(
    x=None, y=None, batch_size=None, epochs=1, verbose=1, callbacks=None,
    validation_split=0.0, validation_data=None, shuffle=True, class_weight=None,
    sample_weight=None, initial_epoch=0, steps_per_epoch=None,
    validation_steps=None, validation_batch_size=None, validation_freq=1,
    max_queue_size=10, workers=1, use_multiprocessing=False
)</pre>
<p><span data-contrast="auto">Remember to choose the right learning parameters. Each epoch is modified with indivudal weights, which affects the quality of the network. In the algorithm results section of this article, You can see the parameters we selected and information on how to modify them.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><span data-contrast="auto">After completing the network training process, it is enough to save the model to a file and proceed to the next stage, i.e. object detection on test data. Now, for each input image, we once again perform a selective search segmentation and use the built-in model to predict individual ROI’s. For our own solution, we can define a minimum probability for which the regions will be considered valid. Typically, this value is in the range of 95-99%. Finally, all ROI’s that were filtered out in the previous operations can be </span><span data-contrast="auto">marked</span><span data-contrast="auto"> on the target image by using simple function of the </span><i><span data-contrast="auto">OpenCV</span></i><span data-contrast="auto"> library. </span><span data-contrast="auto">The next chapter presents the effects of the R-CNN based detector constructed in this article.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><img decoding="async" data-attachment-id="2770" data-permalink="https://inero-software.com/data-the-playground-of-machine-learning/inero-glify-10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Inero Software" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-2770 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h3><span style="color: #800080;">Results and summary</span></h3>
<p><span class="TextRun SCXW267551755 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267551755 BCX0"><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />To implement detecor in this article were used only 10 images. It allowed to generate about 150 positive and 1000 negative samples. An important aspect of the network training itself is the selection of parameters. These include learning rate, batch size and number of epochs. The </span></span><span class="TextRun SCXW267551755 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267551755 BCX0">Tensorflow</span></span><span class="TextRun SCXW267551755 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267551755 BCX0"> library provides tools for evaluating the solution, such as </span></span><span class="TextRun SCXW267551755 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267551755 BCX0">Tensorboard</span></span><span class="TextRun SCXW267551755 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW267551755 BCX0"> or the classification report. In the first one, we can observe different types of graphs, such as the accuracy and loss of the learning process every epoch. Additionally, the report automatically predicts the test data, returning the final precision. Thanks to this, even if we select parameters experimentally, we can deduce their further modification in order to improve the network. </span></span><span class="EOP SCXW267551755 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559731&quot;:708,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p><span class="TextRun SCXW89439901 BCX0" lang="EN-GB" xml:lang="EN-GB" data-contrast="auto"><span class="NormalTextRun SCXW89439901 BCX0">The created dataset and selected parameters (learning rate = 0.00001, batch size = 32, epochs = 100) allowed to obtain the final accuracy – 97%. Considering that the image’s collection was relatively small, good results were achieved. At the end of this article, let’s show the effects of the implemented date detector on sample images of transport documents. </span></span><span class="EOP SCXW89439901 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559731&quot;:708,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" data-attachment-id="2988" data-permalink="https://inero-software.com/few-tips-on-how-to-create-custom-class-detection-system-using-r-cnn/2_2_after-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2020/09/2_2_after-1.png" data-orig-size="946,439" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="2_2_after" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2020/09/2_2_after-1-300x139.png" data-large-file="https://inero-software.com/wp-content/uploads/2020/09/2_2_after-1.png" tabindex="0" role="button" class="aligncenter wp-image-2988 size-full" src="https://inero-software.com/wp-content/uploads/2020/09/2_2_after-1.png" alt="parameters in data set" width="946" height="439" srcset="https://inero-software.com/wp-content/uploads/2020/09/2_2_after-1.png 946w, https://inero-software.com/wp-content/uploads/2020/09/2_2_after-1-300x139.png 300w, https://inero-software.com/wp-content/uploads/2020/09/2_2_after-1-768x356.png 768w, https://inero-software.com/wp-content/uploads/2020/09/2_2_after-1-646x300.png 646w" sizes="(max-width: 946px) 100vw, 946px" /></p>
<p><span data-contrast="auto">You can see in the pictures that the detecor is doing very effectively. If we would like to expand the developed detector, we would have to:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<ul>
<li data-leveltext="" data-font="Symbol" data-listid="10" aria-setsize="-1" data-aria-posinset="1" data-aria-level="1"><span data-contrast="auto">prepare an extensive set of data, various date cases and their location on the document,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="10" aria-setsize="-1" data-aria-posinset="2" data-aria-level="1"><span data-contrast="auto">train the neural network again,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="10" aria-setsize="-1" data-aria-posinset="3" data-aria-level="1"><span data-contrast="auto">depending on the metrics used, modify the parameters of the learning process,</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
<li data-leveltext="" data-font="Symbol" data-listid="10" aria-setsize="-1" data-aria-posinset="4" data-aria-level="1"><span data-contrast="auto">perform a detection on test images.</span><span data-ccp-props="{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li>
</ul>
<p><span data-contrast="auto">By following a few steps outlined in this article, You can create Your own solution by classifying a variety of objects. You can even upgrade your detector by adding more recognition classes. </span></p>
<p>&nbsp;</p>
<p><a href="https://inero-software.com/contact-us/"><strong><span style="color: #800080;">Inero Software</span></strong></a> provides knowledge and expertise on how to successfully use cutting edge technologies and data to shape corporate digital products of the future.</p>
<p><span data-contrast="auto">In the <a href="https://inero-software.com/category/blog/company/"><strong><span style="color: #800080;">blog post</span></strong></a> section you will find other articles about IT systems and more!</span></p>
<p><img decoding="async" data-attachment-id="2770" data-permalink="https://inero-software.com/data-the-playground-of-machine-learning/inero-glify-10-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Inero Software" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-2770 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/05/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<p>Artykuł <a href="https://inero-software.com/few-tips-on-how-to-create-custom-class-detection-system-using-r-cnn/">Few tips on how to create custom class detection system using R-CNN</a> pochodzi z serwisu <a href="https://inero-software.com">Inero Software - Software Consulting</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2973</post-id>	</item>
	</channel>
</rss>
